compile with swig files if available

This commit is contained in:
Philippe Teuwen
2020-11-11 00:03:58 +01:00
parent 2f6261badb
commit f37088095b
17 changed files with 198 additions and 593 deletions

View File

@@ -11,22 +11,22 @@
typedef struct {
%extend {
pm3() {
printf("SWIG pm3 constructor, get current pm3\n");
// printf("SWIG pm3 constructor, get current pm3\n");
pm3_device * p = pm3_get_current_dev();
p->script_embedded = 1;
return p;
}
pm3(char *port) {
printf("SWIG pm3 constructor with port, open pm3\n");
// printf("SWIG pm3 constructor with port, open pm3\n");
pm3_device * p = pm3_open(port);
p->script_embedded = 0;
return p;
}
~pm3() {
if ($self->script_embedded) {
printf("SWIG pm3 destructor, nothing to do\n");
// printf("SWIG pm3 destructor, nothing to do\n");
} else {
printf("SWIG pm3 destructor, close pm3\n");
// printf("SWIG pm3 destructor, close pm3\n");
pm3_close($self);
}
}