2.4GH
Z
B
LUETOOTH
T
RANSCEIVER
M
ODULE
P
ROGRAMMING
G
UIDE
BRM01
Introduction
The coherenceRF BRM allows fast development of sophisticated wireless
applications by embedding the complexities of the radio. This allows the BRM to
present a very simple API to the Host device, thus significantly easing wireless
integration into the customer’s end product.
This document describes the programming requirements for the BRM when used in
the ‘Enhanced’ mode of operation. Enhanced mode provides a non-transparent
interface allowing a more flexible and complex system to be built.
System Scenarios
Before detailing the programmer’s interface, it is useful to understand the possible system architectures.
Fixed Point to Point
This describes the most basic system
architecture. Data is always sent to and
received from the same device.
The Basic or Enhanced mode of
operation can handle this.
Point-t
t
o -Poiintt Systtem
o
Po n Sys em
BRM
A OS T uP
Hpplication
Platform
D OD CE
MEVIULEA
(MASTER)
BRM
D OD CE
MEVIULEB
(SLAVE)
Sensor
Display
H OS T uP
Switch
Keypad
Fixed Point to Multi-Point System
SUPPLY
SUPPLY
Fixed Point to Multi-Point
This is another basic system architecture.
Each BRM sets up a connection to a fixed
BRM, but may also accept a connection
from any known BRM. The Basic or
Enhanced mode of operation can handle
this.
The example shows devices B, C and D
fixed to device A.
The term ‘Master’ denotes only the device
that initialises the connection.
A Typical application might be where
devices B, C or D set-up a connection to
A when an event occurs which must be
reported.
Fixed Point to Multipoint
Host
Platform
BRM
DEVICE A
(MASTER)
BRM
DEVICE B
(SLAVE)
Sensor
Display
Switch
Keypad
SUPPLY
SUPPLY
BRM
Valve
DEVICE C
(SLAVE)
BRM
DEVICE D
(MASTER)
Freezer
SUPPLY
SUPPLY
DS361-3 Dec 03
©2003 Reg. No. 227 4001, England
Page 1
2.4GH
Z
B
LUETOOTH
T
RANSCEIVER
M
ODULE
P
ROGRAMMING
G
UIDE
Multi-Point To Multi-Point
Multi-Point to Multi-Point System
BRM01
This is a more flexible architecture. Each BRM
can set-up a connection to any other BRM,
providing they are known to each other.
This architecture is only supported by the
Enhanced mode of operation.
A Typical application might be where device A
sets-up a connection to B, C and D in turn,
requesting status data from each one.
Host
Platform
BRM
DEVICE A
(M/S)
BRM
DEVICE B
(M/S)
Robot
SUPPLY
SUPPLY
BRM
Valve
DEVICE C
(M/S)
BRM
DEVICE D
(M/S)
Freezer
SUPPLY
SUPPLY
Version Information
Note: This data sheet refers to BRM01 modems with firmware versions 0.29 or later. The firmware version is
labelled on the modules
DS361-3 Dec 03
©2003 Reg. No. 227 4001, England
Page 2
2.4GH
Z
B
LUETOOTH
T
RANSCEIVER
M
ODULE
P
ROGRAMMING
G
UIDE
Table of Contents
BRM01
Introduction ....................................................................................................................................................... 1
System Scenarios ............................................................................................................................................. 1
M
ULTI
-P
OINT
T
O
M
ULTI
-P
OINT
....................................................................................................................2
V
ERSION
I
NFORMATION
...............................................................................................................................2
Commands, Responses and Events............................................................................................................... 4
G
ENERAL
R
ULES
........................................................................................................................................4
S
UMMARY
..................................................................................................................................................4
D
ETAILED
D
ESCRIPTIONS
............................................................................................................................5
A
DD
D
EVICE
T
O
I
NDEX
...............................................................................................................................5
C
ONNECT
T
O
D
EVICE
.................................................................................................................................5
D
ISCONNECT
D
EVICE
..................................................................................................................................5
GPIO S
ET
-
UP
............................................................................................................................................6
GPIO O
UTPUT
...........................................................................................................................................7
GPIO I
NPUT
..............................................................................................................................................7
GPIO M
EASURE
........................................................................................................................................7
D
EVICE
A
DDRESS
.......................................................................................................................................8
L
OCAL
A
DDRESS
........................................................................................................................................8
L
OCAL
N
AME
..............................................................................................................................................8
S
ET
L
OCAL
N
AME
.......................................................................................................................................8
R
EMOTE
D
EVICE
N
AME
...............................................................................................................................9
Q
UALITY
....................................................................................................................................................9
R
ESET
.......................................................................................................................................................9
C
ONNECT
V
OICE
D
EVICE
............................................................................................................................9
S
LEEP
.....................................................................................................................................................10
S
TATUS
C
ODES
........................................................................................................................................10
DS361-3 Dec 03
©2003 Reg. No. 227 4001, England
Page 3
2.4GH
Z
B
LUETOOTH
T
RANSCEIVER
M
ODULE
P
ROGRAMMING
G
UIDE
Commands, Responses and Events
When the BRM is set to ‘Enhanced ‘ mode several commands are available to the Host system.
BRM01
General Rules
Except when sending or receiving payload data, or stated otherwise, commands, responses and events
are constructed using ASCII codes – i.e.. In the range from 0x00 to 0x7F.
Commands always result in a response and new commands must not be sent until a response to the
previous command has been received.
Responses consist of at least 1 Command Echo Byte and 2 ASCII Coded Status Bytes.
Status “00” = success
Return parameters are not sent for non “00” responses
Events occur from time to time and indicate connection failures and other critical events. Events always
comprise at least 3 bytes. The first byte indicates the type of event and the second and third bytes
indicate the status.
Summary
The table below provides a summary of the commands supported in V0.29 Firmware.
Commands
Name
Add Device To Index
Connect To Device
Disconnect Device
GPIO
Code
“A”
“C”
“D”
“G”
Parameter(s)
Address (12), ID (2)
ID (2)
---------
Direction (2)
Function (2)
Initialise (2)
ID (2), Mask (2)
ID (2), Null (2)
ID (2), Pin (2)
ID (2)
Name (16)<CR>
---------
---------
ID (2)
---------
---------
ID (2)
Description
Adds a device to the local index
Requests a data connection to a BRM
Disconnects the currently connected remote BRM
Sets the GPIO pin functions (In/Out/ADC, Initial
state)
Outputs a GPIO bit mask to the GPIO pins
Inputs a byte which is a bit mask of the GPIO pins
Performs an ADC measurement on a GPIO pin
Gets the device address stored in the local BRM
Sets a new local name for the local BRM
Gets the local BRM’s name
Gets the local BRM’s address
Requests the name from a remote BRM
Performs a power-on-reset
Requests the link quality for a connection
Requests a voice+data connection to a device
GPIO Output
GPIO Input
GPIO Measure
Device Address
Set Local Name
Local Name
Local Address
Remote Device Name
Reset
Quality
Connect Voice Device
“>”
“<”
“$”
“I”
“l”
“L”
“K”
“N”
“R”
“Q”
“V”
Sleep
“Z”
---------
Sets BRM into low power sleep mode
DS361-3 Dec 03
©2003 Reg. No. 227 4001, England
Page 4
2.4GH
Z
B
LUETOOTH
T
RANSCEIVER
M
ODULE
P
ROGRAMMING
G
UIDE
Events
Type
Connect
Disconnect
Transaction complete
Code
“C”
“D”
“S”
Parameters
Status (2),
Device ID (2)
Status (2),
Device ID (2)
Status (2)
Description
Connect occurred from device
BRM01
Disconnect occurred from device - See
Status
Codes
The data packet has completed. See Status
Codes
Detailed Descriptions
Add Device To Index
This command allows known devices to be added to the local BRM’s device list. Once in the device list each
connectable BRM is represented by an Index number. This allows incoming and outgoing connection
requests to be validated and identified.
Command Code
(1 byte)
“A”
Parameter 1 – BRM Address
(12 bytes 0-9, A-F)
“xxxxxxxxxxxx”
Parameter 2 – Index ID
(2 bytes 00-1F)
“xx”
Response Code
Status Code *
(1 byte)
(2 bytes 0-9, A-F)
“A”
“xx”
*See Status Codes for meanings
Connect To Device
This command requests an immediate connection to the device whose Index ID is provided in the parameter.
This is useful for testing purposes.
Command Code
(1 byte)
“C”
Parameter 1 – Index ID
(2 bytes 00-1F)
“xx”
Device ID
(2 bytes 00-1F)
“xx”
Response Code
Status Code *
(1 byte)
(2 bytes 0-9, A-F)
“C”
“xx”
*See Status Codes for meanings
Disconnect Device
This command requests an immediate disconnection from the currently connected remote device. This
command should be used after the local device has finished communicating to the remote device.
Command Code
(1 byte)
“D”
Response Code
Status Code *
(1 byte)
(2 bytes 0-9, A-F)
“D”
“xx”
*See Status Codes for meanings
Device ID
(2 bytes 00-1F)
“xx”
DS361-3 Dec 03
©2003 Reg. No. 227 4001, England
Page 5