PCMD = 0x00
Sets outputs' state and returns a previous state. Up to 32 binary outputs are supported.
Request
NADR |
PNUM |
PCMD |
HWPID |
0 … 3 |
4 … n |
NADR |
0x4B |
0x00 |
0xXXXX or 0xFFFF |
Bitmap |
NewState |
Bitmap A 32-bit bitmap (4 bytes) specifying binary outputs to set. The 1st bit specifies output index with index 0, the 32nd bit specifies output with index 31. If an unimplemented binary output is selected in the bitmap, then, of course, it is not set and also no error is reported. Thus the full bitmap 0xFF.FF.FF.FF indexing all theoretical 32 binary outputs will cause setting all actually implemented binary outputs without previous knowledge of their real count.
NewState Byte array with a new state for each selected binary output. Thus the number of bytes in this array equals to a number of selected bits (binary outputs) in the Bitmap i.e. it equals to “n - 3”. If the number of bytes is not correct then ERROR_DATA_LEN is returned. Each NewState byte has the following format:
0x00 Sets output to the OFF state. Previously set ON timing is disabled.
0x01 Sets output to the ON state. Previously set ON timing is disabled.
0x02-0x7F Sets ON state for next 2-127 minutes. After the specified time the output goes to OFF state.
0x80 Reserved. Returns ERROR_FAIL.
0x81-0xFF Sets ON state for next 1-127 seconds (bit.7 from the state value is masked out). After the specified time the output goes to OFF state.
ON time precision depends on the particular implementation. Especially in LP mode, it is influenced by the receiving timeout value (see LPtoutRF DPA variable).
Response
NADR |
PNUM |
PCMD |
HWPID |
ErrN |
DpaValue |
0 … 3 |
NADR |
0x4B |
0x80 |
0xXXXX |
0 |
? |
PreviousStates |
PreviousStates Each bit in the PreviousStates is set, when the corresponding implemented (not only selected) binary output was previously at ON state.