microbit: BLE service bugfixes

Updates to BLE interface to match specification following testing by Bluetooth SIG.

Accelerometer Period: now supports READ and WRITE
Magnetometer Period: now supports READ and WRITE
LED Matrix State: now supports READ and WRITE.

UUIDs of Temperature Service characteristic corrected.
This commit is contained in:
Joe Finney 2015-10-08 23:23:00 +01:00
parent 5da263db81
commit 1d76def8fa
4 changed files with 4 additions and 4 deletions

View file

@ -22,7 +22,7 @@ MicroBitAccelerometerService::MicroBitAccelerometerService(BLEDevice &_ble) :
GattCharacteristic accelerometerPeriodCharacteristic(MicroBitAccelerometerServicePeriodUUID, (uint8_t *)&accelerometerPeriodCharacteristicBuffer, 0,
sizeof(accelerometerPeriodCharacteristicBuffer),
GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_READ | GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_WRITE_WITHOUT_RESPONSE);
GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_READ | GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_WRITE);
// Initialise our characteristic values.
accelerometerDataCharacteristicBuffer[0] = 0;

View file

@ -16,7 +16,7 @@
MicroBitLEDService::MicroBitLEDService(BLEDevice &_ble) :
ble(_ble),
matrixCharacteristic(MicroBitLEDServiceMatrixUUID, (uint8_t *)&matrixCharacteristicBuffer, 0, sizeof(matrixCharacteristicBuffer),
GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_WRITE_WITHOUT_RESPONSE | GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_READ)
GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_WRITE | GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_READ)
{
// Create the data structures that represent each of our characteristics in Soft Device.
GattCharacteristic textCharacteristic(MicroBitLEDServiceTextUUID, (uint8_t *)textCharacteristicBuffer, 0, MICROBIT_BLE_MAXIMUM_SCROLLTEXT,

View file

@ -25,7 +25,7 @@ MicroBitMagnetometerService::MicroBitMagnetometerService(BLEDevice &_ble) :
GattCharacteristic magnetometerPeriodCharacteristic(MicroBitMagnetometerServicePeriodUUID, (uint8_t *)&magnetometerPeriodCharacteristicBuffer, 0,
sizeof(magnetometerPeriodCharacteristicBuffer),
GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_READ | GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_WRITE_WITHOUT_RESPONSE);
GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_READ | GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_WRITE);
// Initialise our characteristic values.
magnetometerDataCharacteristicBuffer[0] = 0;

View file

@ -51,7 +51,7 @@ const uint8_t MicroBitTemperatureServiceUUID[] = {
};
const uint8_t MicroBitTemperatureServiceDataUUID[] = {
0xe9,0x5d,0x8a,0x38,0x25,0x1d,0x47,0x0a,0xa0,0x62,0xfa,0x19,0x22,0xdf,0xa9,0xa8
0xe9,0x5d,0x92,0x50,0x25,0x1d,0x47,0x0a,0xa0,0x62,0xfa,0x19,0x22,0xdf,0xa9,0xa8
};