I noticed that all the bluetooth heart rate demos are including the service & a characteristic but the naming conventions seem very different from the methods defined on Bluetooth.org :
BLEService heartRateService("180D"); // BLE Heart Rate Service
BLECharacteristic heartRateChar
Can anyone provide an example on how to define these services?
void rxCharacteristicWritten(BLECentral& central, BLECharacteristic& characteristic) {
int len = characteristic.valueLength();
const unsigned char data = characteristic.value();
parserCmd = parser.parse((const byte)data, len);
}
I am putting the finishing touches on a code generator Android app (pfodDesigner) that will generate custom menus for Arduino101 and other BLE cards and connect with pfodApp to display those menus and allow the user to operate buttons, sliders, sub-menus and log and plot data
see www.pfod.com.au for the current, non-BLE app and designer
// set advertised local name and service UUID
blePeripheral.setLocalName("101 BLE");
blePeripheral.setAdvertisedServiceUuid(uartService.uuid());
// add service and characteristic
blePeripheral.addAttribute(uartService);
blePeripheral.addAttribute(rxCharacteristic);
blePeripheral.addAttribute(txCharacteristic);
// assign event handlers for connected, disconnected to peripheral
blePeripheral.setEventHandler(BLEConnected, blePeripheralConnectHandler);
blePeripheral.setEventHandler(BLEDisconnected, blePeripheralDisconnectHandler);
// assign event handlers for characteristic
rxCharacteristic.setEventHandler(BLEWritten, rxCharacteristicWritten);