ANT API Question - How to get the result of sending an acknowledged message?

Former Member
Former Member
I have an application where I can send both broadcast and acknowledged messages. However looking through the API documentation here I can't find a way to get the result (MSG_CODE_EVENT_TRANSFER_TX_COMPLETED I think) from the operation.

var message = new Ant.Message();
message.setPayload(data); // Form the Message

// Set the message buffer.
GenericChannel.sendAcknowledge(message);

// Do something depending on the success or failure of the above?


Thank you for any help you can provide.
  • I did the following to verify that the sendAcknowledge was received. When I set the power on an FEC, I get setPwrSucess set to true.


    function onMessage(msg) {
    var payload = msg.getPayload();
    var currentPage = (payload[0].toNumber() & 0xFF);
    if (Ant.MSG_ID_BROADCAST_DATA == msg.messageId) {

    //.... bunch of stuff that's not relevant here

    }
    else if (Ant.MSG_ID_CHANNEL_RESPONSE_EVENT == msg.messageId) {
    if (Ant.MSG_ID_RF_EVENT == (payload[0].toNumber() & 0xFF)) {
    if (Ant.MSG_CODE_EVENT_CHANNEL_CLOSED == (payload[1].toNumber() & 0xFF)) {
    mChannel.open(); // If the search timed out, just reopen the channel
    searching = true;
    }
    else if (Ant.MSG_CODE_EVENT_RX_FAIL_GO_TO_SEARCH == (payload[1].toNumber() & 0xFF)) {
    searching = true;
    }
    else if (Ant.MSG_CODE_EVENT_TRANSFER_TX_COMPLETED == (payload[1].toNumber() & 0xFF)) {
    if (isCompatible && trainerPower != intervalPower) {
    setPwrSuccess = true;
    }

    }
    }
    }