本帖最后由 QQQQQ 于 2025-1-8 11:08 编辑
- static uint16_t appl_mesh_prov_data_out_ccd_cb(uint16_t conn_hndl, uint8_t enabled)
- {
- // BLEBRRPL_LOG("Mesh Prov: active_conn_hndl %x,conn_hndl %x\r\n",active_conn_hndl,conn_hndl);
- #ifdef MS_PRIVATE_SUPPORT
- if (active_conn_hndl == BLEBRR_CONN_HNDL_INVALID)
- {
- /* Store the incoming connection handle in global */
- active_conn_hndl = conn_hndl;
- }
- #endif
- /* Check the Current mode is not PROV */
- if (BLEBRR_GATT_PROV_MODE != blebrr_gatt_mode_get())
- {
- BLEBRRPL_LOG("Mesh Prov Out CCD being Written when PROV is not Active!\r\n");
- return 0xFFFF;
- }
- if (TRUE == enabled)
- {
- BLEBRRPL_LOG("Mesh Prov Out CCD Enabled");
- #ifdef MS_PRIVATE_SUPPORT
- prov_conn_hndl = conn_hndl;
- MS_prov_stop_interleave_timer();
- MS_brr_bcast_end(BRR_BCON_TYPE_UNPROV_DEVICE, BRR_BCON_ACTIVE);
- MS_brr_bcast_end(BRR_BCON_TYPE_UNPROV_DEVICE, BRR_BCON_PASSIVE);
- #endif
- }
- else
- {
- BLEBRRPL_LOG("Mesh Prov Out CCD Disabled");
- }
- blebrr_gatt_com_channel_setup_pl
- (
- BLEBRR_SERVER_ROLE,
- BLEBRR_GATT_PROV_MODE,
- (enabled) ? BLEBRR_COM_CHANNEL_CONNECT : BLEBRR_COM_CHANNEL_DISCONNECT
- );
- return 0x0000;
- }
- static uint16_t appl_mesh_prov_data_in_wt_cb
- (
- uint16_t conn_hndl,
- uint16_t offset,
- uint16_t length,
- uint8_t* value
- )
- {
- if (NULL != value)
- {
- BLEBRRPL_LOG("Mesh Prov Data IN received");
- appl_dump_bytes(value, length);
- BLEBRRPL_LOG("Mesh Prov Data IN received");
- blebrr_recv_mesh_packet_pl
- (
- &conn_hndl,
- offset,
- value,
- length
- );
- }
- return 0x0000;
- }
复制代码
代码是官网下载的例程ble_mesh里面的mesh_friend
这是我找到的蓝牙收发数据的处理,目前收数据正常,就是没看到发数据怎么处理
|
|