Hi,
What macro should be used in the bt_data ad struct in order to advertise a custom 128 bit UUID? I have tried the following: BT_UUID_128_ENCODE(BT_UUID_CUSTOM_SERVICE).
Thanks,
Adam
Hi,
What macro should be used in the bt_data ad struct in order to advertise a custom 128 bit UUID? I have tried the following: BT_UUID_128_ENCODE(BT_UUID_CUSTOM_SERVICE).
Thanks,
Adam
I don't see anything about active scanning?
If it does do active scanning, surely I would be able to see the 128 bit UUID? Currently I cannot see this UUID when the device is advertising and this is required.
Thanks,
Adam
Have you split the data you were advertising into advertising data and scan response data in bt_le_adv_start?
In the below code snippet, all data is under ad which is advertising data. You should split this into two ad and sd
static struct bt_data ad[] = {
BT_DATA_BYTES(BT_DATA_FLAGS, (BT_LE_AD_GENERAL | BT_LE_AD_NO_BREDR)),
BT_DATA_BYTES(BT_DATA_UUID16_ALL,
BT_UUID_16_ENCODE(BT_UUID_HTS_VAL),
BT_UUID_16_ENCODE(BT_UUID_DIS_VAL),
BT_UUID_16_ENCODE(BT_UUID_BAS_VAL)),
BT_DATA_BYTES(BT_DATA_UUID128_ALL, RSSI_SERVICE_UUID),
};
Thanks.
It works now - I was not sending the sd data originally.
However, now the device name is not printing in full whenever I include sd data. I don't have this issue when I am not sending sd data. Could this be because the advertising packet is too long to fit the full device name?
Thanks,
Adam
adam_atmo said:Could this be because the advertising packet is too long to fit the full device name?
It most likely is too long. How did you split the adv data and the scan response data? Can you show us your new declaration for ad and sd?
Sure, attached below:
static struct bt_data ad[] = { BT_DATA_BYTES(BT_DATA_FLAGS, (BT_LE_AD_GENERAL | BT_LE_AD_NO_BREDR)), BT_DATA_BYTES(BT_DATA_UUID16_ALL, BT_UUID_16_ENCODE(BT_UUID_HTS_VAL), BT_UUID_16_ENCODE(BT_UUID_DIS_VAL), BT_UUID_16_ENCODE(BT_UUID_BAS_VAL)), { /* TX power adv data */}, }; /* Scan response data. * Includes 128 bit UUID for custom RSSI service. */ static const struct bt_data sd[] = { BT_DATA_BYTES(BT_DATA_UUID128_ALL, RSSI_SERVICE_UUID), };