let OpenPm be responsible of setting session.pm3_present

This commit is contained in:
Philippe Teuwen 2019-05-07 20:37:23 +02:00
parent 061321c353
commit 532dbf28a1
4 changed files with 4 additions and 4 deletions

View file

@ -522,7 +522,7 @@ static int CmdConnect(const char *Cmd) {
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)) {
PrintAndLogEx(ERR, _RED_("ERROR:") "cannot communicate with the Proxmark\n");

View file

@ -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);
__atomic_clear(&comm_thread_dead, __ATOMIC_SEQ_CST);
session.pm3_present = true;
fflush(stdout);

View file

@ -77,8 +77,7 @@ int main(int argc, char **argv) {
char *serial_port_name = argv[1];
session.pm3_present = OpenProxmark(serial_port_name, true, 60, true, FLASHMODE_SPEED);
if (session.pm3_present) {
if (OpenProxmark(serial_port_name, true, 60, true, FLASHMODE_SPEED)) {
PrintAndLogEx(NORMAL, _GREEN_("Found"));
} else {
PrintAndLogEx(ERR, "Could not find Proxmark3 on " _RED_("%s") ".\n", serial_port_name);

View file

@ -488,7 +488,7 @@ int main(int argc, char *argv[]) {
// try to open USB connection to Proxmark
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)) {