Hi !
I am using ANT+ProfileLib of SimulANT+.I don't have to parse the data. it's really convenient.But ,I found two
problems.First,It seems that it is not possible to connect with the specified device number.After I set up,it's invalid,still 0.Second, It seems impossible to set infinite search.I have set searchTimeout 255.The specific code is as follows:
static HeartRateDisplay heartRateDisplay0;
device0 = new ANT_Device();
channel0 = device0.getChannel(0);
channel0.channelResponse += new dChannelResponseHandler(bsChannelResponse);
device0.setNetworkKey(USER_NETWORK_NUM, USER_NETWORK_KEY, 500)
channel0.setChannelID((ushort)(Convert.ToInt32(DeviceNumber)), false, USER_DEVICETYPE USER_TRANSTYPE, 500)
channel0.setChannelSearchTimeout(255);
hrd();
private static void hrd()
{
heartRateDisplay = new HeartRateDisplay(channel, networkAntPlus);
heartRateDisplay.HeartRateDataReceived += HeartRateDisplay_HeartRateDataReceived0;
heartRateDisplay.TurnOn();
}
private static void HeartRateDisplay_HeartRateDataReceived0(HeartRateData arg3, uint arg4)
{
ANT_Response respChID = device0.requestMessageAndResponse(0,
ANT_ReferenceLibrary.RequestMessageID.CHANNEL_ID_0x51, 500);
dn = ((ushort)((respChID.messageContents[2] << 8) + respChID.messageContents[1])).ToString();
HR = (arg3.HeartRate).ToString();
}
DeviceNumber is the device number of my current device,not 0.It does not work when I use a specific device number to connect.It is equivalent to public 0 device number. And,infinite search is invalid.Where have I been wrong or I can't set it up?