Welcome Guest,Register Now
Log In

ANT Forum

Welcome guest, please Login or Register

   

ANT+ Change Device Name

Rank

Total Posts: 1

Joined 2014-01-02

PM

Hey everybody,

I'm currently working on a project for my studies with ANT+ on Android devices.
Right now, I'm running a bit into a problem. Basically, I'm trying to use my own UI to connect to ANT+ devices, which works fine using the asyncscan and request access methods and so on.
So at the moment I'm wondering if its possible to change or to set the device display name within the user device database without starting an Activity to the ANT+ Plugin Manager.

Thank you in advance.      
Rank

Total Posts: 14

Joined 2014-02-18

PM

In addition, related question from me.
Is it possible to add a device into ANT+ Plugin Manager database (this will be similar to pairing bluetooth device with my own application)?
It is useful when you perform your own scanning.      
Avatar
RankRankRankRank

Total Posts: 149

Joined 2014-04-02

PM

Did either of you work this out?

The getDeviceInfo()/changeDeviceInfo() methods in AntPluginDeviceDbProvider look to provide the exact functionality required, but a "plugin name" string is required. What is this?

Also, what is the deviceParams bundle in addDevice()?      

Signature

blackramlabs.com

Avatar
RankRankRankRank

Total Posts: 149

Joined 2014-04-02

PM

I expect to be able to see the name set to a saved device every time that device is found in a search, however this appears to only be the case if the device is already connected using the provided graphical search (ie the ANT+ Plugin Sampler)

This is the flow I see:
1. In ANT+ Plugin Sampler: Connect to a device, setting a name.
2. While connected to that device, go to the Plugin Manager and change name.
3. Search for devices in another app.
4. The initial set name is used.
5. Plugin Manager shows new name.
6. In ANT+ Plugin Sampler: Disconnect the sensor.
7. Search for devices in other app.
8. No set name is used.
9. Plugin Manager shows new name.
10. In ANT+ Plugin Sampler: Connect to device (shows new name)
11. Search for devices in other app.
12. New name is used.      

Signature

blackramlabs.com

Avatar
RankRankRankRank

Total Posts: 149

Joined 2014-04-02

PM

I have verified that using the ANT+ service in the ANT+ P.B1 SDK, the saved device name is now provided to my app, even when the ANT+ Plugins Sampler is not already connected.

I have not looked at setting the device name in the new API.      

Signature

blackramlabs.com

RankRankRankRank

Total Posts: 313

Joined 2011-09-12

PM

Sorry for the really long wait to reply to this question.

AntPluginDeviceDbProvider is not intended to be publicly used right now so we can't guarantee forward compatibility. That is also the reason there is no documentation on the parameters and such.

In the future we are thinking the best way to provide this feature would be to allow apps to freely add devices, but require them to launch the ANT+ Plugin Manager and let the user make any edits or deletions. We haven't had very much feedback on the device DB since most people have just been doing their own thing, so what do you guys think is the best approach? Is the global device database a valuable feature for you?      

Signature

Dynastream Developer

Rank

Total Posts: 14

Joined 2014-02-18

PM

It is useful if you have more than one device of the same type in the same moment.
And it is useful if you want to tell a user about device name.      
Avatar
RankRankRankRank

Total Posts: 149

Joined 2014-04-02

PM

"ANT Plugin Device database" from my understanding is a list of user set device names. I don't "do my own thing" as the name is provided to me when a device access is complete (working since ANT+ P.B1 SDK). What feedback would you like?

When I access a device that I have not set a name for using the ANT+ Plugin Sampler, I want to be able to, like BikeApp has said, "change or to set the device display name within the user device database without starting an Activity to the ANT+ Plugin Manager", like the ANT+ Plugin Sampler does. Preferably I would be able to do this using my GUI, but my requirement is at least being able to add the device to the database, so the user can later use the "ANT+ Plugin Manager" to set the name. The user interaction in this case would be quite awkward though, especially when saving multiple devices of the same type as A Pyatigin has said.

Looking through the documentation to try and discover a solution to this, I found that watches (for the "Watch Downloader") can only be remembered by saving the device to the device database (or else any UUID previously provided is invalid). I haven't written any code for a watch, but I can't figure out how you would save this device either. The documentation is incomplete as it says "You can determine if this device is saved to the plugin database using {”.      

Signature

blackramlabs.com

RankRankRankRank

Total Posts: 313

Joined 2011-09-12

PM

That line in the watch downloader plugin is an error and should be removed. The preceding text explains:
Returns a UUID uniquely identifying this device for the plugin.
Once any application has interacted with this device the device is saved
to the plugin database and the UUID will be permanent across sessions. If this device
is not saved to the database the UUID will only be consistent until the PCC is
released and the plugin service shuts down.

The use-case for watches is if you perform actions with a given watch, then you are free to use the same UUID in your next session to connect to the same device. If you don't execute any actions with a device, you should not save that UUID and assume it is only valid for the current session.

The mechanism on the watch devices are different in that the database they are referring to is related to the pairing info and such. The watch downloader does not at present use the same Global database for naming since device names are already handled by the ANTFS protocol.      

Signature

Dynastream Developer

Avatar
RankRankRankRank

Total Posts: 149

Joined 2014-04-02

PM

Ok, I was reading
If this device is not saved to the device database

as the action required by our app, but you are saying that it is actually
If this device is not interacted with

as there is no way to specifically request saving any device details in the database.      

Signature

blackramlabs.com

Rank

Total Posts: 7

Joined 2015-11-19

PM

Is there any update on this topic? I would also like to set/change the device name without using the ANT+ Plugin Manager Launcher app.      
RankRankRankRank

Total Posts: 313

Joined 2011-09-12

PM

No update right now, it's on the list, but not very high up because most apps are ignoring the saved device DB. Maybe that is a chicken and egg thing...??      

Signature

Dynastream Developer