Skip to content

Commit

Permalink
goodfet: remove duplicate definition of GoodFETMonitorApp
Browse files Browse the repository at this point in the history
  • Loading branch information
antoinevg committed Jan 22, 2024
1 parent 304d976 commit d6ef75e
Showing 1 changed file with 0 additions and 56 deletions.
56 changes: 0 additions & 56 deletions facedancer/backends/goodfet.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,59 +322,3 @@ def GoodFETSerialPort(**kwargs):
parity=serial.PARITY_NONE, timeout=2)
args.update(kwargs)
return serial.Serial(**args)


class GoodFETMonitorApp(FacedancerApp):
app_name = "GoodFET monitor"
app_num = 0x00

def read_byte(self, addr):
d = [ addr & 0xff, addr >> 8 ]
cmd = FacedancerCommand(self.app_num, 2, d)

self.device.writecmd(cmd)
resp = self.device.readcmd()

return resp.data[0]

def get_infostring(self):
return bytes([ self.read_byte(0xff0), self.read_byte(0xff1) ])

def get_clocking(self):
return bytes([ self.read_byte(0x57), self.read_byte(0x56) ])

def print_info(self):
infostring = self.get_infostring()
clocking = self.get_clocking()

print("MCU", bytes_as_hex(infostring, delim=""))
print("clocked at", bytes_as_hex(clocking, delim=""))

def list_apps(self):
cmd = FacedancerCommand(self.app_num, 0x82, b'\x01')
self.device.writecmd(cmd)

resp = self.device.readcmd()
print("build date:", resp.data.decode("utf-8"))

print("firmware apps:")
while True:
resp = self.device.readcmd()
if len(resp.data) == 0:
break
print(resp.data.decode("utf-8"))

def echo(self, s):
b = bytes(s, encoding="utf-8")

cmd = FacedancerCommand(self.app_num, 0x81, b)
self.device.writecmd(cmd)

resp = self.device.readcmd()

return resp.data == b

def announce_connected(self):
cmd = FacedancerCommand(self.app_num, 0xb1, b'')
self.device.writecmd(cmd)
resp = self.device.readcmd()

0 comments on commit d6ef75e

Please sign in to comment.