Welcome Guest,Register Now
Log In

ANT Forum

Welcome guest, please Login or Register

You are here: Forum Home → ANT+ Forums → ANT+ Blood Pressure → Thread

   

smartLAB profi+ Blood Pressure Monitor

Rank

Total Posts: 11

Joined 2010-11-25

PM

Hi,

The BPM expects only 1 message in Link Layer. Sending a burst (multiple messages) will not work since the BPM is waiting for a single message. The BPM will accept the burst (This will be done at ANT level) but not process it (in application level) in this state.

I am sorry to tell you that but I am pretty sure the BPM expects an ack message. So you need to fix this at your phone, so you can use ack messages without exceptions. Maybe someone in the forum can help you to fix it.


Best Regards,
Berthold      
Avatar
RankRankRankRank

Total Posts: 213

Joined 2011-05-02

PM

Hi Albert,

Would you be able to post your entire sequence please? I don't believe this is an android error, rather an error with the message formats or something along those lines.

Thanks!

Kassandra      
Rank

Total Posts: 13

Joined 0

PM

Hi Kassandra

I think it is the channelType. Is it possible to Transmit and Receive using the same channel?

I have the network as ANT_PLUS. What should be the channelType if I want to send and receive using the same channel?

Originally I had 0x00 (PARAMETER_RX_NOT_TX) this was copied from the sample - This mode was causing the exception. I changed it to 0x20(PARAMETER_SHARED_CHANNEL) - this doesnot work. I dont see the beacon anymore in this mode. 0x10 (PARAMETER_TX_NOT_RX) also doesnot seem to work. I dont see the beacon in this either. I will continue debugging and see where this goes.

-Albert      
Rank

Total Posts: 13

Joined 0

PM

Hi

Here are the debug captures with different channel types

channel type - PARAMETER_RX_NOT_TX (0x00)
--------------------
After reset
Rx:[01][6F][20]
Rx:[03][40][03][42][00]
Rx:[03][40][00][74][00]
Rx:[03][40][03][51][00]
Rx:[03][40][03][43][00]
Rx:[03][40][03][45][00]
Rx:[03][40][03][44][00]
Rx:[03][40][03][63][00]
Rx:[03][40][03][71][00]
Rx:[03][40][03][4B][00]
Rx:[03][40][00][74][00]
Rx:[09][4E][03][43][2B][00][03][12][00][15][00] - beacon
Tx:[02][39][02][01][02][05][05] - transmitted link request (calls ANTANTSendAcknowledgedData API)
02-link request
39 - channel frequency 2457MHz.
02 - channel period 2 Hz
1255 - serial number - random number

com.dsi.ant.exception.AntInterfaceException: Unknown ANT Interface error
at com.dsi.ant.AntInterface.ANTSendAcknowledgedData(AntInterface.java:1019)
at alberta.ANTInterface.ANTDeviceProfile.sendSingleCommand(ANTDeviceProfile.java:274)
at alberta.ANTInterface.ANTBPCuffProfile.processBroadCastMessage(ANTBPCuffProfile.java:46)
at alberta.ANTInterface.ANTBPCuffProfile.decodeDataBuffer(ANTBPCuffProfile.java:100)
at alberta.ANTInterface.ANTDeviceProfile.onReceive(ANTDeviceProfile.java:303)
at android.app.LoadedApk$ReceiverDispatcher$Args.run(LoadedApk.java:709)
at android.os.Handler.handleCallback(Handler.java:587)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:123)
at android.app.ActivityThread.main(ActivityThread.java:3652)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:862)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:620)
at dalvik.system.NativeStart.main(Native Method)
Rx:[09][4E][03][43][2B][00][03][12][00][15][00] - beacon
Rx:[09][4E][03][43][2B][00][03][12][00][15][00] - beacon
Rx:[09][4E][03][43][2B][00][03][12][00][15][00] - beacon
Rx:[09][4E][03][43][2B][00][03][12][00][15][00] - beacon
Rx:[09][4E][03][43][2B][00][03][12][00][15][00]
Rx:[09][4E][03][43][2B][00][03][12][00][15][00]
Rx:[09][4E][03][43][2B][00][03][12][00][15][00]

PARAMETER_TX_NOT_RX (0x10)
--------------------
After reset
Rx:[01][6F][20]
Rx:[03][40][00][74][00]
Rx:[03][40][03][42][00]
Rx:[03][40][03][51][00]
Rx:[03][40][03][43][00]
Rx:[03][40][03][45][00]
Rx:[03][40][03][44][00]
Rx:[03][40][03][63][00]
Rx:[03][40][03][71][00]
Rx:[03][40][03][4B][00]
Rx:[03][40][00][74][00]
- not receiving the beacon at all...
Rx:[03][40][03][01][03]
Rx:[03][40][03][01][03]
Rx:[03][40][03][01][03]
Rx:[03][40][03][01][03]
Rx:[03][40][03][01][03]
Rx:[03][40][03][01][03]
Rx:[03][40][03][01][03]
Rx:[03][40][03][01][03]
Rx:[03][40][03][01][03]
Rx:[03][40][03][01][03]
Rx:[03][40][03][01][03]
Rx:[03][40][03][01][03]
Rx:[03][40][03][01][03]
Rx:[03][40][03][01][03]
Rx:[03][40][03][01][03]
Rx:[03][40][03][01][03]
Rx:[03][40][03][01][03]
Rx:[03][40][03][01][03]
Rx:[03][40][03][01][03]
Rx:[03][40][03][01][03]
Rx:[03][40][03][01][03]
Rx:[03][40][03][01][03]
Rx:[03][40][03][01][03]
Rx:[03][40][03][01][03]
Rx:[03][40][03][01][03]
Rx:[03][40][03][01][03]
Rx:[03][40][03][01][03]
Rx:[03][40][03][01][03]
Rx:[03][40][03][01][03]

PARAMETER_SHARED_CHANNEL (0x20)
------------------------
Rx:[01][6F][20]
Rx:[03][40][00][74][00]
Rx:[03][40][03][42][00]
Rx:[03][40][03][51][00]
Rx:[03][40][03][43][00]
Rx:[03][40][03][45][00]
Rx:[03][40][03][44][00]
Rx:[03][40][03][63][00]
Rx:[03][40][03][71][00]
Rx:[03][40][03][4B][00]
Rx:[03][40][00][74][00]
- not receiving the beacon at all...
Rx:[03][40][03][01][02]
Rx:[03][40][03][01][02]
Rx:[03][40][03][01][02]
Rx:[03][40][03][01][02]
Rx:[03][40][03][01][02]
Rx:[03][40][03][01][02]
Rx:[03][40][03][01][02]
Rx:[03][40][03][01][02]
Rx:[03][40][03][01][08]

PARAMETER_NO_TX_GUARD_BAND (0x40)
--------------------------
Rx:[01][6F][20]
Rx:[03][40][00][74][00]
Rx:[03][40][03][42][00]
Rx:[03][40][03][51][00]
Rx:[03][40][03][43][00]
Rx:[03][40][03][45][00]
Rx:[03][40][03][44][00]
Rx:[03][40][03][63][00]
Rx:[03][40][03][71][00]
Rx:[03][40][03][4B][00]
Rx:[03][40][00][74][00]
Rx:[09][4E][03][43][2B][00][03][12][00][15][00] - Beacon
Tx:[02][39][02][01][02][05][05] - transmitted link request (calls ANTANTSendAcknowledgedData API)
02-link request
39 - channel frequency 2457MHz.
02 - channel period 2 Hz
1255 - serial number - random number
com.dsi.ant.exception.AntInterfaceException: Unknown ANT Interface error
at com.dsi.ant.AntInterface.ANTSendAcknowledgedData(AntInterface.java:1019)
at alberta.ANTInterface.ANTDeviceProfile.sendSingleCommand(ANTDeviceProfile.java:274)
at alberta.ANTInterface.ANTBPCuffProfile.processBroadCastMessage(ANTBPCuffProfile.java:46)
at alberta.ANTInterface.ANTBPCuffProfile.decodeDataBuffer(ANTBPCuffProfile.java:100)
at alberta.ANTInterface.ANTDeviceProfile.onReceive(ANTDeviceProfile.java:303)
at android.app.LoadedApk$ReceiverDispatcher$Args.run(LoadedApk.java:709)
at android.os.Handler.handleCallback(Handler.java:587)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:123)
at android.app.ActivityThread.main(ActivityThread.java:3652)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:862)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:620)
at dalvik.system.NativeStart.main(Native Method)
Rx:[09][4E][03][43][2B][00][03][12][00][15][00]
Rx:[09][4E][03][43][2B][00][03][12][00][15][00]
Rx:[09][4E][03][43][2B][00][03][12][00][15][00]
Rx:[09][4E][03][43][2B][00][03][12][00][15][00]
Rx:[09][4E][03][43][2B][00][03][12][00][15][00]
Rx:[09][4E][03][43][2B][00][03][12][00][15][00]
Rx:[09][4E][03][43][2B][00][03][12][00][15][00]
Rx:[09][4E][03][43][2B][00][03][12][00][15][00]
Rx:[09][4E][03][43][2B][00][03][12][00][15][00]
Rx:[09][4E][03][43][2B][00][03][12][00][15][00]      
Avatar
RankRankRankRank

Total Posts: 213

Joined 2011-05-02

PM

Can you please provide the code on how you're formatting the LINK command?

Thanks

Kassandra      
Rank

Total Posts: 13

Joined 0

PM

private byte[] getLinkCommand(){
byte[] commandArray = new byte[7];
commandArray[0] = 0x02; //LINK Command
commandArray[1] = (byte)57; //channel frequency 2457MHz.
commandArray[2] = 0x02; //channel period 2 Hz (16384)
commandArray[3] = BP_CHANNEL_SERIAL_NO_BYTE_0;
commandArray[4] = BP_CHANNEL_SERIAL_NO_BYTE_1;
commandArray[5] = BP_CHANNEL_SERIAL_NO_BYTE_2;
commandArray[6] = BP_CHANNEL_SERIAL_NO_BYTE_3;
return commandArray;
}

try {
System.out.println("Tx:"+ getHexString(cmdArray));
sAntReceiver.ANTSendAcknowledgedData(currentChannelNumber, getLinkCommand());
} catch (AntInterfaceException aie) {
aie.printStackTrace();
}      
Avatar
RankRank

Total Posts: 39

Joined 2011-06-29

PM

I have looked at the Ant Radio Service code for sending an acknowledge message, and think I know why you are getting an exception thrown. The ANTSendAcknowledgedData() function requires 8 bytes of data to transmit, if less are passed to it, an exception is thrown. Try changing
byte[] commandArray = new byte[7]
to
byte[] commandArray = new byte[8]


Also the reason PARAMETER_TX_NOT_RX (0x10) doesn't receive beacon messages is because it configures the channel as a Master. Assigning a Slave channel will make it search for a Master (Broadcasting beacon messages)      
Rank

Total Posts: 13

Joined 0

PM

OK

I got the error the first byte should be 0x44. I got this. Now I am proceeding to the next step.

- Albert      
Rank

Total Posts: 13

Joined 0

PM

Hi

When I acknowledge the authenticate beacon [09][4E][03][43][2B][00][03][12][00][15][00] with a request for pairing [44][04][02][00][01][02][05][05]

04 - Authenticate command
02 - request pairing
00 - length of authentication string
01020505 - host ID.

I get three burst commands.

Rx:[09][50][03][43][2B][03][03][01][02][05][05]
Rx:[09][50][23][44][84][01][04][39][99][12][00]
Rx:[09][50][C3][E3][ED][81][92][00][00][00][00]

The first packet [43][2B][03][03][01][02][05][05] looks like the authenticate beacon
the second packet [44][84][01][04][39][99][12][00] looks like authentication accepted with passkey 39 99 12 00
I am not sure what the third packet is.

Am I reading this correctly? Or all three packets part of the same packet that needs to be interpreted differently

Thanks

albert      
Rank

Total Posts: 11

Joined 2010-11-25

PM

Hi,

Rx:[43][2B][03][03][01][02][05][05] This is the normal beacon
Rx:[44][84][01][04][39][99][12][00] This is the response

[01] is accepted
[04] length of auth string
[39][99][12][00] Host serial number


Rx:[E3][ED][81][92][00][00][00][00] This is the Auth string (first 4 bytes)

Regards Berthold      
Rank

Total Posts: 13

Joined 0

PM

Thanks      
Rank

Total Posts: 6

Joined 0

PM

I am trying to connect the BPM device UAANT851(A&D) with the help

Can some one tell me that what is the next setup after that, I have get the broadcast message from beacon

Rx:[09][4E][03][43][2B][00][03][12][00][15][00] - beacon

I think after that i need to send the ack message to becon device

But can some tell me that what format i need to send the beacon.      
Avatar
RankRankRankRank

Total Posts: 213

Joined 2011-05-02

PM

Hello,

Have you read the ANT-FS Technology Specification? This document details the messages from Host to Client etc. I suggest reading this document, and paying special attention to Section 12.

Cheers,

Kassandra      
Rank

Total Posts: 6

Joined 0

PM

I am facing the issue with how do i get the host serial number when replying the the BPM beacon      
Avatar
RankRankRankRank

Total Posts: 213

Joined 2011-05-02

PM

When the client is in the Authentication or Transport layers, it will broadcast the host's serial number its beacon, instead of its device type and manufacturer ID. Refer to the ANTFS Technical Specification, page 48 for more detail.