function SendData() {
var payload = new [8];
payload[0] = 0x10; // Command data page
payload[1] = 0x20; // Stuff your data here
payload[2] = 0x21; // Stuff your data here
payload[3] = 0x22; // Stuff your data here
payload[4] = 0x23; // Stuff your data here
payload[5] = 0x24; // Stuff your data here
payload[6] = 0x25; // Stuff your data here
payload[7] = num; // Stuff your data here
num=num+1;
var message = new Ant.Message();
message.setPayload(payload);
GenericChannel.sendAcknowledge(message);
}
class MO2DisplayApp extends App.AppBase
{
var mSensor;
var mTimer;
function initialize() {
mTimer = new Timer.Timer();
}
// onStart() is called on application start up
function onStart()
{
//Create the sensor object and open it
mSensor = new MO2Sensor();
mSensor.open();
mTimer.start(self.method(:onTimerCallback), 250, true);
}
.......
function onTimerCallback() {
Ui.requestUpdate();
}
mSensor.SendData();
....
744830065 : Tx: [01][34][00][06][D0][47][1F][7D]
744830080 : Rx (Ack): [10][20][21][22][23][24][25][4E]
744830314 : Tx: [01][34][00][06][D0][47][1F][7D]
744830330 : Rx (Ack): [10][20][21][22][23][24][25][4F]
744830564 : Tx: [01][34][00][06][D0][47][1F][7D]
744830580 : Rx (Ack): [10][20][21][22][23][24][25][50]
744830814 : Tx: [01][34][00][06][D0][47][1F][7D]
744830845 : Rx (Ack): [10][20][21][22][23][24][25][51]
744831063 : Tx: [01][35][00][06][D0][47][1F][7D]
744831079 : Rx (Ack): [10][20][21][22][23][24][25][52]
744831313 : Tx: [01][35][00][06][D0][47][1F][7D]
744831328 : Rx (Ack): [10][20][21][22][23][24][25][53]
744831562 : Tx: [01][35][00][06][D0][47][1F][7D]
744831594 : Rx (Ack): [10][20][21][22][23][24][25][54]
744831812 : Tx: [01][35][00][06][D0][47][1F][7D]
744831843 : Rx (Ack): [10][20][21][22][23][24][25][55]
744832062 : Tx: [01][36][00][06][D0][47][1F][7D]
744832093 : Rx (Ack): [10][20][21][22][23][24][25][56]
744832311 : Tx: [01][36][00][06][D0][47][1F][7D]
744832342 : Rx (Ack): [10][20][21][22][23][24][25][57]
744832561 : Tx: [01][36][00][06][D0][47][1F][7D]
744832592 : Rx (Ack): [10][20][21][22][23][24][25][58]
744832810 : Tx: [01][36][00][06][D0][47][1F][7D]
744832842 : Rx (Ack): [10][20][21][22][23][24][25][59]
....
I gave this a go just for fun.
So I thought I might be able to leave the watch as a slave but use the sendAcknowledge() to get the data going the other direction (from the watch to SimulANT)
[...]
I set SimulANT+ up to simulate a Muscle Oxygen Sensor and then let it pair to the watch. The ANT Messages Tab streams the data and you can cut an paste it out. You will need to dump the Tx lines and your data is encoded in the Rx lines.
That’s a great question. Originally we added the restriction because we didn’t know if apps were being certified. This restriction blocks a dev from creating something like a fake HRM that goes against the ANT+ HRM profile. However, since they are now certified we should be able to remove this restriction.