Welcome Guest,Register Now
Log In

ANT Forum

Welcome guest, please Login or Register

   

Background Scanning not working

RankRankRankRank

Total Posts: 523

Joined 2012-11-15

PM

Currently the Android API doesn't contain functions to activate background scanning but it should by possible by sending the correct message.

But my program seems to be unable to create a background channel.

Current setup:
- 3 mobile phones (Sony X8)
- 2 phones have a broadcast with same frequency/device type/tx type, channel ID differs on device id and channel period
- 1 phone has a background channel and extended messages enabled

Expected result:
The background channel receives messages from both phones

Current result:
The background channel doesn't stay in search mode. As soon as it sees a broadcast it syncs with this node and no messages from the other node arrive. If the node of which the messages received stops transmitting the background channel reports EVENT_RX_FAIL and after a while EVENT_RX_FAIL_GO_TO_SEARCH. The messages from the other node are not received although it says it is in search mode, only when the channel is reset it can receive the messages from the other node. So it looks like the channel is configured as a normal channel.

Here is my code to setup the background channel and the response to the assign channel is RESPONSE_NO_ERROR (0)

byte[] assignChannel = new byte[6];
assignChannel[0] = (byte)4//message length
assignChannel[1] AntMesg.MESG_ASSIGN_CHANNEL_ID//message id
assignChannel[2] channelNumber
assignChannel[3] AntDefine.PARAMETER_RX_ONLY;
assignChannel[4] 0//public network
assignChannel[5] AntDefine.EXT_PARAM_ALWAYS_SEARCH//Background searching

byte[] enableExt = new byte[6];
enableExt[0] = (byte2;
enableExt[1] AntMesg.MESG_RX_EXT_MESGS_ENABLE_ID;
enableExt[2] = (byte0//filler
enableExt[3] = (byte1//enable

sAntReceiver.ANTTxMessage(assignChannel); //enable background scanning
sAntReceiver.ANTTxMessage(enableExt); //enable extended format
sAntReceiver.ANTSetChannelId(channelNumber, (byte)0DEVICE_TYPETX_TYPE);
sAntReceiver.ANTSetChannelRFFreq(channelNumberradioFreq);
sAntReceiver.ANTSetLowPriorityChannelSearchTimeout(channelNumber,(byte0xFF); // Set search timeout to unlimited
sAntReceiver.ANTSetChannelSearchTimeout(channelNumber, (byte)0); // Disable high priority search
sAntReceiver.ANTOpenChannel(channelNumber); 
     
Avatar
RankRankRankRank

Total Posts: 662

Joined 2012-10-09

PM

Background scanning channel is not supported in the current version of the firmware of the SE X8 phones. It will be implemented in a future firmware update; we have no information on SE plans regarding timeline for deploying this.      
Rank

Total Posts: 2

Joined 0

PM

Is it possible to get the firmware package for just the ANT chip via any other channel then Sony? They have announced that they won't release any updates for the X8. As I have root access to the phone I could install the firmware myself.

But it should be mentioned on the supported phones section of this website what part of the specification is supported and what not. Now I have three phones that are missing the most important feature needed for my research/application.      
Avatar
RankRankRankRank

Total Posts: 662

Joined 2012-10-09

PM

Firmware updates are only available from the handset manufacturers.

Can you provide details of what you are trying to achieve? There may be a way of meeting your needs using independent channels.      
Rank

Total Posts: 1

Joined 0

PM

I too am trying to use background channel scanning with an SE phone, in order to write an app that scans for all ANT devices and displays them as a list, selectable.. I'd be very interested in hearing advice from someone who has done this, or if its not possible on SE hardware a firm yes/no would be good too .. still waiting for my HTC Rhyme to arrive ..      
RankRankRankRank

Total Posts: 523

Joined 2012-11-15

PM

BUMP - I just wanted to bump this thread .. has *anyone* gotten background scanning working in Android yet? I am developing on HTC Rhyme, but getting the same results as with the SE phones. Perhaps there is some working code sample out there which can enumerate all ANT devices under Android, somehow?      
Rank

Total Posts: 2

Joined 0

PM

It is possible to achieve a background scanning channel, but it is a VERY bad solution.

You will need to create a channel that scans for any message, but once it finds such a message the channel will automatically synchronize with this other node. The only solution is to destroy the channel to reset the search algorithm. On the SE phones this takes anywhere between 1-3 seconds, during this period you will not receive any messages (therefor not detecting nodes). And when the channel is reopened it may connect to the same node.

I have achieved 'acceptable' results for my project in that I could find two phones within 10 seconds. But if you are searching for official ANT nodes I think it is easier to scan known frequencies of the devices you can communicate with.      
RankRankRankRank

Total Posts: 523

Joined 2012-11-15

PM

Hmm .. I wonder if this is the case with the HTC Rhyme .. I guess this is reported in the CAPABILITIES message field, so I'll go find out whats up there .. I got an HTC Rhyme on the strength of recommendations from this forum, but it seems like it doesn't allow background channel scanning, either. What a pity .. it should be a standard feature, no - the ability to scan for all ANT devices with ones mobile phone, and get a list of things available to use? Seems quite silly to me that this feature is being left off by manufacturers ..      
Avatar
RankRankRankRank

Total Posts: 662

Joined 2012-10-09

PM

There is no specific capabilities bit for background scanning channel (there is just CAPABILITIES_EXT_ASSIGN_ENABLED), however, one way to check if this feature is available is to request the ANT Version string. For phones based on the WL1271, if they have an ANT Version string AOV1.09B00 or higher, then background scanning channel should be available. Earlier versions do not have this feature.

Unfortunately, we do not have much control over if/when ANT firmware updates get integrated into phone firmware, as this is under the control of handset manufacturers and carriers. We would highly recommend contacting the handset manufacturer, to request the feature, to raise awareness on how this would benefit their users.

Regarding working around this, it would be possible to open a standard channel to search and close it as soon as it acquires a device. In order to start a new search, all you would need is to close the channel, set the channel ID so it is back to wildcards, and open the channel again. Exclusion lists could potentially be used in this scenario to exclude the device you just found from the search - the limitation is that the exclusion list can only include 4 devices. Using multiple channels to do the search may also be a possibility, depending on your specific goal.      
RankRankRankRank

Total Posts: 523

Joined 2012-11-15

PM

Thanks for the insight .. I will now write code to determine if this feature is available on the HTC Rhyme and what to do about it.

As for contacting the phone manufacturers, it is not very easy to do.. In the case of Sony-Ericsson, they don't have any obvious means to make contact at a developer level. Also, they really don't appear to be set up to be interested in this kind of feedback - feature phones don't get much support, and so on.

As for HTC, I've tried but also can't find any way to communicate in an effective way. It seems to me that this feedback loop ought to be a function of the ANT Consortium itself - isn't it possible that the ANT group themselves have the internal contacts to implementors that can provide this feedback, somehow?

It seems crippling to me to be having to resort to workarounds to get this feature implemented, when the spec for the technology itself states that the method for scanning be implemented. A little more thought ought to be put into this relationship between the ANT group and hardware implementors - in the past, it has been well proven that such failure to communicate on viable, valuable features poorly or not-well implemented has led to a market death. I can't imagine anyone using ANT effectively if they have to keep entering ID's and whatnot to find their devices - what will it be like when ANT is ubiquitous in the bathroom/residence, multiple ANT devices around, and we have to uniquely pair/resort to dire hacks to get scanning working? For the end-user, its far more usable to just have scanning work properly - if hardware implementors are crippling this feature, then ANT itself is being crippled in the marketplace. This is why I believe the ANT consortium must care about this issue a bit better and I hope this message is not lost in the noise ..


I will now go ahead and implement a workaround hack for this, much as it makes life miserable for the user.