mirror of
https://github.com/intrepidcs/icsscand.git
synced 2026-09-21 16:48:21 +02:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c506f274c2 | ||
|
|
8cc37c9df0 | ||
|
|
028538cc90 | ||
|
|
8d21b98ac6 | ||
|
|
f254ee2515 | ||
|
|
e83021258f | ||
|
|
a69c41c9d5 |
@@ -1,3 +1,11 @@
|
||||
v2.0.3
|
||||
Update copyright date
|
||||
Update to libicsneo v0.2.0
|
||||
Ensure lock is held when accessing open devices
|
||||
|
||||
v2.0.2
|
||||
Use libicsneo v0.1.2 to resolve LEDs not indicating device status
|
||||
|
||||
v2.0.1
|
||||
Set timeout tv_sec instead of tv_usec for compatibility with older kernels
|
||||
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
cmake_minimum_required(VERSION 3.2)
|
||||
project(libicsneo-socketcan-daemon VERSION 2.0.1)
|
||||
project(libicsneo-socketcan-daemon VERSION 2.0.3)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 11)
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Copyright (c) 2016-2019 Intrepid Control Systems, Inc.
|
||||
Copyright (c) 2016-2020 Intrepid Control Systems, Inc.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
Version 2.0.1
|
||||
Version 2.0.3
|
||||
|
||||
This is the usermode daemon for the Intrepid Control Systems SocketCAN support. This daemon requires that ```intrepid.ko``` is loaded on your system.
|
||||
|
||||
1. Build and load the kernel module follwowing the instructions in [intrepid-socketcan-kernel-module](https://github.com/intrepidcs/intrepid-socketcan-kernel-module).
|
||||
|
||||
2. Install the dependencies needed. These are CMake 3.2+, GCC 4.8+, git, and libusb-1.0-0-dev.
|
||||
2. Install the dependencies needed. These are CMake 3.2+, GCC 4.8+, git, libusb-1.0-0-dev, and libpcap.
|
||||
|
||||
On Ubuntu or other Debian-based systems, run `sudo apt install git cmake gcc libusb-1.0-0-dev build-essential`.
|
||||
On Ubuntu or other Debian-based systems, run `sudo apt install git cmake gcc libusb-1.0-0-dev libpcap-dev build-essential`.
|
||||
|
||||
3. Clone this repository recursively by running `git clone --recursive https://github.com/intrepidcs/icsscand.git`
|
||||
|
||||
4. Switch into the cloned directory, `cd icsscand`
|
||||
|
||||
5. Make a build directory and switch into it, `mkdir -p build && cd build`
|
||||
5. Make a build directory and switch into it, `mkdir build && cd build`
|
||||
|
||||
6. Invoke CMake, `cmake .. -DCMAKE_BUILD_TYPE=Release`
|
||||
|
||||
|
||||
+6
-5
@@ -187,7 +187,7 @@ void header() {
|
||||
|
||||
void usage(std::string executableName) {
|
||||
std::cerr << "The libicsneo SocketCAN Usermode Daemon\n";
|
||||
std::cerr << "Copyright Intrepid Control Systems, Inc. 2019\n\n";
|
||||
std::cerr << "Copyright 2019-2020 Intrepid Control Systems, Inc.\n\n";
|
||||
std::cerr << "Usage: " << executableName << " [option]\n\n";
|
||||
std::cerr << "Options:\n";
|
||||
std::cerr << "\t-d, --daemon\t\tRun as a daemon in the background\n";
|
||||
@@ -223,9 +223,8 @@ void searchForDevices() {
|
||||
});
|
||||
if(!newDevice.device->open() || !newDevice.device->goOnline()) {
|
||||
if(firstTimeFailedToOpen) {
|
||||
icsneo::APIError err;
|
||||
icsneo::GetLastError(err);
|
||||
LOGF(LOG_INFO, "%s failed to connect. Will keep trying...\n%s\n", newDevice.device->describe().c_str(), err.describe().c_str());
|
||||
const std::string err = icsneo::GetLastError().describe();
|
||||
LOGF(LOG_INFO, "%s failed to connect. Will keep trying...\n%s\n", newDevice.device->describe().c_str(), err.c_str());
|
||||
failedToOpen.push_back(serial);
|
||||
}
|
||||
continue;
|
||||
@@ -275,6 +274,7 @@ void searchForDevices() {
|
||||
return;
|
||||
auto canMessage = std::static_pointer_cast<icsneo::CANMessage>(message);
|
||||
const OpenDevice* openDevice = nullptr;
|
||||
std::lock_guard<std::mutex> lg(openDevicesMutex);
|
||||
for(const auto& dev : openDevices) {
|
||||
if(dev.device->getSerial() == serial) {
|
||||
openDevice = &dev;
|
||||
@@ -320,7 +320,7 @@ void searchForDevices() {
|
||||
openDevices.end()
|
||||
);
|
||||
|
||||
for(const auto& err : icsneo::GetErrors()) {
|
||||
for(const auto& err : icsneo::GetEvents()) {
|
||||
bool forErrorDevice = false;
|
||||
for(const auto& dev : failedToOpen) {
|
||||
if(err.isForDevice(dev)) {
|
||||
@@ -482,6 +482,7 @@ int main(int argc, char** argv) {
|
||||
msg->data = currentPosition;
|
||||
currentPosition += msg->length;
|
||||
bool sent = false;
|
||||
std::lock_guard<std::mutex> lg(openDevicesMutex);
|
||||
for(auto& dev : openDevices) {
|
||||
for(auto& netifPair : dev.interfaces) {
|
||||
if(netifPair.second->getKernelHandle() != msg->netid)
|
||||
|
||||
Vendored
+1
-1
Submodule third-party/libicsneo updated: 0b4ffdbaad...b09f85693f
Reference in New Issue
Block a user