cancel
Showing results for 
Search instead for 
Did you mean: 

Does the ST Bluetooth stack for STM32WB55-Nucleo support scan request/scan response?

ACoad.1
Associate II

As the title says. I can see no support for this but a perpiheral advertising with ADV_IND should support this by default.

Does anyone know?

Regards,

AC

1 ACCEPTED SOLUTION

Accepted Solutions
ACoad.1
Associate II

Found it - it's an hci call, not an aci call. Hmmm...

View solution in original post

7 REPLIES 7
ACoad.1
Associate II

Found it - it's an hci call, not an aci call. Hmmm...

VBess.1
Associate II

Does it mean one can customize scan response data? If so what's the proper way to do that? I'd want to just add the device name.

I'm new in STM32WB and infos are sometimes difficult to find.

ACoad.1
Associate II

I can find no way to configure it - do let me know if you do.

I guess ST decided not to support scan response that's why everything crammed into the advertisement packet and, as a result, there's only room for 7 characters of device name. The problem with this is that you can't use 128-bit UUIDs as there's no room.

ac

Thank you for your quick answer.

My device name is 9 char long and even CubeMX refuses to put it with the 128-bit UUID I need in advertisement packet. My goal is to port an application running with a Bluegiga module which actually puts devname in scan response and UUID in advert. Of course name length must be 9...would have been too easy...

I'll report if I find a solution.

Vincent

ACoad.1
Associate II

I just wish that there were some experts on this forum who can answer these types of question. Most questions just go unanswered...

DGann.1
Associate

To set scan response you have to use functions aci_gap_update_adv_data and hci_le_set_scan_response_data.

Here is an example on how to use them:

static uint8_t manuf_data[] = {
    14, AD_TYPE_COMPLETE_LOCAL_NAME, 'C' ,'O' ,'M' ,'P' ,'L' ,'E' ,'T' ,'E' ,' ' ,'N' ,'A' ,'M' ,'E' 
};
aci_gap_update_adv_data(sizeof(manuf_data), (uint8_t *)manuf_data);
 
static uint8_t scan_resp_data[] = {
    17,                                
    AD_TYPE_MANUFACTURER_SPECIFIC_DATA,                                
    0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f
};
hci_le_set_scan_response_data(sizeof(scan_resp_data), (uint8_t*)scan_resp_data);

Thank you DGann. This works for me. I'll just add some complement. Care must be taken when using these functions to have low level layers initialized, else you face a HardFault (at least I've faced...). If using a CubeMX generated project this can be done at the end of APP_BLE_Init() in app_ble.c