We have our nrf52 working well with our iOS app - almost everything we need is in place. One last item (haha) we've been struggling with is to get the nrf52 to advertise our services properly. We've been working around this for awhile, but to get iOS to reconnect in the background, and for our OTA (we're using the Rigado module), we need our services to advertise properly.
Based on these links:
devzone.nordicsemi.com/.../ devzone.nordicsemi.com/.../
and a few others, I believe the correct way to do this is something like this. Add service to the m_adv_uuid as such:
static ble_uuid_t m_adv_uuids[] = {
{BLE_UUID_TX_POWER_SERVICE, BLE_UUID_TYPE_BLE},
{BLE_UUID_BATTERY_SERVICE, BLE_UUID_TYPE_BLE},
{BLE_UUID_DEVICE_INFORMATION_SERVICE, BLE_UUID_TYPE_BLE},
{OUR_SERVICE, BLE_UUID_TYPE_VENDOR_BEGIN}
};
and then add it as a scan response:
ble_advdata_t srdata;
memset(&srdata, 0, sizeof(srdata));
srdata.uuids_complete.uuid_cnt = sizeof(m_adv_uuids) / sizeof(m_adv_uuids[0]);
srdata.uuids_complete.p_uuids = m_adv_uuids;
But everything we've tried produces code that doesn't run - we get errors are various parts of the init process. The two links seem to provide conflicting info as to where the UUID provided for our service in m_adv_uuid is the 16 or 128 flavor.
It seems like the srdata.uuids_complete structure may not get setup correctly based on what's exactly put in m_adv_data.
Our environment is make/gcc on Mac, using SDK 11.0.0. The only sample code I could find that uses BLE_UUID_TYPE_VENDOR_BEGIN was the UART stuff, and that didn't seem to apply(??).
Any pointers are appreciated.
Ed