1Overview
2********
3
4This example demonstrates how to leverage the Alibaba ble mesh
5profile APIs to support provisioning with Tmall Genius (as provisioner)
6over PB-GATT bearer and join the bluetooth low energy mesh network. After
7success provisioning and pairing, usr can control the light on/off status
8by speaking with Tmall Genius.
9
10Alibaba ble mesh profile APIs are encapsulated based on ported Zephyr
11bluetooth mesh stack. If vendor has their own ble mesh stack, just need to
12reimplement the related APIs based on their own mesh stack instead.
13
14The ble mesh profile APIs could be found in the directory:
15/network/bluetooth/bt_mesh_profile/bt_mesh_profile.h
16
17Prerequisites
18*************
19
20Apply for the triple-elements: <product id, device name, device key, product key>
21from Alibaba first. Among of these triple-elemetns, device name will be used to
22construct the uuid as mac address. And other elements will be used to calcualte
23the sha256 hash value of static oob information.
24
25Usage
26*****
27
281. compile the source code and generate the elf image.
29
30   nrf52840
31   $ aos make bluetooth.blemesh_tmall@pca10056
32
33   nrf52832
34   $ aos make bluetooth.blemesh_tmall@pca10040
35
362. program the dev board with generated elf image.
37
38   nrf52840
39   $ JLinkGDBServer -if swd -device nRF52840_xxAA
40
41   nrf52832
42   $ JLinkGDBServer -if swd -device nRF52832_xxAB
43
44   open another terminal
45   $ arm-none-eabi-gdb bluetooth.blemesh_tmall\@pca10040.elf
46   $ (gdb) target remote 127.0.0.1:2331
47   $ (gdb) load
48   $ (gdb) monitor reset
49   $ (gdb) c
50   note: you can also use nrfjprog tool to program the generated hex file.
51
523. use minicom or other serial tools to connect to dev board.
53
544. verify with Tmall genius (as provisioner)
55   1) say "天猫精灵" to wake up tmall genius smart speaker
56   2) say "发现设备" to let tmall genius scan on the smart bluetooth devices nearby
57   3) after tmall genius responses "嗯,已发现智能设备,是否连接?", say "连接", then tmall genius will establish gatt connection with dev board.
58   4) after gatt connection has been established, say "天猫精灵,开灯 or 天猫精灵,关灯" to control the LED1's on/off status on the dev board.
59      note: Using LED1(p0.17) of nrf52832 pca10040 dev board for demo here.
60
61