Difference between revisions of "Firmware-811 Message-000"

From I-CubeX Wiki
Jump to: navigation, search
(STREAM DATA (0, 00h))
 
Line 28: Line 28:
 
:240, 125, 0 {DEV}, 0 {STREAM DATA}, 100 {yyyyyyy of sensor input 1}, 125 {yyyyyyy of sensor input 5}, 8 {zzz00 of sensor input 5}, 21 {yyyyyyy of sensor input 8}, 247 (F0h, 7Dh, 00h, 00h, 64h, 7Dh, 08h, 15h, F7h)
 
:240, 125, 0 {DEV}, 0 {STREAM DATA}, 100 {yyyyyyy of sensor input 1}, 125 {yyyyyyy of sensor input 5}, 8 {zzz00 of sensor input 5}, 21 {yyyyyyy of sensor input 8}, 247 (F0h, 7Dh, 00h, 00h, 64h, 7Dh, 08h, 15h, F7h)
  
The sampled value from sensor input 5 is 125 * 8 (i.e. 3 bit shift) + 8 / 8 (i.e. 2 bit right shift) = 1001
+
The sampled value from sensor input 5 is 125 * 8 (i.e. 3 bit left shift) + 8 / 8 (i.e. 2 bit right shift) = 1001

Latest revision as of 14:40, 14 May 2021

STREAM DATA (0, 00h)

In host mode the WiDig sends analog sensor input values, after being activated through a STREAM command, in the STREAM DATA message.

The [BODY] of the STREAM DATA message contains a list of sensor values from all active (turned on) sensors, in ascending order. Inactive sensors are not included in the list. Both 7-bit and 10-bit sensor values are packed together - 10-bit values are sent using two bytes, where the first byte contains the first 7 bits of the sensor value and the second byte contains the last 3 bits of the sensor value:

7-bit lo-res mode

0yyyyyyy: yyyyyyy = [0..127]; the most significant bits

10-bit hi-res mode

0yyyyyyy: yyyyyyy = [0..127]; the most significant bits
000zzz00: zzz = [0..7]; the 3 least significant bits

Example:

The WiDig has sensor input 1 turned on in lo-res mode (7-bit), sensor input 5 turned on in hi-res mode (10-bit), and sensor input 8 turned on in lo -res mode (7-bit). All other sensor inputs are turned off. The WiDig acquires the value 100 (sensor input 1), 1001 (sensor input 5), and 21 on (sensor input 8). The WiDig sends the following message:

240, 125, 0 {DEV}, 0 {STREAM DATA}, 100 {yyyyyyy of sensor input 1}, 125 {yyyyyyy of sensor input 5}, 8 {zzz00 of sensor input 5}, 21 {yyyyyyy of sensor input 8}, 247 (F0h, 7Dh, 00h, 00h, 64h, 7Dh, 08h, 15h, F7h)

The sampled value from sensor input 5 is 125 * 8 (i.e. 3 bit left shift) + 8 / 8 (i.e. 2 bit right shift) = 1001