You are here: Forum Home → ANT Developers Forums → ANT General Questions → Thread
void Hub::setLoad(int antID, bool fecTrainer, double load) {
if (!fecTrainerChanConfigured) {
configureSendChannelFEC(antID);
}
uint8_t aucTxBuf[ANT_STANDARD_DATA_PAYLOAD_SIZE];
FEC_Controller::EncodeTrainerTargetPower(aucTxBuf, load);
pclMessageObject->SendAcknowledgedData(constants::fecChannelNumber, aucTxBuf);
}
void Hub::configureSendChannelFEC(int antID) {
qDebug() << "configureSendChannelFEC";
bool bStatus = pclMessageObject->AssignChannel(constants::fecChannelNumber, 0, USER_NETWORK_NUM);
bStatus = pclMessageObject->SetChannelID(constants::fecChannelNumber, antID, constants::fecDeviceType, constants::transTypeFec);
if (bStatus) {
fecTrainerChanConfigured = true;
vecChannelUsed.append(constants::fecChannelNumber);
}
}
void Hub::closeScanningModeChannel(bool closeShop) {
bool bStatus = true;
// Only close 1 channel (Channel 0), other channel are virtual channels?
foreach(int chan, vecChannelUsed) {
bStatus = pclMessageObject->CloseChannel(chan);
if (bStatus)
qDebug() << "CloseChannel Success" << chan;
else
qDebug() << "CloseChannel Error" << chan;
bStatus = pclMessageObject->UnAssignChannel(chan);
if (bStatus)
qDebug() << "UnAssignChannel Success" << chan;
else
qDebug() << "UnAssignChannel Error" << chan;
}
}
——————————————————
Free Indoor Cycling Software - https://maximumtrainer.com
——————————————————
Free Indoor Cycling Software - https://maximumtrainer.com
void Hub::configureSendChannelPM(int antID) {
qDebug() << "configureSendChannelPM Now";
bool bStatus = pclMessageObject->AssignChannel(constants::pmChannelNumber, 0, USER_NETWORK_NUM);
bStatus = pclMessageObject->SetChannelID(constants::pmChannelNumber, antID, constants::powerDeviceType, constants::transTypePower);
}
——————————————————
Free Indoor Cycling Software - https://maximumtrainer.com
void Hub::configureSendChannelFEC(int antID) {
qDebug() << "configureSendChannelFEC";
if (currentSendingChannel != constants::fecChannelNumber) {
pclMessageObject->AssignChannel(constants::fecChannelNumber, 0, USER_NETWORK_NUM);
currentSendingChannel = constants::fecChannelNumber;
}
pclMessageObject->SetChannelID(constants::fecChannelNumber, antID, constants::fecDeviceType, constants::transTypeFec);
}
——————————————————
Free Indoor Cycling Software - https://maximumtrainer.com