admin管理员组文章数量:1641786
GAP
generic access profile
以下命令都是在广播过程应用的命令
C:\ti\simplelink_cc2640r2_sdk_2_40_00_32\source\ti\blestack\profiles\roles\peripheral_broadcaster.c
调用API-设置
bStatus_t GAPRole_SetParameter(uint16_t param, uint8_t len, void *pValue)
调用API-获取
bStatus_t GAPRole_GetParameter( uint16 param, void *pValue )
举例:设置广播数据,注意多个参数时的写法
// Advertisement data (max size = 31 bytes, though this is
// best kept short to conserve power while advertising)
static uint8_t advertData[] =
{
// Flags: this field sets the device to use general discoverable
// mode (advertises indefinitely) instead of general
// discoverable mode (advertise for 30 seconds at a time)
0x02, // length of this data
GAP_ADTYPE_FLAGS,
DEFAULT_DISCOVERABLE_MODE | GAP_ADTYPE_FLAGS_BREDR_NOT_SUPPORTED,
0x05,
GAP_ADTYPE_MANUFACTURER_SPECIFIC,
0x55,
0x55,
0x55,
0x55,
0x55,
// 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)
};
GAPRole_SetParameter(GAPROLE_ADVERT_DATA, sizeof(advertData), advertData);
设备角色配置命令
C:\ti\simplelink_cc2640r2_sdk_2_40_00_32\source\ti\blestack\profiles\roles\cc26xx\peripheral.h
命令 | 说明 |
---|---|
GAPROLE_PROFILEROLE | 此参数将返回设备角色类型(只读),4种 |
GAPROLE_IRK | 身份解析密钥(读/写)大小为uint8_t [KEYLEN]。 |
GAPROLE_SRK</ |
版权声明:本文标题:CC2640R2F BLE 开发之GAP配置命令说明 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://www.elefans.com/dongtai/1729329081a1196150.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论