Eddystone谷歌公司制定的标准。Eddystone相对于iBeacon功能更为广泛,可以广播自定义唯一的信标ID(UID)、广播网(URL)、广播自身数据(TLM/ETLM)、加密的临时标识符(EID)。

协议如下所示:

image.png

详情可以参考

https://blog.csdn.net/yplwrt/article/details/129107710


由于不熟悉gap广播,参照ibeacon的定义

static uint8_t advertData[] =

{

? // Flags; this sets the device to use limited discoverable

? // mode (advertises for 30 seconds at a time) instead of general

? // discoverable mode (advertises indefinitely)

? 0x02,? ?// length of this data

? GAP_ADTYPE_FLAGS,

? DEFAULT_DISCOVERABLE_MODE | GAP_ADTYPE_FLAGS_BREDR_NOT_SUPPORTED,

? //ibeacon

?26,0xff,0x4c,0x00,0x02,0x15,0xe2,0xc5,0x6d,0xb5,0xdf,0xfb,0x48,0xd2,0xb0,0x60,0xd0,0xf5,0xa7,0x10,0x96,0xe0,0x88,0xab,0x04,0x12,0xd7

};

定义Eddystone定义错了

static uint8_t advertData[] =

{

? // Flags; this sets the device to use limited discoverable

? // mode (advertises for 30 seconds at a time) instead of general

? // discoverable mode (advertises indefinitely)

? 0x02,? ?// length of this data

? GAP_ADTYPE_FLAGS,

? DEFAULT_DISCOVERABLE_MODE | GAP_ADTYPE_FLAGS_BREDR_NOT_SUPPORTED,

? //Eddystone

? 0x1f,0x02,0x01,0x06,0x03,0x03,0xaa,0xfe,0x17,0x16,0xaa,0xfe,0x00,-10,0x00,0x01,0x02,0x03,0x04,0x05 ,0x06,

? 0x07,0x08,0x09,0x0a,0x0b,0x0e,0x0f,0x00,0x00,0x00,0x00

};

然后发送失败,发现超过了31字节

修改后Eddystone能正常扫描到

static uint8_t advertData[] =

{

? 0x02,0x01,0x06,0x03,0x03,0xaa,0xfe,0x17,0x16,0xaa,0xfe,0x00,-10,0x00,0x01,0x02,0x03,0x04,0x05 ,0x06,

? 0x07,0x08,0x09,0x0a,0x0b,0x0e,0x0f,0x00,0x00,0x00,0x00

};