PreviousNext
Read Sensors
Help > DPA Commands > Read Sensors

PCMD = 0x00

 

Reads data from the selected sensor(s). Optionally a proprietary data can be written to the sensor(s) too. Up to 32 sensors are supported.

 

Request

NADR

PNUM

PCMD

HWPID

0 … 3

4 … 3 + n * 5

NADR

0x5E

0x00

0xXXXX or 0xFFFF

Bitmap

WrittenData

 

Bitmap             A 32-bit bitmap (4 bytes) specifying sensors to read data from.

There are 3 options for how the Bitmap is used. Corresponding details and expected response to the request are discussed later in the Response section.

1.                    Read 1st sensor: the bitmap is not provided at all (i.e. the Request actually contains no data). In this case, the WrittenData field cannot be present.

2.                    Read sensor(s): other bitmap values. If an unimplemented sensor is selected in the bitmap, there is, of course, no return value and also no error is reported. Thus the full bitmap 0xFF.FF.FF.FF indexing all theoretical 32 sensors will cause reading all actually implemented sensors without previous knowledge of their real count.

 

WrittenData       Optional data to write to the sensors. The WrittenData data block consists of a list of a group of 5 bytes for one sensor. The 1st byte of the group is the sensor index; the next 4 bytes are the actual data to write to the sensor. The meaning of the written data is either standardized (see chapter Sensor Types) or proprietary. If the length of WrittenData is not a multiple of 5 or any of the specified sensors does not implement writing data then ERROR_DATA_LEN is returned. If the content of the written data is not valid ERROR_DATA is returned.

 

Response

NADR

PNUM

PCMD

HWPID

ErrN

DpaValue

0 … n

NADR

0x5E

0x80

0xXXXX

0

?

Data

 

Data     The content depends on the request Bitmap format:

1.     Read 1st sensor:

Same as option No 2 with Bitmap=0x00.00.00.01 (bitmap bytes 0x01, 0x00, 0x00, 0x00), i.e. 1st sensor (index 0) is selected. See below.

 

2.     Read sensor(s):

Data contains a list of sensor values for all selected sensors:

 

Data = [1st selected sensor value], [2nd selected sensor value], …, [last selected sensor value].

 

The length and format of each sensor value depend on the actual sensor type. See examples. If data from all selected sensors do not fit into the reserved Data array (56 bytes at DPA 3.00) then the response is ERROR_FAIL.