From 661ceeda06eb7e081ab449e345e12d9c9407c8ac Mon Sep 17 00:00:00 2001 From: Marco Gario Date: Tue, 6 Nov 2018 09:31:09 -0500 Subject: [PATCH 1/2] SdoAbortedError: Include additional error messages Include error messages defined in the standard. --- canopen/sdo/exceptions.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/canopen/sdo/exceptions.py b/canopen/sdo/exceptions.py index 788cf760..d1fb747c 100644 --- a/canopen/sdo/exceptions.py +++ b/canopen/sdo/exceptions.py @@ -14,21 +14,33 @@ class SdoAbortedError(SdoError): 0x05040002: "Invalid block size", 0x05040003: "Invalid sequence number", 0x05040004: "CRC error", + 0x05040005: "Out of memory", 0x06010000: "Unsupported access to an object", 0x06010001: "Attempt to read a write only object", 0x06010002: "Attempt to write a read only object", 0x06020000: "Object does not exist", + 0x06040041: "Object cannot be mapped to the PDO", 0x06040042: "PDO length exceeded", + 0x06040043: "General parameter incompatibility reason", + 0x06040047: "General internal incompatibility in the device", 0x06060000: "Access failed due to a hardware error", 0x06070010: "Data type and length code do not match", + 0x06070012: "Data type does not match, length of service parameter too high", + 0x06070013: "Data type does not match, length of service parameter too low", 0x06090011: "Subindex does not exist", 0x06090030: "Value range of parameter exceeded", + 0x06090031: "Value of parameter written too high", + 0x06090032: "Value of parameter written too low", + 0x06090036: "Maximum value is less than minimum value", 0x060A0023: "Resource not available", 0x08000000: "General error", + 0x08000020: "Data cannot be transferred or stored to the application", 0x08000021: ("Data can not be transferred or stored to the application " "because of local control"), 0x08000022: ("Data can not be transferred or stored to the application " - "because of the present device state") + "because of the present device state"), + 0x08000023: ("Object dictionary dynamic generation fails or no object " + "dictionary is present"), } def __init__(self, code): From fbc66056d5e96edd1496769384603d0c982489c9 Mon Sep 17 00:00:00 2001 From: Marco Gario Date: Tue, 6 Nov 2018 09:44:11 -0500 Subject: [PATCH 2/2] Missing one case --- canopen/sdo/exceptions.py | 1 + 1 file changed, 1 insertion(+) diff --git a/canopen/sdo/exceptions.py b/canopen/sdo/exceptions.py index d1fb747c..2276273a 100644 --- a/canopen/sdo/exceptions.py +++ b/canopen/sdo/exceptions.py @@ -41,6 +41,7 @@ class SdoAbortedError(SdoError): "because of the present device state"), 0x08000023: ("Object dictionary dynamic generation fails or no object " "dictionary is present"), + 0x08000024: "No data available", } def __init__(self, code):