蓝牙协议栈主从机之间发送数据

蓝牙协议栈主从机之间发送数据,先讲主机给从机发送数据。然后是从机给主机发送数据。
1.Initialize GATT attributes (初始化GATT属性表)
SimpleProfile_AddService( GATT_ALL_SERVICES );  // Simple GATT Profile
---->
2.注册属性列表 and 回调函数 simpleProfileCBs。 这是GATT Server App干的事。
// Register GATT attribute list and CBs with GATT Server App
    status = GATTServApp_RegisterService( simpleProfileAttrTbl, 
                                          GATT_NUM_ATTRS( simpleProfileAttrTbl ),
                                          &simpleProfileCBs );
---->
3.属性表simpleProfileAttrTbl,根据自己需要自己添加需要的UUID,及修改具体项的值。


---->
4.simpleProfileCBs
// Simple Profile Service Callbacks
CONST gattServiceCBs_t simpleProfileCBs =
{
  simpleProfile_ReadAttrCB,  // Read callback function pointer
  simpleProfile_WriteAttrCB, // Write callback function pointer
  NULL                       // Authorization callback function pointer
};


---->
5.simpleProfile_WriteAttrCB,主机给从机发
  • 1
    点赞
  • 11
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值