File tree 3 files changed +29
-2
lines changed
3 files changed +29
-2
lines changed Original file line number Diff line number Diff line change 13
13
14
14
15
15
16
- ![ ] ( ./images/mesh1.png ) ![ ] ( ./images/mesh2.png ) ![ ] ( ./images/mesh3.png ) ![ ] ( ./images/mesh4.png )
16
+ ![ ] ( ./images/mesh1.png ) ![ ] ( ./images/mesh2.png ) ![ ] ( ./images/mesh3.png ) ![ ] ( ./images/mesh4.png )
17
17
18
18
对应的android端程序界面效果展示。
19
19
Original file line number Diff line number Diff line change
1
+ # template
2
+ template是一个基础模板,可以直接在上面进行编程开发。
3
+
4
+ ### 代码流程介绍
5
+
6
+
7
+ 代码不长,涉及了一些蓝牙知识,这里简要介绍一下代码流程:
8
+
9
+ ```
10
+ 1. 系统就绪(属于`系统API`,也是应用层编程的第一入口(系统回调事件),相当于传统的`main()`函数。) -- on_ready;
11
+ 2. 设置Cannon的蓝牙广播地址 -- ble_set_adv_param;
12
+ 3. Cannon开始蓝牙广播 -- ble_device_start_advertising;
13
+ 4. 手机端APP和Cannon建立连接,假设使用BLE调试助手APP;
14
+ 5. BLE调试助手APP给Cannon发一些数据;
15
+ 6. Cannon收到数据后,触发回调事件 -- ble_device_on_message;
16
+ 7. Cannon将数据原封不动的回传给手机 -- ble_device_send;
17
+ 8. 手机或Cannon断开连接;
18
+ 9. Cannon触发断开连接事件 -- ble_device_on_disconnect;
19
+ 10. Cannon重新开启蓝牙广播 -- ble_device_start_advertising;
20
+
21
+ ```
22
+
23
+ > 需记住,收发蓝牙数据,需要先要建立连接,而建立连接,需要设备先开启广播。
24
+
25
+
26
+ ### 附
27
+
1
28
API文档:
2
29
[ http://www.juma.io/doc/zh/embedded_api/task/ ] ( http://www.juma.io/doc/zh/embedded_api/task/ )
3
30
Original file line number Diff line number Diff line change 5
5
6
6
7
7
8
- ![ ] ( ./images/tb1.png ) ![ ] ( ./images/tb2.png ) ![ ] ( ./images/tb3.png ) ![ ] ( ./images/tb4.png ) ![ ] ( ./images/tb5.png )
8
+ ![ ] ( ./images/tb1.png ) ![ ] ( ./images/tb2.png ) ![ ] ( ./images/tb3.png ) ![ ] ( ./images/tb4.png ) ![ ] ( ./images/tb5.png )
9
9
10
10
对应的android端程序界面效果展示。
11
11
You can’t perform that action at this time.
0 commit comments