Skip to content

Commit f4098c1

Browse files
Merge pull request #228 from myrmexinc/respect-rtr-not-allowed
2 parents 1b12c97 + ad1d93a commit f4098c1

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

canopen/pdo/base.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ def save(self):
338338
"""Save PDO configuration for this map using SDO."""
339339
logger.info("Setting COB-ID 0x%X and temporarily disabling PDO",
340340
self.cob_id)
341-
self.com_record[1].raw = self.cob_id | PDO_NOT_VALID
341+
self.com_record[1].raw = self.cob_id | PDO_NOT_VALID | (RTR_NOT_ALLOWED if not self.rtr_allowed else 0x0)
342342
if self.trans_type is not None:
343343
logger.info("Setting transmission type to %d", self.trans_type)
344344
self.com_record[2].raw = self.trans_type
@@ -388,7 +388,8 @@ def save(self):
388388

389389
if self.enabled:
390390
logger.info("Enabling PDO")
391-
self.com_record[1].raw = self.cob_id
391+
self.com_record[1].raw = self.cob_id | (RTR_NOT_ALLOWED if not self.rtr_allowed else 0x0)
392+
392393
self.pdo_node.network.subscribe(self.cob_id, self.on_message)
393394

394395
def clear(self):

0 commit comments

Comments
 (0)