Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove BLECharateristic write(int32_t) #527

Merged
merged 3 commits into from
Jul 16, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions .github/workflows/githubci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,24 @@ jobs:
arduino-cli core update-index
arduino-cli core update-index --additional-urls $BSP_URL
arduino-cli core install adafruit:nrf52 --additional-urls $BSP_URL

# Repalce release BSP with our code
BSP_VERSION=`eval ls $HOME/$BSP_PATH`
rm -r $HOME/$BSP_PATH/*
ln -s $GITHUB_WORKSPACE $HOME/$BSP_PATH/$BSP_VERSION

# Install library dependency
arduino-cli lib install "Adafruit AHRS" "Adafruit APDS9960 Library" "Adafruit BMP280 Library" "Adafruit Circuit Playground" "Adafruit EPD" "Adafruit GFX Library" "Adafruit HX8357 Library" "Adafruit ILI9341" "Adafruit LIS3MDL" "Adafruit LSM6DS" "Adafruit NeoPixel" "Adafruit NeoMatrix" "Adafruit Sensor Calibration" "Adafruit SHT31 Library" "Adafruit SSD1306" "Adafruit ST7735 and ST7789 Library" "Firmata" "SdFat - Adafruit Fork"
arduino-cli lib install "Adafruit AHRS" "Adafruit APDS9960 Library" "Adafruit BMP280 Library" "Adafruit Circuit Playground" "Adafruit EPD" "Adafruit GFX Library" "Adafruit HX8357 Library" "Adafruit ILI9341" "Adafruit LIS3MDL" "Adafruit LSM6DS" "Adafruit NeoPixel" "Adafruit NeoMatrix" "Adafruit Sensor Calibration" "Adafruit SHT31 Library" "Adafruit SSD1306" "Adafruit ST7735 and ST7789 Library" "SdFat - Adafruit Fork"

# TODO update to support MIDI version 5 later on
arduino-cli lib install "MIDI Library"@4.3.1

# TODO use firmata master to prevent build error with gcc v9 (should be remove after 2.5.9 is released)
# https://github.com/firmata/arduino/pull/438
git clone --depth 1 https://github.com/firmata/arduino.git $HOME/Arduino/libraries/firmata

# Library summary
arduino-cli lib list

- name: Build examples
run: python3 tools/build_all.py ${{ matrix.arduino-platform }}
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ BLEAdafruitSensor::BLEAdafruitSensor(BLEUuid service_uuid, BLEUuid data_uuid)
_notify_cb = NULL;
}

err_t BLEAdafruitSensor::_begin(int32_t ms)
err_t BLEAdafruitSensor::_begin(int ms)
{
// Invoke base class begin()
VERIFY_STATUS( BLEService::begin() );
Expand All @@ -59,19 +59,19 @@ err_t BLEAdafruitSensor::_begin(int32_t ms)
return ERROR_NONE;
}

err_t BLEAdafruitSensor::begin(measure_callback_t fp, int32_t ms)
err_t BLEAdafruitSensor::begin(measure_callback_t fp, int ms)
{
_measure_cb = fp;
return _begin(ms);
}

err_t BLEAdafruitSensor::begin(Adafruit_Sensor* sensor, int32_t ms)
err_t BLEAdafruitSensor::begin(Adafruit_Sensor* sensor, int ms)
{
_sensor = sensor;
return _begin(ms);
}

void BLEAdafruitSensor::setPeriod(int32_t period_ms)
void BLEAdafruitSensor::setPeriod(int period_ms)
{
_period.write32(period_ms);
_update_timer(period_ms);
Expand Down
10 changes: 5 additions & 5 deletions libraries/BLEAdafruitService/src/services/BLEAdafruitSensor.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,17 @@
class BLEAdafruitSensor : public BLEService
{
public:
static const int32_t DEFAULT_PERIOD = 1000;
static const int DEFAULT_PERIOD = 1000;

typedef void (*notify_callback_t)(uint16_t conn_hdl, bool enabled);
typedef uint16_t (*measure_callback_t )(uint8_t* buf, uint16_t bufsize);

BLEAdafruitSensor(BLEUuid service_uuid, BLEUuid data_uuid);

virtual err_t begin(measure_callback_t fp, int32_t ms = DEFAULT_PERIOD);
virtual err_t begin(Adafruit_Sensor* sensor, int32_t ms = DEFAULT_PERIOD);
virtual err_t begin(measure_callback_t fp, int ms = DEFAULT_PERIOD);
virtual err_t begin(Adafruit_Sensor* sensor, int ms = DEFAULT_PERIOD);

void setPeriod(int32_t period_ms);
void setPeriod(int period_ms);
void setNotifyCallback(notify_callback_t fp);

protected:
Expand All @@ -54,7 +54,7 @@ class BLEAdafruitSensor : public BLEService

SoftwareTimer _timer;

err_t _begin(int32_t ms);
err_t _begin(int ms);

virtual void _update_timer(int32_t ms);
virtual void _measure_handler(void);
Expand Down
5 changes: 0 additions & 5 deletions libraries/Bluefruit52Lib/src/BLECharacteristic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -564,11 +564,6 @@ uint16_t BLECharacteristic::write32(int num)
return write32( (uint32_t) num );
}

uint16_t BLECharacteristic::write32(int32_t num)
{
return write32( (uint32_t) num );
}

/*------------------------------------------------------------------*/
/* READ
*------------------------------------------------------------------*/
Expand Down
1 change: 0 additions & 1 deletion libraries/Bluefruit52Lib/src/BLECharacteristic.h
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@ class BLECharacteristic
uint16_t write16 (uint16_t num);
uint16_t write32 (uint32_t num);
uint16_t write32 (int num);
uint16_t write32 (int32_t num);

/*------------- Read -------------*/
uint16_t read (void* buffer, uint16_t bufsize, uint16_t offset = 0);
Expand Down
149 changes: 0 additions & 149 deletions tools/build_all_travis.py

This file was deleted.