I have an external temperature on my nRF51 DK. I would like to read the value of the temperature on my mobile device(Android).
I am able to read the temperature on the MCP. But when I try to read the temperature on my Android device it will crash the app.
This is the line where the error occurs:
descriptor.setValue(BluetoothGattDescriptor.ENABLE_NOTIFICATION_VALUE);
Here the set up for the temperature characteristic on the nRF51 DK:
char_md.char_props.read = 1;
char_md.char_props.write = 1;
char_md.p_char_user_desc = NULL;
char_md.p_char_pf = NULL;
char_md.p_user_desc_md = NULL;
char_md.p_cccd_md = NULL;
char_md.p_sccd_md = NULL;
CCCD is standing for notification if I understand that right. So do I have to set the CCCD? But if it works on the MCP, then it should also work with the mobile device...
Or is there another reason why the application will crash when I enable the notifcation?