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
Probably some code snippets that you used might help us see the issue. What kind of errors are you getting?
The eddystone sample uses below initialization to advertise all of 128 bit UUID, just an example to show you.
static const struct bt_data ad[] = { BT_DATA_BYTES(BT_DATA_FLAGS, (BT_LE_AD_GENERAL | BT_LE_AD_NO_BREDR)), /* Eddystone Service UUID a3c87500-8ed3-4bdf-8a39-a01bebede295 */ BT_DATA_BYTES(BT_DATA_UUID128_ALL, 0x95, 0xe2, 0xed, 0xeb, 0x1b, 0xa0, 0x39, 0x8a, 0xdf, 0x4b, 0xd3, 0x8e, 0x00, 0x75, 0xc8, 0xa3), };
Hi Susheel,
I have attached the relevant code below. I am now getting the following error: too big advertising data. It works perfectly when I leave out the other SIG defined UUIDs. The error probably occurs because I am already advertising three other SIG defined services.
1. Is there anyway to encode this 128 bit data into a smaller number that can be advertised?
2. Or would it be a better idea to just include the 128 but UUID in the scan response sd data? If so, I am using the Android nRF Connect app - how do I request scan response data so that I can see the 128 bit UUID.
3. Any other suggestions?
4. Also, what is the max size in bits for a legacy advertising packet?
Thanks so much,
Adam
Here is my advertising struct:
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), };
In my service.h file, I have the following:
#define RSSI_SERVICE_UUID 0xb4, 0xa0, 0x76, 0x45, 0xE9, 0x47, 0xC5, \ 0x93, 0x9D, 0x9D, 0x03, 0x45, 0x76, 0xA0, 0xB4, 0x49
#define BT_UUID_RSSI_SERVICE BT_UUID_DECLARE_128(RSSI_SERVICE_UUID)
Sorry Susheel, I am still confused as to why I cannot see the full name...
In addition to the code that I have already attached, this is what I have in my prj.conf:
CONFIG_BT_DEVICE_NAME="abcdefghigklmnop"
This is what I see on the Android nRF Connect app:
Regards,
Adam
I will try to test this tomorrow, I think you have given me all the information needed to replicate your setup.
Which SDK version are you using Adam, Unable to compile your code in SDKv2.0
I am using NCS v2.00
Hi Susheel,
Is there any update on this please? It has been nearly two weeks.
Thanks,
Adam
Hi Susheel,
Is there any update on this please? It has been nearly two weeks.
Thanks,
Adam
Sorry Adam,
I missed to follow this up, I will test this today, should not take too long, sorry for delays.
Adam,
I just tested this and I see full name in the nrf connect desktop and the services.
Can you provide me a sniffer trace of your data that is being transmitted by the advertiser, it looks right on my side.
Hi Susheel,
What is a sniffer trace and how do I provide you with one?
Adam
Sniffer is a setup to trace and log the Bluetooth LE traffic with details of packet data so that we can understand the flow of data between peers.
There are few tutorials like this one that can be useful for you.