Commit Graph

712 Commits (136-add-android-support)

Author SHA1 Message Date
Paul Hollinsky d051d20db6 CI: Add Windows 32-bit 2022-02-22 10:49:49 -05:00
Paul Hollinsky d0d279fdad Windows: Disable unaligned on x86
Closes GH-44
2022-02-22 10:49:49 -05:00
Paul Hollinsky 2c282fe396 Tests: Resolve MSVC x86 warnings 2022-02-22 10:46:30 -05:00
Paul Hollinsky 95de93aa84 Examples: C Interactive: Resolve warnings 2022-02-22 10:46:27 -05:00
Paul Hollinsky 733312628c CI: Also set warnings as errors in C code 2022-02-22 10:37:37 -05:00
Paul Hollinsky b177617940 CI: Add Windows 32-bit 2022-02-22 10:31:46 -05:00
Paul Hollinsky 28d3730375 Windows: Disable unaligned on x86
Closes GH-44
2022-02-22 10:24:13 -05:00
Paul Hollinsky c32d027b2d MessageCallback: Tolerate being created with nullptr filter
Communication does this in waitForMessageSync if a filter
is not passed in.

This fixes a crash in icsneoWaitForRxMessagesWithTimeOut
for the legacy API.

For good measure, creation with an empty std::function will
immediately throw an std::bad_function_call back at the
caller, rather than letting that happen on the callback thread.

I'm also making the members const here so they are provably
always non-null (and not empty, for the function).
2022-02-21 22:55:49 -05:00
Paul Hollinsky ac7b2d5106 FlexRay: Automatically reconfigure for runtime-added message buffers 2022-02-21 21:40:46 -05:00
Paul Hollinsky 4dbb8f3956 FlexRay: Don't set default key slots to continuous
This way they will come out as NULL frames, which is likely
more appropriate for a default.

This only takes effect if you set a key slot, but then don't
configure a message buffer for it.
2022-02-21 21:40:46 -05:00
Paul Hollinsky eace014494 FlexRay: Don't enforce key slot rules on non-keyslots 2022-02-21 21:40:46 -05:00
Paul Hollinsky 159c54b756 Legacy: Updates for the new neomessage_t API 2022-02-21 21:36:20 -05:00
Paul Hollinsky 416996b31d CI: Warnings are errors 2022-02-21 21:36:20 -05:00
Paul Hollinsky f37669139f MSVC: Resolve warnings 2022-02-21 21:36:20 -05:00
Paul Hollinsky 7aedb673fd Legacy: Fix icsneoGetVnetSimpleNetid
The NetID is written to the out* parameter, not returned.
2022-02-21 21:28:31 -05:00
Paul Hollinsky 52c7b5aaca Legacy: Fix icsneoGetNetidforSlaveVNETs
The NetID is written to the out* parameter, not returned.
2022-02-21 21:28:31 -05:00
Paul Hollinsky 0f9bf83c89 Legacy: Formatting 2022-02-21 21:28:31 -05:00
Paul Hollinsky dfd8768bbf Legacy: Correct Ethernet message translation
* Fixes NetIDs over 255
* Fixes data lengths over 255
* Avoids writing unexpected messages to client
2022-02-21 21:28:31 -05:00
Paul Hollinsky 94e0ea1fe0 Legacy: Prevent incorrect access to NetID maps 2022-02-21 21:28:30 -05:00
Paul Hollinsky 58944a2523 Tests: Spaces to Tabs 2022-02-21 21:28:30 -05:00
Paul Hollinsky be666e810d CI: Add Windows 2022-02-21 21:28:30 -05:00
Paul Hollinsky c451fc2b7c CI: Warnings are errors 2022-02-21 21:23:58 -05:00
Paul Hollinsky c620b2ee8b MSVC: Resolve warnings 2022-02-21 21:16:15 -05:00
Paul Hollinsky 111d377d4a Legacy: Fix icsneoGetVnetSimpleNetid
The NetID is written to the out* parameter, not returned.
2022-02-21 21:16:12 -05:00
Paul Hollinsky c3469f5fb6 Legacy: Fix icsneoGetNetidforSlaveVNETs
The NetID is written to the out* parameter, not returned.
2022-02-21 21:16:07 -05:00
Paul Hollinsky 0219eccc94 Legacy: Formatting 2022-02-21 21:14:31 -05:00
Paul Hollinsky e22f70a35a Legacy: Correct Ethernet message translation
* Fixes NetIDs over 255
* Fixes data lengths over 255
* Avoids writing unexpected messages to client
2022-02-21 21:14:31 -05:00
Paul Hollinsky b019c20ad0 Legacy: Prevent incorrect access to NetID maps 2022-02-21 21:14:31 -05:00
Paul Hollinsky 6fa469de5f Tests: Spaces to Tabs 2022-02-21 20:26:57 -05:00
Paul Hollinsky be219288dc CI: Add Windows 2022-02-21 20:13:28 -05:00
Paul Hollinsky d35653e3d0 Windows: PCAP: Fix WinPCAP loading
Used when LIBICSNEO_NPCAP_INCLUDE_DIR is not defined
2022-02-14 19:37:41 -05:00
Paul Hollinsky 0ce7326b83 Windows: PCAP: Fix a race which could cause transmit delays
If you had a chain of packets being sent all at once, the latter
section of packets could be delayed, theoretically infinitely.

If queue1 was filled and enqueued for transmit, then queue2
had packets enqueued in it while queue1 was still transmitting,
we'd try to fill queue2 further rather than waiting for queue1's
transmit to finish.

However, in that case, we wouldn't check if we could transmit
queue2 again until the next packet. If the user application
was waiting for the response from something in queue2
before pushing more packets, it could hang indefinitely.

This also fixes a subtle bug where hitting the "not safe to try
to fit any more packets in this queue" limit would cause a
packet to drop, as it would be dequeued and then tossed.

Closes GH-42
2022-02-14 19:37:41 -05:00
Paul Hollinsky 44e48182bf Device: Don't try to deduce lock_guard template parameters
This improves compatibility with older C++ standards
2022-02-14 19:32:12 -05:00
Paul Hollinsky 4fd65d85c8 Windows: PCAP: Fix WinPCAP loading
Used when LIBICSNEO_NPCAP_INCLUDE_DIR is not defined
2022-02-14 19:24:46 -05:00
Paul Hollinsky 0ded5508c1 Windows: Fix build issues with EthPhyRegPacket 2022-02-14 19:20:50 -05:00
Paul Hollinsky 6d92b7a03a Windows: PCAP: Fix a race which could cause transmit delays
If you had a chain of packets being sent all at once, the latter
section of packets could be delayed, theoretically infinitely.

If queue1 was filled and enqueued for transmit, then queue2
had packets enqueued in it while queue1 was still transmitting,
we'd try to fill queue2 further rather than waiting for queue1's
transmit to finish.

However, in that case, we wouldn't check if we could transmit
queue2 again until the next packet. If the user application
was waiting for the response from something in queue2
before pushing more packets, it could hang indefinitely.

This also fixes a subtle bug where hitting the "not safe to try
to fit any more packets in this queue" limit would cause a
packet to drop, as it would be dequeued and then tossed.

Closes GH-42
2022-02-04 01:14:08 -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 890eb1e1bc RAD-Galaxy: Update settings structure with new entries 2021-12-08 14:30:54 -05:00
Paul Hollinsky 96f18dcfd6 PCAP: Don't use pthread_cancel on Linux
It is not necessary and can cause a crash in libunwind
2021-12-08 14:30:02 -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 78747aa899 CMake: Set CXX_STANDARD to C++11 if not set elsewhere
We need at least C++11.

If we're statically compiling into an application, we want to be using the same
CXX_STANDARD as it for ABI compatibility (particularly with icsneo::optional),
hence having the check around it.
2021-11-16 20:04:12 -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 988289afc1 ValueCAN 4 Industrial: Disable 16-bit alignment over Ethernet
This is a continuation of a1a544045b
2021-11-16 20:03:02 -05:00
Paul Hollinsky 714db03a05 CMake: Set CXX_STANDARD to C++11 if not set elsewhere
We need at least C++11.

If we're statically compiling into an application, we want to be using the same
CXX_STANDARD as it for ABI compatibility (particularly with icsneo::optional),
hence having the check around it.
2021-11-16 19:49:08 -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 181223375a ValueCAN 4 Industrial: Disable 16-bit alignment over Ethernet
This is a continuation of a1a544045b
2021-11-16 19:27:38 -05:00
Paul Hollinsky 51626b9e63 POSIX: PCAP: Use EthernetPacketizer 2021-11-16 18:00:04 -05:00