GetMeasurements NHS3100

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

GetMeasurements NHS3100

Jump to solution
1,065 Views
MarcoT
Contributor I

Hi,

Currently I'm trying to get the logged measurements from an iOS native app via NFC.

I can read some measurements by sending the command [0x46,0x00,0x00,0x00] where the last 0x00 are the offset bytes.

For example when there are 1423 measurements and i want to have the latest 200 i sent:

[0x46,0x00,0xC7,0x04]

04:C7 = 1223 so to get the 200 measurements i have to put the offset to 1223

But as far as I understand you can't control how many samples you want to read other then changing the offset value, or do I miss something?

The problem is that if you want to read 1423 measurements i don't get a result back, only the response:

46:01:00:00:00:00:00:00:00:00:00:00:

Think the amount of measurements is to big to sent it in 1 message, so how can I do paging, let's say I want measurement 0 to 100, 100 to 200 etc?

Many thanks if you want to give me some direction, what I'm doing wrong, or that i miss something.

Labels (1)
Tags (2)
0 Kudos
1 Solution
1,025 Views
patrickgeens
NXP Apps Support
NXP Apps Support

Hi MarcoT,


The maximum amount of samples returned in one GetMeasurements (0x46) transaction is defined in the NHS firmware. The actual amount of samples returned is contained in the GetMeasurements response structure.

As an example, for a recent Tlogger app the maximum is 232 samples (x16bit). When the end of the log is hit, less samples are returned. (Never hardcode this number!)

Reading the full log can be done in the following way:

(1) set OFFSET = 0

(2) execute GetMeasurements with offset "OFFSET" -> it returns the offset, the number of samples returned = N, and the N samples.

(3) while N>0:  OFFSET = OFFSET + N; goto (2)


Example output:

OFFSET, N

0 232

232 232

464 232

....

24360 232

24592 151

24743 0 -> done

 


Kind regards,

Patrick

 

View solution in original post

2 Replies
1,020 Views
MarcoT
Contributor I

Thanks for your answer Patrick!

0 Kudos
1,026 Views
patrickgeens
NXP Apps Support
NXP Apps Support

Hi MarcoT,


The maximum amount of samples returned in one GetMeasurements (0x46) transaction is defined in the NHS firmware. The actual amount of samples returned is contained in the GetMeasurements response structure.

As an example, for a recent Tlogger app the maximum is 232 samples (x16bit). When the end of the log is hit, less samples are returned. (Never hardcode this number!)

Reading the full log can be done in the following way:

(1) set OFFSET = 0

(2) execute GetMeasurements with offset "OFFSET" -> it returns the offset, the number of samples returned = N, and the N samples.

(3) while N>0:  OFFSET = OFFSET + N; goto (2)


Example output:

OFFSET, N

0 232

232 232

464 232

....

24360 232

24592 151

24743 0 -> done

 


Kind regards,

Patrick