Welcome Guest,Register Now
Log In

ANT Forum

Welcome guest, please Login or Register

   

Text from A to B phone.

Rank

Total Posts: 1

Joined 2013-04-16

PM

Dear.
I'm going to make a simple application on Android phone via ANT+
My plan is to send messages from A phone to B phone.
But I don't know where the proper sample source codes are.
Could anyone else let me know how to message each other via ANT+ ?
Please help me.
Thanks
     
Avatar
RankRankRankRank

Total Posts: 745

Joined 2012-09-14

PM

Hi,

Have you taken a look at the ANT Android API? The sample app in there open's master/slave channels which can communicate with one another.

I would also recommend reading the ANT Message Protocol and Usage doc to gain an understanding of how ANT works, but you'll need to write your own code to send text data over 8 byte packets (you'll also likely need to use bytes to indicate pages, new events, etc similar to ANT+ Device Profiles).

     
Rank

Total Posts: 2

Joined 2014-04-03

PM

harrison - 18 March 2014 01:43 PM
Hi,

Have you taken a look at the ANT Android API? The sample app in there open's master/slave channels which can communicate with one another.

I would also recommend reading the ANT Message Protocol and Usage doc to gain an understanding of how ANT works, but you'll need to write your own code to send text data over 8 byte packets (you'll also likely need to use bytes to indicate pages, new events, etc similar to ANT+ Device Profiles).



But how to implement Master/Slave in Android?
I read D00000652_ANT_Message_Protocol_and_Usage_Rev_5.1 already, but it seem to be written in C and I was not able to use in Android.
I'm a newbie with ANT+ and I don't know how to implement process transferring text between 2 Android devices via ANT+ :
1. Search device
2. Request access
3. Transferring text data
I appreciate if you give any example code for my process.
Thank you very much.      
Avatar
RankRankRankRank

Total Posts: 745

Joined 2012-09-14

PM

Hi,

Sorry, at this time there is no other sample code available for the ANT Channel API.

Some tips...

The Android API is modeled after the PC API, the C# example in the ANT Windows Library Package is much simpler, but obviously is not directly applicable to the Java code.

I'd also take a look at the ANT+ Presentation from DroidCon Berlin 2013. In particular slide 37 and onwards provides a high level summary of how to use the ANT Android API.

In terms of device search I would play with ANTWare II. In particular once you open a slave channel, it automatically looks for a master channel with the same Channel ID parameters which you configured.

Best regards      
Rank

Total Posts: 2

Joined 2014-04-03

PM

harrison - 10 April 2014 02:06 PM
Hi,

Sorry, at this time there is no other sample code available for the ANT Channel API.

Some tips...

The Android API is modeled after the PC API, the C# example in the ANT Windows Library Package is much simpler, but obviously is not directly applicable to the Java code.

I'd also take a look at the ANT+ Presentation from DroidCon Berlin 2013. In particular slide 37 and onwards provides a high level summary of how to use the ANT Android API.

In terms of device search I would play with ANTWare II. In particular once you open a slave channel, it automatically looks for a master channel with the same Channel ID parameters which you configured.

Best regards


Hi,
Thank you for your reply.
I have to change from ANT+ to ANT. It works fine, except the payload data only accept maximum 8 bytes.
When I try to send a packet with 64 bytes, I have to separate into many smaller packets, so it takes long time.
Have you got any suggestion for me to solve this issue?
I use Broadcast between Tx and Rx channel.
Thank you and Best Regards,      
Avatar
RankRankRankRank

Total Posts: 745

Joined 2012-09-14

PM

Hi,

Please refer to section 5.4.3 of the ANT Message Protocol and Usage document.