Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
7c44101
use is_extended_id instead of id_type for message objects
felixdivo Sep 6, 2018
b3fd52f
better documentation
felixdivo Sep 6, 2018
00903f8
document check option
felixdivo Sep 6, 2018
6204cda
fixes for the Message class
felixdivo Sep 6, 2018
965bbbb
run test on CI for logformats_test.py
felixdivo Sep 6, 2018
1797e43
added channel to docs
felixdivo Sep 6, 2018
e76f017
add example messages with channel attribute set
felixdivo Sep 6, 2018
4e23808
test codecov
felixdivo Sep 8, 2018
f71fd56
change logformat tests
felixdivo Sep 10, 2018
a20f4f7
nicer __repr__
felixdivo Sep 10, 2018
5217880
add __slots__, correct __hash__. deprecate id_type
felixdivo Sep 10, 2018
edb2b6e
make timestamp comparisoun a bit more forgiving
felixdivo Sep 10, 2018
ec9f9ed
use extended_id in constructor
felixdivo Sep 10, 2018
1a76644
fix TestBlfFileFormat test
felixdivo Sep 10, 2018
26b2406
implemented Message._check
felixdivo Sep 10, 2018
52ab605
adjust logformat test
felixdivo Sep 10, 2018
a724a92
Merge branch 'develop' into change-messages
felixdivo Sep 10, 2018
5d88662
try to add warning & compat __dict__
felixdivo Sep 15, 2018
c0fe8a7
Merge branch 'change-messages' of github.com:hardbyte/python-can into…
felixdivo Sep 15, 2018
5fb1775
properly implement warning
felixdivo Sep 16, 2018
eee819f
update deprecation notes
felixdivo Sep 16, 2018
00f6b92
docs & remove undocumented setting of flags in kvaser backend
felixdivo Sep 16, 2018
da6d180
docs
felixdivo Sep 16, 2018
9791761
compare by identity; add _dict to __hash__()
felixdivo Sep 23, 2018
95cc0b5
address PR comments
felixdivo Sep 23, 2018
f4c532e
remove leftover code
felixdivo Sep 23, 2018
360cfdf
Merge branch 'develop' into change-messages
felixdivo Sep 23, 2018
43586e9
resolve bad merge commit
felixdivo Sep 23, 2018
afe9cf6
added missing comma
felixdivo Sep 23, 2018
58a31f3
add __copy__ and __deepcopy__
felixdivo Sep 23, 2018
e840d36
docs
felixdivo Sep 23, 2018
e27fafb
fix bad test case
felixdivo Sep 27, 2018
196cd89
add Message.equals(), and correctly check for equality in failing tests
felixdivo Sep 27, 2018
2499c95
Merge branch 'develop' into change-messages
felixdivo Sep 27, 2018
fddef63
Merge branch 'develop' into change-messages
felixdivo Sep 27, 2018
c28a106
Remove message hash implementation
hardbyte Sep 28, 2018
5eb4fa4
Merge branch 'develop' into change-messages
hardbyte Sep 28, 2018
68d8e45
Fix missing space in setup
hardbyte Sep 28, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ coverage:
round: down
range: 50...100
status:
# pull-requests only
project:
default:
# coverage may fall by <1.0% and still be considered "passing"
threshold: 1.0%
patch:
default:
# coverage may fall by <1.0% and still be considered "passing"
Expand Down
4 changes: 2 additions & 2 deletions can/CAN.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@

log = logging.getLogger('can')

# See #267
# See #267.
# Version 2.0 - 2.1: Log a Debug message
# Version 2.2: Log a Warning
# Version 2.3: Log an Error
# Version 2.4: Remove the module
log.warning('Loading python-can via the old "CAN" API is deprecated since v2.0 an will get removed in v2.4. '
log.error('Loading python-can via the old "CAN" API is deprecated since v2.0 an will get removed in v2.4. '
'Please use `import can` instead.')
2 changes: 1 addition & 1 deletion can/broadcastmanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,5 +154,5 @@ def send_periodic(bus, message, period, *args, **kwargs):
:return: A started task instance
"""
log.warning("The function `can.send_periodic` is deprecated and will " +
"be removed in version 2.3. Please use `can.Bus.send_periodic` instead.")
"be removed in version 3.0. Please use `can.Bus.send_periodic` instead.")
return bus.send_periodic(message, period, *args, **kwargs)
4 changes: 2 additions & 2 deletions can/interfaces/ixxat/canlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ def send(self, msg, timeout=None):
message = structures.CANMSG()
message.uMsgInfo.Bits.type = constants.CAN_MSGTYPE_DATA
message.uMsgInfo.Bits.rtr = 1 if msg.is_remote_frame else 0
message.uMsgInfo.Bits.ext = 1 if msg.id_type else 0
message.uMsgInfo.Bits.ext = 1 if msg.is_extended_id else 0
message.uMsgInfo.Bits.srr = 1 if self._receive_own_messages else 0
message.dwMsgId = msg.arbitration_id
if msg.dlc:
Expand Down Expand Up @@ -545,7 +545,7 @@ def __init__(self, scheduler, msg, period, duration, resolution):
self._msg.wCycleTime = int(round(period * resolution))
self._msg.dwMsgId = msg.arbitration_id
self._msg.uMsgInfo.Bits.type = constants.CAN_MSGTYPE_DATA
self._msg.uMsgInfo.Bits.ext = 1 if msg.id_type else 0
self._msg.uMsgInfo.Bits.ext = 1 if msg.is_extended_id else 0
self._msg.uMsgInfo.Bits.rtr = 1 if msg.is_remote_frame else 0
self._msg.uMsgInfo.Bits.dlc = msg.dlc
for i, b in enumerate(msg.data):
Expand Down
4 changes: 1 addition & 3 deletions can/interfaces/kvaser/canlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -516,8 +516,6 @@ def _recv_internal(self, timeout=None):
error_state_indicator=error_state_indicator,
channel=self.channel,
timestamp=msg_timestamp + self._timestamp_offset)
rx_msg.flags = flags
rx_msg.raw_timestamp = msg_timestamp
#log.debug('Got message: %s' % rx_msg)
return rx_msg, self._is_filtered
else:
Expand All @@ -526,7 +524,7 @@ def _recv_internal(self, timeout=None):

def send(self, msg, timeout=None):
#log.debug("Writing a message: {}".format(msg))
flags = canstat.canMSG_EXT if msg.id_type else canstat.canMSG_STD
flags = canstat.canMSG_EXT if msg.is_extended_id else canstat.canMSG_STD
if msg.is_remote_frame:
flags |= canstat.canMSG_RTR
if msg.is_error_frame:
Expand Down
2 changes: 1 addition & 1 deletion can/interfaces/nican.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ def send(self, msg, timeout=None):
It does not wait for message to be ACKed currently.
"""
arb_id = msg.arbitration_id
if msg.id_type:
if msg.is_extended_id:
arb_id |= NC_FL_CAN_ARBID_XTD
raw_msg = TxMessageStruct(arb_id,
bool(msg.is_remote_frame),
Expand Down
2 changes: 1 addition & 1 deletion can/interfaces/pcan/pcan.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ def _recv_internal(self, timeout):
return rx_msg, False

def send(self, msg, timeout=None):
if msg.id_type:
if msg.is_extended_id:
msgType = PCAN_MESSAGE_EXTENDED
else:
msgType = PCAN_MESSAGE_STANDARD
Expand Down
2 changes: 1 addition & 1 deletion can/interfaces/usb2can/usb2canInterface.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def message_convert_tx(msg):
if msg.is_remote_frame:
messagetx.flags |= IS_REMOTE_FRAME

if msg.id_type:
if msg.is_extended_id:
messagetx.flags |= IS_ID_TYPE

return messagetx
Expand Down
2 changes: 1 addition & 1 deletion can/interfaces/vector/canlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ def _recv_internal(self, timeout):
def send(self, msg, timeout=None):
msg_id = msg.arbitration_id

if msg.id_type:
if msg.is_extended_id:
msg_id |= vxlapi.XL_CAN_EXT_MSG_ID

flags = 0
Expand Down
2 changes: 1 addition & 1 deletion can/io/blf.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ def on_message_received(self, msg):
channel += 1

arb_id = msg.arbitration_id
if msg.id_type:
if msg.is_extended_id:
arb_id |= CAN_MSG_EXT
flags = REMOTE_FLAG if msg.is_remote_frame else 0
data = bytes(msg.data)
Expand Down
2 changes: 1 addition & 1 deletion can/io/csv.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def on_message_received(self, msg):
row = ','.join([
repr(msg.timestamp), # cannot use str() here because that is rounding
hex(msg.arbitration_id),
'1' if msg.id_type else '0',
'1' if msg.is_extended_id else '0',
'1' if msg.is_remote_frame else '0',
'1' if msg.is_error_frame else '0',
str(msg.dlc),
Expand Down
2 changes: 1 addition & 1 deletion can/io/sqlite.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ def _db_writer_thread(self):
messages.append((
msg.timestamp,
msg.arbitration_id,
msg.id_type,
msg.is_extended_id,
msg.is_remote_frame,
msg.is_error_frame,
msg.dlc,
Expand Down
Loading