CC2640R2F BLE 开发之GAP配置命令说明

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</
  • 3
    点赞
  • 10
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值