mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-01-11 18:48:08 +08:00
rearranged banner output and messages
This commit is contained in:
parent
74ece72b26
commit
2639de23c6
2 changed files with 11 additions and 12 deletions
|
@ -342,17 +342,16 @@ bool OpenProxmark(void *port, bool wait_for_port, int timeout, bool flash_mode,
|
|||
}
|
||||
}
|
||||
|
||||
// check if we can communicate with Pm3
|
||||
int TestProxmark(void) {
|
||||
// check if we can communicate with Pm3
|
||||
clearCommandBuffer();
|
||||
UsbCommand resp;
|
||||
UsbCommand c = {CMD_PING, {0, 0, 0}, {{0}}};
|
||||
SendCommand(&c);
|
||||
if (WaitForResponseTimeout(CMD_ACK, &resp, 1000)) {
|
||||
PrintAndLogEx(INFO, "Ping successful, communicating with PM3 over %s.", resp.arg[0] == 1 ? "FPC" : "USB");
|
||||
if (WaitForResponseTimeout(CMD_ACK, &resp, 5000)) {
|
||||
PrintAndLogEx(INFO, "Communicating with PM3 over %s.", resp.arg[0] == 1 ? "FPC" : "USB");
|
||||
return 1;
|
||||
} else {
|
||||
PrintAndLogEx(WARNING, _RED_("Ping failed"));
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
@ -360,7 +359,6 @@ int TestProxmark(void) {
|
|||
void CloseProxmark(void) {
|
||||
conn.run = false;
|
||||
|
||||
|
||||
#ifdef __BIONIC__
|
||||
if (USB_communication_thread != 0) {
|
||||
pthread_join(USB_communication_thread, NULL);
|
||||
|
@ -421,8 +419,8 @@ bool WaitForResponseTimeoutW(uint32_t cmd, UsbCommand *response, size_t ms_timeo
|
|||
|
||||
if (msclock() - start_time > 3000 && show_warning) {
|
||||
// 3 seconds elapsed (but this doesn't mean the timeout was exceeded)
|
||||
PrintAndLogEx(NORMAL, "Waiting for a response from the proxmark...");
|
||||
PrintAndLogEx(NORMAL, "You can cancel this operation by pressing the pm3 button");
|
||||
PrintAndLogEx(INFO, "Waiting for a response from the proxmark...");
|
||||
PrintAndLogEx(INFO, "You can cancel this operation by pressing the pm3 button");
|
||||
show_warning = false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -420,6 +420,12 @@ int main(int argc, char *argv[]) {
|
|||
return 1;
|
||||
}
|
||||
|
||||
// ascii art
|
||||
bool stdinOnPipe = !isatty(STDIN_FILENO);
|
||||
if (!script_cmds_file && !stdinOnPipe)
|
||||
showBanner();
|
||||
|
||||
|
||||
// default speed for USB 460800, USART(FPC serial) 115200 baud
|
||||
if (speed == 0)
|
||||
#ifdef WITH_FPC_HOST
|
||||
|
@ -454,11 +460,6 @@ int main(int argc, char *argv[]) {
|
|||
}
|
||||
}
|
||||
|
||||
// ascii art
|
||||
bool stdinOnPipe = !isatty(STDIN_FILENO);
|
||||
if (!script_cmds_file && !stdinOnPipe)
|
||||
showBanner();
|
||||
|
||||
// set global variables
|
||||
set_my_executable_path();
|
||||
|
||||
|
|
Loading…
Reference in a new issue