一、描述你遇到的问题
普通开发拿不到星闪的规范,但是我通过抓包华为的星闪鼠标、对照蓝牙规范后,认为星闪的服务、特征、描述这一套跟蓝牙的应该是差不多的。
但是我在 Client 端尝试从 ssapc_find_structure 获取返回结果 find_strcuture_cb、find_property_cb 后,通过 ssapc_read_req
或者 ssapc_read_req_by_uuid
接口发起读取请求时没有效果,对端 Server 我是通过在 read_request_cb 接口中调用 ssaps_send_response
写的响应数据。
在对端 Server 上能看到 ssaps_read_request_cb 产生了回调,handle = 2,两端的时间戳都能对应上。
Client 端内核的打印也很奇怪,显示 ssapc read rsp handle:201, data len:2 ssapc read by conn_id:0, err_code:0
,handle 就已经变了。
如果是这个SDK下开发蓝牙的话,Client端用类似的 gattc_read_req_by_uuid
接口是能读到相关属性值的。
目前测下来发现 Server 端只有 ssaps_notify_indicate 这个接口是能在 Client 收到消息的。
二、你具体做的所有步骤结果截图
- Client:从 exchange_info_cb 切入,
ssapc_find_structure
获取服务(Service) - Client:find_structure_cb 回调后再获取属性(Property)
- Client:find_property_cb 回调中调用
ssapc_read_req_by_uuid
获取属性值 - Server:read_request_cb 收到读请求,立即调用
ssaps_send_response
发送回复。
三、当前开发板状态全景照片
请插入图片
四、开发板串口所有日志
Client
[2025-03-03 15:18:32.782]# RECV ASCII/861 <<<
[adv_report] event_type: 0x03, addr_type: 0x0000, addr: 15:**:**:**:01:00
[adv_report] data length: 35, data: 0x01 0x01 0x01 0x03 0x1e 0xee
[sle_seek_result_info_cbk] addr 15-cd-15-0c-01-00
[sle_seek_result_info_cbk] data: 01 01 01 03 1e ee fd 01 01 0d 04 00 11 0a 12 00 00 00 00 15 00 00 00 00 00 00 ff 17 01 00 14 02 00 00 00
[sle_seek_result_info_cbk] addr 15-cd-15-0c-01-00
[sle_seek_result_info_cbk] data: 01 01 01 03 1e ee fd 01 01 0d 04 00 11[adv_report] event_type: 0x0b, addr_type: 0x0000, addr: 15:**:**:**:01:00
[adv_report] data length: 18, data: 0x0b 0x0f 0x6c 0x74 0x2d 0x6d
0a 12 00 00 00 00 15 00 00 00 00 00 00 ff 17 01 00 14 02 00 00 00
[sle_seek_result_info_cbk] addr 15-cd-15-0c-01-00
[sle_seek_result_info_cbk] data: 0b 0f 6c 74 2d 6d 72 73 78 73 00 00 00 00 00 00 00 00
[2025-03-03 15:18:32.843]# RECV ASCII/154 <<<
[Connected]
addr:15:**:**:**:01:00, handle:00
[sle_connect_state_changed_cbk] disc_reason:0x0
[sle_connect_state_changed_cbk] SLE_ACB_STATE_CONNECTED
[2025-03-03 15:18:33.366]# RECV ASCII/59 <<<
[sle_connect_state_changed_cbk] sle_low_latency_rx_enable
[2025-03-03 15:18:34.119]# RECV ASCII/230 <<<
[sle_pair_complete_cbk] conn_id:0, addr:15***0100
ssapc exchange info, conn_id:0, err_code:0
[sle_exchange_info_cbk] pair complete client id:0 conn_id:0 status:0
[sle_exchange_info_cbk] exchange mtu, mtu size: 520, version: 1.
[2025-03-03 15:18:34.197]# RECV ASCII/233 <<<
discovery character cbk complete in
[sle_find_structure_cbk] client_id: 0, conn_id: 0, handle start 0x01 end 0x03.
uuid: 09 06.
discovery character cbk complete in
discovery character cbk in
discovery character cbk complete in
[2025-03-03 15:18:34.228]# RECV ASCII/65 <<<
discovery character cbk in
discovery character cbk complete in
[2025-03-03 15:18:34.688]# RECV ASCII/205 <<<
[sle_find_property_cbk] client_id: 0, conn_id: 0, operate_ind: 0x9, descriptors_count: 1, property->handle: 0x02.
uuid: 2e 10.
ssapc read rsp handle:201, data len:2
ssapc read by conn_id:0, err_code:0
Server
[2025-03-03 15:18:32.843]# RECV ASCII/278 <<<
[Connected]
addr:ee:**:**:**:8d:5c, conn_id:00
[ACore] sle adv cbk in, event:7 status:0
[sle_connect_state_changed_cbk] conn_id:0x00, conn_state:0x1, pair_state:0x1, disc_reason:0x0
[sle_connect_state_changed_cbk] addr: ee-ef-33-9b-8d-5c
[sle_announce_terminal_cbk] id:01
[2025-03-03 15:18:33.304]# RECV ASCII/78 <<<
APP|[SYS INFO] mem: used:105968, free:258468; log: drop/all[0/0], at_recv 0.
[2025-03-03 15:18:33.443]# RECV ASCII/45 <<<
[als_task] sle client is not connected yet.
[2025-03-03 15:18:34.104]# RECV ASCII/169 <<<
[sle_pair_complete_cbk] conn_id:0x00, status:0
[sle_pair_complete_cbk] addr: ee-ef-33-9b-8d-5c
[ssaps_mtu_changed_cbk] server_id:0, conn_id:0, mtu_size:208, status:0
[2025-03-03 15:18:34.688]# RECV ASCII/180 <<<
[ssaps_read_request_cbk] server_id:1, conn_id:0, request_id:0, handle:2, type:3, status:0
[sle_server_send_response] server_id:1 conn_id:0 send response, request_id:0, status:3.