mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-19 21:03:48 -07:00
SWIG: test callback & output grabbing
This commit is contained in:
parent
c7e5648164
commit
39710c5fdf
26 changed files with 8332 additions and 6950 deletions
21
client/experimental_client_with_swig/testembedded_cb.py
Executable file
21
client/experimental_client_with_swig/testembedded_cb.py
Executable file
|
@ -0,0 +1,21 @@
|
|||
#!/usr/bin/env python3
|
||||
|
||||
import pm3
|
||||
p=pm3.pm3()
|
||||
|
||||
# PyConsoleHandler class is defined and derived from C++ class ConsoleHandler
|
||||
class PyConsoleHandler(pm3.ConsoleHandler):
|
||||
def __init__(self):
|
||||
pm3.ConsoleHandler.__init__(self)
|
||||
def handle_output(self, c):
|
||||
print("PY>>", c, end='')
|
||||
# don't let original print routine pursuing:
|
||||
return 0
|
||||
|
||||
#p.console("hw status")
|
||||
|
||||
handler = PyConsoleHandler()
|
||||
result = p.console_async_wrapper("hw status", handler)
|
||||
print(result)
|
||||
|
||||
print("Device:", p.name)
|
Loading…
Add table
Add a link
Reference in a new issue