How do I encode a Configuration Downlink for a External Probe Temp Sensor?

How do I encode a Configuration Downlink for a External Probe Temp Sensor?

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


External Probe Temp Sensor Configuration Message: 0x09
      Byte            Description
      0                  Downlink Message Type External Probe Temp Sensor 0x09

            Byte            Description
            1                  Mode: 0x00 for Threshold, or 0x01 for Report on Change
            2-7               Defined by Mode (See Mode sections)

If the temperature increase or decrease are non-zero, then the sensor will send an alert any time the temperature changes by the specified amount. For example, if the temperature increase and decrease are set to 5 degrees, then an alert is sent every time the temperature changes 5 degrees from the last report. The temperature increase and decrease are unsigned values with units in degrees C.
Periodic reporting is described in the section Periodic Reports.

Periodic Reports
The temperature sensor can also send periodic updates, and this is defined in byte 2 of both modes. A setting of 0 will disable periodic reporting. The period is defined in 1 hour increments when the most significant bit is 0, and it is defined in 1 minute increments when the most significant bit is 1 as shown in the following table.
Table 10 Period Bye (byte 2) from Downlink Configuration Message

External Probe Temp Sensor Threshold Configuration Example:
      09 00 0E 0F FD 19 00 00
      09                    Downlink Message Type (0x09 = External Probe Temp Sensor)
      00                    0x00 (Threshold mode)
      0E                    Periodic reporting (0x0E = 14 Hours) 
      0F                    Restoral Margin (0x0F = 15 Celsius)                           
      FD                    Lower Temperature Threshold (0xFD in signed 2's complement = -3 Celsius)
      19                    Upper Temperature Threshold (0x19 in signed 2's complement = 25 Celsius)
      00                    Not used
      00                    Not used

External Probe Temp Sensor Report On Change Configuration Example:
      09 01 93 00 07 03 00 00
      09                   Downlink Message Type (0x09 = External Probe Temp Sensor = 0x09 )
      01                   0x01 (Report on Change mode)  
      93                   Periodic reporting (0x93 = 19 minutes)
      00                   Not used
      07                   Temperature increase (0x07 =  7 Celsius)
      03                   Temperature decrease (0x03 =  3 Celsius)
      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)