物联网技术
直播中

fejlkel

8年用户 1046经验值
擅长:制造/封装
私信 关注
[问答]

CC2541如何在广播中带上service uuid以及characteristics的uuid和属性?

请问各位大侠,CC2541如何在广播中带上service uuid以及characteristics的uuid和属性?

回帖(1)

可口可甜

2016-4-25 14:19:35
广播的数据长度是有限制的,不一定能带上所有的

可修改的部分参考:

static uint8 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,

// service UUID, to notify central devices what services are included
// in this peripheral
0x03, // length of this data
GAP_ADTYPE_16BIT_MORE, // some of the UUID's, but not all
LO_UINT16( SIMPLEPROFILE_SERV_UUID ),
HI_UINT16( SIMPLEPROFILE_SERV_UUID ),

};
举报

更多回帖

发帖
×
20
完善资料,
赚取积分