I have created a DataFields for Edge device (edge 1000 with v8.3 firmware).
Recently I have use Activity.info.currentPower to get instance power.
Also, I have create an Ant+ GenericChannel derived class to communicate with PowerMeter directly to get TorqueEfficiency/Balance/PedalSmoothness value.
I tried my DataFields on Simulator all fine. No problem, no issue, everything perfect.
But when I publish my application then download my DataFields from CIQ store, configure my power meter sensor ID, problem occurred:
1. If on Edge Device, disabled Power Meter, my data fields can connect to PowerMeter directly correctly also can get all values correctly (But of cause, the value will NOT be recorded into FIT file becuase NO power meter associated in System level);
2. But if enable PowerMeter on edge device (means in sensor list on edge system level, goto power meter, then enable it), restart edge device, System internal PowerMeter value can works fine, but my GenericChannel can NEVER works;
3. If based on status 1, then enable System Level power meter, system Level power meter can NEVER find and paired with my actual power meter. Only if restart Edge device to make System level power meter channel connect first (But in this situation, my GenericChannel will NOT work as status 2).
So I assume the Edge device does NOT support create 2 different ANT+ channel to connect to the same power meter? Any body can confirm that?
I guess the problem because, if publish my datafield to edge device, both of internal power meter connection and my customized GenericChannel connection will have the same client identification. So my physical power meter (garmin vector) will ignore the "second" connection. So only one connection can work at a time. But simulator with another client identification so no problem there.
If so, is there any way to identify my customized GenericChannel connection with customized client identification?
Additionally, I have attached part of my key codes:
function open()
{
// Get the channel
_channel = new Ant.ChannelAssignment(
Ant.CHANNEL_TYPE_RX_NOT_TX,
Ant.NETWORK_PLUS);
GenericChannel.initialize(method(:onMessage), _channel);
// Set the configuration
_device = new Ant.DeviceConfig( {
:deviceNumber => _device_number,
:deviceType => 0x0B,
:transmissionType => 0,
:messagePeriod => 8192,
:radioFrequency => 57, //Ant+ Frequency
:searchTimeoutLowPriority => 1, //Timeout in 2.5s * 3
:searchThreshold => 0} ); //Pair to all transmitting sensors
GenericChannel.setDeviceConfig(_device);
// Open the channel
GenericChannel.open();
}
Also, I have a function will check connection status every 3 seconds. If no value got in 3 seconds, I will close channel then reopen it again:
function close()
{
GenericChannel.close();
GenericChannel.release();
}
var reopening = false;
function reopen() {
if (!reopening) {
close();
open();
reopening = true;
}
}
Thanks,
Cheer