Skip to content

Commit

Permalink
add rfid write, emulate commands
Browse files Browse the repository at this point in the history
  • Loading branch information
tillwenke committed Oct 16, 2022
1 parent 9257a2e commit 282eaf5
Showing 1 changed file with 31 additions and 1 deletion.
32 changes: 31 additions & 1 deletion lib/rfid.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,34 @@ def _run():
#TODO: Parse data
return data
self.exec(func=None, timeout=timeout)
return _run()
return _run()

def emulate(self, key_type, key_data, timeout: int = 5) -> str:
def _run():
data = self._serial_wrapper.send("rfid emulate " + key_type + " " + key_data)

return data
self.exec(func=None, timeout=timeout)
return _run()

# key_type can be one of EM4100, H10301, Indala26, IoProxXSF, AWID, FDX-A, FDX-B, HIDProx, HIDExt, Pyramid, Viking, Jablotron, Paradox, PAC/Stanley, Keri, Gallagher
# key_data is just the data you can also read from the lf rfid tags in hex eg '5500824806' from EM4100 type

def emulate(self, key_type, key_data, timeout: int = 5) -> str:
def _run():
data = self._serial_wrapper.send("rfid emulate " + key_type + " " + key_data)

return data
self.exec(func=None, timeout=timeout)
return _run()


def write(self, key_type, key_data, timeout: int = 5) -> str:
def _run():
data = self._serial_wrapper.send("rfid write " + key_type + " " + key_data)

return data
self.exec(func=None, timeout=timeout)
return _run()


0 comments on commit 282eaf5

Please sign in to comment.