A nice BLE demo program which allows remote switch of an LED via GATT interface.

Dependencies:   BLE_API mbed nRF51822

Fork of BLE_Button by Bluetooth Low Energy

Revision:
11:80f2c19ecbce
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bricks/print.h	Sat Jan 07 23:48:53 2017 +0000
@@ -0,0 +1,28 @@
+// print.h - print value of a characteristic
+//
+// Synopsis:
+//
+//    See also: CHARACTERISTIC, GET, SET
+//
+#ifndef _PRINT_H_
+#define _PRINT_H_
+
+#include "ble/Gap.h"
+#include "bricks/blob.h"
+
+//==============================================================================
+// Some Callbacks
+//==============================================================================
+
+   inline void print(Blob &blue, GattCharacteristic &chr, const char *name)
+   {
+      Serial out(USBTX, USBRX);           // serial port to PC terminal
+       
+      Buffer data;  uint8_t *p = data;
+      blue.get(chr,data);
+
+      out.printf("%s: %02x-%02x-%02x-%02x-%02x-",name,(int)(p[0]),(int)(p[1]),(int)(p[2]),(int)(p[3]),(int)(p[4]));
+      out.printf("%02x-%02x-%02x-%02x-%02x\r\n",(int)(p[5]),(int)(p[6]),(int)(p[7]),(int)(p[8]),(int)(p[9]));
+   }    
+
+#endif // _SET_H_
\ No newline at end of file