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

BLE_UUID_OUR_BASE_UUID not correct, flags not correct

Hi,

I'm using nRF52840 with SDK15.0.0 wit code from : https://devzone.nordicsemi.com/tutorials/b/bluetooth-low-energy/posts/ble-services-a-beginners-tutorial

I could make the tutorial advertising works i can see my device on nRF connect application... but i have troubles with definitions :

my problem is defining 128-bit base UUIDs :

ADVERTISING :

#define BLE_UUID_OUR_BASE_UUID              {{0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, 033, 0x44, 0xAB, 0x00, 0x00, 0x00, 0x00, 0x00}}

NOT ADVERTISNG :

#define BLE_UUID_OUR_BASE_UUID              {{0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, 033, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}

so the problem seems to be a sequence of 6 0x00, but that's the sequence requested by my protocol...

I have another problem similar with flags :

 ADVERTSING
 init.advdata.flags                   = BLE_GAP_ADV_FLAGS_LE_ONLY_GENERAL_DISC_MODE;
 NOT ADVERTISING
 init.advdata.flags                   = BLE_GAP_ADV_FLAGS_NEW_MODE;

i defined : #define BLE_GAP_ADV_FLAGS_NEW_MODE    (0x1A), requested by my protocol :

bit 0 (OFF) : LE Limited Discoverable Mode
bit 1 (ON)  : LE General Discoverable Mode
bit 2 (OFF) : BR/EDR not Supported
bit 3 (ON)  : Simultaneous LE and BR/EDR to Same Device Capable (controller)
bit 4 (ON)  : Simultaneous LE and BR/EDR to Same Device Capable (Host)

thank your for your help

Geoffroy

Parents
  • I have an other question concerning this tutorial : devzone.nordicsemi.com/.../ble-characteristics-a-beginners-tutorial

    i have same problem than Milton : "I was able to add a custom service and verify it successfully on MCP. However, when I included the code to add a characteristic to the service, I always get "NRF_ERROR_INVALID_PARAM'."

    he found a solution :

    //for service
    err_code = sd_ble_uuid_vs_add(&base_uuid, &m_base_uuid_type);
    uuid.type   = m_base_uuid_type;
    uuid.uuid   = BLE_UUID_OUR_SERVICE_UUID;
    
    //For the characteristic:
    
    char_uuid.uuid      = BLE_UUID_OUR_CHARACTERISTC_UUID;
    char_uuid.type      = m_base_uuid_type;
    

    i tryed to implement this solution but it didn't work can you help me please ?

Reply
  • I have an other question concerning this tutorial : devzone.nordicsemi.com/.../ble-characteristics-a-beginners-tutorial

    i have same problem than Milton : "I was able to add a custom service and verify it successfully on MCP. However, when I included the code to add a characteristic to the service, I always get "NRF_ERROR_INVALID_PARAM'."

    he found a solution :

    //for service
    err_code = sd_ble_uuid_vs_add(&base_uuid, &m_base_uuid_type);
    uuid.type   = m_base_uuid_type;
    uuid.uuid   = BLE_UUID_OUR_SERVICE_UUID;
    
    //For the characteristic:
    
    char_uuid.uuid      = BLE_UUID_OUR_CHARACTERISTC_UUID;
    char_uuid.type      = m_base_uuid_type;
    

    i tryed to implement this solution but it didn't work can you help me please ?

Children
No Data
Related