• Have any questions?
  • info.zbook.org@gmail.com

Performance Monitor Bluetooth Smart Communications .

2m ago
42 Views
0 Downloads
218.72 KB
37 Pages
Last View : Today
Last Download : n/a
Upload by : Angela Sonnier
Share:
Transcription

Concept2Performance MonitorBluetooth Smart Communications Interface DefinitionFilename: Concept2 PM Bluetooth Smart Communication Interface Definition.docRevision: 1.2711/8/2018 12:05:00 PMConcept2105 Industrial Park DriveMorrisville, VT 05661802-888-5226 (Voice)802-888-6331 (Fax)rowing@concept2.comRevision 1.27

Concept2 PM Bluetooth Smart Communication Interface DefinitionTable of ContentsLIST OF FIGURES .2LIST OF TABLES .3PURPOSE AND SCOPE .4DOCUMENT HISTORY .4RELATED DOCUMENTS .5OVERVIEW .5MOBILE DEVICE INTERFACE .5SINGLE PM5 TO SINGLE MOBILE DEVICE .5Discovery .5Enumeration .6Data/Control .6Discovery .6Enumeration .6Data/Control .6BLUETOOTH LOW ENERGY LINK LAYER .6CONCEPT2 PM BLUETOOTH PROFILE .8OVERVIEW .8SUPPORTED MOBILE PLATFORMS .8C2 PM DEVICE DISCOVERY .8C2 PM DEVICE INFORMATION SERVICE .8C2 PM CONTROL SERVICE .8C2 PM ROWING SERVICE .8NEAR FIELD COMMUNICATION NDEF RECORDS . 33APPENDIX A. 34ENUMERATED VALUES . 34Erg Machine Type . 34Workout Type . 34Interval Type . 34Workout State . 35Rowing State . 35Stroke State . 35Workout Duration Type . 35Game ID . 36GAME IDENTIFIER / VERIFIED INFORMATION. 36COMMUNICATING WITH THE PM USING CSAFE COMMANDS. 37Retrieving Heartrate Belt Information . 37Commanding the PM5 to Pair with a known Heartrate Belt . 37List of FiguresFIGURE 1 – MINIMUM CONNECTION INTERVALS .7Revision 1.272

Concept2 PM Bluetooth Smart Communication Interface DefinitionList of TablesTABLE 1 - DOCUMENT MODIFICATION HISTORY .4TABLE 2 - RELATED DOCUMENTS .5TABLE 3 – C2 PM BTS PERIPHERAL : ATTRIBUTE TABLE .9TABLE 4 – C2 MULTIPLEXED INFORMATION: DATA DEFINITIONS . 23Revision 1.273

Concept2 PM Bluetooth Smart Communication Interface DefinitionPurpose and ScopeThis document contains the communications interface definition for devices communicating with PerformanceMonitor Generation 5s (PM5s) using the wireless Bluetooth Smart technology, also known as Bluetooth LowEnergy (BTS). Information in this document combined with the documents referred to in Table 2 should provide thedeveloper with sufficient information to create applications that communicate with the PM over the BTS interface.Document HistoryTable 1 - Document Modification HistoryEdit Date9/4/14EngineerAndrew Kurt PreissAndrew DombekAndrew DombekAndrew DombekAndrew DombekAndrew Dombek10/15/14Andrew Dombek10/15/1410/16/14Andrew DombekAndrew Dombek10/22/1411/6/1411/18/14Kurt PreissAndrew DombekAndrew Dombek2/4/15Andrew 6/2015Andrew DombekScott HamiltonKurt PreissAndrew DombekKurt PreissAndrew Dombek9/7/20161/31/20172/3/2017Kurt PreissAndrew DombekAndrew 8Mark LyonsAndrew DombekAndrew DombekAndrew DombekMark Lyons11/8/2018Andrew DombekDescription of ModificationInitial outline created with design concept for Mobile Deviceinterfacing. V0.01Added section on BTS link layer. General edits. V0.02Edits to characteristic table. V0.03Minor edits. V0.04Added more characteristic data. V0.05Deleted Impulse Drive Force, added more characteristic data. V0.06More additions and edits to characteristic data. This version of thespec corresponds to PM firmware version 999 build 12, and ErgDataV1.2.19. V0.07Added machine type attribute. Deleted rows about writing values toturn on notifications because it was causing confusion. V0.08.Moved machine type attribute to Device Status area. V0.09Added characteristics to split/interval characteristics. Added CSAFEnames to parameters. V0.10Updated units of measurement in the split characteristicsAdded characteristic for heart rate belt information. V0.12Added stroke data characteristics for Projected Work Distance andProjected Work Time. V0.13General clean up and additions to Appendix. First official release ofspecification, coinciding with PM firmware V17, PM Ski V717.V1.0Fix units in Workout Summary Characteristics. V1.01Minor wording changes, unpair from PM5, references to Polar. V1.02Added multiplexing concept. V1.03Major rework to accommodate multiplexing. V1.04Tweaks to multiplexed characteristic. V1.06Deleted Model Number Characteristic, Added back ManufacturerCharacteristic. V1.07Added NFC NDEF record description for BLE pairingAdded Erg Machine Type and Workout Verified information. V1.20Deleted Machine Type information in Device Info Service asfirmware unable to support it. V1.21.Added Force Curve characteristic definition. V1.22.Modified Force Curve characteristic definition. V1.23.Added new machine types. V1.24.Added model number and machine type. V1.25.Added Erg Machine Type parameter to characteristic 0x0032/0x0080/V1.26.Added Erg Machine Type parameter to characteristic 0x0038.Clarifications added for MultiErg workouts.V1.27.Revision 1.274

Concept2 PM Bluetooth Smart Communication Interface DefinitionRelated DocumentsTable 2 - Related DocumentsDocument TitleCSAFE Protocol Technical Specification, V1.xGetting Started with Bluetooth Low Energy.docConcept2 PM Communications Interface Definition.docBluetooth Specification Version 4.1Android guideDocument Number - Datehttp://www.fitlinxx.com/csafe/Rev 0.15 8/23/2010Rev 4.1 s/connectivity/bluetoothle.htmlOverviewPM5 devices are equipped with a Bluetooth low energy module that provides short range RF communicationscapability. The PM5 utilizes BTS for data transfer with mobile devices as well as configuration and control of thePM5 by mobile devices.This document describes a proprietary Bluetooth profile utilized by the PM5 to provide a data and control interfacewith mobile devices. The profile defines the services and characteristics available to the mobile device developer.This document assumes the reader has sufficient knowledge of the Bluetooth specification.In Bluetooth terminology, the PM5 assumes the Peripheral role and the mobile device assumes the Central role.Mobile Device InterfaceThe following BTS wireless scenarios are supported by the PM5:1. Single PM5 To Single Mobile Device - A PM sends realtime data to a BTS-enabled mobile device. Themobile device can also setup and start workouts on the PM. An example application is a specializedsmartphone application for the visually impaired.2.Multiple PM5s To Single Mobile Device – Multiple PMs send realtime data to a BTS-enabled mobiledevice. Example mobile device applications are coaching tools and racing controllers.3.[future] Multiple PM5s to single PM5 – may be used for Wireless Racing (see existing PM4 ANTWireless racing) or for Venue Race cut-wire backup.The three key operational areas common to the scenarios defined above are Discovery, Enumeration andData/Control. These are described for each scenario in the following sections.Single PM5 To Single Mobile DeviceDiscoveryWhen an application running on a mobile device wants to communicate with a particular PM using BTS, it needs touniquely identify the desired device before establishing the communication link. Since there may be other BTSdevices transmitting, this involves a step in which the PM user selects and confirms the correct Mobile Device.PM Logic – Not Previously Paired, or Reset PairingRevision 1.275

Concept2 PM Bluetooth Smart Communication Interface DefinitionIf the PM has not previously been paired with a device, or the user wants to pair with a different device, then theuser must use the Main Menu and select “More Options” then “Turn Wireless ON”. This will bring the user to the“Connect Device” screen on the PM to enable BTS and enter pairing mode. Once on that screen, the PMA) displays it’s ‘friendly ID number/string’ to the user andB) broadcasts BTS data, advertising the services and characteristics it has to offer.The mobile device listens for the BTS advertising information and completes the connection per the Bluetoothspecification. The Mobile device may choose to pair based on ‘very close’ proximity of the PM5 BTS signal, orbased on a user choice of which advertising PM5 to connect to. The mobile device application should use theproprietary C2 base UUID, advertised in a Scan Response packet, to filter the selection of BTS devices available toconnect to.PM Logic – UnpairingThe PM will unpair from the mobile device when it powers down, or when the Mobile Device signals to end thesession. To Unpair from the PM5, select More Options, Turn Wireless OFF. With older firmware, this may be stilllabeled "Wireless ON".EnumerationEnumeration is not necessary in this use case with a single PM connected to a single Mobile Device.Data/ControlData transfer and PM control occurs using C2 proprietary BTS services. A C2 PM Control service is utilized tosend CSAFE commands and receive CSAFE responses. This service is typically used to set up workouts on the PMor to retrieve workout data. The C2 Rowing Service is utilized to enable/disable broadcast of PM data at variousdata rates. These services are defined in the following sections.Multiple PMs To Single Mobile DeviceDiscoveryDiscovery of multiple PMs is based upon the process decribed in the single PM case defined in the previous section.In this scenario one PM at a time is put in the “Connect Device” screen to perform the pairing function, until allPM’s have been paired.EnumerationDevices are enumerated using additional transactions after the Discovery/Pairing process has been completed. Thisinvolves sending additional CSAFE commands to the PM (TBD).Data/ControlReceiving data from and sending commands to PMs works the same as with the single PM scenario.Bluetooth Low Energy Link LayerBluetooth Smart is a low bandwidth interface capable of achieving speeds upto 16kBytes per second under idealconditions. The protocol supports a single master and up to 8 slaves. For the single PM5 to Mobile device model,the PM5 will act as a slave to the mobile device master. Below is a summary of how packets are transferred overthe air between a master and slave. Once in a Connected state, either the master OR slave can terminate the connection.In a connected state, the rf link is broken up into connection events. One connection event occurs perconnection interval. The premise of the connection event is to allow master and slave devices to exchangedata then go back to sleep as quickly as possible to conserve power. As the connection interval decreases,Revision 1.276

Concept2 PM Bluetooth Smart Communication Interface Definition the data throughput increases. The minimum connection interval is OS dependent. On Android, theminimum interval is 7.5msec and on iOS, the minimum is around 30msec.The slave can request the master to change the connection interval.The master and slave are synchronized in time when the connected state is established and rely on the timesynchronization to wakeup, transmit and receive.Within a connection event, there are back-to-back time slots dedicated for transmission and reception ofdata packets. The master transmits in the first time slot and listens in the second. The slave listens in thefirst time slot and transmits in the second. The time between two consecutive packets is defined as theInter Frame Space (T IFS) time. It is specified to be 150usec. Even if the master has no data to send, itwill still transmit a NULL packet to the slave allowing the slave to respond with data it may want totransmit.The data packets transmitted by both master and slave are acknowledged. A slave device upon receiving apacket from the master must ALWAYS send a response back to the master. There are 2 bits in EVERYdata packet containing ACK information adjusted appropriately by both master and slave upon packetreception. If the master does not receive a data packet from the slave or determines the received datapacket is bad (including ACK bits), it will close the connection event and retransmit it’s previouslytransmitted packet at the next connection interval. This guarantees master and slave acknowledgement.A supervision timeout determines if the connection is good. Both the master and slave are aware of thetimeout value. The supervision timer is reset whenever a valid packet is received. If the timer elapses, themaster/slave issues a Disconnect event to the application layer and the radio returns to an unconnectedstate.Each data packet can contain up to 20 bytes of data. A data packet will be smaller if fewer data bytes aretransmitted.Within a single connection event, multiple data packets may be transmitted by master or slave. Up to 6data packets may be transmitted within a single connection event. This too appears to be platformdependent. Android allows 4 packets per event while iOS allows 6 packets. There is a bit (More Data) inevery transmitted data packet indicating to the receiver if more packets should follow.The current Nordic S120 softstack used for communicating with BTS slaves, only allows one 20 bytepacket per connection event. A packet is dedicated per connection within a single connection event. Thismeans that the minimum connection interval cannot be 7.5msec if the master has made connections since1.25msec/packet x 8 7.5msec. Below is a table of minimum connection intervals based upon the numberof connected slaves. Figure 1 – Minimum Connection IntervalsRevision 1.277

Concept2 PM Bluetooth Smart Communication Interface DefinitionConcept2 PM Bluetooth ProfileOverviewThe Concept2 PM Bluetooth Profile consists of three proprietary BTS services for device discovery, control anddata transfer. These services are all based on the Generic Attribute Profile (GATT). GATT provides standardinterfaces for discovering, reading, writing and indicating of service characteristics and attributes.Supported Mobile PlatformsiPhone 4S and above (and similar class iPad), iOS7. Samsung S4 and above and similarly enabled phones/tablets;Nexus7 and MotoX.References: According to developer.android.com, the minimum Android is 4.3 (API Level 18).C2 PM Device DiscoveryA mobile device uses the PM’s unique 128-bit Bluetooth peripheral Universally Unique Identifier (UUID) todiscover the PM. This UUID is specified as Version 1 by the Network Working Group specification RFC 4122. It isbased upon the time of day and the MAC address of the computer upon which it was generated. The PM’s UUID isCE06xxxx-43E5-11E4-916C-0800200C9A66, where xxxx is a 16-bit value used to identify the specific service orcharacteristic. The base UUID of the PM is CE060000 -43E5-11E4-916C-0800200C9A66.C2 PM Device Information

10/14/14 Andrew Dombek More additions and edits to characteristic data. This version of the spec corresponds to PM firmware version 999 build 12, and ErgData V1.2.19. V0.07 10/15/14 Andrew Dombek Added machine type attribute. Deleted rows about writing values to turn