removed the magic byte prefix from dongle commands

master
Ondřej Hruška 7 years ago
parent 827c714daf
commit 30727b7640
Signed by: MightyPork
GPG Key ID: 2C5FD5035250423D
  1. 16
      gex/transport.py

@ -84,8 +84,8 @@ class DongleAdapter(BaseGexTransport):
def write(self, buffer): def write(self, buffer):
# multipart sending # multipart sending
pb = gex.PayloadBuilder() pb = gex.PayloadBuilder()
pb.u8(0x47) # pb.u8(0x47)
pb.u8(0xB8) # pb.u8(0xB8)
pb.u8(ord('m')) pb.u8(ord('m'))
pb.u8(self._slaveAddr) pb.u8(self._slaveAddr)
pb.u16(len(buffer)) pb.u16(len(buffer))
@ -128,8 +128,8 @@ class DongleAdapter(BaseGexTransport):
def gw_reset(self): def gw_reset(self):
pb = gex.PayloadBuilder() pb = gex.PayloadBuilder()
pb.u8(0x47) # pb.u8(0x47)
pb.u8(0xB8) # pb.u8(0xB8)
pb.u8(ord('r')) pb.u8(ord('r'))
spaceused = len(pb.buf) spaceused = len(pb.buf)
pb.zeros(64 - spaceused) pb.zeros(64 - spaceused)
@ -137,8 +137,8 @@ class DongleAdapter(BaseGexTransport):
def gw_add_nodes(self, nodes): def gw_add_nodes(self, nodes):
pb = gex.PayloadBuilder() pb = gex.PayloadBuilder()
pb.u8(0x47) # pb.u8(0x47)
pb.u8(0xB8) # pb.u8(0xB8)
pb.u8(ord('n')) pb.u8(ord('n'))
pb.u8(len(nodes)) pb.u8(len(nodes))
@ -155,8 +155,8 @@ class DongleAdapter(BaseGexTransport):
return self._address return self._address
pb = gex.PayloadBuilder() pb = gex.PayloadBuilder()
pb.u8(0x47) # pb.u8(0x47)
pb.u8(0xB8) # pb.u8(0xB8)
pb.u8(ord('i')) pb.u8(ord('i'))
spaceused = len(pb.buf) spaceused = len(pb.buf)
pb.zeros(64 - spaceused) pb.zeros(64 - spaceused)

Loading…
Cancel
Save