first iteration cleanup

This commit is contained in:
Kyle Johannes
2023-11-29 17:05:08 -05:00
parent 0b9491e5e3
commit aa77bbbc9e
4 changed files with 742 additions and 801 deletions
+2 -12
View File
@@ -4,13 +4,6 @@
#define ICSNEOC_MAKEDLL
#ifdef ICSNEO_ENABLE_ANDROIDUSB
#include "icsneo/platform/android/androidusb.h"
#include <android/log.h>
#define LOG_TAG "libicsneoc"
#define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG, LOG_TAG, __VA_ARGS__)
#endif
#include "icsneo/icsneoc.h"
#include "icsneo/icsneocpp.h"
#include "icsneo/platform/dynamiclib.h"
@@ -101,7 +94,6 @@ bool icsneo_isValidNeoDevice(const neodevice_t* device) {
// return false on nullptr
if(!device) {
EventManager::GetInstance().add(APIEvent::Type::RequiredParameterNull, APIEvent::Severity::Error);
LOGD("nullparameter neodevice error\n");
return false;
}
// If this neodevice_t was returned by a previous search, it will no longer be valid (as the underlying icsneo::Device is freed)
@@ -115,18 +107,17 @@ bool icsneo_isValidNeoDevice(const neodevice_t* device) {
}
EventManager::GetInstance().add(APIEvent::Type::InvalidNeoDevice, APIEvent::Severity::Error);
LOGD("Invalid neodevice error\n");
return false;
}
bool icsneo_openDevice(const neodevice_t* device) {
if(!icsneo_isValidNeoDevice(device)) {
LOGD("Invalid neodevice error\n");
//todo error
return false;
}
if(!device->device->open()) {
LOGD("Device failed to open...\n");
//todo error
return false;
}
@@ -233,7 +224,6 @@ bool icsneo_getMessages(const neodevice_t* device, neomessage_t* messages, size_
return false;
*items = storage.size();
for(size_t i = 0; i < *items; i++) {
// For each message, copy into neomessage_t buffer given
messages[i] = CreateNeoMessage(storage[i]);