Welcome Guest,Register Now
Log In

ANT Forum

Welcome guest, please Login or Register

   

Reading Parcel after sending Broadcast Messages

Rank

Total Posts: 2

Joined 2020-09-24

PM

Hello,
I am a newbie in this forum and I'm not very familiar with app development in general, however I am in the situation in which I have to develop an app to acquire ANT data from 3 nodes. I am basing myself on a previously developed app for Windows in C++ (.exe extension).
I am using a Samsung Galaxy A51 as a mobile phone and my Android Studio API is 29.0.
I am starting with the case of a single node and have implemented the following steps in my app:

- bindService() and it returns that it is true;
- getChannelProvider() and it returns a name of the channel;
- acquireChannel(), with a setup of a default Public network;
- assignChannel() to the type of a Shared Bidirectional Master;
- open() the channel;
- setPeriod() to the user period I chose (1092, corresponding to 30 Hz which is what I want to achieve in order to look for each of my 3 units with a frequency of 10 Hz);
- setBroadcastData() with a payload that I need to call one of my units.

At this point, I expect to have sent my broadcast data and I am waiting for an "answer" from my unit. How do I read the message? I am finding many functions that want an AntMessageParcel type as input but I don't know where to get that Parcel from. Also, I am not sure that the logical order of the app is correct or if I need additional steps in between my code.

I thank you for your help.
Have a nice day!