This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

braodcast issue

hii....

am working on a custom profile having broadcast feature in active connection... am advertising some sensor readings and scan response and a battery service before connecting to any device. but aftr get connected i started a non connectable advertise where am trying to advertise the same sensor data and battery service.

uint8_t                    flags = BLE_GAP_ADV_FLAG_BR_EDR_NOT_SUPPORTED;
memset(&advdata, 0, sizeof(advdata));

advdata.name_type               = BLE_ADVDATA_FULL_NAME;
advdata.flags.size              = sizeof(flags);
advdata.flags.p_data            = &flags;

advdata.p_manuf_specific_data = &manuf_specific_data;

advdata.p_service_data_array    = service_data;

advdata.service_data_count      = 1; 

But it shows error invalid length..then i chnge the code as

uint8_t                    flags = BLE_GAP_ADV_FLAG_BR_EDR_NOT_SUPPORTED;

memset(&advdata, 0, sizeof(advdata));

advdata.name_type               = BLE_ADVDATA_FULL_NAME;
advdata.flags.size              = sizeof(flags);
advdata.flags.p_data            = &flags;

advdata.p_manuf_specific_data   = &manuf_specific_data;
memset(&advdata1, 0, sizeof(advdata1));

advdata1.p_service_data_array    = service_data;

advdata1.service_data_count      = 1;

err_code = ble_advdata_set(&advdata,&advdata1);
APP_ERROR_CHECK(err_code);

now code is running with out error but not advertising the battery service... can anyone help me to do dis plzzz...

Parents
  • When you advertise in a connection, the advertising type must be non connectable and undirected, BLE_GAP_ADV_TYPE_ADV_NONCONN_IND.

    This advertising type doesn't allow connection requests or scan requests, you need to fit all the data in to one advertising packets.

    The minimum advertising interval with this type is 100 ms.

Reply
  • When you advertise in a connection, the advertising type must be non connectable and undirected, BLE_GAP_ADV_TYPE_ADV_NONCONN_IND.

    This advertising type doesn't allow connection requests or scan requests, you need to fit all the data in to one advertising packets.

    The minimum advertising interval with this type is 100 ms.

Children
No Data
Related