M Series Direct Communication
Overview
This development documentation outlines utilizing a Bluetooth® Smart Ready device to directly gather data from M Series Bluetooth Smart enabled equipment (M3i, M5i, M3i-TBT, and M3iX). The information can be used to supplement real time data, performance tracking, group training, or caloric burn tracking.
For scenarios in which more than 30 pieces of equipment are intended to be in use at the same time, it is recommended to use the M Series Receiver as it uses a redundant antenna scheme and larger hardware buffers to accommodate the higher traffic load
Version Note
This documentation applies to M Series consoles with version 6.32 and above. Please reference the Revision History section for information about previous console versions.
Transmission
The Keiser M Series Bluetooth radio utilizes the Bluetooth 4.0 specification for Low Energy devices (Bluetooth Smart) and operates in a TX-only mode. This allows the equipment to communicate with more than one receiving device simultaneously, as well as allowing the equipment to use less power.
The transmission from the equipment is a non-connectable advertisement packet set to transmit once every 318.75 milliseconds. Equipment versions prior to 6.32 vary in broadcast interval as noted in the Revision History section. The broadcast is non-connectable and will therefore not be visible to most applications using Bluetooth pairing designed for GATT devices. The broadcast is only visible while performing a Low Energy scan, so the recommendation is to perform a scan on a small window around the expected transmission period. The capability to perform a Low Energy scan is available on most modern platforms with the exception being some older versions of the Windows OS.
Platform Notes
iOS
: iOS SDK versions 5.0 and greater supports Bluetooth Smart. Due to the energy management built into the Core Bluetooth API, running a continuous scan will often result in intermittent reception of data. The best approach for working with iOS is to toggle the scan after the receipt of a packet from the targeted equipment, or on a regular interval when receiving from multiple pieces of equipment.
Android
: Bluetooth Smart is supported on Android versions 4.4 and greater. There is an API break at version 5.0, and due to the number of issues with the Bluetooth LE portion of Bluedroid it is recommended to target versions 5.0+.
Broadcast Packet Data Structure
The equipment’s data is held in the body of the advertisement broadcast, in the section designated for advertising data. Most Bluetooth APIs will extrapolate this data from the full broadcast packet and may make it available as a byte array. The advertising packet also includes a six-byte advertising address, which is a universally unique identifier, similar to a MAC address (though there is no designation for manufacturers).
Broadcast Packet
d6 be 89 8e 42 25 7e 75 29 3b 78 db 03 09 4d 33 03 19 00 00 02 01 04 15 ff 02 01 06 13 00 38 38 03 46 05 73 00 0D 00 04 27 01 00 0A 62 41 7f
d6 be 89 8e
The access address will likely be hidden by most APIs and is not necessary.42 25
Thepacket header
will also likely be extrapolated by the API. This includes information about the type of transmission address, packet type, and the length of the transmission.7e 75 29 3b 78 db
Theadvertising address
will likely be extrapolated by the API but is needed for quickly sorting Low Energy scan responses. The address is transmitted as little-endian, so the address parsed correctly resolves todb:78:3b:29:75:7e
. This address will be universally unique, but due to obfuscation on some platforms, this address cannot be relied upon for identification of equipment across sessions.03 09 4d … 01 00 0A
Theadvertising data
contains the majority of the data and may be accessible as a byte array or may be broken down further by the API.62 41 7f
TheCRC
is used for verifying validity of the data transmitted and will likely not be accessible via an API.
Advertising Data Structure
Within the advertising data section are several sections of structured and unstructured data. Some APIs will process the structured data portions while others will require manual parsing of this section.
Advertising Data
03 09 4d 33 03 19 00 00 02 01 04 14 ff 02 01 06 13 00 38 38 03 46 05 73 00 0D 00 04 27 01 00 0A
03 09 4d 33
Thelocal name
contains the length, type, and actual name of the transmitting equipment. The M3i, M3i-TBT, and M5 will all display asM3
.03 19 00 00
Theappearance section
is unused by Keiser, so it will always appear as0000
. This attribute is removed in revisions6.32+
.02 01 04
Theflags
portion contains information regarding the capabilities of the equipment broadcasting and will always be0x04
.14 ff 02 … 01 00 0A
Themanufacturer specific data
section is where the equipment’s data is stored. The first byte is the length and will likely be hidden by most APIs. The remainder will typically be exposed as a byte array.
Manufacturer Specific Data Structure
The manufacturer specific data portion uses Keiser’s proprietary data structure. This section will require a custom parser to extract the data as data sizes vary, and some bitwise operations are required.
The manufacturer specific data section contains this data structure as a concatenated byte stream with a two-byte company identifier prefix. The two-byte prefix, along with the local name can be used to ensure the packets are coming from a Keiser M Series product. All attributes are unsigned integers unless otherwise noted. All two-byte values are little-endian (LSB first, MSB second).
Data Stream
02 01 06 30 00 38 38 03 46 05 73 00 0D 00 04 27 01 00 0A
Byte Index | Attribute | Size | Example Value |
---|---|---|---|
0, 1 | Company ID | 2 Byte | 02 01 |
2 | Version Major | 1 Byte | 06 |
3 | Version Minor | 1 Byte | 30 |
4 | Data Type | 1 Byte | 00 |
5 | Equipment ID | 1 Byte | 38 |
6, 7 | Cadence | 2 Byte | 38 03 |
8, 9 | Heart Rate | 2 Byte | 46 05 |
10, 11 | Power | 2 Byte | 73 00 |
12, 13 | Caloric Burn | 2 Byte | 0D 00 |
14 | Duration Minutes | 1 Byte | 04 |
15 | Duration Seconds | 1 Byte | 27 |
16, 17 | Distance | 2 Byte | 01 00 |
18 | Gear | 1 Byte | 0A |
Data Attributes
Equipment Version (Major & Minor)
The equipment version is a Semantic Versioning value composed by the major and minor version segments. This value is useful in determining the machines capabilities for parsing. Both values are transmitted as decimal representations and must to converted back to decimal upon parsing. The example segment values of 06
and 30
converts to equipment version 6.30
. (See Revision History)
Data Type
The data type integer contains information regarding the interval and whether data transmitted is real time (real time mode) or review values (review mode).
A data type value of 0
, or 128
to 227
indicates that the data being received is real time. A data type value 255
, or 1
to 99
indicates the data being received are review values.
The data type values 0
and 255
correspond to the main interval values (both real time and review accordingly). The data type values 1
to 99
correspond to the review values for intervals 1
to 99
. The data type values 128
to 227
correspond to the real time values for 1
to 99
offset by 127
.
Data Type | Interval | Mode |
---|---|---|
0 | Main | Real Time |
1-99 | 1-99 | Review |
128-227 | 1-99 | Real Time |
255 | Main | Review |
Equipment ID
The equipment ID contains the ordinal integer assigned to the equipment. This integer is only unique within the collision domain of the equipment (typically a room or facility). This integer will always be between 0
and 200
and is the primary method of identifying the equipment.
Cadence
The cadence value corresponds to the equipment's cadence in rotations per minute with decimal precision transmitted as one order of magnitude larger (x10
). In review mode this value will correspond to the average cadence for that interval.
Heart Rate
The heart rate value contains the heart rate detected by the equipment's 5kHz receiver when the user is wearing a compatible heart rate monitoring device. The value corresponds to the measured heart rate in beats per minute with decimal precision transmitted as one order of magnitude larger (x10
). If no heart rate monitor is detected, a 0
value will be transmitted. In review mode this value will correspond to the average heart rate for that interval.
Power
The power value corresponds to the equipment's power value in watts with integer precision. In review mode this value will correspond to the average power for that interval.
Caloric Burn
The caloric burn value corresponds to the approximated caloric burn value determined using the measured energy output of the user assuming an average caloric burn efficiency plus an average basil metabolic rate. This method is independent of age or weight. This value is an accumulated value for the current interval and is the same for real time and review modes.
Duration (Minutes & Seconds)
The duration value is the duration of the current interval represented in minutes and seconds. The example segment values of 04
and 27
convert to a duration value of 4 Minute, 39 Seconds
. This value is an accumulated value for the current interval and is the same for real time and review modes.
Distance
The distance value corresponds to the calculated distance for the current interval in units dependent upon the unites identifier bit (MSB) with decimal precision transmitted as one order of magnitude larger (x10
). The 15 lowest bits contain the distance with the value range from 0
to 999
. The highest bit (MSB) indicates the units used. A 1
indicates the units are metric (kilometers), while a 0
indicates the units are imperial (Miles). The example segment values of 01
and 00
covert to a distance value of 0.1 miles
. This value is an accumulated value for the current interval and is the same for real time and review mode.
Gear
The gear value is an integer corresponding to the current gear as displayed on the equipment console, ranging from 1
to 24
. This value will continue transmitting 24
during braking while the equipment console will show 88
. This value is non-representative during the review mode and should be ignored. Equipment prior to version 6.21
will not transmit a gear value so this value will be 0
and should be ignored. (See Revision History)
Data Parse Example
02 01 06 30 00 38 38 03 46 05 73 00 0D 00 04 27 01 00 0A
Data | Attribute | Parsed Value |
---|---|---|
02 01 | Prefix Bits | Ignore this data |
06 | Version Major | 0x06 = 6 |
30 | Version Minor | 0x30 = 30 |
00 | Data Type | 0x00 = 0 (Real Time Data) |
38 | Equipment Id | 0x38 = 56 |
38 03 | Cadence | 0x0338 = 824 (82.4 RPM) |
46 05 | Heart Rate | 0x0546 = 1350 (135.0 BPM) |
73 00 | Power | 0x0073 = 115 (115 watts) |
0D 00 | Caloric Burn | 0x000D = 13 (13 kilocalories) |
04 | Duration Minutes | 0x04 = 4 |
27 | Duration Seconds | 0x27 = 39 |
01 00 | Distance | 0x0001 = 1 (0.1 miles) |
0A | Gear | 0x0A = 10 |
Revision History
Versions | Changes |
---|---|
6.00 - 6.20 | - |
6.21 - 6.22 | Addition of Gear attribute to broadcast. |
6.23 - 6.29 | Reduced broadcast interval from 2000 ms to 1937.5 ms . |
6.30 - 6.31 | Reduced broadcast interval from 1937.5 ms to 354.375 ms . |
6.32+ | Reduced broadcast interval from 354.375 ms to 318.75 ms . Removes appearance data. |
Code Examples
Name | Description |
---|---|
TypeScript M Series Parser | M Series parser written in TypeScript. |
TypeScript M Series Cordova Scanner | Keiser M Series Bluetooth Smart (BLE) scanner for Cordova written in Typescript. |
Swift M Series Parser | M Series parser written in Swift. |
C# M Series Parser | M Series parser written in C#. |
Development Tools
Name | Description |
---|---|
M Series Development Board | Development kit that perfectly replicates M Series electronics without full equipment. |
M Series Parser Library | Portable C# library for parsing broadcast packets into usable Broadcast objects. |
M Series Simulator | Android Studio Project which broadcasts a signal identical to an M Series broadcast for testing. |
M3i BLE Simulator | Linux Bash script using HCI BLE device to simulate an M3i's BLE broadcast. |
Keiser Kit Cocoapod | CocoaPod Library created by Ben Woodford for working with the M3i on iOS. |
M Series Documentation
Name | Description |
---|---|
M3i Bike ID Settings PDF | Describes procedure for setting equipment distance to either miles or kilometers, and changing the equipment identification number. |
M3i Bike ID Settings Video | Video tutorials instructing how to set the equipment distance units and equipment identification number. |
All Equipment Manuals | All the manuals, parts diagrams, and tutorials for Keiser equipment. |
Agreements and Guidelines
Using any of the APIs outlined in these documents make you subject to the following agreements. Please read all documents in their entirety as they govern your use of the APIs.