Release 0.3.3

=============

Enhancements
~~~~~~~~~~~~

* Changes needed to support v8 of the Nordic SDK.

Bugfixes
~~~~~~~~

none.
This commit is contained in:
Rohit Grover 2015-03-31 11:55:53 +01:00
parent 8b631fc0c2
commit 35e1e8b8c4
3 changed files with 27 additions and 3 deletions

View file

@ -336,12 +336,20 @@ public:
* output: Total length of attribute value upon successful return.
*/
ble_error_t readCharacteristicValue(GattAttribute::Handle_t attributeHandle, uint8_t *buffer, uint16_t *lengthP);
/**
* A version of the same as above with connection handle parameter to allow fetches for connection-specific multivalued attribtues (such as the CCCDs).
*/
ble_error_t readCharacteristicValue(Gap::Handle_t connectionHandle, GattAttribute::Handle_t attributeHandle, uint8_t *buffer, uint16_t *lengthP);
/**
* @param localOnly
* Only update the characteristic locally regardless of notify/indicate flags in the CCCD.
*/
ble_error_t updateCharacteristicValue(GattAttribute::Handle_t attributeHandle, const uint8_t *value, uint16_t size, bool localOnly = false);
/**
* A version of the same as above with connection handle parameter to allow updates for connection-specific multivalued attribtues (such as the CCCDs).
*/
ble_error_t updateCharacteristicValue(Gap::Handle_t connectionHandle, GattAttribute::Handle_t attributeHandle, const uint8_t *value, uint16_t size, bool localOnly = false);
/**
* Yield control to the BLE stack or to other tasks waiting for events. This
@ -691,12 +699,23 @@ inline ble_error_t BLEDevice::readCharacteristicValue(GattAttribute::Handle_t at
return transport->getGattServer().readValue(attributeHandle, buffer, lengthP);
}
inline ble_error_t BLEDevice::readCharacteristicValue(Gap::Handle_t connectionHandle, GattAttribute::Handle_t attributeHandle, uint8_t *buffer, uint16_t *lengthP)
{
return transport->getGattServer().readValue(connectionHandle, attributeHandle, buffer, lengthP);
}
inline ble_error_t
BLEDevice::updateCharacteristicValue(GattAttribute::Handle_t attributeHandle, const uint8_t *value, uint16_t size, bool localOnly)
{
return transport->getGattServer().updateValue(attributeHandle, const_cast<uint8_t *>(value), size, localOnly);
}
inline ble_error_t
BLEDevice::updateCharacteristicValue(Gap::Handle_t connectionHandle, GattAttribute::Handle_t attributeHandle, const uint8_t *value, uint16_t size, bool localOnly)
{
return transport->getGattServer().updateValue(connectionHandle, attributeHandle, const_cast<uint8_t *>(value), size, localOnly);
}
inline void
BLEDevice::waitForEvent(void)
{

View file

@ -77,7 +77,10 @@ public:
}
typedef void (*EventCallback_t)(void);
typedef void (*ConnectionEventCallback_t)(Handle_t, addr_type_t peerAddrType, const address_t peerAddr, const ConnectionParams_t *);
typedef void (*ConnectionEventCallback_t)(Handle_t,
addr_type_t peerAddrType, const address_t peerAddr,
addr_type_t ownAddrType, const address_t ownAddr,
const ConnectionParams_t *);
typedef void (*DisconnectionEventCallback_t)(Handle_t, DisconnectionReason_t);
typedef void (*RadioNotificationEventCallback_t) (bool radio_active); /* gets passed true for ACTIVE; false for INACTIVE. */
@ -148,10 +151,10 @@ protected:
}
public:
void processConnectionEvent(Handle_t handle, addr_type_t type, const address_t addr, const ConnectionParams_t *params) {
void processConnectionEvent(Handle_t handle, addr_type_t peerAddrType, const address_t peerAddr, addr_type_t ownAddrType, const address_t ownAddr, const ConnectionParams_t *params) {
state.connected = 1;
if (onConnection) {
onConnection(handle, type, addr, params);
onConnection(handle, peerAddrType, peerAddr, ownAddrType, ownAddr, params);
}
}

View file

@ -48,7 +48,9 @@ private:
/* These functions must be defined in the sub-class */
virtual ble_error_t addService(GattService &) = 0;
virtual ble_error_t readValue(GattAttribute::Handle_t attributeHandle, uint8_t buffer[], uint16_t *lengthP) = 0;
virtual ble_error_t readValue(Gap::Handle_t connectionHandle, GattAttribute::Handle_t attributeHandle, uint8_t buffer[], uint16_t *lengthP) = 0;
virtual ble_error_t updateValue(GattAttribute::Handle_t, const uint8_t[], uint16_t, bool localOnly = false) = 0;
virtual ble_error_t updateValue(Gap::Handle_t connectionHandle, GattAttribute::Handle_t, const uint8_t[], uint16_t, bool localOnly = false) = 0;
virtual ble_error_t initializeGATTDatabase(void) = 0;
// ToDo: For updateValue, check the CCCD to see if the value we are