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

device could not be found due to changes in m_adv_uuids[]

Hi expert,

I'm working for my project that make a controller for drone, and that i need nus for as my service so i can exchange the data (send order via rx from smartphone) so i'm using ble_app_templat as my basis for esthablishing a connection, and it works and then i want to implement my NUS, theoritically I just should  change uuid and the service so the nus could be implemented

but as i change m_adv_uuids[] my device could not be found anymore.

I change it from

static ble_uuid_t m_adv_uuids[] =                                               /**< Universally unique service identifiers. */
{
    {BLE_UUID_DEVICE_INFORMATION_SERVICE, BLE_UUID_TYPE_BLE}
};

to

static ble_uuid_t m_adv_uuids[] =                                               /**< Universally unique service identifiers. */
{
		{BLE_UUID_NUS_SERVICE, NUS_SERVICE_UUID_TYPE }
};

I also try these

static ble_uuid_t m_adv_uuids[] =                                               /**< Universally unique service identifiers. */
{
		{BLE_UUID_NUS_SERVICE, BLE_UUID_TYPE_BLE}
};

it works, my device could be found but i got another problem it shows an error "the handle is invalid" in nrf toolbox app as i want to check the uart.

could anyone help me?

thanks in advance

Andhika

Parents
  • Hi,

    How have you defined BLE_UUID_NUS_SERVICE? Did you include ble_nus.h in your project? Please take a look at the ble_app_uart example. This example runs the Nordic UART Service (NUS) and can be found under 'examples/ble_peripheral/ble_app_uart' folder.

    The Nordic UART service is a custom service, so we use a 128-bit vendor specific UUID and you need to use UUID type BLE_UUID_TYPE_VENDOR_BEGIN.

    You can change the base of the 128-bit vendor-specific UUID by changing NUS_BASE_UUID in ble_nus.c if you want (for example if you want to create a custom UART service for your application), please take a look a this tutorial for more information about custom services and UUIDs.

    Best regards,

    Marjeris

  • Hi,

    How have you defined BLE_UUID_NUS_SERVICE? Did you include ble_nus.h in your project? Please take a look at the ble_app_uart example. This example runs the Nordic UART Service (NUS) and can be found under 'examples/ble_peripheral/ble_app_uart' folder.

    yes I defined it through ble_nus.h i already included it in makefile and yes i took the example for my project from ble_app_uart.

    The Nordic UART service is a custom service, so we use a 128-bit vendor specific UUID and you need to use UUID type BLE_UUID_TYPE_VENDOR_BEGIN.

    yeah i also aready defined BLE_UUID_TYPE_VENDOR_BEGIN in nus_service_uuid_type this one that cause the problem i think.

    best regard,

    Andhika

  • Hi,

    What error message are you getting now? Have you tried to compare your application to ble_app_uart?

    In ble_app_template the function advertising_init is called before service_init(). If you want to advertise the NUS UUID you need to change the order and call advertising_init() after services_init().

    Best regards,

    Marjeris

Reply Children
Related