Skip to content

Commit d706f9e

Browse files
committed
fix: incorrect control information
1 parent 20247cc commit d706f9e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/controller.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def get_mouse(self):
3939
return mouse
4040

4141
def generate_msg(self, transaction_id, command_class, command_id, data_size):
42-
msgs = [0x00, transaction_id, 0x00, 0x00, 0x00, command_class, command_id, data_size]
42+
msgs = [0x00, transaction_id, 0x00, 0x00, 0x00, data_size, command_class, command_id]
4343
msg = bytes(msgs)
4444
crc = 0
4545
for i in msg[2:]:
@@ -49,10 +49,10 @@ def generate_msg(self, transaction_id, command_class, command_id, data_size):
4949
return msg
5050

5151
def battery_msg(self):
52-
return self.generate_msg(self.config.getDefault("tranId"), 0x02, 0x07, 0x80)
52+
return self.generate_msg(self.config.getDefault("tranId"), 0x07, 0x80, 0x02)
5353

5454
def charge_msg(self):
55-
return self.generate_msg(self.config.getDefault("tranId"), 0x02, 0x07, 0x84)
55+
return self.generate_msg(self.config.getDefault("tranId"), 0x07, 0x84, 0x02)
5656

5757
def send_msg(self, msg):
5858
self.mouse = self.get_mouse()

0 commit comments

Comments
 (0)