A blue button is always a nice toy ...

Dependencies:   BLE_API X_NUCLEO_IDB0XA1 mbed

Fork of BLE_HeartRate_IDB0XA1 by ST

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers updated.h Source File

updated.h

00001 // updated.h - check whether a characteristic has been updated
00002 //             note: can only used within 'onWritten' callback
00003 //
00004 // Synopsis:
00005 //
00006 //    See also: CHARACTERISTIC, GET, SET, ONWRITTEN
00007 //
00008 #ifndef _UPDATED_H_
00009 #define _UPDATED_H_
00010 
00011 #include "ble/Gap.h"
00012 #include "bricks/blob.h"
00013 
00014    inline int updated(Blob &o,GattCharacteristic &chr)  // has char. been updated?
00015    {
00016       const GattWriteCallbackParams *p = o.pWritten;
00017       if (!p)
00018          return 0;                               // no update!
00019       else if(p->handle == chr.getValueHandle())
00020          return 1;
00021       else
00022          return 0;   
00023    }
00024 
00025 #endif // _SET_H_