请问各位大侠,CC2541如何在广播中带上service uuid以及characteristics的uuid和属性?
Barbara Wu:
广播的数据长度是有限制的,不一定能带上所有的
可修改的部分参考:
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 ),
};
wujun cui:
回复 Barbara Wu:
Hi WBJ,
advertData我已经做了相应的修改。我碰到的问题主要是用app软件扫描到CC2541的广播里,有0x1800、0x1801、0x180A、0xFFF0这四个services uuid,但是我在程序里把DevInfo_AddService()注释掉,还是可以扫描到0x180A这个uuid,而且我想修改例程里的0xFFF0这个uuid,改为我自定义的uuid(0xFEA0),却是怎么改都是扫描到的0xFFF0。我的程序是用HeartRate这个例程修改的。
盼望您的解答,谢谢!
wujun cui:
回复 Barbara Wu:
按照参考例子,已经解决问题了。谢谢WBJ的帮助!
cedar_xuesong:
回复 wujun cui:
我也遇到过这种,可以重启安卓手机
TI中文支持网


