// close an ant channel assignment void ANTChannel::close() { emit lostInfo(number); lastMessage = ANTMessage(); parent->sendMessage(ANTMessage::close(number)); init(); }
// Open an ant channel assignment. void ANTChannel::open(int device, int chan_type) { channel_type=chan_type; channel_type_flags = CHANNEL_TYPE_QUICK_SEARCH ; device_number=device; setId(); #if 0 if (channel_assigned) { parent->sendMessage(ANTMessage::unassignChannel(number)); } else { #endif attemptTransition(ANT_UNASSIGN_CHANNEL); //} } // close an ant channel assignment void ANTChannel::close() { emit lostInfo(number); lastMessage = ANTMessage(); parent->sendMessage(ANTMessage::close(number)); init(); }
ANTMessage ANTMessage::setAutoCalibrate(const unsigned char channel, bool autozero) { return ANTMessage(4, ANT_ACK_DATA, channel, ANT_SPORT_CALIBRATION_MESSAGE, ANT_SPORT_CALIBRATION_REQUEST_AUTOZERO_CONFIG, autozero ? ANT_SPORT_AUTOZERO_ON : ANT_SPORT_AUTOZERO_OFF); }
ANTMessage ANTMessage::setChannelFreq(const unsigned char channel, const unsigned char frequency) { // Channel Frequency = 2400 MHz + Channel RF Frequency Number * 1.0 MHz // The range is 0-124 with a default value of 66 // ANT_SPORT_FREQ = 57 // ANT_KICKR_FREQ = 52 return ANTMessage(2, ANT_CHANNEL_FREQUENCY, channel, frequency); }
ANTMessage ANTMessage::close(const unsigned char channel) { return ANTMessage(1, ANT_CLOSE_CHANNEL, channel); }
ANTMessage ANTMessage::open(const unsigned char channel) { return ANTMessage(1, ANT_OPEN_CHANNEL, channel); }
// see http://www.thisisant.com/images/Resources/PDF/ap2_rf_transceiver_module_errata.pdf ANTMessage ANTMessage::ANTMessage::boostSignal(const unsigned char channel) { // [A4][02][6A][XX][57][9B] return ANTMessage(2, 0x6A, channel, 0x57); }
ANTMessage ANTMessage::requestCalibrate(const unsigned char channel) { return ANTMessage(4, ANT_ACK_DATA, channel, ANT_SPORT_CALIBRATION_MESSAGE, ANT_SPORT_CALIBRATION_REQUEST_MANUALZERO); }
ANTMessage ANTMessage::setNetworkKey(const unsigned char net, const unsigned char *key) { return ANTMessage(9, ANT_SET_NETWORK, net, key[0], key[1], key[2], key[3], key[4], key[5], key[6], key[7]); }
ANTMessage ANTMessage::setChannelFreq(const unsigned char channel, const unsigned char frequency) { return ANTMessage(2, ANT_CHANNEL_FREQUENCY, channel, frequency); }
ANTMessage ANTMessage::requestMessage(const unsigned char channel, const unsigned char request) { return ANTMessage(2, ANT_REQ_MESSAGE, channel, request); }
ANTMessage ANTMessage::setSearchTimeout(const unsigned char channel, const unsigned char timeout) { return ANTMessage(2, ANT_SEARCH_TIMEOUT, channel, timeout); }
ANTMessage ANTMessage::unassignChannel(const unsigned char channel) { return ANTMessage(1, ANT_UNASSIGN_CHANNEL, channel); }
ANTMessage ANTMessage::assignChannel(const unsigned char channel, const unsigned char type, const unsigned char network) { return ANTMessage(3, ANT_ASSIGN_CHANNEL, channel, type, network); }
ANTMessage ANTMessage::resetSystem() { return ANTMessage(1, ANT_SYSTEM_RESET); }