microbit: Added support for explicit notification

Introduce abality to explicitly perform a notify/indicate opertion on a characteristic.
This brings benefits of a reduce RAM footprint for storing GattCharacterisitics.

n.b. temporary measure until ARM mbed integrate more generic optimisations.
This commit is contained in:
Joe Finney 2015-12-10 16:52:41 +00:00
parent a5f6d4b877
commit 3306737028
1 changed files with 21 additions and 0 deletions

View File

@ -186,6 +186,27 @@ public:
return BLE_ERROR_NOT_IMPLEMENTED; /* Requesting action from porters: override this API if this capability is supported. */ return BLE_ERROR_NOT_IMPLEMENTED; /* Requesting action from porters: override this API if this capability is supported. */
} }
/**
* Perform an explicit BLE notification of a given attribute.
*
* @param[in] attributeHandle
* Handle for the value attribute of the Characteristic.
* @param[in] value
* A pointer to a buffer holding the new value
* @param[in] size
* Size of the new value (in bytes).
*
* @return BLE_ERROR_NONE if we have successfully set the value of the attribute.
*/
virtual ble_error_t notify(GattAttribute::Handle_t attributeHandle, const uint8_t *value, uint16_t size)
{
(void)attributeHandle;
(void)value;
(void)size;
return BLE_ERROR_NOT_IMPLEMENTED; /* Requesting action from porter(s): override this API if this capability is supported. */
}
/** /**
* Determine the updates-enabled status (notification or indication) for the current connection from a characteristic's CCCD. * Determine the updates-enabled status (notification or indication) for the current connection from a characteristic's CCCD.
* *