ANT Device Profile Heart Rate Monitor
ANT Device Profile Heart Rate Monitor
Revision History
Table of Contents
1 Overview of ANT+ .................................................................................................................................................... 6
1.1 Interoperability .......................................................................................................................................... 6
2 Related Documents .................................................................................................................................................. 6
3 Typical Use Case of a Heart Rate Monitor ............................................................................................................... 7
3.1 Messages Transmitted from the ANT+ Heart Rate Monitor ............................................................................ 7
3.2 ANT+ Heart Rate Monitor Receiver Implementation ..................................................................................... 8
4 Channel Configuration ............................................................................................................................................. 9
4.1 Receiver Channel Configuration .................................................................................................................. 9
4.1.1 Message Period ........................................................................................................................... 9
4.1.2 Receiver Channel Code Example ................................................................................................. 10
4.2 Transmitter Channel Configuration ............................................................................................................ 11
4.2.1 Channel Type ............................................................................................................................ 11
4.2.2 Device Number .......................................................................................................................... 12
4.2.3 Transmitter Channel Code Example ............................................................................................. 12
5 Message Payload Format .......................................................................................................................................13
5.1 ANT+ Message Data Formats ................................................................................................................... 13
5.2 Data Page Types ..................................................................................................................................... 13
5.2.1 Background Data Pages.............................................................................................................. 13
5.2.2 Main Data Pages ........................................................................................................................ 13
5.2.3 Receiving Data Pages ................................................................................................................. 13
5.3 Data Page Formats .................................................................................................................................. 14
5.3.1 Page Change Toggle Bit ............................................................................................................. 14
5.3.2 Page 0 or Unknown Page Format ................................................................................................ 15
5.3.3 Page 1 Format ........................................................................................................................... 16
5.3.4 Page 2 Format ........................................................................................................................... 17
5.3.5 Page 3 Format ........................................................................................................................... 18
5.3.6 Page 4 Format ........................................................................................................................... 19
5.3.7 Page 5 – 127 Formats ................................................................................................................ 20
6 Implementation Guidelines – Computed Heart Rate ...........................................................................................20
6.1 Receiver Implementation Code Example .................................................................................................... 20
ANT+ Managed Network Document – Heart Rate Monitor Device Profile Page 5 of 21
List of Tables
Table 1: ANT Channel Configuration for Receiving Heart Rate Information ................................................... 9
Table 2: ANT Channel Configuration for Transmitting Heart Rate Information ............................................ 11
Table 3: ANT+ General Message Format ................................................................................................. 13
Table 4: Page 0 Heart Rate Data Format ................................................................................................. 15
Table 5: Page 1 Heart Rate Data Format ................................................................................................. 16
Table 6: Page 2 Heart Rate Data Format ................................................................................................. 17
Table 7: Page 3 Heart Rate Data Format ................................................................................................. 18
Table 8: Page 4 Heart Rate Data Format ................................................................................................. 19
List of Figures
1 Overview of ANT+
The ANT+ managed networks are designed to promote interoperability of a new generation of sports and health devices.
They combine the global 2.4GHz ANT RF products with common branding and an interface specification to allow
manufacturers to build interoperable communicating sports and health equipment.
Interoperating equipment includes both sensors and receiver/display devices.
Examples of sensors include:
1. Speed and Distance Monitors
2. Heart Rate Monitors
3. Bike Speed Sensors
4. Bike Cadence Sensors
5. Combined Bike Speed and Cadence Sensors
6. Bike Power Sensors
7. Bike Component Sensors
8. Environment Sensors
9. Weight Scales
10. Fitness Equipment (Treadmills, Bike Trainers, Elliptical Trainers, etc)
Examples of receiver/display devices include:
1. Watches and Wrist-top Computers
2. Bike Computers
3. Cell Phones / PDAs
4. Fitness Equipment (Treadmills, Bike Trainers, Elliptical Trainers, etc)
ANT+ sensors use ANT 2.4GHz low power communication to transmit their data to the remote display devices. Sensor
messages are embedded in ANT serial communications packets and have appropriate header and checksum information in
the link layer.
The ANT+ sensor is designed to interface to an ANT receiver, which is embedded in the device that wishes to receive this
sensor data. The information provided in this document assumes the user has knowledge of the ANT protocol, and is
intended to be used in conjunction with the ANT Message Protocol and Usage document.
This document details the wireless communication link between the sensor and the receiving display device. The ANT+
sensor’s typical use case, channel configuration, data message format, and implementation guidelines are detailed.
1.1 Interoperability
Interoperability of sensors within the ANT+ managed network is of paramount importance.
IMPORTANT: To have received this document you have agreed to and signed the ANT+ Managed Network
license agreement and have received the ANT+ Managed Network key. By signing this
agreement and receiving the ANT+ device profiles you are agreeing to implement and test your
product to this specification in its entirety. You are also agreeing to implement only ANT+
defined messages on the ANT+ managed network. This is essential to maintaining
interoperability of all devices on the ANT+ managed network.
2 Related Documents
Refer to current versions of the listed documents. To ensure you are using the current versions, check the website or
contact your ANT+ representative.
1. ANT Message Protocol and Usage
2. ANT Reference Design User Manual
ANT+ Managed Network Document – Heart Rate Monitor Device Profile Page 7 of 21
TRANSMITTER RECEIVER
Background
HR
HR Cum Time
Data Pages:
HR Prod Id
1 every 65th
HR Man Id
message
4 Channel Configuration
The channel configuration parameters of the heart rate monitor and all other ANT-enabled devices are defined by the ANT
protocol. Refer to the ANT Message Protocol and Usage document for definitions of the various channel parameters.
/***********************************************************************************************************
* These are the steps to set up an ANT channel to receive ANT+ heart rate monitor data. The function
* calls used here are based on the ANT PC Interface Functions.
* *********************************************************************************************************/
#include "ant_dll.h"
USHORT usMessagePeriod = 8070; //Set the message period to 8070 counts specific for the HRM
ANT_SetChannelPeriod(ucChanNum, usMessagePeriod);
if (!WaitAck(MESG_CHANNEL_MESG_PERIOD_ID, MESSAGE_TIMEOUT))
printf("Failed Setting the Message Period.\n");
ANT_SetChannelRFFreq(ucChanNum, ucRF);
if (!WaitAck(MESG_CHANNEL_RADIO_FREQ_ID, MESSAGE_TIMEOUT))
printf("Failed Setting the Radio Frequency.\n");
ANT_OpenChannel(ucChanNum);
if (!WaitAck(MESG_OPEN_CHANNEL_ID, MESSAGE_TIMEOUT))
printf("Failed Opening the Channel.\n");
}
To search for a new heart rate monitor the ucTransType parameter should use a value of 0x00 for pairing and the
usDeviceNum should use a value of 0x00 to allow for the wildcard search to take place. For more details on wildcard
searching refer to the ANT Message Protocol and Usage document.
The code example in Figure 4 assumes that the ANT receiver is already receiving information from a new device that it used
wildcard parameters to find. When the code is implemented the receiver finds the device number and transmission type
parameters of the channel.
ANT+ Managed Network Document – Heart Rate Monitor Device Profile Page 11 of 21
/***********************************************************************************************************
* These are the steps to get the ANT channel parameters from an active ANT channel and save the device
* number and transmission type to variables to be used for later pairing.
* *********************************************************************************************************/
#include "ant_dll.h"
/***********************************************************************************************************
* These are the steps to set up an ANT channel to transmit ANT+ heart rate monitor data. The function
* calls used here are based on the ANT PC Interface Functions.
* *********************************************************************************************************/
#include "ant_dll.h"
ANT_SetChannelPeriod(ucChanNum, usMessagePeriod);
if (!WaitAck(MESG_CHANNEL_MESG_PERIOD_ID, MESSAGE_TIMEOUT))
printf("Failed Setting the Message Period.\n");
ANT_SetChannelRFFreq(ucChanNum, ucRF);
if (!WaitAck(MESG_CHANNEL_RADIO_FREQ_ID, MESSAGE_TIMEOUT))
printf("Failed Setting the Radio Frequency.\n");
ANT_OpenChannel(ucChanNum);
if (!WaitAck(MESG_OPEN_CHANNEL_ID, MESSAGE_TIMEOUT))
printf("Failed Opening the Channel.\n");
}
[00][FF][FF][FF][41][1E][D5][56]
[00][FF][FF][FF][61][3D][D6][56]
[00][FF][FF][FF][61][3D][D6][56]
[00][FF][FF][FF][61][3D][D6][56]
[80][FF][FF][FF][27][3E][D7][56] The receiver receives one of the messages in this set of
[80][FF][FF][FF][27][3E][D7][56]
four messages with the toggle bit set high. Now the
[80][FF][FF][FF][27][3E][D7][56]
[80][FF][FF][FF][27][3E][D7][56] new data pages can be decoded.
[00][FF][FF][FF][FA][3E][D8][56]
[00][FF][FF][FF][FA][3E][D8][56]
.
.
.
5.3.4.2 Manufacturer ID
The list of manufacturer identification values is kept by the ANT+ Alliance. To obtain your unique manufacturer
identification number please contact [email protected].
if ((ucBeatCount – ucPreviousBeatCount) == 1) // ensure that there is only one beat between time intervals
{
usR_R_Inteval = usBeatTime – usPreviousBeatTime; // subracting the event times gives the R-R interval
The R-R interval can be computed by subtracting (in USHORT form) the last event time from the previous event time (bytes
4|5 from bytes 2|3) after making sure that the event count has changed from the previous reported R-R interval.
Data page 4 has the advantage that an R-R value can be computed without receiving the immediately preceding event.
However, code can be implemented to use other message types and calculate R-R intervals using the previous event.
ANT+ Managed Network Document – Heart Rate Monitor Device Profile Page 20 of 21
switch (ucPage & ~TOGGLE_MASK) //check the new pages and remove the toggle bit, TOGGLE_MASK = 0x80
{
case PAGE_1:
{
//decode the cumulative operating time
ulOperatingTime = pucEventBuffer[BUFFER_INDEX_MESG_DATA + 1];
ulOperatingTime |= pucEventBuffer[BUFFER_INDEX_MESG_DATA + 2] << 8;
ulOperatingTime |= pucEventBuffer[BUFFER_INDEX_MESG_DATA + 3] << 16;
ulOperatingTime = 2 * ulOperatingTime;
break;
}
case PAGE_2:
{
//decode the Manufacturer ID
ucManId = pucEventBuffer [BUFFER_INDEX_MESG_DATA + 1];
//decode the 4 byte serial number
ulSerialNumber = usDeviceNum;
ulSerialNumber |= pucEventBuffer [BUFFER_INDEX_MESG_DATA + 2] << 16;
ulSerialNumber |= pucEventBuffer [BUFFER_INDEX_MESG_DATA + 3] << 24;
break;
}
case PAGE_3:
{
//decode HW version, SW version, and model number
ucHwVersion = pucEventBuffer[BUFFER_INDEX_MESG_DATA + 1];
ucSwVersion = pucEventBuffer[BUFFER_INDEX_MESG_DATA + 2];
ucModelNum = pucEventBuffer[BUFFER_INDEX_MESG_DATA + 3];
break;
}
case PAGE_4:
{
//decode the previous heart beat measurement time
usPreviousBeat = pucEventBuffer [BUFFER_INDEX_MESG_DATA + 2];
usPreviousBeat |= pucEventBuffer [BUFFER_INDEX_MESG_DATA + 3] << 8;
break;
}
}
}
// decode the last four bytes of the HRM format, the first byte of this message is the channel number
DecodeDefaultHRM( &pucEventBuffer[BUFFER_INDEX_MESG_DATA + 4] );
ucOldPage = ucPage;
}
// continue code for all of the active channels
}
}
}
//code continues
/******************************************************************************************************
* This function is used to decode the last 4 bytes of data from the HRM message. The variables
* usMeasurement Time, ucMeasurementCount, and ucComputedHeartRate have been defined previously.
* ***************************************************************************************************/
void DecodeDefaultHRM(UCHAR* pucPayload)
{
// decode the measurement time data (two bytes)
usBeatTime = pucPayload[0];
usBeatTime |= pucPayload[1] << 8;
// decode the measurement count data
ucBeatCount = pucPayload[2];
// decode the measurement count data
ucComputedHeartRate = pucPayload[3];
}