01-23-2013 02:33 AM - edited 01-23-2013 04:16 PM
Hi Developers and Shahid,
I am following the JAM-21 PDF on using Bluetooth Low Energy. I am successfully receiving advertising callbacks and packets, and successfully parsed them following the Bluetooth 4.0 specification.
I am trying to use bt_gatt_connect_service(), but none of my bt_gatt_callbacks_t are invoked.
I am testing with a Polar H7 heart rate sensor. The "advertisement" message says it supports Service (16-bit UUID) 0x180D, but I call:
static bt_le_callbacks_t le_callbacks = { HRM_advertisement_cb };
static bt_gatt_callbacks_t gatt_callbacks = {
HRM_service_connected_cb,
HRM_service_disconnected_cb,
HRM_service_updated_cb
};
bt_le_init(&le_callbacks);
bt_gatt_init(&gatt_callbacks);
bt_gatt_connect_service("00:22:D0:00:21:C0", "0x180d", NULL, NULL, NULL");
What am I doing wrong? I also don't have any luck with Service 0x180A (Device Information) or 0x10F (Battery Service).
Testing with BlackBerry DevAlpha B, OS 10.9.9.339. Compiled with BlackBerry 10 Native SDK 10.0.9.2318 on a Linux 64-bit host.
Thanks in advance!
* Updated: (16-bit UDID, not 16-byte)
01-23-2013 04:05 PM
What return codes are you getting from those calls?
01-23-2013 04:11 PM
EOK everywhere.
01-23-2013 04:17 PM - edited 01-23-2013 04:22 PM
Have you done a
bt_device_init( bt_controller_cb );
I think it is necessary for any BT events in your app... (and you do say you're getting some..)
01-23-2013 04:32 PM
I will give it a try tonight. I didn't think it was necessary, as this is Bluetooth LE.
Thanks, Robbie!
01-24-2013 11:08 AM
any luck?
01-24-2013 12:20 PM
That didn't help either, but it did point me in the right direction! The BB10 device has to be paired with the Bluetooth LE device, which I did in the Settings app. Then everything started to work correctly.
Thanks for the nudge in the right direction!