This document is obsolete. Please see team documentation 'Comm Protocol' for the latest version

Bluetooth WT11i Per collegamento al nostro Host vedi WT11i Configuration


Specifications of communication

Format: 8-bit bytes transferred as serial data.
Speed: 115200 baud (bit/sec) <optionally higher>
Desired Device to Host data rate: minimum 2.000 16 bit samples/sec.
Data transfer protocol type: programmable. Reading 200+ variables (scalars or arrays of 8,16 or 32 bit data).
Note: Only 32 bit data to implement in prototype version.
All data are treated as arrays (length 1 is a scalar)
Possibility of synchronization with dataprocessing epochs (e.g. data are transmitted each 60 millisecond)
Data may be written to device anytime. That is, special commands like stop/go/change mode etc. may be issued asynchronously

The protocol consists of 'commands' which performs following actions



Data are packed in a generic format
  • command
  • [ID=variable id]
  • [Nlen=length]
  • [array of data with size Nlen]






Initialization
  • Host sends a kCommInit to target
  • Target responds with a n packages starting with kCommInit. Each package describes a variable that is exposed (published) by the firmware
  • Target responds with a list of available commands and their communication codes
o[String with variable name][16 bit variable identifier][16 bit length of variable (scalar =1)][8 bit data type code (to define)] (note1)
  • PC takes this list and breaks down into internal variables for the GUI. Variables are compared with the data saved in the Firmware configuration file (FCF)
note1: at this point the target generates its list of available commands.


Communication is performed using packages (commpack) in the following generic format:
Header
Payload
nCmdB = [ pack type]<packlength>
data = <array of data>

The pack type defines the data to expect, some types may include a dPayloadByteLength, defining the byte size of the payload. To optimise the Payload/commpack relation, the packlength (dPayloadByteLength) may be optional. In normal cases dPayloadByteLength would be redundant. Not all nCmdB may require data.
Below is a list of pack types.

nCmdB
Priority
Value
description
kHandshake
1
104
confirm serial communication and enable the protocol
kErrMsg
2
13
Error message. A string descriptor of the protocol event resultign error
kCommInit
3
101
Reset protocol, request for exposed variables
kGetReq
4
111
(Request to read memory) Set up the protocol by adding a packages to it. (setup a ‘read’ command)
kSetReq
6
102
Change variable in target (a write command)
kSend24Bit
Data Cmd
224
A 24 bit array is transmitted
kSend32Bit
Data Cmd
232
A 32 bit array is transmitted
<future commands>





The variables in the Host are oHDataPack objects containing data, type, size and blocks to send


List of possible commands

Host issued -> Target

Target -> Host

//kHandshake// (Handshake symbol)
//kHandshake// (Handshake symbol)
kCommInit
kCommInit + Data
kGetReq,VarId
Request to receive variable, the target will increase a send counter controlling the number of sends that will be performed
kSetReq(H2D set a variable content)

kCommand (H2D/D2H not implemented reserved for special commands)


kReady
Prototype Android