This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

I can't search 128bits UUID service

I use the S110-6.0.0 to find the iphone ANCS service,return attr missing. The 16bits UUID is xF431.I have added the long UUID ble_uuid128_t ans_base_uuid = {0xD0, 0x00, 0x2D, 0x12, 0x1E, 0x4B, 0x0F, 0xA4, 0x99, 0x4E, 0xCE, 0xB5, 0x31, 0xf4, 0x05, 0x79} ,using sd_ble_uuid_vs_add(ble_uuid128_t const * const p_vs_uuid, uint8_t * const p_uuid_type)) function before sending service search requset. I found that p_vs_uuid pointe to a 16-octet (128-bit) little endian Vendor Specific UUID disregarding bytes 12 and 13.So how the SD know the short UUID 0xF4310 is the ANSC's short UUID ?My confusion come from follow the example of the ble_ans_c.c

BLE_UUID_BLE_ASSIGN(ans_uuid,BLE_ANCS_SERVICE_UUID ); err_code = sd_ble_gattc_primary_services_discover(p_ans->conn_handle, handle, &ans_uuid);

Here BLE_UUID_BLE_ASSIGN use 16bits UUID. the sd_ble_gattc_primary_services_discover() descript as : /* If any of the discovered services have 128-bit UUIDs which are not present in the table provided to ble_vs_uuids_assign, a UUID structure with type BLE_UUID_TYPE_UNKNOWN will be received in the corresponding event.*/ I can't find where the "ble_vs_uuids_assign" defined,it means that the function using 128bits UUID?

Furthermore I change UUID to 0x1800 service,the GATTC run correct ,I don't know why? I have tried to debug the S110-8.0.0 ANSC example,unfortunately,the device go to HardFault after sending security request.

  • FormerMember
    0 FormerMember

    The problem can be that the event BLE_GATTS_EVT_SYS_ATTR_MISSING is not being handled. If the application doesn't support boding, it can for example be handled the following way in on_ble_evt(..) in main.c:

    case BLE_GATTS_EVT_SYS_ATTR_MISSING:
            err_code = sd_ble_gatts_sys_attr_set(m_peripheral_conn_handle, NULL, 0);
            APP_ERROR_CHECK(err_code);
            break;
    

    Update 14.03.16: After a little thinking I see that adding BLE_GATTS_EVT_SYS_ATTR_MISSING will not help, because it requires the device to be a GATT server and not a GATT client.

    Could you try the ANCS example in SDK 8.1 with S110 v.8.0.0? Or SDK 6.1.0 and S110 v.7.3.0?

    Do you have a nRF51-DK or a nRF51-Dongle? If so, could you use the sniffer to track what is being transferred over the air? And upload the sniffer trace here?

    The sniffer should be used with Wireshark, and it works best with version 1.10, not one of the newer versions, this answer links to older version of wireshark.

    What do you mean by access the 128 bit UUID? This thread explains storing of a UUID added using sd_ble_uuid_vs_add(..). S110 v. 6.0.0 does support adding a custom UUID.

  • Hi, I have added the BLE_GATTS_EVT_SYS_ATTR_MISSING case in on_ble_evt() :

        case BLE_GATTS_EVT_SYS_ATTR_MISSING://attr missing 
            err_code = sd_ble_gatts_sys_attr_set(m_conn_handle, NULL, 0); 
            APP_ERROR_CHECK(err_code); 
            break;
    

    But when I debug it,the program never goes into this case,and the event_discover_rsp() go into: p_ble_evt->evt.gattc_evt.gatt_status=BLE_GATT_STATUS_ATTERR_ATTRIBUTE_NOT_FOUND. My device have been bonding to the iphone 6s pluse.I want to know how to search a 128bits UUID service,whether S110-6.0.0 version supports accessing a 128bits UUID service or not? Thank you for your reply.

  • Hi Kristin ,thank you for your answer.I have a Dongle ,but it can only capture the peripheral advertising datas.After the cental bonding the peripheral ,they work under encrypted link ,so Dongle can't trace what they are doing. My production are developed base on S110 V.6.0.0,Now I want to add GATTC module to get the iphone message throught Apple's ANCS protocol. The ANCS runs as a GATT server, my production runs as a GATT client. The ANCS service UUID is :7905F431-B5CE-4E99-A40F-4B1E122D00D0 .After I adding 128bits service UUID by using sd_ble_uuid_vs_add() ,I call the sd_ble_gattc_primary_services_discover() function used short UUID 0xF431,the SD return Gatt_status==BLE_GATT_STATUS_ATTERR_ATTRIBUTE_NOT_FOUND.Does it mean that the service isn't found by this short UUID? If I search the 0x1800 service ,there is not problem.So I don't know which step I miss. Could you debug this base on S110 V.6.0.0 ? I had try the ANCS example in SDK 8.1 with S110 v.8.0.0,but it can't work correctly.After Sending_security_request() , the device goes to restart.I want to develop base on S110 V.6.0.0 not S110 v.8.0.0,beacause my production are being saled.Thanks.

    image description

    Could you analyse the problem for me ?The Control Opcode:LL_VErSION_IND means that the cental have bonded peripheral ? I sniffed another device,which can access the ANCS successfully.The sniff result as follow image description

    They look the same :-(

  • Hi Kristin,there is a text lengh limit in comment,please see my answer,thanks.

  • FormerMember
    0 FormerMember in reply to Songplus

    Okay, I see.

    You can use the sniffer to sniff an encrypted link if the sniffer is present during the encryption key exchange. Could you do that, and then upload the sniffer trace here?

Related