Welcome Guest,Register Now
Log In

ANT Forum

Welcome guest, please Login or Register

You are here: Forum Home → ANT+ Forums → ANT-FS → Thread

   

Receiving Data from a FE enabled watch

Rank

Total Posts: 1

Joined 2011-03-08

PM

I am working on some code that has to interface with a FE enabled watch. However I have been unable to establish communication with either a watch or the FS client application set up as a watch. The piece of my code that sets up the channel is as follows:

ANT_Device device = new ANT_Device();

device.setNetworkKey(1, networkKey);


InChannel = device.getChannel(0);
InChannel.channelResponse += new ANT_Channel.ChannelResponseHandler(DataComes);

InChannel.assignChannelExt(ANT_ReferenceLibrary.ChannelType.ADV_TxRx_Only_or_RxAlwaysWildCard_0x40, 0x00, ANT_ReferenceLibrary.ChannelTypeExtended.ADV_AlwaysSearch_0x01);

InChannel.setChannelID(0x00, false,0x01, 5);

device.enableRxExtendedMessages(true);
InChannel.setLowPrioritySearchTimeout(0x44);
InChannel.setChannelSearchTimeout(0x00);
InChannel.setChannelFreq(57);
InChannel.setChannelPeriod(8192);

InChannel.openChannel();

Timer SearchTimer = new Timer(250);
InChannel.channelResponse += new ANT_Channel.ChannelResponseHandler(DataComes);

Specifically I am looking for the beacon signal coming from the watch so that I may pair with it and initiate an ant-fs session. However even with the client app broadcasting, the code never enters the DataComes function.      
Avatar
RankRankRankRank

Total Posts: 662

Joined 2012-10-09

PM

Are you using the ANT+ Network Key? It looks like you are configuring a network key on network 1, and then assigning your channel on network 0. Is there a particular reason why your channel is being configured as a Rx only background scanning channel? You should still be able to see the beacon in this case, but will need to open a second channel to synchronize with it and establish a session.

You should not need to assign a new handler to the channel event after opening the channel as well.

Have you tried connecting to the client with the PC Host? You can use the preset configuration for FE enabled watch, along with the debug logs, as a reference for your implementation. The source code for the PC host is also available.