-
Notifications
You must be signed in to change notification settings - Fork 657
Release 3.3.4 #887
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Release 3.3.4 #887
Changes from 11 commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
cdf1e5a
Start 3.3.4 release notes
hardbyte ea142fd
Fix SocketCAN periodic Tasks on Python 2 (#850)
karlding ed58372
Update configuration.rst (#879)
johanbrus 0c34e50
Fix RecursionError in Message.__getattr__
karlding 23cf849
fix issue 787
zhupumpkin 9682d6a
Update changelog and bump to alpha version
hardbyte 0988fba
Revert change of Message extended id default behaviour.
hardbyte 2545141
Upgrade version of pytest
hardbyte b47ca2f
Tag version 3.3.4-beta.0
hardbyte 5c7810f
Change ascii conversion to be compatible with Python2.7 in ixxat back…
hardbyte bdf46cd
Version 3.3.4
hardbyte d271323
Fix iteration in Bus.stop_all_periodic_tasks (#901)
karlding 57b1a34
Update CHANGELOG.txt
hardbyte 9452b54
Backport Neovi features for release 3.3.4 (#903)
pierreluctg 551cc94
Update CHANGELOG.txt
pierreluctg 453a4b7
vector: Skip channels without CAN support
karlding ff9e77e
Merge pull request #916 from karlding/backport_vector_canfd_discovery
mergify[bot] 14c0162
Update CHANGELOG.txt
zariiii9003 d3ee328
Remove usused import from setup.py
hardbyte faed6e9
Merge branch 'master' into release-3.3.4
mergify[bot] File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,7 +8,7 @@ | |
|
|
||
| import logging | ||
|
|
||
| __version__ = "3.3.3" | ||
| __version__ = "3.3.4" | ||
|
|
||
| log = logging.getLogger('can') | ||
|
|
||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,176 @@ | ||
| """ | ||
| This module tests multiple message cyclic send tasks. | ||
| """ | ||
| import unittest | ||
|
|
||
| import time | ||
| import can | ||
|
|
||
| from .config import TEST_INTERFACE_SOCKETCAN | ||
|
|
||
|
|
||
| @unittest.skipUnless(TEST_INTERFACE_SOCKETCAN, "skip testing of socketcan") | ||
| class CyclicSocketCan(unittest.TestCase): | ||
| BITRATE = 500000 | ||
| TIMEOUT = 0.1 | ||
|
|
||
| INTERFACE_1 = "socketcan" | ||
| CHANNEL_1 = "vcan0" | ||
| INTERFACE_2 = "socketcan" | ||
| CHANNEL_2 = "vcan0" | ||
|
|
||
| PERIOD = 1.0 | ||
|
|
||
| DELTA = 0.01 | ||
|
|
||
| def _find_start_index(self, tx_messages, message): | ||
| """ | ||
| :param tx_messages: | ||
| The list of messages that were passed to the periodic backend | ||
| :param message: | ||
| The message whose data we wish to match and align to | ||
|
|
||
| :returns: start index in the tx_messages | ||
| """ | ||
| start_index = -1 | ||
| for index, tx_message in enumerate(tx_messages): | ||
| if tx_message.data == message.data: | ||
| start_index = index | ||
| break | ||
| return start_index | ||
|
|
||
| def setUp(self): | ||
| self._send_bus = can.Bus( | ||
| interface=self.INTERFACE_1, channel=self.CHANNEL_1, bitrate=self.BITRATE | ||
| ) | ||
| self._recv_bus = can.Bus( | ||
| interface=self.INTERFACE_2, channel=self.CHANNEL_2, bitrate=self.BITRATE | ||
| ) | ||
|
|
||
| def tearDown(self): | ||
| self._send_bus.shutdown() | ||
| self._recv_bus.shutdown() | ||
|
|
||
| def test_cyclic_initializer_message(self): | ||
| message = can.Message( | ||
| arbitration_id=0x401, | ||
| data=[0x11, 0x11, 0x11, 0x11, 0x11, 0x11], | ||
| is_extended_id=False, | ||
| ) | ||
|
|
||
| task = self._send_bus.send_periodic(message, self.PERIOD) | ||
| self.assertIsInstance(task, can.broadcastmanager.CyclicSendTaskABC) | ||
|
|
||
| # Take advantage of kernel's queueing mechanisms | ||
| time.sleep(4 * self.PERIOD) | ||
| task.stop() | ||
|
|
||
| for _ in range(4): | ||
| tx_message = message | ||
| rx_message = self._recv_bus.recv(self.TIMEOUT) | ||
|
|
||
| self.assertIsNotNone(rx_message) | ||
| self.assertEqual(tx_message.arbitration_id, rx_message.arbitration_id) | ||
| self.assertEqual(tx_message.dlc, rx_message.dlc) | ||
| self.assertEqual(tx_message.data, rx_message.data) | ||
| self.assertEqual(tx_message.is_extended_id, rx_message.is_extended_id) | ||
| self.assertEqual(tx_message.is_remote_frame, rx_message.is_remote_frame) | ||
| self.assertEqual(tx_message.is_error_frame, rx_message.is_error_frame) | ||
| self.assertEqual(tx_message.is_fd, rx_message.is_fd) | ||
|
|
||
| def test_create_same_id_raises_exception(self): | ||
| messages_a = can.Message( | ||
| arbitration_id=0x401, | ||
| data=[0x11, 0x11, 0x11, 0x11, 0x11, 0x11], | ||
| is_extended_id=False, | ||
| ) | ||
|
|
||
| messages_b = can.Message( | ||
| arbitration_id=0x401, | ||
| data=[0x22, 0x22, 0x22, 0x22, 0x22, 0x22], | ||
| is_extended_id=False, | ||
| ) | ||
|
|
||
| task_a = self._send_bus.send_periodic(messages_a, 1) | ||
| self.assertIsInstance(task_a, can.broadcastmanager.CyclicSendTaskABC) | ||
|
|
||
| # The second one raises a ValueError when we attempt to create a new | ||
| # Task, since it has the same arbitration ID. | ||
| with self.assertRaises(ValueError): | ||
| task_b = self._send_bus.send_periodic(messages_b, 1) | ||
|
|
||
| def test_modify_data_message(self): | ||
| message_odd = can.Message( | ||
| arbitration_id=0x401, | ||
| data=[0x11, 0x11, 0x11, 0x11, 0x11, 0x11], | ||
| is_extended_id=False, | ||
| ) | ||
| message_even = can.Message( | ||
| arbitration_id=0x401, | ||
| data=[0x22, 0x22, 0x22, 0x22, 0x22, 0x22], | ||
| is_extended_id=False, | ||
| ) | ||
| task = self._send_bus.send_periodic(message_odd, self.PERIOD) | ||
| self.assertIsInstance(task, can.broadcastmanager.ModifiableCyclicTaskABC) | ||
|
|
||
| results_odd = [] | ||
| results_even = [] | ||
| for _ in range(1 * 4): | ||
| result = self._recv_bus.recv(self.PERIOD * 2) | ||
| if result: | ||
| results_odd.append(result) | ||
|
|
||
| task.modify_data(message_even) | ||
| for _ in range(1 * 4): | ||
| result = self._recv_bus.recv(self.PERIOD * 2) | ||
| if result: | ||
| results_even.append(result) | ||
|
|
||
| task.stop() | ||
|
|
||
| # Now go through the partitioned results and assert that they're equal | ||
| for rx_index, rx_message in enumerate(results_even): | ||
| tx_message = message_even | ||
|
|
||
| self.assertEqual(tx_message.arbitration_id, rx_message.arbitration_id) | ||
| self.assertEqual(tx_message.dlc, rx_message.dlc) | ||
| self.assertEqual(tx_message.data, rx_message.data) | ||
| self.assertEqual(tx_message.is_extended_id, rx_message.is_extended_id) | ||
| self.assertEqual(tx_message.is_remote_frame, rx_message.is_remote_frame) | ||
| self.assertEqual(tx_message.is_error_frame, rx_message.is_error_frame) | ||
| self.assertEqual(tx_message.is_fd, rx_message.is_fd) | ||
|
|
||
| if rx_index != 0: | ||
| prev_rx_message = results_even[rx_index - 1] | ||
| # Assert timestamps are within the expected period | ||
| self.assertTrue( | ||
| abs( | ||
| (rx_message.timestamp - prev_rx_message.timestamp) - self.PERIOD | ||
| ) | ||
| <= self.DELTA | ||
| ) | ||
|
|
||
| for rx_index, rx_message in enumerate(results_odd): | ||
| tx_message = message_odd | ||
|
|
||
| self.assertEqual(tx_message.arbitration_id, rx_message.arbitration_id) | ||
| self.assertEqual(tx_message.dlc, rx_message.dlc) | ||
| self.assertEqual(tx_message.data, rx_message.data) | ||
| self.assertEqual(tx_message.is_extended_id, rx_message.is_extended_id) | ||
| self.assertEqual(tx_message.is_remote_frame, rx_message.is_remote_frame) | ||
| self.assertEqual(tx_message.is_error_frame, rx_message.is_error_frame) | ||
| self.assertEqual(tx_message.is_fd, rx_message.is_fd) | ||
|
|
||
| if rx_index != 0: | ||
| prev_rx_message = results_odd[rx_index - 1] | ||
| # Assert timestamps are within the expected period | ||
| self.assertTrue( | ||
| abs( | ||
| (rx_message.timestamp - prev_rx_message.timestamp) - self.PERIOD | ||
| ) | ||
| <= self.DELTA | ||
| ) | ||
|
|
||
|
|
||
| if __name__ == "__main__": | ||
| unittest.main() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.