AnW_BT_SRV
AnW Bluetooth Service API, offered two sorts of releases
- APP Release (btsrv): executable BTDemo, launcher btsrv_client.sh, essentails libraries (.so), and App configures (.xml)
- SDK Release (anwbtsrv_sdk): open source with AnWBTServiceDemo.cpp, imported essentials libraries (.so), header (anwbtservice.h), and App configures (.xml)
RELEASE NOTE
20220121 TAG:0.0.03
- [FUNC]supports android auto connect & write data to android
- [FUNC]Add some functions, For details, refer to anwbtservice.h
20220118 TAG:TAMUL_BT_V2
- [FUNC]supports iphone carplay connect & write carplay data to iphone
20220117 TAG:TAMUL_BT_V1
- [FUNC] supports basic BT pair & connect
USAGE
- Support HFP, A2DP, AVRCP, PBAP, .. AnW BT stack
- Support Device Serarch & Pair, Call, Phonebook, Music, ...
Pre-Requirement
Modify combo module init script /etc/init.d/ubloxinit.sh
echo "[DDMISO] UBLOX Driver"
modprobe jody-w2-sdiouart
ifconfig uap0 192.168.1.10
hostapd /etc/ublox/hostapd.conf -B
udhcpd /etc/ublox/udhcpd.conf
ifconfig uap0 up
wpa_supplicant -B -D nl80211 -i mlan0 -c /etc/ublox/wpa_supplicant.conf
#modprobe jody-w2-sdiouart-bt
#hciattach /dev/ttyAMA1 any 3000000 flow
#hciconfig -a hci0 up
#hciconfig -a hci0
udhcpc -i mlan0
Run App on targets (tamul_btsrv-.zip)
- unzip
- Copy results folder /build/btsrv to target /home/btsrv
- go to target, in terminal entering /btsrv folder
- run btsrv_client.sh to launch BTDemo demo app and following the menu commands or
> export LD_LIBRARY_PATH="/home/btsrv"
>./BTDemo
set device name
================bluetooth menu=================
1.EXIT
2.BTPowerOn
3.BTPowerOff
4.SetLocalDevAddrOrName
===============================================
> input num: 4
0.set local name
1.set local address
> 0
> input name: TAMUL_MARVELL (for example)
...
power on init
================bluetooth menu=================
1.EXIT
2.BTPowerOn
3.BTPowerOff
4.SetLocalDevAddrOrName
===============================================
> input num: 2
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. At this time, mobile has paired storage with the device.
spp connect
================ BT Test Menu =================
1. Exit
2. StartInquiry
...
8. ConnectDevice
9. DisconnectDevice
10.SPP_Write
===============================================
> input num: 8
...
> 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" (iphone)
> input profile_mask: 0x00000040
Note: Then, connected.
spp write
================ BT Test Menu =================
1. Exit
2. StartInquiry
...
8. ConnectDevice
9. DisconnectDevice
10.SPP_Write
===============================================
> input num: 10
> 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" (iphone)
CarPlay spp settings
>input SPP_data:ff,55,2,0,ee,10 (for example)
Note: ff,55,2,0,ee,10 is specified for CarPlay, to check log printed to get successfully responded from iPhone Note: Then, check log printed to get successfully responded
AnWBTService_SPP_DATA_IND_S sppData:
[ff] [55] [2] [0] [ee] [10]
Android Auto spp settings
>input SPP_data:00, 15, 00, 04, 08, 01, 10, 00, 18, 00,20, 95, 01, 20, 99, 01, 20, 9D,01, 20, A1, 01, 20, A5, 01 (for example)
Note: 00, 15, 00, 04, 08, 01, 10, 00 ... is specified for Android Auto or inquiry device from Android phone, upon paired, if phone is "Android Auto" supported, the connect request will automatically send to host HU. Note: Then, check log printed to get successfully responded
AnWBTService_SPP_DATA_IND_S sppData:
[0][64][0][5][8][1][10][5][1a][e][39][41][32][37][31][46][46][41][5a][30][30][41][4b][34][20][0][32][4c][a][24][66][32][61][63][66][36][61][33][2d][35][64][64][64][2d][34][31][66][64][2d][62][33][62][63][2d][64][38][39][37][38][30][36][36][33][63][30][63][12][24][30][65][33][34][39][62][63][61][2d][62][30][32][61][2d][34][38][39][31][2d][39][38][38][34][2d][64][65][35][63][65][38][35][33][34][66][30][63](26213|0xB4DFF450)[BTAPI] btsdk_exec_apicb end
Customize on SDK (tamul_release-.zip)
- unzip
- in terminal entering ./anwbtsrv_sdk/Demo folder
- setup tool-chain by command line (source ...) or edit in ./anwbtsrv_sdk/Demo/build_demo.sh
- run make or build_demo.sh
> cd ./build/anwbtsrv_sdk/Demo
> source /opt/poky-tamul/2.5.1/environment-setup-cortexa9hf-neon-poky-linux-gnueabi
> make or ./build_demo.sh
then, result is collected in ./Demo/btsrv
STRUCTURE (tamul_release-.zip)
. └── Demo ├── AnWBTServiceDemo.cpp (examples to use anwbtservice) ├── build_demo.sh (build script, call to make) ├── makefile (makefile for BTDemo) ├── btsrv_client.sh (launcher for BTDemo) ├── \*.xml, \*.cfg (app settings) ├── import (anwbtservice) │ ├── anwbtservice.h (service api header) │ └── \*.so (essentials libraries) └── btsrv (ouput for produced, e.g. BTDemo)