Commit Graph

191 Commits (776d14bb3e5b59eae4e6d22e9ad7a647a2e7885f)

Author SHA1 Message Date
Paul Hollinsky f8a46b7196 Device: Add logical disk size accessor 2022-02-28 01:49:50 -05:00
Paul Hollinsky f8bfb243fa Disk: Implement NeoMemoryDiskReadDriver 2022-02-25 01:14:57 -05:00
Paul Hollinsky 6cc0f08e2b Settings: The device can report when defaults were applied 2022-02-24 15:50:39 -05:00
Paul Hollinsky f37669139f MSVC: Resolve warnings 2022-02-21 21:36:20 -05:00
Paul Hollinsky c620b2ee8b MSVC: Resolve warnings 2022-02-21 21:16:15 -05:00
Paul Hollinsky 0ded5508c1 Windows: Fix build issues with EthPhyRegPacket 2022-02-14 19:20:50 -05:00
Kyle Johannes 2d1bb381f6 Device: Implement Ethernet PHY MDIO Communication
The following fixups were added during the squash/merge:

Fix formatting in EthPhyMessage and EthPhyRegPacket
Device: Use std::make_shared when creating the EthPHYControl filter
Network: Create NetID String for EthPHYControl
EthPhyRegPacket: Constants in PascalCase
2021-12-08 19:07:07 -05:00
Paul Hollinsky d5087c1ba5 Communication: Remove extra accidentally added logging 2021-12-06 05:41:27 -05:00
Paul Hollinsky f8b5710a6c Communication: Avoid MessageFilter type punning in waitForMessageSync 2021-12-02 15:00:13 -05:00
Paul Hollinsky 2d6004bed1 CANPacket: Remove unused byte from datastream 2021-11-16 20:04:12 -05:00
Paul Hollinsky 574530978c Encoder: Add 1 to host-to-device long format packets
Vehicle Spy 3 does this, it's a long-standing firmware idiosyncrasy.

Due to the way the device handles packets, this didn't cause a loss of
communication, only a "host to device byte" app error under certain
circumstances.
2021-11-16 20:03:41 -05:00
Paul Hollinsky d097fb9a74 CANPacket: Remove unused byte from datastream 2021-11-16 19:48:55 -05:00
Paul Hollinsky 9d5bad94d4 Encoder: Add 1 to host-to-device long format packets
Vehicle Spy 3 does this, it's a long-standing firmware idiosyncrasy.

Due to the way the device handles packets, this didn't cause a loss of
communication, only a "host to device byte" app error under certain
circumstances.
2021-11-16 19:35:20 -05:00
Paul Hollinsky 719dbcefc8 EthernetPacketizer: Coalesce small PC-to-device packets 2021-11-16 18:00:04 -05:00
Paul Hollinsky 0656cb568e EthernetPacketizer: Coalesce small PC-to-device packets 2021-09-23 21:29:15 -04:00
Paul Hollinsky 38f0022bb6 Communication: Support extended commands 2021-09-20 23:07:49 -04:00
Paul Hollinsky 5f44986c1b Merge branch 'master' into v0.3.0-dev 2021-08-22 13:15:54 -04:00
Paul Hollinsky 68715d515d Decoder: Allow older ResetStatus packets without voltage or temperature 2021-08-22 13:12:36 -04:00
Paul Hollinsky e5bf87ba7d Merge branch 'master' into v0.3.0-dev 2021-06-11 18:54:36 -04:00
Paul Hollinsky c888aad5ae VersionPacket: Use C++11 function signature 2021-06-11 18:40:50 -04:00
Paul Hollinsky d4f6c12394 CANPacket: Fix invalid length check
This case is already checked above, and further
was invalid since the length had already been
translated to the numeric (0-64) value.
2021-06-10 15:03:34 -04:00
Paul Hollinsky ed5132e852 CANPacket: Ensure correct padding when padding by the DLC 2021-05-25 22:19:03 -04:00
Paul Hollinsky 76b6ecbf04 CANPacket: Fix invalid length check
This case is already checked above, and further
was invalid since the length had already been
translated to the numeric (0-64) value.
2021-05-25 17:23:41 -04:00
Paul Hollinsky 21bc4eeff2 Message: Create a type system so non-frame data can be represented
This change breaks existing code, hence the version bump, but it's
going to be much less error prone going forward.
2021-05-22 01:58:36 -04:00
Paul Hollinsky 21e93d1f73 CAN: Honor the specified dlcOnWire for transmit 2021-05-21 17:38:00 -04:00
Paul Hollinsky 6f8e073fd1 MultiChannelCommunication: Resolve MSVC constexpr warning 2021-05-10 21:16:21 -04:00
Paul Hollinsky 0006f31844 Network: Mark Main51, OldFormat, and ReadSettings as Internal 2021-05-05 02:18:22 -04:00
Paul Hollinsky 595cc36545 Device: Implement version handling 2021-05-05 02:17:38 -04:00
Paul Hollinsky 72bc5914a6 EthernetPacket: Allow 1 extra byte at the end of the packet
ValueCAN 4-2EL sends an extra byte to pad the message
to an even byte count.
2021-05-04 23:25:36 -04:00
Paul Hollinsky 3d4e0a27e3 Decoder: Pass on short Device messages 2021-04-29 19:07:38 -04:00
Paul Hollinsky 8e2883bca9 MultiChannelCommunication: Use generic handleInput
This way redirection, and any other changes we
make to the packetizer/dispatch flow, apply to
MultiChannelCommunication as well.
2021-04-23 22:34:32 -04:00
Paul Hollinsky f8355df770 Communication: Block destruction while inside redirectionFn 2021-04-23 22:33:32 -04:00
Paul Hollinsky 55ca6adee6 Communication: Allow redirection of reads 2021-04-23 17:00:37 -04:00
Paul Hollinsky bb322ad190 neoVI FIRE 2: MiscIO and EMiscIO Support 2021-04-21 10:40:35 -04:00
Paul Hollinsky 7fdae15aed Network: Update DeviceStatus define to match the standard style 2021-04-07 00:38:49 -04:00
Paul Hollinsky a6c8acd8e9 Ethernet (DoIP) Activation Line support 2021-04-06 22:50:25 -04:00
Paul Hollinsky 18394d0cfb Add transmit support for ISO 9141-2 2021-03-23 17:23:55 -04:00
Paul Hollinsky f63c187ed3 Add receive support for ISO 9141-2 2021-02-18 23:19:33 -05:00
Paul Hollinsky 4d655da69d Decoder: 64-bit shift to avoid UB
Shifting a value by more than the size of its type is UB.

This was actually causing mangled serial numbers with
optimization on using Clang 12 on Linux.
2021-01-29 17:32:07 -05:00
Kyle Schwarz ffbb5e20c5 Add description field for messages
Closes https://github.com/intrepidcs/libicsneo/issues/28
2020-11-13 16:15:04 -05:00
Kyle Schwarz a5b27a15b0 Allow disconnections to be signaled by drivers
This allows for disconnections to be detected quickly
where possible.

It also makes sure other driver errors aren't thrown
in the event of a disconnection.
2020-10-08 17:38:10 -04:00
Paul Hollinsky 7e714abfd1 EthernetPacketizer: Add missing include for GCC 2020-09-23 10:23:05 -04:00
Paul Hollinsky 2c55584962 Ethernet: Encode preemption enabled flag 2020-09-22 19:19:22 -04:00
Paul Hollinsky 1f4358af4b Packetizer: Correct packet length check
AA(1) + Old format(1)  + New Length(2) + New NetID(2) = 6
2020-09-22 19:17:12 -04:00
Paul Hollinsky 28b35a8243 Communication: Create EthernetPacketizer
This code previously was separately maintained in each of the
PCAP driver layers.

While adding complexity for reassembly, I decided it was
time to pull it out into a common implementation.

As of this commit, the old implementations have not been
removed from the PCAP drivers yet.
2020-09-22 19:15:24 -04:00
Kyle Schwarz 3e4b595fe4 Resolve signedness warnings on GCC 2020-08-18 15:37:05 -04:00
Kyle Schwarz 4cd897badd Fix deadlock with Driver::write
Use a spin lock to recheck the queue size until it has room to push.
2020-08-14 16:57:52 -04:00
Kyle Schwarz afda617894 Remove trailing white-space 2020-08-11 13:42:13 -04:00
Paul Hollinsky 07e99515fa Always send the ReadSettings command in short format
This is needed for FIRE
2020-08-10 12:30:30 -04:00
Paul Hollinsky a759c1faa9 Communication: Fix issue where driver failing to open leaves dangling thread 2020-06-24 22:03:31 -04:00
Paul Hollinsky 67bd1e616a MultiChannelCommunication: Fix issue where initial open fails 2020-06-24 21:38:57 -04:00
Paul Hollinsky 8260149cb8 Add bridging between neomessage_eth_t and EthernetMessage
This allows transmitting Ethernet from the C API
2020-05-18 17:23:40 -04:00
Paul Hollinsky 38e24d7641 Refactor ICommunication/Transport => Driver 2020-03-09 14:09:27 -04:00
Paul Hollinsky d8798acaa7 Communication: MultiChannel: Properly mask out communication from non-main VNETs
This also makes it possible for Communication to create more instances of Packetizer
This is necessary because Packetizer is not thread safe,
so when we support more VNETs we will need to create more Packetizers.
2020-03-09 13:56:18 -04:00
Paul Hollinsky 1cd817a16b Fix race conditions with Communication::waitForMessageSync 2020-02-28 20:00:08 -05:00
Jeffrey Quesnelle 98bd7e9c55 add decoding of transmitted, error, and description fields for CAN packets 2020-02-19 09:36:28 -05:00
Paul Hollinsky fe7c50f8a3 Correctly shift received data 2019-11-19 17:07:26 +01:00
Paul Hollinsky 4821a957dd Properly decode incoming FlexRayPackets 2019-11-18 06:09:25 +01:00
Paul Hollinsky 37778d7891 Implement FlexRay transmit, configuration, and cold start 2019-11-12 20:38:47 -05:00
Paul Hollinsky 3396f5dcce Refining the FlexRay API 2019-11-09 15:34:58 -05:00
Paul Hollinsky f0582697a6 Clarify FlexRay Slot ID 2019-11-01 14:48:14 -04:00
Jeffrey Quesnelle 423f854682 fix MSVC build errors and warnings 2019-10-16 23:56:49 -04:00
Paul Hollinsky eb856dffec Quiet down warnings on Windows 2019-10-16 17:43:11 -04:00
Paul Hollinsky 2f9844df92 Begin work on FlexRay support 2019-10-16 16:43:31 -04:00
EricLiu2000 9629864f1b Fixed wait check in device online/offline 2019-08-07 10:06:33 -04:00
EricLiu2000 3358241abe Reordered error downgrading, order of going offline, and renamed locks 2019-08-06 10:32:19 -04:00
EricLiu2000 f9712a4bcd Added error flag when packetizer and multichannelcommunication fail to read 2019-08-01 16:21:29 -04:00
EricLiu2000 f41b5c4a79 Removed cancellation of error downgrading after closing, was causing read access violations. 2019-08-01 14:07:42 -04:00
EricLiu2000 c10224002a Added message callback functionality in c and canceled error downgrading on user callbacks in communication as well 2019-07-30 10:22:27 -04:00
EricLiu2000 54b98ec9b4 Error downgrading now uses a map<threadid, bool>, and error downgrading is canceled during message callbacks 2019-07-29 15:16:35 -04:00
EricLiu2000 66126b2b61 Downgraded non-user thread errors to warnings 2019-07-24 13:22:17 -04:00
Paul Hollinsky 21c3fead4a Error checking for Encoder::encode UpdateLEDState 2019-07-23 15:04:50 -04:00
EricLiu2000 50dba62a89 Event refactor builds on Windows 2019-06-24 17:59:45 -04:00
EricLiu2000 878d9e6dde Implemented threaded error handling in errormanager and fixed compile error 2019-06-21 16:14:52 -04:00
EricLiu2000 a4a42c8704 Reworked updating LEDState to use sendCommand() instead of transmit() 2019-06-14 16:09:19 -04:00
EricLiu2000 44ca4d4db1 Removed extraneous error checking 2019-06-13 16:04:20 -04:00
EricLiu2000 b7288edd9a Finished adding error checking 2019-06-13 16:01:35 -04:00
EricLiu2000 255e1e2b90 Added more error logging 2019-06-13 16:01:35 -04:00
EricLiu2000 dc4f96affb Commands can now only be sent when the device is open 2019-06-13 16:01:35 -04:00
EricLiu2000 519e64fb17 Added error checking to functions called from Communication 2019-06-13 16:01:35 -04:00
EricLiu2000 965679c370 Added error checking and removed some redundancy from device isOpen() 2019-06-13 16:01:35 -04:00
Paul Hollinsky b7dbeccaef Lock before adding or removing message callbacks 2019-06-13 15:47:23 -04:00
Paul Hollinsky 7cf0ec5f4f Rename timestampMultiplier to timestampResolution
We've also decided to leave it out of the message structures since, for most uses going forward, it will not be needed.

Anyone who wants the timestamp resolution can always make the inexpensive device call to get it.
2019-05-06 12:32:04 -04:00
Paul Hollinsky d1cd34fb24 Merge remote-tracking branch 'drebbe-intrepid/master' into timestamp 2019-05-06 12:01:09 -04:00
Paul Hollinsky 6ffc364eba Transmits now block when the buffer fills 2019-05-02 16:33:44 -04:00
Paul Hollinsky 5a6a1c990a Support CAN FD Error State Indicator 2019-04-17 17:03:38 -04:00
Paul Hollinsky 37b83e0506 Automatically pad CAN FD messages out 2019-04-17 16:50:11 -04:00
David Rebbe 23c3cc3763 Implemented legacy icsneoGetTimeStampForMsg() function call.
Signed-off-by: David Rebbe <drebbe@intrepidcs.com>
2019-04-05 19:09:52 -04:00
Paul Hollinsky ae78122cbe Add LSFTCAN and SWCAN support 2019-01-22 13:14:28 -05:00
Paul Hollinsky c94ace87f9 Timestamp information for CAN frames 2019-01-03 17:08:47 -05:00
Paul Hollinsky d37d5bb23e Support Ethernet and Broad-R Reach TX and RX 2018-12-21 20:32:27 -05:00
Paul Hollinsky 07a5dc4118 Allow threads to reopen after closing 2018-11-16 17:08:53 -05:00
Paul Hollinsky 92d98f8bd5 Remove all debugging printouts to stdout 2018-10-30 15:02:01 -04:00
Paul Hollinsky ccd26a3637 Fix a bug where settings were not read properly 2018-10-30 14:24:57 -04:00
Paul Hollinsky 3a42372dcd Add error system 2018-10-26 20:53:30 -04:00
Paul Hollinsky bc91796d15 Proper detection for RTR CAN frames 2018-10-22 18:25:01 -04:00
Paul Hollinsky 911871a1c7 Resolve GCC warning 2018-10-22 15:00:58 -04:00
Paul Hollinsky 8e6b0d0b0e Refactor for a central include directory 2018-10-22 11:52:34 -04:00
Paul Hollinsky 12451def11 Add dlcOnWire to CAN 2018-10-22 11:13:07 -04:00
Paul Hollinsky 0f703f494f CAN FD transmission on non CAN FD hardware now fails as would be expected 2018-10-19 17:00:40 -04:00