SWIG experiments
Squash of the following commits (a full rebase was too hard :( ) *ef309cfdfN - SWIG: create pm3.c (5 months ago) <Philippe Teuwen> *05ba6a73fN - swig pm3_device -> pm3 (5 months ago) <Philippe Teuwen> *d59630183N - swig: move pm3.i (5 months ago) <Philippe Teuwen> *6adcfad75N - Fix historic make & cmake (5 months ago) <Philippe Teuwen> *bcbef2edfN - Fix typo with script_embedded (5 months ago) <slurdge> *538ee4dabN - Better SWIG integration: autogen func & attributes (5 months ago) <slurdge> *756b62466N - SWIG: few helper scripts (5 months ago) <Philippe Teuwen> *47ba4acd0N - SWIG %extend (5 months ago) <Philippe Teuwen> *21841cb9dN - simplify scripts (5 months ago) <Philippe Teuwen> *78c4f7929N - Revert "SWIG experiments: introduce context" (5 months ago) <Philippe Teuwen> *1562b75fcN - SWIG experiments: introduce context (5 months ago) <Philippe Teuwen> *a503dfcd9N - SWIG experiments (5 months ago) <Philippe Teuwen>
This commit is contained in:
1 parent
e959d0e229
commit
eadacd82f5
42 files changed
+8542
-34
No files matched your search
+8
-5
@@ -14,6 +14,7 @@
|
||||
#include <inttypes.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "uart/uart.h"
|
||||
#include "ui.h"
|
||||
@@ -541,7 +542,7 @@ bool IsCommunicationThreadDead(void) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
bool OpenProxmark(char *port, bool wait_for_port, int timeout, bool flash_mode, uint32_t speed) {
|
||||
bool OpenProxmark(pm3_device **dev, char *port, bool wait_for_port, int timeout, bool flash_mode, uint32_t speed) {
|
||||
|
||||
if (!wait_for_port) {
|
||||
PrintAndLogEx(INFO, "Using UART port " _YELLOW_("%s"), port);
|
||||
@@ -588,15 +589,17 @@ bool OpenProxmark(char *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;
|
||||
session.pm3_present = true; // TODO support for multiple devices
|
||||
|
||||
fflush(stdout);
|
||||
*dev = malloc(sizeof(pm3_device));
|
||||
(*dev)->conn = &conn; // TODO conn shouldn't be global
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
// check if we can communicate with Pm3
|
||||
int TestProxmark(void) {
|
||||
int TestProxmark(pm3_device *dev) {
|
||||
|
||||
PacketResponseNG resp;
|
||||
uint16_t len = 32;
|
||||
@@ -659,8 +662,8 @@ int TestProxmark(void) {
|
||||
return PM3_SUCCESS;
|
||||
}
|
||||
|
||||
void CloseProxmark(void) {
|
||||
conn.run = false;
|
||||
void CloseProxmark(pm3_device *dev) {
|
||||
dev->conn->run = false;
|
||||
|
||||
#ifdef __BIONIC__
|
||||
if (communication_thread != 0) {
|
||||
|
||||
Reference in new issue
Block a user