- # Data is in packed decimal
- # 00/01 - GPS on/off
- # 00/01 - Don't set / Set upload period
- # HHMMHHMM - Upload period
- # 00/01 - LBS on/off
- # 00/01 - Don't set / Set time of boot
- # HHMM - Time of boot
- # 00/01 - Don't set / Set time of shutdown
- # HHMM - Time of shutdown
- def out_encode(self):
- return b"" # TODO
+ OUT_KWARGS = (
+ ("gps_off", boolx, False), # Clarify the meaning of 0/1
+ ("gps_interval_set", boolx, False),
+ ("gps_interval", hhmmhhmm, "00000000"),
+ ("lbs_off", boolx, False), # Clarify the meaning of 0/1
+ ("boot_time_set", boolx, False),
+ ("boot_time", hhmm, "0000"),
+ ("shut_time_set", boolx, False),
+ ("shut_time", hhmm, "0000"),
+ )
+
+ def out_encode(self) -> bytes:
+ return (
+ pack("B", self.gps_off)
+ + pack("B", self.gps_interval_set)
+ + bytes.fromhex(self.gps_interval)
+ + pack("B", self.lbs_off)
+ + pack("B", self.boot_time_set)
+ + bytes.fromhex(self.boot_time)
+ + pack("B", self.shut_time_set)
+ + bytes.fromhex(self.shut_time)
+ )