mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-19 21:03:48 -07:00
let OpenPm be responsible of setting session.pm3_present
This commit is contained in:
parent
061321c353
commit
532dbf28a1
4 changed files with 4 additions and 4 deletions
|
@ -522,7 +522,7 @@ static int CmdConnect(const char *Cmd) {
|
||||||
CloseProxmark();
|
CloseProxmark();
|
||||||
}
|
}
|
||||||
|
|
||||||
session.pm3_present = OpenProxmark(port, false, 20, false, USART_BAUD_RATE);
|
OpenProxmark(port, false, 20, false, USART_BAUD_RATE);
|
||||||
|
|
||||||
if (session.pm3_present && (TestProxmark() != PM3_SUCCESS)) {
|
if (session.pm3_present && (TestProxmark() != PM3_SUCCESS)) {
|
||||||
PrintAndLogEx(ERR, _RED_("ERROR:") "cannot communicate with the Proxmark\n");
|
PrintAndLogEx(ERR, _RED_("ERROR:") "cannot communicate with the Proxmark\n");
|
||||||
|
|
|
@ -571,6 +571,7 @@ bool OpenProxmark(void *port, bool wait_for_port, int timeout, bool flash_mode,
|
||||||
|
|
||||||
pthread_create(&communication_thread, NULL, &uart_communication, &conn);
|
pthread_create(&communication_thread, NULL, &uart_communication, &conn);
|
||||||
__atomic_clear(&comm_thread_dead, __ATOMIC_SEQ_CST);
|
__atomic_clear(&comm_thread_dead, __ATOMIC_SEQ_CST);
|
||||||
|
session.pm3_present = true;
|
||||||
|
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
|
|
||||||
|
|
|
@ -77,8 +77,7 @@ int main(int argc, char **argv) {
|
||||||
|
|
||||||
char *serial_port_name = argv[1];
|
char *serial_port_name = argv[1];
|
||||||
|
|
||||||
session.pm3_present = OpenProxmark(serial_port_name, true, 60, true, FLASHMODE_SPEED);
|
if (OpenProxmark(serial_port_name, true, 60, true, FLASHMODE_SPEED)) {
|
||||||
if (session.pm3_present) {
|
|
||||||
PrintAndLogEx(NORMAL, _GREEN_("Found"));
|
PrintAndLogEx(NORMAL, _GREEN_("Found"));
|
||||||
} else {
|
} else {
|
||||||
PrintAndLogEx(ERR, "Could not find Proxmark3 on " _RED_("%s") ".\n", serial_port_name);
|
PrintAndLogEx(ERR, "Could not find Proxmark3 on " _RED_("%s") ".\n", serial_port_name);
|
||||||
|
|
|
@ -488,7 +488,7 @@ int main(int argc, char *argv[]) {
|
||||||
|
|
||||||
// try to open USB connection to Proxmark
|
// try to open USB connection to Proxmark
|
||||||
if (port != NULL) {
|
if (port != NULL) {
|
||||||
session.pm3_present = OpenProxmark(port, waitCOMPort, 20, false, speed);
|
OpenProxmark(port, waitCOMPort, 20, false, speed);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (session.pm3_present && (TestProxmark() != PM3_SUCCESS)) {
|
if (session.pm3_present && (TestProxmark() != PM3_SUCCESS)) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue