I'm writing a ConnectIQ App that will use the FE-C profile as a Generic Ant channel to control the mode and resistance on a trainer.
The app is running a graded exercise step where it needs to periodically change the resistance level and mode on the trainer.
What is the best strategy for making sure that the trainer receives the settings from the CIQ App? I can't just send one Acknowledge message and hope that it gets it. I have considered 3 strategies.
1) Have the App keep sending "Target Power" data pages as an acknowledged message until the App receives a Ant.MSG_CODE_EVENT_TRANSFER_TX_COMPLETED message as a part of a channel response message.
2) Just keep sending "Target Power" data pages as acknowledged messages to every Broadcast message that is received from the trainer.
3) After sending the "Target Power" data page as an acknowledged message, I could send a "Request Data Page" (0x46) to request that the trainer send back a "Target Power" data page. Then I could verify that the settings are correct and retry sending a "Target Power" data page back to the trainer.
#3 has a lot of overhead. I think I would only do that if #1 was insufficient for some reason or if I'm not understanding that channel response message appropriately. So it's really between #1 and #2.
#1 seems like the elegant way to do things. However there are some complexities that creep in. When I want to set the trainer in %grade mode, I need to send both "Wind Resistance' and "Track Resistance" pages so I would need to verify that both are received by the trainer.
I don't see much harm in method #2. If the resistance data isn't received by the trainer, the only remedy I have is to send it again anyway. I imagine that this will hog some ANT bandwidth but this seems pretty small.
Is there a generally preferred strategy for this?