PreviousNext
Examples
Help > Examples

Note: if not specified then PNUM=0x5E and always the same device.

 

Enumerate sensor types:

         Request

PCMD=0x3E Enumerate sensors

         Response

PCMD=0xBE, PData=[0x01 Temperature, 0x01 Temperature, 0x02 CO2, 0x80 Humidity] => 1st and 2nd sensors are temperature sensors, 3rd is CO2 and 4th is humidity sensor.

 

Read values from sensors of indexes 0 and 3. Write 0x11, 0x22, 0x44, 0x55 to the 3rd sensor.

         Request

PCMD=0x00 Read sensors, PData=[0x091st and 4th sensor, 0x00, 0x00, 0x00][0x023rd sensor, 0x11, 0x22, 0x44, 0x55]

         Response

PCMD=0x80, PData=[0x40 Temperature value lower byte,0x01 Temperature value higher byte,0xA0 Humidity value] => 1st temperature sensor returns 20.0 °C, 4th humidity sensor returns 80.0 %.

 

Read values of indexes 0 and 3 from sensors including their types:

         Request

PCMD=0x01 Read sensors with types, PData=[0x09 1st and 4th sensor,0x00,0x00,0x00]

         Response

PCMD=0x81, PData=[0x01 Temperature, 0x40 Temperature value lower byte, 0x01 Temperature value higher byte, 0x80 Humidity, 0xA0 Humidity value] => 1st sensor is temperature sensor and it returns 20.0 °C, 4th sensor is humidity sensor and it returns 80.0 %.

 

Read value and type of the 1st sensor

         Request

PCMD=0x01 Read sensors with types, PData=none 1st sensor only

         Response

PCMD=0x81, PData=[0x01 Temperature, 0x40 Temperature value lower byte, 0x01 Temperature value higher byte] => 1st sensor is temperature sensor and it returns 20.0 °C.

 

Read FRC byte temperature value from the 2nd temperature sensor from all nodes. Nodes supporting this temperature FRC then deep-sleep for 5 minutes.

         Request

PNUM=0x0D FRC peripheral, PCMD=0x00 FRC Send, PData=[0x90 1-byte FRC ][0x5E, 0x01 Temperature, 0x01 2nd sensor][0x01 Sleep used ][0x8F Sleep time lower byte, 0x00 Sleep time higher byte, 0x20 Sleep control byte]

         Response

PNUM=0x0D, PCMD=0x80, PData=[0x?? FRC status][0x?? unused][0x40 Node#1, 0x59 Node#2, 0xF4 Node#3, 0x00, …, 0x00] => Nodes from addresses 1 to 3 returned temperatures 10.0 °C, 22.5 °C, 100.0 °C respectively.