How do I encode a Configuration Downlink for a Single Push Button Sensor?

How do I encode a Configuration Downlink for a Single Push Button Sensor?

NOTE:  All downlinks must contain a total of (8) bytes, padded with zeros at the end when necessary.

See User Manual at https://www.multitech.com/brands/reveal-wireless-push-buttons for more information.

Single Push Button Sensor Configuration Message: 0x06
      Byte            Description
      0                  Downlink Message Type (0x06 = Single Button Push Button)

            Byte            Description
            1                  Enable events (see table Disable Event Bit Definitions)
            2                  Hold delay
            3                  LED config (version 2.0 or later)

Hold Delay
The hold delay defines the amount of time the button must be held before a button held event is sent. The field can range from 0-20 in 250ms increments (0-5 seconds). If set to 0 then the hold delay will not send an event message.
The disable event bit definitions are shown in the following table.

Event Bits Definitions
      Bits            Description
      7:3             Unused
      2                Enable button hold event. Set to disable, clear to enable.
      1                Enable button released event. Set to disable, clear to enable.
      0                Enable button pressed event. Set to disable, clear to enable.

LED Configuration
Note that the LED configuration is only available in firmware v2.0 or later.
The behavior of the LED can be controlled through the LED configuration byte defined in the following table.
      Bits            Description
      7:3              Unused
      2                  Blink LED after message ack received (confirmed messages only, does not apply to unconfirmed messages).
                                    0 means LED is blinked after a message ack is received,
                                    1 means LED is not blinked after a message ack is received. 
      1                  Blink LED after send.
                                    0 means LED is blinked after a send,
                                    1 means LED is not blinked after a send.
      0                  LED illumination during button press.
                                    0 means LED is illuminated during button press,
                                    1 means LED is not illuminated during button press.

For the blink after send, note that if a message is confirmed (acknowledgements) then the blink occurs after the message is sent and an ack is received. If the message is unconfirmed (no acknowledgements) then the blink occurs after the message is sent.

Single Push Button Configuration Example:
      06 02 08 04 00 00 00 00
      06                   Downlink Message Type (0x06 = Single Push Button)
      02                   Enable events
                                    0x02
                                          Enable button pressed event: Yes
                                          Enable button released event: No
                                          Enable button hold event: Yes
      08                    Hold delay (0x08 = 8 -> 8*250ms= Hold set to 2 seconds)
      04                    LED config
                                    0x04
                                          LED illumination during button press: Yes
                                          Blink LED after send: Yes
                                          Blink LED after message ACK received (confirmed messages only): No
      00                    Not used
      00                    Not used
      00                    Not used
      00                    Not used
      
      If the configuration is successful the sensor will respond with a Downlink Acknowledge message:
            1 0 FF 02
            1                   Protocol Version (currently always 0x1)
            0                   Packet Counter, increments by 1 each message and wraps from 0xF to 0x0
            FF                 Message Type (Downlink ACK = 0xFF)
            02                 Downlink Message Valid (Invalid/Undefined = 0x01, Valid = 0x02)
    • Related Articles

    • Why do I see two messages when I press the button on a Push-Button Sensor?

      The Push Button Sensors send event messages for both the button press and button release actions. It is possible to configure the sensor so that either press or release messages (or both) are disabled. For more information on Push Button Sensors ...
    • How do I decode a Single Push Button event?

      The Single Push Button Sensor will generate events when the button is pressed, released and or held-down for a configurable amount of time.   Byte 0: 7-4 Byte 0: 3-0 Byte 1 Byte 2 Byte 3 Protocol version (4 bits) Counter (4 bits) Message Type Code ...
    • How do I decode a Dual Push Button event?

      The Dual Push Button Sensor will generate events when the either the left button, the right button, or both buttons are pressed, released, or held-down for a configurable amount of time.   Byte 0: 7-4 Byte 0: 3-0 Byte 1 Byte 2 Byte 3 Protocol version ...
    • How do I encode a configuration downlink for a 4-20mA Current Loop Sensor?

      NOTE:  All downlinks must contain a total of (8) bytes, padded with zeros at the end when necessary. See User Manual at https://www.multitech.com/brands/reveal-wireless-industrial-sensors for more information. 4-20mA Current Loop Sensor Threshold ...
    • How do I encode a configuration downlink for a Voltage Sensor?

      NOTE:  All downlinks must contain a total of (8) bytes, padded with zeros at the end when necessary. For more information see the the user manual at https://www.multitech.com/brands/reveal-wireless-industrial-sensors Voltage Sensor Threshold ...