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

Connecting a peripheral device to a central device

Hi, I am trying to connect a peripheral device which in this case is a BLE device called DELTA and I am trying to connect it to a central device which is the NRF52 board. However, I am not successful because they are not connected to each other somehow, even though I put the correct UUID in the I used the ble_uart_c example that was provided on the Nordic website and changed the default base UUID, BLE_UUID_NUS_SERVICE, and the BLE_UUID_NUS_TX_CHARACTERISTIC from the ble_nus_c. I put 0x2902 because that was the UUID under the longer version of the UUID. Is this how to properly set up the UUID in the code listed below?

The UUID for the peripheral device is c1d0f554-a142-4b56-b02d-2bc23da2df50

This is what I have for the connection. Any help will be appreciated :)

#define NUS_BASE_UUID                  {{0xC1, 0xD0, 0xF5, 0x54, 0xA1, 0x42, 0x4B, 0x56, 0xB0, 0x2D, 0x2B, 0xC2, 0x3D, 0xA2, 0xDF, 0x50}} /**< Used vendor specific UUID. */
#define BLE_UUID_NUS_SERVICE           0x2902                 
#define BLE_UUID_NUS_TX_CHARACTERISTIC 0x2A4B                      /**< The UUID of the TX Characteristic. */
#define BLE_UUID_NUS_RX_CHARACTERISTIC 0x0001                     /**< The UUID of the RX Characteristic. */

UPDATE:

I think I got the issue with the UUID. However I am not sure, if I am doing the array in the method static bool is_uuid_present(const ble_uuid_t *p_target_uuid, const ble_gap_evt_adv_report_t *p_adv_report) correctly.

I know it is the 128 bit service that has to be executed,

if ( (field_type == BLE_GAP_AD_TYPE_128BIT_SERVICE_UUID_MORE_AVAILABLE) || (field_type == BLE_GAP_AD_TYPE_128BIT_SERVICE_UUID_COMPLETE) ) { err_code = sd_ble_uuid_decode(UUID128_SIZE, &p_data[index], &extracted_uuid); if (err_code == NRF_SUCCESS) { if ((extracted_uuid.uuid == p_target_uuid->uuid) && (extracted_uuid.type == p_target_uuid->type)) { return true; } } } index += field_length + 1; }

However, the extracted uuid is different from the target uuid when debugging. Is there a problem with that?

Related