We are trying to integrate CycleOps Pro Series IC Power sensor into our custom app built on .NET and C#.
We used all the settings in ANT+ Power Profile PDF document and network key defined in Device Profiles. But channel just times out without finding any power meter device. While using Garmin computer device is found in about 2secs. The code from the test application is given below. What do we miss in the channel configuration? Any help would be very much appreciated!
static readonly byte USER_ANT_CHANNEL = 0x0; // ANT Channel to use
static readonly ushort USER_DEVICENUM = 0; // Device number
static readonly byte USER_DEVICETYPE = 0x0B; // Device type
static readonly byte USER_TRANSTYPE = 0x0; // Transmission type
static readonly byte USER_RADIOFREQ = 0x39;//0x41;; // RF Frequency + 2400 MHz
static readonly byte[] USER_NETWORK_KEY = { 0xB9, 0xA5, 0x21, 0xFB, 0xBD, 0x72, 0xC3, 0x45 };
static readonly byte USER_NETWORK_NUM = 0; // The network key is assigned to this network number
...
if (channel0.assignChannel(channelType, USER_NETWORK_NUM, 500))
Console.WriteLine("Channel Assigned");
else
throw new Exception("Channel assignment operation failed.");
Console.WriteLine("Assigning channel...");
Console.WriteLine("Setting Channel ID...");
if (channel0.setChannelID(USER_DEVICENUM, false, USER_DEVICETYPE, USER_TRANSTYPE, 500)) // Not using pairing bit
Console.WriteLine("Channel ID Set");
else
throw new Exception("Set Channel ID operation failed.");
if (device0.setNetworkKey(USER_NETWORK_NUM, USER_NETWORK_KEY, 500))
Console.WriteLine("Network Key Set");
else
throw new Exception("Set Network Key operation failed");
Console.WriteLine("Setting Channel Period...");
channel0.setChannelPeriod(8182);
Console.WriteLine("Setting RF Frequency...");
if (channel0.setChannelFreq(USER_RADIOFREQ, 500))
Console.WriteLine("Radio Frequency set");
else
throw new Exception("Set RF Frequency operation failed.");
Console.WriteLine("Opening channel...");
if (channel0.openChannel(500))
Console.WriteLine("Channel opened");
else
throw new Exception("Open Channel operation failed.");