Skip to content

Commit

Permalink
fix: 🐛 wrapped handle in namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
Katze719 committed Jun 10, 2023
1 parent 486d80b commit 1ebe31f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions cpp/src/serial_unix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@
#include <cstring>
#include <dirent.h>

namespace {
int hSerialPort;
termios2 tty;
std::string data;
}

void (*errorCallback)(int errorCode);
void (*readCallback)(int bytes);
Expand Down
3 changes: 2 additions & 1 deletion cpp/src/serial_windows.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@

#include "serial.h"


namespace {
HANDLE hSerialPort;
DCB dcbSerialParams = {0};
COMMTIMEOUTS timeouts = {0};
std::string data;
}

void (*errorCallback)(int errorCode);
void (*readCallback)(int bytes);
Expand Down

0 comments on commit 1ebe31f

Please sign in to comment.