mirror of
https://github.com/intrepidcs/libicsneo.git
synced 2026-08-05 01:18:36 +02:00
Resolve merge conflicts master into devicesettings
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
#ifndef __DYNAMICLIB_DARWIN_H_
|
||||
#define __DYNAMICLIB_DARWIN_H_
|
||||
|
||||
#define icsneo_dynamicLibraryLoad() dlopen("/home/paulywog/Code/icsneonext/build/libicsneoc.dylib", RTLD_LAZY)
|
||||
#define icsneo_dynamicLibraryLoad() dlopen("/Users/paulywog/Code/icsneonext/build/libicsneoc.dylib", RTLD_LAZY)
|
||||
|
||||
#endif
|
||||
@@ -46,6 +46,6 @@ private:
|
||||
FTDIDevice ftdiDevice;
|
||||
};
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -26,6 +26,6 @@ private:
|
||||
void writeTask();
|
||||
};
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -273,8 +273,8 @@ void STM32::writeTask() {
|
||||
if(!writeQueue.wait_dequeue_timed(writeOp, std::chrono::milliseconds(100)))
|
||||
continue;
|
||||
|
||||
const auto writeSize = writeOp.bytes.size();
|
||||
int actualWritten = ::write(fd, writeOp.bytes.data(), writeSize);
|
||||
const ssize_t writeSize = (ssize_t)writeOp.bytes.size();
|
||||
ssize_t actualWritten = ::write(fd, writeOp.bytes.data(), writeSize);
|
||||
if(actualWritten != writeSize)
|
||||
std::cout << "Failure to write " << writeSize << " bytes, wrote " << actualWritten << std::endl;
|
||||
}
|
||||
|
||||
@@ -11,6 +11,6 @@ public:
|
||||
static std::vector<neodevice_t> FindByProduct(int product) { return VCP::FindByProduct(product, L"serenum"); }
|
||||
};
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -65,6 +65,6 @@ private:
|
||||
};
|
||||
};
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -28,6 +28,6 @@ private:
|
||||
};
|
||||
};
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -11,6 +11,6 @@ public:
|
||||
static std::vector<neodevice_t> FindByProduct(int product) { return VCP::FindByProduct(product, L"usbser"); }
|
||||
};
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -43,6 +43,6 @@ private:
|
||||
void writeTask();
|
||||
};
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -4,12 +4,17 @@
|
||||
#include <Windows.h>
|
||||
#include <winsock2.h>
|
||||
#include <pcap.h>
|
||||
#include <memory>
|
||||
|
||||
namespace icsneo {
|
||||
|
||||
// Helper loader for the PCAP DLL
|
||||
class PCAPDLL {
|
||||
public:
|
||||
// The first time we use the DLL we keep it in here and it won't get freed until the user unloads us (for speed reasons)
|
||||
static std::shared_ptr<PCAPDLL> lazyLoadHolder;
|
||||
static bool lazyLoaded;
|
||||
|
||||
// Functions
|
||||
typedef int(__cdecl* PCAPFINDDEVICE)(char* source, struct pcap_rmtauth* auth, pcap_if_t** alldevs, char* errbuf);
|
||||
typedef pcap_t*(__cdecl* PCAPOPEN)(const char* source, int snaplen, int flags, int read_timeout, struct pcap_rmtauth* auth, char* errbuf);
|
||||
@@ -48,6 +53,6 @@ private:
|
||||
void closeDLL();
|
||||
};
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -2,7 +2,15 @@
|
||||
|
||||
using namespace icsneo;
|
||||
|
||||
std::shared_ptr<PCAPDLL> PCAPDLL::lazyLoadHolder;
|
||||
bool PCAPDLL::lazyLoaded = false;
|
||||
|
||||
PCAPDLL::PCAPDLL() {
|
||||
if(!lazyLoaded) {
|
||||
lazyLoaded = true;
|
||||
lazyLoadHolder = std::make_shared<PCAPDLL>();
|
||||
}
|
||||
|
||||
dll = LoadLibrary("wpcap.dll");
|
||||
|
||||
if(dll == NULL) {
|
||||
|
||||
Reference in New Issue
Block a user