Merge branch 'master' of intrepidcs.homeip.net:paulhollinsky/icsneonext

pull/4/head
Paul Hollinsky 2018-09-25 17:56:02 -04:00
commit 4c45b235bc
41 changed files with 51 additions and 45 deletions

View File

@ -7,7 +7,9 @@
#include "device/include/device.h"
namespace icsneo {
std::vector<std::shared_ptr<Device>> FindAllDevices();
};
std::vector<std::shared_ptr<Device>> FindAllDevices();
}
#endif

View File

@ -13,7 +13,7 @@ int Communication::messageCallbackIDCounter = 1;
uint8_t Communication::ICSChecksum(const std::vector<uint8_t>& data) {
uint32_t checksum = 0;
for(auto i = 0; i < data.size(); i++)
for(size_t i = 0; i < data.size(); i++)
checksum += data[i];
checksum = ~checksum;
checksum++;

View File

@ -60,6 +60,6 @@ private:
void readTask();
};
};
}
#endif

View File

@ -38,6 +38,6 @@ protected:
std::atomic<bool> closing{false};
};
};
}
#endif

View File

@ -41,6 +41,6 @@ public:
CANMessageCallback(CANMessageFilter f, fn_messageCallback cb) : MessageCallback(cb, std::make_shared<CANMessageFilter>(f)) {}
};
};
}
#endif

View File

@ -67,6 +67,6 @@ private:
}
};
};
}
#endif

View File

@ -97,6 +97,6 @@ private:
void readTask();
};
};
}
#endif

View File

@ -335,6 +335,6 @@ private:
}
};
};
}
#endif

View File

@ -10,6 +10,6 @@ public:
uint32_t arbid;
};
};
}
#endif

View File

@ -14,6 +14,6 @@ public:
uint64_t timestamp;
};
};
}
#endif

View File

@ -33,8 +33,10 @@ typedef struct {
#include "communication/message/include/message.h"
namespace icsneo {
neomessage_t CreateNeoMessage(const Message& message);
};
neomessage_t CreateNeoMessage(const Message& message);
}
#endif
#endif

View File

@ -97,7 +97,7 @@ void MultiChannelCommunication::readTask() {
continue;
}
for(auto i = 0; i < currentReadIndex; i++)
for(size_t i = 0; i < currentReadIndex; i++)
usbReadFifo.pop_front();
payloadBytes.clear();

View File

@ -68,7 +68,7 @@ bool Packetizer::input(const std::vector<uint8_t>& inputBytes) {
break;
case ReadState::GetData:
// We do not include the checksum in packetLength so it doesn't get copied into the payload buffer
if(bytes.size() < packetLength + (checksum ? 1 : 0)) { // Read until we have the rest of the packet
if(bytes.size() < (size_t)(packetLength + (checksum ? 1 : 0))) { // Read until we have the rest of the packet
haveEnoughData = false;
break;
}

View File

@ -71,6 +71,6 @@ private:
void enforcePollingMessageLimit();
};
};
}
#endif

View File

@ -12,6 +12,6 @@ public:
static std::vector<std::shared_ptr<Device>> FindAll();
};
};
}
#endif

View File

@ -6,8 +6,10 @@
#ifdef __cplusplus
// A forward declaration is needed as there is a circular dependency
namespace icsneo {
class Device;
};
class Device;
}
typedef icsneo::Device* devicehandle_t;
#else
typedef void* devicehandle_t;

View File

@ -27,6 +27,6 @@ public:
}
};
};
}
#endif

View File

@ -27,6 +27,6 @@ public:
}
};
};
}
#endif

View File

@ -50,6 +50,6 @@ public:
}
};
};
}
#endif

View File

@ -14,6 +14,6 @@ public:
}
};
};
}
#endif

View File

@ -24,6 +24,6 @@ public:
}
};
};
}
#endif

View File

@ -24,6 +24,6 @@ public:
}
};
};
}
#endif

View File

@ -25,6 +25,6 @@ public:
}
};
};
}
#endif

View File

@ -25,6 +25,6 @@ public:
}
};
};
}
#endif

View File

@ -14,6 +14,6 @@ public:
}
};
};
}
#endif

View File

@ -27,6 +27,6 @@ public:
}
};
};
}
#endif

View File

@ -27,6 +27,6 @@ public:
}
};
};
}
#endif

View File

@ -29,6 +29,6 @@ public:
}
};
};
}
#endif

View File

@ -26,6 +26,6 @@ public:
}
};
};
}
#endif

View File

@ -27,6 +27,6 @@ public:
}
};
};
}
#endif

View File

@ -29,6 +29,6 @@ public:
}
};
};
}
#endif

View File

@ -1,6 +1,6 @@
#ifndef __DYNAMICLIB_DARWIN_H_
#define __DYNAMICLIB_DARWIN_H_
#define icsneoDynamicLibraryLoad() dlopen("/home/paulywog/Code/icsneonext/build/libicsneoc.dylib", RTLD_LAZY)
#define icsneoDynamicLibraryLoad() dlopen("/Users/paulywog/Code/icsneonext/build/libicsneoc.dylib", RTLD_LAZY)
#endif

View File

@ -46,6 +46,6 @@ private:
FTDIDevice ftdiDevice;
};
};
}
#endif

View File

@ -26,6 +26,6 @@ private:
void writeTask();
};
};
}
#endif

View File

@ -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;
}

View File

@ -11,6 +11,6 @@ public:
static std::vector<neodevice_t> FindByProduct(int product) { return VCP::FindByProduct(product, L"serenum"); }
};
};
}
#endif

View File

@ -65,6 +65,6 @@ private:
};
};
};
}
#endif

View File

@ -28,6 +28,6 @@ private:
};
};
};
}
#endif

View File

@ -11,6 +11,6 @@ public:
static std::vector<neodevice_t> FindByProduct(int product) { return VCP::FindByProduct(product, L"usbser"); }
};
};
}
#endif

View File

@ -43,6 +43,6 @@ private:
void writeTask();
};
};
}
#endif

View File

@ -53,6 +53,6 @@ private:
void closeDLL();
};
};
}
#endif