How to read and write to a non nordic device which has its own BLE characterstics?

Hi, 

I have a device which has different UUID s for the write and read characteristics than the Nordic devices. The device I want to connect to will give out sensor data via one specific characteristic and I want my central read that data. What should I be referring to? Are there any examples which I can modify and get it working?

Thanks in advance.

Parents
  • Hi Runsiv,

    I am able to connect to the device, I am not sure how to send data to a particular characteristic since its not a Nordic device.

  • Hi,

    I have looked into the nus and replicated the same using the custom UUID, but instead of BLE_DB_DISCOVERY_COMPLETE I get ble_db_discovery_srv_not_found.

    I am not able to figure out why.

    sd_ble_uuid_vs_add() is done in the init function.

      #define BLE_UUID_B24_CONFIGURATION_SERVICE                          0xFD30
      #define BLE_UUID_B24_CONF_PIN_CHARACTERISTIC                        0xFD39
      #define BLE_UUID_B24_VIEW_PIN_CHARACTERISTIC                        0xFD34
    
      //a970fd30-a0e8-11e6-bdf4-0800200c9a66
      #define B24_BASE_UUID {{0x66, 0x9a, 0x0c, 0x20, 0x00, 0x08, 0xf4, 0xbd, 0xe6, 0x11, 0xe8, 0xa0, 0x00, 0x00, 0x70, 0xa9}}

    B24 module has the UUID as

    All the Mantracourt services and characteristics have a common 96 bit tail and a variable 32 bit identifier. 00000000-a0e8-11e6-bdf4-0800200c9a66

    The following table shows the 32 bit identifier used to replace the 00000000 shown above to produce the full 128-bit UUID.
    a970fd30 - Configuration Profile Service

    The below code shows my init function.

    uint32_t ble_b24_init(ble_b24_t * p_ble_b24, ble_b24_init_t * p_ble_b24_init)
    {
        uint32_t      err_code;
        ble_uuid_t    b24_uuid;
        ble_uuid128_t b24_base_uuid = B24_BASE_UUID;
    
        VERIFY_PARAM_NOT_NULL(p_ble_b24);
        VERIFY_PARAM_NOT_NULL(p_ble_b24_init);
        VERIFY_PARAM_NOT_NULL(p_ble_b24_init->p_gatt_queue);
    
        err_code = sd_ble_uuid_vs_add(&b24_base_uuid, &p_ble_b24->uuid_type);
        VERIFY_SUCCESS(err_code);
    
        b24_uuid.type = p_ble_b24->uuid_type;
        b24_uuid.uuid = BLE_UUID_B24_CONFIGURATION_SERVICE;
    
        p_ble_b24->conn_handle           = BLE_CONN_HANDLE_INVALID;
        p_ble_b24->evt_handler           = p_ble_b24_init->evt_handler;
        p_ble_b24->error_handler         = p_ble_b24_init->error_handler;
        p_ble_b24->handles.b24_tx_handle = BLE_GATT_HANDLE_INVALID;
        p_ble_b24->handles.b24_rx_handle = BLE_GATT_HANDLE_INVALID;
        p_ble_b24->p_gatt_queue          = p_ble_b24_init->p_gatt_queue;
    
        return ble_db_discovery_evt_register(&b24_uuid);
    }

  • Hey I was able to figure this out.

    Apparently this was BLE_GATT_DB_MAX_CHARS set to 6.

    Changed it to 9 and now I am able to list the characteristic I want.

    Thank you.

  • Hi,

    I am happy to see that you found a solution.

    VinayakaKS said:
    And after a filter match, it takes around 20 seconds to get connected, where is this time being spent?

    In order to connect, the device must wait for the next advertising and respond to that with a connection request. 20 seconds sounds very long for establishing a BLE connection, though. A sniffer trace may reveal the exact timings including advertising interval and any attempted (failed) connection attempts during those 20 seconds.

    Regards,
    Terje

  • Okay,

    I am planning to buy one 840 dongle.

    Let me see if I can get it to me faster.

  • Hi,

    If I have a profile defined as a9712440-a0e8-11e6-bdf4-0800200c9a66, which is different from my base UUID which is defined as  a9700000-a0e8-11e6-bdf4-0800200c9a66. The new profile differs in 24 bits and I don't see any UUID type to give for my characteristics.

    Do I need to add a sd_ble_uuid_vs_add for this again?

  • I found out that I had to create 2 more custom services in order to discover the remaining characteristics.

    So its able to discover all of the characteristics.

Reply Children
No Data
Related