mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-21 13:53:55 -07:00
Replace ukbhit by kbd_enter_pressed, not requiring tcgetattr:
Note that it behaves differently now * it looks for Enter key only, not any key * it "eats" the input, no need for (void)getchar() after it * it works the same no matter the value of ICANON * the mingw version has been adapted to act the similarly This should fix its usage on Android where tcgetattr always returns -1
This commit is contained in:
parent
fd5c30f555
commit
844d732297
27 changed files with 90 additions and 126 deletions
|
@ -15,10 +15,10 @@ local reader15693 = require('read15')
|
|||
-- @return if successfull: an table containing card info
|
||||
-- @return if unsuccessfull : nil, error
|
||||
local function waitForTag()
|
||||
print("Waiting for card... press any key to quit")
|
||||
print("Waiting for card... press Enter to quit")
|
||||
local readers = {reader14443A, reader14443B, reader15693}
|
||||
local i = 0;
|
||||
while not core.ukbhit() do
|
||||
while not core.kbd_enter_pressed() do
|
||||
i = (i % 3) +1
|
||||
r = readers[i]
|
||||
print("Reading with ",i)
|
||||
|
|
|
@ -121,8 +121,8 @@ end
|
|||
-- @return if successfull: an table containing card info
|
||||
-- @return if unsuccessfull : nil, error
|
||||
local function waitFor14443a()
|
||||
print('Waiting for card... press any key to quit')
|
||||
while not core.ukbhit() do
|
||||
print('Waiting for card... press Enter to quit')
|
||||
while not core.kbd_enter_pressed() do
|
||||
res, err = read14443a()
|
||||
if res then return res end
|
||||
-- err means that there was no response from card
|
||||
|
|
|
@ -99,8 +99,8 @@ end
|
|||
-- @return if successfull: an table containing card info
|
||||
-- @return if unsuccessfull : nil, error
|
||||
local function waitFor14443b()
|
||||
print('Waiting for card... press any key to quit')
|
||||
while not core.ukbhit() do
|
||||
print('Waiting for card... press Enter to quit')
|
||||
while not core.kbd_enter_pressed() do
|
||||
res, err = read14443b(false)
|
||||
if res then return res end
|
||||
-- err means that there was no response from card
|
||||
|
|
|
@ -133,8 +133,8 @@ end
|
|||
-- @return if successfull: an table containing card info
|
||||
-- @return if unsuccessfull : nil, error
|
||||
local function waitFor15693()
|
||||
print('Waiting for card... press any key to quit')
|
||||
while not core.ukbhit() do
|
||||
print('Waiting for card... press Enter to quit')
|
||||
while not core.kbd_enter_pressed() do
|
||||
res, err = read15693()
|
||||
if res then return res end
|
||||
-- err means that there was no response from card
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue