Refactor for a central include directory

This commit is contained in:
Paul Hollinsky
2018-10-22 11:52:34 -04:00
parent 12451def11
commit 8e6b0d0b0e
127 changed files with 263 additions and 265 deletions
@@ -1,6 +0,0 @@
#ifndef __DYNAMICLIB_DARWIN_H_
#define __DYNAMICLIB_DARWIN_H_
#define icsneo_dynamicLibraryLoad() dlopen("/Users/paulywog/Code/icsneonext/build/libicsneoc.dylib", RTLD_LAZY)
#endif
+1 -1
View File
@@ -1,4 +1,4 @@
#include "platform/include/ftdi.h"
#include "icsneo/platform/ftdi.h"
#include <iostream>
#include <stdio.h>
#include <cstring>
-22
View File
@@ -1,22 +0,0 @@
#ifndef __DEVICES_POSIX_H_
#define __DEVICES_POSIX_H_
#include "device/neoobd2pro/include/neoobd2pro.h"
#include "device/neoobd2sim/include/neoobd2sim.h"
#include "device/neovifire/include/neovifire.h"
//#include "device/neovifire2/include/neovifire2eth.h" Ethernet not yet supported
#include "device/neovifire2/include/neovifire2usb.h"
#include "device/plasion/include/neoviion.h"
#include "device/plasion/include/neoviplasma.h"
//#include "device/radgalaxy/include/radgalaxy.h" Ethernet not yet supported
//#include "device/radstar2/include/radstar2eth.h" Ethernet not yet supported
#include "device/radstar2/include/radstar2usb.h"
#include "device/radsupermoon/include/radsupermoon.h"
#include "device/valuecan3/include/valuecan3.h"
#include "device/valuecan4/include/valuecan4-1.h"
#include "device/valuecan4/include/valuecan4-2.h"
#include "device/valuecan4/include/valuecan4-2el.h"
#include "device/valuecan4/include/valuecan4-4.h"
#include "device/vividcan/include/vividcan.h"
#endif
-24
View File
@@ -1,24 +0,0 @@
#ifndef __DYNAMICLIB_POSIX_H_
#define __DYNAMICLIB_POSIX_H_
#include <dlfcn.h>
#ifdef __APPLE__
#include "platform/posix/darwin/include/dynamiclib.h"
#else
#include "platform/posix/linux/include/dynamiclib.h"
#endif
// Nothing special is needed to export
#define DLLExport
// #ifndef ICSNEO_NO_AUTO_DESTRUCT
// #define ICSNEO_DESTRUCTOR __attribute__((destructor));
// #else
#define ICSNEO_DESTRUCTOR
// #endif
#define icsneo_dynamicLibraryGetFunction(handle, func) dlsym(handle, func)
#define icsneo_dynamicLibraryClose(handle) (dlclose(handle) == 0)
#endif
-51
View File
@@ -1,51 +0,0 @@
#ifndef __FTDI_POSIX_H_
#define __FTDI_POSIX_H_
#include <vector>
#include <memory>
#include <string>
#include <atomic>
#include <ftdi.hpp>
#include "device/include/neodevice.h"
#include "communication/include/icommunication.h"
#include "third-party/concurrentqueue/blockingconcurrentqueue.h"
namespace icsneo {
class FTDI : public ICommunication {
public:
static constexpr neodevice_handle_t INVALID_HANDLE = 0x7fffffff; // int32_t max value
static std::vector<neodevice_t> FindByProduct(int product);
static bool IsHandleValid(neodevice_handle_t handle);
FTDI(neodevice_t& forDevice);
~FTDI() { close(); }
bool open();
bool close();
bool isOpen() { return ftdiDevice.is_open(); }
private:
static Ftdi::Context context;
static neodevice_handle_t handleCounter;
class FTDIDevice : public Ftdi::Context {
public:
FTDIDevice() {}
FTDIDevice(const Ftdi::Context &x) : Ftdi::Context(x) {
handle = handleCounter++;
}
neodevice_handle_t handle = INVALID_HANDLE;
};
static std::vector<FTDIDevice> searchResultDevices;
static bool GetDeviceForHandle(neodevice_handle_t handle, FTDIDevice& device);
void readTask();
void writeTask();
bool openable; // Set to false in the constructor if the object has not been found in searchResultDevices
neodevice_t& device;
FTDIDevice ftdiDevice;
};
}
#endif
-31
View File
@@ -1,31 +0,0 @@
#ifndef __STM32_POSIX_H_
#define __STM32_POSIX_H_
#include "communication/include/icommunication.h"
#include "device/include/neodevice.h"
#include <chrono>
#include <stdint.h>
namespace icsneo {
class STM32 : public ICommunication {
public:
STM32(neodevice_t& forDevice) : device(forDevice) {}
static std::vector<neodevice_t> FindByProduct(int product);
bool open();
bool isOpen();
bool close();
private:
neodevice_t& device;
int fd = -1;
static constexpr neodevice_handle_t HANDLE_OFFSET = 10;
void readTask();
void writeTask();
};
}
#endif
-6
View File
@@ -1,6 +0,0 @@
#ifndef __TCHAR_POSIX_H_
#define __TCHAR_POSIX_H_
typedef char TCHAR;
#endif
@@ -1,6 +0,0 @@
#ifndef __DYNAMICLIB_LINUX_H_
#define __DYNAMICLIB_LINUX_H_
#define icsneo_dynamicLibraryLoad() dlopen("libicsneoc.so", RTLD_LAZY)
#endif
+1 -1
View File
@@ -1,4 +1,4 @@
#include "platform/include/stm32.h"
#include "icsneo/platform/stm32.h"
#include <dirent.h>
#include <cstring>
#include <iostream>