CI: Add warnings & error on warnings
parent
52e98af9fd
commit
2209e348a3
|
|
@ -234,54 +234,6 @@ unit_test linux/ubuntu/2204/amd64/clang:
|
||||||
- linux-build
|
- linux-build
|
||||||
timeout: 5m
|
timeout: 5m
|
||||||
|
|
||||||
build linux/fedora/37/amd64/gcc:
|
|
||||||
<<: *build_linux_fedora_gcc
|
|
||||||
image: fedora:37
|
|
||||||
|
|
||||||
unit_test linux/fedora/37/amd64/gcc:
|
|
||||||
<<: *test_linux_fedora_gcc
|
|
||||||
image: fedora:37
|
|
||||||
dependencies:
|
|
||||||
- build linux/fedora/37/amd64/gcc
|
|
||||||
needs:
|
|
||||||
- build linux/fedora/37/amd64/gcc
|
|
||||||
|
|
||||||
build linux/fedora/37/amd64/clang:
|
|
||||||
<<: *build_linux_fedora_clang
|
|
||||||
image: fedora:37
|
|
||||||
|
|
||||||
unit_test linux/fedora/37/amd64/clang:
|
|
||||||
<<: *test_linux_fedora_clang
|
|
||||||
image: fedora:37
|
|
||||||
dependencies:
|
|
||||||
- build linux/fedora/37/amd64/clang
|
|
||||||
needs:
|
|
||||||
- build linux/fedora/37/amd64/clang
|
|
||||||
|
|
||||||
build linux/fedora/38/amd64/gcc:
|
|
||||||
<<: *build_linux_fedora_gcc
|
|
||||||
image: fedora:38
|
|
||||||
|
|
||||||
unit_test linux/fedora/38/amd64/gcc:
|
|
||||||
<<: *test_linux_fedora_gcc
|
|
||||||
image: fedora:38
|
|
||||||
dependencies:
|
|
||||||
- build linux/fedora/38/amd64/gcc
|
|
||||||
needs:
|
|
||||||
- build linux/fedora/38/amd64/gcc
|
|
||||||
|
|
||||||
build linux/fedora/38/amd64/clang:
|
|
||||||
<<: *build_linux_fedora_clang
|
|
||||||
image: fedora:38
|
|
||||||
|
|
||||||
unit_test linux/fedora/38/amd64/clang:
|
|
||||||
<<: *test_linux_fedora_clang
|
|
||||||
image: fedora:38
|
|
||||||
dependencies:
|
|
||||||
- build linux/fedora/38/amd64/clang
|
|
||||||
needs:
|
|
||||||
- build linux/fedora/38/amd64/clang
|
|
||||||
|
|
||||||
build linux/fedora/39/amd64/gcc:
|
build linux/fedora/39/amd64/gcc:
|
||||||
<<: *build_linux_fedora_gcc
|
<<: *build_linux_fedora_gcc
|
||||||
image: fedora:39
|
image: fedora:39
|
||||||
|
|
@ -306,6 +258,54 @@ unit_test linux/fedora/39/amd64/clang:
|
||||||
needs:
|
needs:
|
||||||
- build linux/fedora/39/amd64/clang
|
- build linux/fedora/39/amd64/clang
|
||||||
|
|
||||||
|
build linux/fedora/40/amd64/gcc:
|
||||||
|
<<: *build_linux_fedora_gcc
|
||||||
|
image: fedora:40
|
||||||
|
|
||||||
|
unit_test linux/fedora/40/amd64/gcc:
|
||||||
|
<<: *test_linux_fedora_gcc
|
||||||
|
image: fedora:40
|
||||||
|
dependencies:
|
||||||
|
- build linux/fedora/40/amd64/gcc
|
||||||
|
needs:
|
||||||
|
- build linux/fedora/40/amd64/gcc
|
||||||
|
|
||||||
|
build linux/fedora/40/amd64/clang:
|
||||||
|
<<: *build_linux_fedora_clang
|
||||||
|
image: fedora:40
|
||||||
|
|
||||||
|
unit_test linux/fedora/40/amd64/clang:
|
||||||
|
<<: *test_linux_fedora_clang
|
||||||
|
image: fedora:40
|
||||||
|
dependencies:
|
||||||
|
- build linux/fedora/40/amd64/clang
|
||||||
|
needs:
|
||||||
|
- build linux/fedora/40/amd64/clang
|
||||||
|
|
||||||
|
build linux/fedora/41/amd64/gcc:
|
||||||
|
<<: *build_linux_fedora_gcc
|
||||||
|
image: fedora:41
|
||||||
|
|
||||||
|
unit_test linux/fedora/41/amd64/gcc:
|
||||||
|
<<: *test_linux_fedora_gcc
|
||||||
|
image: fedora:41
|
||||||
|
dependencies:
|
||||||
|
- build linux/fedora/41/amd64/gcc
|
||||||
|
needs:
|
||||||
|
- build linux/fedora/41/amd64/gcc
|
||||||
|
|
||||||
|
build linux/fedora/41/amd64/clang:
|
||||||
|
<<: *build_linux_fedora_clang
|
||||||
|
image: fedora:41
|
||||||
|
|
||||||
|
unit_test linux/fedora/41/amd64/clang:
|
||||||
|
<<: *test_linux_fedora_clang
|
||||||
|
image: fedora:41
|
||||||
|
dependencies:
|
||||||
|
- build linux/fedora/41/amd64/clang
|
||||||
|
needs:
|
||||||
|
- build linux/fedora/41/amd64/clang
|
||||||
|
|
||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
# Python Module
|
# Python Module
|
||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
export CFLAGS="-Wall -Werror"
|
||||||
|
export CXXFLAGS="-Wall -Werror"
|
||||||
cmake -GNinja -Bbuild -DCMAKE_BUILD_TYPE=Release -DLIBICSNEO_BUILD_EXAMPLES=ON \
|
cmake -GNinja -Bbuild -DCMAKE_BUILD_TYPE=Release -DLIBICSNEO_BUILD_EXAMPLES=ON \
|
||||||
-DLIBICSNEO_BUILD_UNIT_TESTS=ON -DLIBICSNEO_ENABLE_TCP=OFF || exit 1
|
-DLIBICSNEO_BUILD_UNIT_TESTS=ON -DLIBICSNEO_ENABLE_TCP=OFF || exit 1
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,8 +4,8 @@ mkdir build
|
||||||
|
|
||||||
REM build
|
REM build
|
||||||
cd build
|
cd build
|
||||||
set CFLAGS=/WX
|
set CFLAGS=/WX /W4 /wd4127
|
||||||
set CXXFLAGS=/WX
|
set CXXFLAGS=/WX /W4 /wd4127
|
||||||
cmake -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DLIBICSNEO_BUILD_UNIT_TESTS=ON -DLIBICSNEO_ENABLE_TCP=ON ..
|
cmake -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DLIBICSNEO_BUILD_UNIT_TESTS=ON -DLIBICSNEO_ENABLE_TCP=ON ..
|
||||||
if %errorlevel% neq 0 exit /b %errorlevel%
|
if %errorlevel% neq 0 exit /b %errorlevel%
|
||||||
cmake --build .
|
cmake --build .
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@
|
||||||
* Author: BJones
|
* Author: BJones
|
||||||
*/
|
*/
|
||||||
#include "icsneo/communication/crc32.h"
|
#include "icsneo/communication/crc32.h"
|
||||||
|
#include <stddef.h>
|
||||||
|
|
||||||
static const unsigned long crc32_table[256] = { 0x00000000, 0x77073096, 0xEE0E612C, 0x990951BA, 0x076DC419, 0x706AF48F, 0xE963A535,
|
static const unsigned long crc32_table[256] = { 0x00000000, 0x77073096, 0xEE0E612C, 0x990951BA, 0x076DC419, 0x706AF48F, 0xE963A535,
|
||||||
0x9E6495A3, 0x0EDB8832, 0x79DCB8A4, 0xE0D5E91E, 0x97D2D988, 0x09B64C2B, 0x7EB17CBD, 0xE7B82D07, 0x90BF1D91, 0x1DB71064, 0x6AB020F2,
|
0x9E6495A3, 0x0EDB8832, 0x79DCB8A4, 0xE0D5E91E, 0x97D2D988, 0x09B64C2B, 0x7EB17CBD, 0xE7B82D07, 0x90BF1D91, 0x1DB71064, 0x6AB020F2,
|
||||||
|
|
@ -49,10 +50,10 @@ static unsigned char rev_crc32_table[256];
|
||||||
|
|
||||||
static void revgen(void)
|
static void revgen(void)
|
||||||
{
|
{
|
||||||
unsigned char k;
|
size_t k;
|
||||||
|
|
||||||
for (k = 0; k < 256; k++)
|
for (k = 0; k < 256; k++)
|
||||||
rev_crc32_table[crc32_table[k] >> 24] = k;
|
rev_crc32_table[crc32_table[k] >> 24] = (uint8_t)k;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t revcrc32(uint32_t crc, const unsigned char* buf, uint32_t len)
|
uint32_t revcrc32(uint32_t crc, const unsigned char* buf, uint32_t len)
|
||||||
|
|
|
||||||
|
|
@ -7,8 +7,7 @@
|
||||||
using namespace icsneo;
|
using namespace icsneo;
|
||||||
|
|
||||||
std::vector<uint8_t> FlexRayControlMessage::BuildBaseControlArgs(uint8_t controller, FlexRay::Opcode op, const std::vector<uint8_t>& args) {
|
std::vector<uint8_t> FlexRayControlMessage::BuildBaseControlArgs(uint8_t controller, FlexRay::Opcode op, const std::vector<uint8_t>& args) {
|
||||||
std::vector<uint8_t> ret;
|
std::vector<uint8_t> ret(args.size() + 4);
|
||||||
ret.reserve(args.size() + 4);
|
|
||||||
ret.push_back(controller);
|
ret.push_back(controller);
|
||||||
const uint16_t size = uint16_t((std::min)(args.size() + 1, size_t(std::numeric_limits<uint16_t>::max()))); // Add 1 for the opcode
|
const uint16_t size = uint16_t((std::min)(args.size() + 1, size_t(std::numeric_limits<uint16_t>::max()))); // Add 1 for the opcode
|
||||||
ret.push_back(uint8_t(size));
|
ret.push_back(uint8_t(size));
|
||||||
|
|
|
||||||
|
|
@ -170,7 +170,6 @@ typedef union _MACSecSa
|
||||||
uint8_t byte[MACSEC_SETTINGS_SA_SIZE];
|
uint8_t byte[MACSEC_SETTINGS_SA_SIZE];
|
||||||
} MACSecSa_t;
|
} MACSecSa_t;
|
||||||
/* MACsec Flags */
|
/* MACsec Flags */
|
||||||
static constexpr int MACSEC_SETTINGS_FLAGS_SIZE = 4;
|
|
||||||
typedef union _MACSecFlags
|
typedef union _MACSecFlags
|
||||||
{
|
{
|
||||||
struct
|
struct
|
||||||
|
|
@ -180,6 +179,7 @@ typedef union _MACSecFlags
|
||||||
};
|
};
|
||||||
uint32_t flags_32b;
|
uint32_t flags_32b;
|
||||||
} MACSecFlags_t;
|
} MACSecFlags_t;
|
||||||
|
#define MACSEC_SETTINGS_FLAGS_SIZE (4)
|
||||||
/* MACSec Settings for 1 port/phy */
|
/* MACSec Settings for 1 port/phy */
|
||||||
typedef struct MACSEC_CONFIG_t
|
typedef struct MACSEC_CONFIG_t
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -75,13 +75,15 @@ neomessage_t icsneo::CreateNeoMessage(const std::shared_ptr<Message> message) {
|
||||||
lin.length = 1;
|
lin.length = 1;
|
||||||
|
|
||||||
lin.linStatus = {
|
lin.linStatus = {
|
||||||
linmsg->statusFlags.TxChecksumEnhanced,
|
linmsg->statusFlags.TxChecksumEnhanced, // .txChecksumEnhanced
|
||||||
linmsg->statusFlags.TxCommander,
|
linmsg->statusFlags.TxCommander, // .txCommander
|
||||||
linmsg->statusFlags.TxResponder,
|
linmsg->statusFlags.TxResponder, // .txResponder
|
||||||
linmsg->statusFlags.UpdateResponderOnce,
|
0, // .txAborted
|
||||||
linmsg->statusFlags.HasUpdatedResponderOnce,
|
linmsg->statusFlags.UpdateResponderOnce, // .updateResponderOnce
|
||||||
linmsg->statusFlags.BusRecovered,
|
linmsg->statusFlags.HasUpdatedResponderOnce, // .hasUpdatedResponderOnce
|
||||||
linmsg->statusFlags.BreakOnly
|
linmsg->statusFlags.BusRecovered, // .busRecovered
|
||||||
|
linmsg->statusFlags.BreakOnly // .breakOnly
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
lin.status.linJustBreakSync = linmsg->errFlags.ErrRxBreakSyncOnly;
|
lin.status.linJustBreakSync = linmsg->errFlags.ErrRxBreakSyncOnly;
|
||||||
|
|
|
||||||
|
|
@ -128,7 +128,7 @@ void printAPIEvents() {
|
||||||
void printDeviceEvents(neodevice_t* device) {
|
void printDeviceEvents(neodevice_t* device) {
|
||||||
neoevent_t events[99];
|
neoevent_t events[99];
|
||||||
size_t eventCount = 99;
|
size_t eventCount = 99;
|
||||||
if(icsneo_getDeviceEvents(selectedDevice, events, &eventCount)) {
|
if(icsneo_getDeviceEvents(device, events, &eventCount)) {
|
||||||
if(eventCount == 1) {
|
if(eventCount == 1) {
|
||||||
printf("1 device event found!\n");
|
printf("1 device event found!\n");
|
||||||
printf("Event 0x%x: %s\n", events[0].eventNumber, events[0].description);
|
printf("Event 0x%x: %s\n", events[0].eventNumber, events[0].description);
|
||||||
|
|
@ -160,7 +160,7 @@ char getCharInput(int numArgs, ...) {
|
||||||
|
|
||||||
char* list = (char*) calloc(numArgs, sizeof(char));
|
char* list = (char*) calloc(numArgs, sizeof(char));
|
||||||
for(int i = 0; i < numArgs; ++i) {
|
for(int i = 0; i < numArgs; ++i) {
|
||||||
*(list + i) = va_arg(vaList, int);
|
*(list + i) = (char)va_arg(vaList, int);
|
||||||
}
|
}
|
||||||
|
|
||||||
va_end(vaList);
|
va_end(vaList);
|
||||||
|
|
@ -285,10 +285,10 @@ int main() {
|
||||||
printf("Would you like to open or close %s?\n", productDescription);
|
printf("Would you like to open or close %s?\n", productDescription);
|
||||||
printf("[1] Open\n[2] Close\n[3] Cancel\n\n");
|
printf("[1] Open\n[2] Close\n[3] Cancel\n\n");
|
||||||
|
|
||||||
char input = getCharInput(3, '1', '2', '3');
|
char userSelection = getCharInput(3, '1', '2', '3');
|
||||||
printf("\n");
|
printf("\n");
|
||||||
|
|
||||||
switch(input) {
|
switch(userSelection) {
|
||||||
case '1':
|
case '1':
|
||||||
// Attempt to open the selected device
|
// Attempt to open the selected device
|
||||||
if(icsneo_openDevice(selectedDevice)) {
|
if(icsneo_openDevice(selectedDevice)) {
|
||||||
|
|
@ -346,10 +346,10 @@ int main() {
|
||||||
printf("Would you like to have %s go online or offline?\n", productDescription);
|
printf("Would you like to have %s go online or offline?\n", productDescription);
|
||||||
printf("[1] Online\n[2] Offline\n[3] Cancel\n\n");
|
printf("[1] Online\n[2] Offline\n[3] Cancel\n\n");
|
||||||
|
|
||||||
char input = getCharInput(3, '1', '2', '3');
|
char userSelection = getCharInput(3, '1', '2', '3');
|
||||||
printf("\n");
|
printf("\n");
|
||||||
|
|
||||||
switch(input) {
|
switch(userSelection) {
|
||||||
case '1':
|
case '1':
|
||||||
// Attempt to go online
|
// Attempt to go online
|
||||||
if(icsneo_goOnline(selectedDevice)) {
|
if(icsneo_goOnline(selectedDevice)) {
|
||||||
|
|
@ -394,10 +394,10 @@ int main() {
|
||||||
printf("Would you like to enable or disable message polling for %s?\n", productDescription);
|
printf("Would you like to enable or disable message polling for %s?\n", productDescription);
|
||||||
printf("[1] Enable\n[2] Disable\n[3] Cancel\n\n");
|
printf("[1] Enable\n[2] Disable\n[3] Cancel\n\n");
|
||||||
|
|
||||||
char input = getCharInput(3, '1', '2', '3');
|
char userSelection = getCharInput(3, '1', '2', '3');
|
||||||
printf("\n");
|
printf("\n");
|
||||||
|
|
||||||
switch(input) {
|
switch(userSelection) {
|
||||||
case '1':
|
case '1':
|
||||||
// Attempt to enable message polling
|
// Attempt to enable message polling
|
||||||
if(icsneo_enableMessagePolling(selectedDevice)) {
|
if(icsneo_enableMessagePolling(selectedDevice)) {
|
||||||
|
|
@ -481,8 +481,8 @@ int main() {
|
||||||
case ICSNEO_NETWORK_TYPE_CAN: {
|
case ICSNEO_NETWORK_TYPE_CAN: {
|
||||||
neomessage_can_t* canMsg = (neomessage_can_t*)frame;
|
neomessage_can_t* canMsg = (neomessage_can_t*)frame;
|
||||||
printf("\t0x%03x [%zu] ", canMsg->arbid, canMsg->length);
|
printf("\t0x%03x [%zu] ", canMsg->arbid, canMsg->length);
|
||||||
for(size_t i = 0; i < canMsg->length; i++) {
|
for(size_t j = 0; j < canMsg->length; j++) {
|
||||||
printf("%02x ", canMsg->data[i]);
|
printf("%02x ", canMsg->data[j]);
|
||||||
}
|
}
|
||||||
if(canMsg->status.transmitMessage)
|
if(canMsg->status.transmitMessage)
|
||||||
printf("TX%s %04x ", canMsg->status.globalError ? " ERR" : "", canMsg->description);
|
printf("TX%s %04x ", canMsg->status.globalError ? " ERR" : "", canMsg->description);
|
||||||
|
|
@ -502,11 +502,11 @@ int main() {
|
||||||
printf("LIN 2 | ID: 0x%02x [%zu] ", linMsg->header[0], dataLen);
|
printf("LIN 2 | ID: 0x%02x [%zu] ", linMsg->header[0], dataLen);
|
||||||
}
|
}
|
||||||
|
|
||||||
for(size_t i = 0; i < dataLen; ++i) {
|
for(size_t j = 0; j < dataLen; ++j) {
|
||||||
if (i < 2) {
|
if (j < 2) {
|
||||||
printf("%02x ", linMsg->header[i+1]);
|
printf("%02x ", linMsg->header[j+1]);
|
||||||
} else {
|
} else {
|
||||||
printf("%02x ", linMsg->data[i-2]);
|
printf("%02x ", linMsg->data[j-2]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(numberBytesData > 0)
|
if(numberBytesData > 0)
|
||||||
|
|
@ -725,7 +725,7 @@ int main() {
|
||||||
}
|
}
|
||||||
|
|
||||||
const bool set = selection2 == '1';
|
const bool set = selection2 == '1';
|
||||||
neoio_t type;
|
neoio_t type = ICSNEO_IO_ETH_ACTIVATION;
|
||||||
switch (selection)
|
switch (selection)
|
||||||
{
|
{
|
||||||
case '1': type = ICSNEO_IO_ETH_ACTIVATION; break;
|
case '1': type = ICSNEO_IO_ETH_ACTIVATION; break;
|
||||||
|
|
|
||||||
|
|
@ -123,7 +123,7 @@ void printAPIEvents() {
|
||||||
void printDeviceEvents(neodevice_t* device) {
|
void printDeviceEvents(neodevice_t* device) {
|
||||||
neoevent_t events[99];
|
neoevent_t events[99];
|
||||||
size_t eventCount = 99;
|
size_t eventCount = 99;
|
||||||
if(icsneo_getDeviceEvents(selectedDevice, events, &eventCount)) {
|
if(icsneo_getDeviceEvents(device, events, &eventCount)) {
|
||||||
if(eventCount == 1) {
|
if(eventCount == 1) {
|
||||||
printf("1 device event found!\n");
|
printf("1 device event found!\n");
|
||||||
printf("Event 0x%x: %s\n", events[0].eventNumber, events[0].description);
|
printf("Event 0x%x: %s\n", events[0].eventNumber, events[0].description);
|
||||||
|
|
@ -155,7 +155,7 @@ char getCharInput(int numArgs, ...) {
|
||||||
|
|
||||||
char* list = (char*) calloc(numArgs, sizeof(char));
|
char* list = (char*) calloc(numArgs, sizeof(char));
|
||||||
for(int i = 0; i < numArgs; ++i) {
|
for(int i = 0; i < numArgs; ++i) {
|
||||||
*(list + i) = va_arg(vaList, int);
|
*(list + i) = (char)va_arg(vaList, int);
|
||||||
}
|
}
|
||||||
|
|
||||||
va_end(vaList);
|
va_end(vaList);
|
||||||
|
|
@ -335,8 +335,8 @@ int main() {
|
||||||
case ICSNEO_NETWORK_TYPE_CAN: {
|
case ICSNEO_NETWORK_TYPE_CAN: {
|
||||||
neomessage_can_t* canMsg = (neomessage_can_t*)frame;
|
neomessage_can_t* canMsg = (neomessage_can_t*)frame;
|
||||||
printf("\t0x%03x [%zu] ", canMsg->arbid, canMsg->length);
|
printf("\t0x%03x [%zu] ", canMsg->arbid, canMsg->length);
|
||||||
for(size_t i = 0; i < canMsg->length; i++) {
|
for(size_t j = 0; i < canMsg->length; j++) {
|
||||||
printf("%02x ", canMsg->data[i]);
|
printf("%02x ", canMsg->data[j]);
|
||||||
}
|
}
|
||||||
if(canMsg->status.transmitMessage)
|
if(canMsg->status.transmitMessage)
|
||||||
printf("TX%s %04x ", canMsg->status.globalError ? " ERR" : "", canMsg->description);
|
printf("TX%s %04x ", canMsg->status.globalError ? " ERR" : "", canMsg->description);
|
||||||
|
|
@ -347,8 +347,6 @@ int main() {
|
||||||
neomessage_lin_t* linMsg = (neomessage_lin_t*)frame;
|
neomessage_lin_t* linMsg = (neomessage_lin_t*)frame;
|
||||||
size_t frameLen = linMsg->length;
|
size_t frameLen = linMsg->length;
|
||||||
size_t dataLen = (frameLen > 2) ? (frameLen - 2) : 0;
|
size_t dataLen = (frameLen > 2) ? (frameLen - 2) : 0;
|
||||||
size_t numberBytesHeader = (dataLen > 1) ? 3 : 1;
|
|
||||||
size_t numberBytesData = frameLen - numberBytesHeader;
|
|
||||||
if(linMsg->netid == ICSNEO_NETID_LIN) {
|
if(linMsg->netid == ICSNEO_NETID_LIN) {
|
||||||
printf("LIN 1 | ID: 0x%02x [%zu] ", linMsg->header[0], dataLen);
|
printf("LIN 1 | ID: 0x%02x [%zu] ", linMsg->header[0], dataLen);
|
||||||
}
|
}
|
||||||
|
|
@ -356,11 +354,11 @@ int main() {
|
||||||
printf("LIN 2 | ID: 0x%02x [%zu] ", linMsg->header[0], dataLen);
|
printf("LIN 2 | ID: 0x%02x [%zu] ", linMsg->header[0], dataLen);
|
||||||
}
|
}
|
||||||
|
|
||||||
for(size_t i = 0; i < dataLen; ++i) {
|
for(size_t j = 0; j < dataLen; ++j) {
|
||||||
if (i < 2) {
|
if (j < 2) {
|
||||||
printf("%02x ", linMsg->header[i+1]);
|
printf("%02x ", linMsg->header[j+1]);
|
||||||
} else {
|
} else {
|
||||||
printf("%02x ", linMsg->data[i-2]);
|
printf("%02x ", linMsg->data[j-2]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
printf("| Checksum: 0x%02x\n", linMsg->checksum);
|
printf("| Checksum: 0x%02x\n", linMsg->checksum);
|
||||||
|
|
|
||||||
|
|
@ -212,7 +212,7 @@ public:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static const uint8_t tdmModeToChannelNum(TDMMode mode) {
|
static uint8_t tdmModeToChannelNum(TDMMode mode) {
|
||||||
|
|
||||||
switch(mode) {
|
switch(mode) {
|
||||||
case TDMMode::TDM2:
|
case TDMMode::TDM2:
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,7 @@ extern void DLLExport icsneo_findAllDevices(neodevice_t* devices, size_t* count)
|
||||||
*
|
*
|
||||||
* See icsneo_findAllDevices() for information regarding the neodevice_t validity contract.
|
* See icsneo_findAllDevices() for information regarding the neodevice_t validity contract.
|
||||||
*/
|
*/
|
||||||
extern void DLLExport icsneo_freeUnconnectedDevices();
|
extern void DLLExport icsneo_freeUnconnectedDevices(void);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Convert a serial number in numerical format to its string representation.
|
* \brief Convert a serial number in numerical format to its string representation.
|
||||||
|
|
|
||||||
|
|
@ -173,7 +173,7 @@ void CDCACM::readTask() {
|
||||||
EventManager::GetInstance().downgradeErrorsOnCurrentThread();
|
EventManager::GetInstance().downgradeErrorsOnCurrentThread();
|
||||||
while(!isClosing() && !isDisconnected()) {
|
while(!isClosing() && !isDisconnected()) {
|
||||||
fd_set rfds = {0};
|
fd_set rfds = {0};
|
||||||
struct timeval tv = {0};
|
struct timeval tv = {};
|
||||||
FD_SET(fd, &rfds);
|
FD_SET(fd, &rfds);
|
||||||
tv.tv_usec = 50000; // 50ms
|
tv.tv_usec = 50000; // 50ms
|
||||||
::select(fd + 1, &rfds, NULL, NULL, &tv);
|
::select(fd + 1, &rfds, NULL, NULL, &tv);
|
||||||
|
|
@ -224,7 +224,7 @@ void CDCACM::writeTask() {
|
||||||
if(errno == EAGAIN || errno == EWOULDBLOCK || errno == EINTR) {
|
if(errno == EAGAIN || errno == EWOULDBLOCK || errno == EINTR) {
|
||||||
// We filled the TX FIFO, use select to wait for it to become available again
|
// We filled the TX FIFO, use select to wait for it to become available again
|
||||||
fd_set wfds = {0};
|
fd_set wfds = {0};
|
||||||
struct timeval tv = {0};
|
struct timeval tv = {};
|
||||||
FD_SET(fd, &wfds);
|
FD_SET(fd, &wfds);
|
||||||
tv.tv_usec = 50000; // 50ms
|
tv.tv_usec = 50000; // 50ms
|
||||||
::select(fd + 1, nullptr, &wfds, nullptr, &tv);
|
::select(fd + 1, nullptr, &wfds, nullptr, &tv);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue