|
# AnW_BT_SRV
|
|
# AnW_BT_SRV
|
|
AnW Bluetooth Service API, offered two sorts of releases
|
|
|
|
|
|
AnW Bluetooth Service API, offered two sorts of releases
|
|
|
|
|
|
1. [APP Release (btsrv)](#AppRelease): executable **BTDemo**, launcher **btsrv_client.sh**, essentails libraries (**.so**), and App configures (**.xml**)
|
|
1. [APP Release (btsrv)](#AppRelease): executable **BTDemo**, launcher **btsrv_client.sh**, essentails libraries (**.so**), and App configures (**.xml**)
|
|
2. [SDK Release (anwbtsrv_sdk)](#SDKRelease): open source with **AnWBTServiceDemo.cpp**, imported essentials libraries (**.so**), header (**anwbtservice.h**), and App configures (**.xml**)
|
|
2. [SDK Release (anwbtsrv_sdk)](#SDKRelease): open source with **AnWBTServiceDemo.cpp**, imported essentials libraries (**.so**), header (**anwbtservice.h**), and App configures (**.xml**)
|
|
|
|
|
|
# RELEASE NOTE
|
|
# RELEASE NOTE
|
|
|
|
|
|
20220118 [TAG:TAMUL_BT_V2](http://192.168.1.51:8088/delly.chen/anw_bt_srv/-/tags/TAMUL_BT_V2)
|
|
20220118 [TAG:TAMUL_BT_V2](http://192.168.1.51:8088/delly.chen/anw_bt_srv/-/tags/TAMUL_BT_V2)
|
|
1. [FUNC]supports iphone carplay connect & write carplay data to iphone
|
|
|
|
|
|
|
|
20220117 [TAG:TAMUL_BT_V1](http://192.168.1.51:8088/delly.chen/anw_bt_srv/-/tags/TAMUL_BT_V1)
|
|
1. \[FUNC\]supports iphone carplay connect & write carplay data to iphone
|
|
1. [FUNC] supports basic BT pair & connect
|
|
|
|
|
|
|
|
<div style="page-break-after: always;"></div>
|
|
20220117 [TAG:TAMUL_BT_V1](http://192.168.1.51:8088/delly.chen/anw_bt_srv/-/tags/TAMUL_BT_V1)
|
|
|
|
|
|
|
|
1. \[FUNC\] supports basic BT pair & connect
|
|
|
|
|
|
# USAGE
|
|
# USAGE
|
|
|
|
|
|
1. Support HFP, A2DP, AVRCP, PBAP, .. AnW BT stack
|
|
1. Support HFP, A2DP, AVRCP, PBAP, .. AnW BT stack
|
|
2. Support Device Serarch & Pair, Call, Phonebook, Music, ...
|
|
2. Support Device Serarch & Pair, Call, Phonebook, Music, ...
|
|
|
|
|
|
## Pre-Requirement
|
|
## Pre-Requirement
|
|
Modify combo module init script **/etc/init.d/ubloxinit.sh**
|
|
|
|
```
|
|
Modify combo module init script **/etc/init.d/ubloxinit.sh**
|
|
|
|
|
|
|
|
```plaintext
|
|
echo "[DDMISO] UBLOX Driver"
|
|
echo "[DDMISO] UBLOX Driver"
|
|
modprobe jody-w2-sdiouart
|
|
modprobe jody-w2-sdiouart
|
|
ifconfig uap0 192.168.1.10
|
|
ifconfig uap0 192.168.1.10
|
... | @@ -33,18 +39,21 @@ wpa_supplicant -B -D nl80211 -i mlan0 -c /etc/ublox/wpa_supplicant.conf |
... | @@ -33,18 +39,21 @@ wpa_supplicant -B -D nl80211 -i mlan0 -c /etc/ublox/wpa_supplicant.conf |
|
udhcpc -i mlan0
|
|
udhcpc -i mlan0
|
|
```
|
|
```
|
|
|
|
|
|
## Run App on targets (tamul_btsrv-.zip) <a name="AppRelease"></a>
|
|
## Run App on targets (tamul_btsrv-.zip)
|
|
|
|
|
|
1. unzip
|
|
1. unzip
|
|
2. Copy results folder /build/btsrv to target /home/btsrv
|
|
2. Copy results folder /build/btsrv to target /home/btsrv
|
|
3. go to target, in terminal entering /btsrv folder
|
|
3. go to target, in terminal entering /btsrv folder
|
|
4. run btsrv_client.sh to launch BTDemo demo app and following the menu commands or
|
|
4. run btsrv_client.sh to launch BTDemo demo app and following the menu commands or
|
|
```
|
|
|
|
|
|
```plaintext
|
|
> export LD_LIBRARY_PATH="/home/btsrv"
|
|
> export LD_LIBRARY_PATH="/home/btsrv"
|
|
>./BTDemo
|
|
>./BTDemo
|
|
```
|
|
```
|
|
|
|
|
|
### Set Local Device Name
|
|
### Set Local Device Name
|
|
```
|
|
|
|
|
|
```plaintext
|
|
================bluetooth menu=================
|
|
================bluetooth menu=================
|
|
1.EXIT
|
|
1.EXIT
|
|
2.BTPowerOn
|
|
2.BTPowerOn
|
... | @@ -60,7 +69,8 @@ udhcpc -i mlan0 |
... | @@ -60,7 +69,8 @@ udhcpc -i mlan0 |
|
```
|
|
```
|
|
|
|
|
|
### Power On For BT INIT
|
|
### Power On For BT INIT
|
|
```
|
|
|
|
|
|
```plaintext
|
|
================bluetooth menu=================
|
|
================bluetooth menu=================
|
|
1.EXIT
|
|
1.EXIT
|
|
2.BTPowerOn
|
|
2.BTPowerOn
|
... | @@ -71,12 +81,12 @@ udhcpc -i mlan0 |
... | @@ -71,12 +81,12 @@ udhcpc -i mlan0 |
|
BTPowerOn
|
|
BTPowerOn
|
|
...
|
|
...
|
|
```
|
|
```
|
|
Note: Looking for device name (e.g. TAMUL_MARVELL) from mobile, then pair the device with mobile
|
|
|
|
When mobile shows connected succeed, turn off the BT button from mobile, then turn on the BT button from mobile again.
|
|
Note: Looking for device name (e.g. TAMUL_MARVELL) from mobile, then pair the device with mobile When mobile shows connected succeed, turn off the BT button from mobile, then turn on the BT button from mobile again. At this time, mobile has paired storage with the device.
|
|
At this time, mobile has paired storage with the device.
|
|
|
|
|
|
|
|
### Connect to SPP
|
|
### Connect to SPP
|
|
```
|
|
|
|
|
|
```plaintext
|
|
================ BT Test Menu =================
|
|
================ BT Test Menu =================
|
|
1. Exit
|
|
1. Exit
|
|
2. StartInquiry
|
|
2. StartInquiry
|
... | @@ -90,15 +100,18 @@ At this time, mobile has paired storage with the device. |
... | @@ -90,15 +100,18 @@ At this time, mobile has paired storage with the device. |
|
> input connect addr(xx:xx:xx:xx:xx:xx): 11:e8:14:da:61:d4 (for example)
|
|
> input connect addr(xx:xx:xx:xx:xx:xx): 11:e8:14:da:61:d4 (for example)
|
|
...
|
|
...
|
|
```
|
|
```
|
|
|
|
|
|
Note: You can find mobile BT mac from **"Setting->General->About-> Bluetooth"**
|
|
Note: You can find mobile BT mac from **"Setting->General->About-> Bluetooth"**
|
|
|
|
|
|
```
|
|
```plaintext
|
|
> input profile_mask: 0x00000100
|
|
> input profile_mask: 0x00000100
|
|
```
|
|
```
|
|
|
|
|
|
Note: Then, connected.
|
|
Note: Then, connected.
|
|
|
|
|
|
### Write SPP
|
|
### Write SPP
|
|
```
|
|
|
|
|
|
```plaintext
|
|
================ BT Test Menu =================
|
|
================ BT Test Menu =================
|
|
1. Exit
|
|
1. Exit
|
|
2. StartInquiry
|
|
2. StartInquiry
|
... | @@ -110,42 +123,45 @@ Note: Then, connected. |
... | @@ -110,42 +123,45 @@ Note: Then, connected. |
|
> input num: 10
|
|
> input num: 10
|
|
> input connect addr(xx:xx:xx:xx:xx:xx): 11:e8:14:da:61:d4 (for example)
|
|
> input connect addr(xx:xx:xx:xx:xx:xx): 11:e8:14:da:61:d4 (for example)
|
|
```
|
|
```
|
|
|
|
|
|
Note: You can find mobile BT mac from **"Setting->General->About-> Bluetooth"**
|
|
Note: You can find mobile BT mac from **"Setting->General->About-> Bluetooth"**
|
|
|
|
|
|
```
|
|
```plaintext
|
|
>input IAP_data:**ff,55,2,0,ee,10** (for example)
|
|
>input IAP_data:**ff,55,2,0,ee,10** (for example)
|
|
```
|
|
```
|
|
|
|
|
|
Note: Then, you can receive data back from IPHONE, check log printed:
|
|
Note: Then, you can receive data back from IPHONE, check log printed:
|
|
```
|
|
|
|
|
|
```plaintext
|
|
AnWBTService_SPP_DATA_IND_S sppData:
|
|
AnWBTService_SPP_DATA_IND_S sppData:
|
|
[ff] [55] [2] [0] [ee] [10]**
|
|
[ff] [55] [2] [0] [ee] [10]**
|
|
```
|
|
```
|
|
|
|
|
|
## Customize on SDK (tamul_release-.zip) <a name="SDKRelease"></a>
|
|
## Customize on SDK (tamul_release-.zip)
|
|
- unzip
|
|
|
|
- in terminal entering ./anwbtsrv_sdk/Demo folder
|
|
1. unzip
|
|
- setup tool-chain by command line (source ...) or edit in ./anwbtsrv_sdk/Demo/build_demo.sh
|
|
2. in terminal entering ./anwbtsrv_sdk/Demo folder
|
|
- run make or build_demo.sh
|
|
3. setup tool-chain by command line (source ...) or edit in ./anwbtsrv_sdk/Demo/build_demo.sh
|
|
```
|
|
4. run make or build_demo.sh
|
|
|
|
|
|
|
|
```plaintext
|
|
> cd ./build/anwbtsrv_sdk/Demo
|
|
> cd ./build/anwbtsrv_sdk/Demo
|
|
> source /opt/poky-tamul/2.5.1/environment-setup-cortexa9hf-neon-poky-linux-gnueabi
|
|
> source /opt/poky-tamul/2.5.1/environment-setup-cortexa9hf-neon-poky-linux-gnueabi
|
|
> make or ./build_demo.sh
|
|
> make or ./build_demo.sh
|
|
```
|
|
```
|
|
then, result is collected in **./Demo/btsrv**
|
|
|
|
|
|
|
|
<div style="page-break-after: always;"></div>
|
|
then, result is collected in **./Demo/btsrv**
|
|
|
|
|
|
# STRUCTURE (tamul_release-.zip)
|
|
# STRUCTURE (tamul_release-.zip)
|
|
<pre>
|
|
|
|
.
|
|
.
|
|
└── Demo
|
|
└── Demo
|
|
├── AnWBTServiceDemo.cpp (examples to use anwbtservice)
|
|
├── AnWBTServiceDemo.cpp (examples to use anwbtservice)
|
|
├── build_demo.sh (build script, call to make)
|
|
├── build_demo.sh (build script, call to make)
|
|
├── makefile (makefile for BTDemo)
|
|
├── makefile (makefile for BTDemo)
|
|
├── btsrv_client.sh (launcher for BTDemo)
|
|
├── btsrv_client.sh (launcher for BTDemo)
|
|
├── *.xml, *.cfg (app settings)
|
|
├── \*.xml, \*.cfg (app settings)
|
|
├── import (anwbtservice)
|
|
├── import (anwbtservice)
|
|
│ ├── anwbtservice.h (service api header)
|
|
│ ├── anwbtservice.h (service api header)
|
|
│ └── *.so (essentials libraries)
|
|
│ └── \*.so (essentials libraries)
|
|
└── btsrv (ouput for produced, e.g. BTDemo) |
|
└── btsrv (ouput for produced, e.g. BTDemo) |
|
</pre> |
|
|