Generic Firmware for AIRcable BLE
The AIRcable SmartBeacon is configurable through an easy to use command line interface. The interface is accessible through the serial port at 115200 baud. For products without serial connections, the command line interface can be used through a wireless connection. The AIRcable SmartBeacon is password protected for reading and writing characteristics.
The AIRcable SmartBeacon allows to find other BLE devices and make connections. In a very generic way you can read and write any characteristics and control the performance and timing of a BLE link. First, it gives you a way to scan for devices in range and provides the Bluetooth address of those devices. Then after a successful connection it can list available services and characteristics as well as their configuration. You can read and write characteristics in a generic way as well as set characteristics into notification mode for data transfer.
In addition you have control over the connection timing, allowing for a very high speed data transfer as well as low power long lasting connections.
Scanning for BLE Devices
check broadcast configuration:
while in broadcast mode, you cannot make connections
scan for 1 second. A number > 60 seconds will not terminate, switch scanning off with "i0"
OK> @c4044 6ce2 89c5
check broadcast configuration:connected
list all servicessrv start=0x1 end=0x3 uuid=1800
srv start=0x4 end=0x4 uuid=1801
srv start=0x5 end=0xffff uuid=1815
list all characteristicschar=2a04 hnd=3 attr=r
char=fee1 hnd=7 attr=rp
char=fee2 hnd=9 attr=rp
char=2a56 hnd=b attr=rwpn
char=2a58 hnd=e attr=r
char=2a5e hnd=10 attr=wpn
char=2a5f hnd=13 attr=wp
char=2a60 hnd=15 attr=pn
char=ffff hnd=18 attr=wp
|OK> h6||set the minimum and maximum interval timing parameter to the fastest level at 7.5ms. Range is 6-3200 time slots.|
The connection timing can be changed to allow high speed transmission of data. E.g.
Read and Write Characteristics
Before it is allowed to read or write characteristics on the SmartBeacon, you need to provide a password.
OK> @w18 30 30 30 30
write the password "0000" to the characteristic with handle 18
|OK> r3||read handle 3 (preferred conneciton parameter)|
allow the UART characteristic 0x10to send notifications
Example: Heart Rate Monitor
A heart rate monitor has a notifiable characteristic, the heart rate. After discovering the services, find the characteristic handle for the notifiable characteristic.
list all servicessrv start=0x1 end=0x7 uuid=1800
srv start=0x8 end=0x8 uuid=1801
srv start=0x9 end=0x10 uuid=180d // this is heart rate service
srv start=0x11 end=0x14 uuid=180f
srv start=0x15 end=0xffff uuid=180a
OK> k9 10
list the characteristics for the heart rate servicechar=2a37 hnd=b attr=n // this is heart rate data characteristic
char=2a38 hnd=e attr=r
char=2a39 hnd=10 attr=p
Set the heart rate characteristic 0x0b to notify
After that, the the heart rate monitor will send heart rates and energy updates.
receive heart rate datanote hnd=0xb data=16.65.f3.01
note hnd=0xb data=16.6b.f9.01
note hnd=0xb data=16.60.fe.01
note hnd=0xb data=1e.66.14.00.f2.01 // this contains energy levels
note hnd=0xb data=16.6c.fa.01
Connect to a SPP over GATT port
SPP over GATT is implemented using a characteristic for streaming data communicaton in both directions and a characteristic for serial port configuration.
|OK> c6e7d 263b d014>||connect to the peripheral connected|
|OK> w18 30 30 30 30||write password to the SmartBeacon to enable access to characteristics|
|OK> w13 8||Write to the characteristic that configures the serial port to 115200 baud, 8N1 (will vary between SPP over GATT devices)|
|OK> n10||enable notifications for characteristic 0x10|
|OK> a10||enable raw mode for characteristic 0x10|
in raw mode, the command line interface is switched off, and all data is sent in raw mode to the characteristic. All data that is received from the characteristic is not interpreted, but received raw.
At this moment this connection represents a transparent serial communication with the other end.
|~.||to disconnect send a ~. sequence, similar to telnet|
About This Community
|Asked: 12/29/15, 11:33 PM|
|Seen: 1567 times|
|Last updated: 12/30/15, 12:53 AM|