restore uriData characteristic upon receiving a write if locked.

This commit is contained in:
Rohit Grover 2014-11-27 14:24:24 +00:00
parent 18ffab58d1
commit f582743345

View file

@ -77,6 +77,11 @@ public:
*/
virtual void onDataWritten(const GattCharacteristicWriteCBParams *params) {
if (params->charHandle == uriDataChar.getValueAttribute().getHandle()) {
if (lockedState) { /* when locked, the device isn't allowed to update the uriData characteristic */
ble.updateCharacteristicValue(uriDataChar.getValueAttribute().getHandle(), uriDataValue, uriDataLength);
return;
}
/* we don't handle very large writes at the moment. */
if ((params->offset != 0) || (params->len > MAX_SIZE_URI_DATA_CHAR_VALUE)) {
return;