PyVLCB 0.2.0__tar.gz → 0.2.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pyvlcb-0.2.0/src/PyVLCB.egg-info → pyvlcb-0.2.2}/PKG-INFO +1 -1
- {pyvlcb-0.2.0 → pyvlcb-0.2.2}/pyproject.toml +1 -1
- {pyvlcb-0.2.0 → pyvlcb-0.2.2/src/PyVLCB.egg-info}/PKG-INFO +1 -1
- {pyvlcb-0.2.0 → pyvlcb-0.2.2}/src/pyvlcb/vlcbformat.py +7 -5
- {pyvlcb-0.2.0 → pyvlcb-0.2.2}/LICENSE +0 -0
- {pyvlcb-0.2.0 → pyvlcb-0.2.2}/README.md +0 -0
- {pyvlcb-0.2.0 → pyvlcb-0.2.2}/setup.cfg +0 -0
- {pyvlcb-0.2.0 → pyvlcb-0.2.2}/src/PyVLCB.egg-info/SOURCES.txt +0 -0
- {pyvlcb-0.2.0 → pyvlcb-0.2.2}/src/PyVLCB.egg-info/dependency_links.txt +0 -0
- {pyvlcb-0.2.0 → pyvlcb-0.2.2}/src/PyVLCB.egg-info/requires.txt +0 -0
- {pyvlcb-0.2.0 → pyvlcb-0.2.2}/src/PyVLCB.egg-info/top_level.txt +0 -0
- {pyvlcb-0.2.0 → pyvlcb-0.2.2}/src/pyvlcb/__init__.py +0 -0
- {pyvlcb-0.2.0 → pyvlcb-0.2.2}/src/pyvlcb/canusb.py +0 -0
- {pyvlcb-0.2.0 → pyvlcb-0.2.2}/src/pyvlcb/exceptions.py +0 -0
- {pyvlcb-0.2.0 → pyvlcb-0.2.2}/src/pyvlcb/tests/run_tests.py +0 -0
- {pyvlcb-0.2.0 → pyvlcb-0.2.2}/src/pyvlcb/tests/test_canusb4.py +0 -0
- {pyvlcb-0.2.0 → pyvlcb-0.2.2}/src/pyvlcb/tests/test_vlcb.py +0 -0
- {pyvlcb-0.2.0 → pyvlcb-0.2.2}/src/pyvlcb/utils.py +0 -0
|
@@ -152,6 +152,7 @@ class VLCBOpcode:
|
|
|
152
152
|
"""
|
|
153
153
|
# Dict from opcode to dict of opcode information
|
|
154
154
|
opcodes = {
|
|
155
|
+
'': {'opc': 'N/A', 'title': 'Null', 'format': '', 'minpri': 0, 'comment': 'Null Opcode / data packet'},
|
|
155
156
|
'00': {'opc': 'ACK', 'title': 'General Acknowledgement', 'format': '', 'minpri': 2, 'comment': 'Positive response to query/request performed for report of availability online'},
|
|
156
157
|
'01': {'opc': 'NAK', 'title': 'General No Ack', 'format': '', 'minpri': 2, 'comment': 'Negative response to query/request denied'},
|
|
157
158
|
'02': {'opc': 'HLT', 'title': 'Bus Halt', 'format': '', 'minpri': 0, 'comment': 'Commonly broadcasted to all nodes to indicate CBUS is not available and no further packets should be sent until a BON or ARST is received'},
|
|
@@ -462,14 +463,15 @@ class VLCBOpcode:
|
|
|
462
463
|
|
|
463
464
|
Returns:
|
|
464
465
|
String: shortened opcode string
|
|
466
|
+
or empty string for NULL opcode
|
|
465
467
|
|
|
466
|
-
Raises:
|
|
467
|
-
ValueError: If string does not contain at least 2 characters
|
|
468
468
|
"""
|
|
469
|
-
|
|
469
|
+
# Also ignore - in position 1 (eg. " - ")
|
|
470
|
+
if len(opcode_string) >= 2 and opcode_string[1] != "-":
|
|
470
471
|
return opcode_string[0:2]
|
|
471
472
|
else:
|
|
472
|
-
|
|
473
|
+
# If not a opcode_string (eg. Null) return ""
|
|
474
|
+
return ""
|
|
473
475
|
|
|
474
476
|
# Get min priority from opcode
|
|
475
477
|
@staticmethod
|
|
@@ -483,7 +485,7 @@ class VLCBOpcode:
|
|
|
483
485
|
ValueError: If opcode not found
|
|
484
486
|
"""
|
|
485
487
|
opcode = VLCBOpcode.opcode_extract(opcode)
|
|
486
|
-
if opcode in VLCBOpcode.opcodes
|
|
488
|
+
if opcode in VLCBOpcode.opcodes:
|
|
487
489
|
return VLCBOpcode.opcodes[opcode]['minpri']
|
|
488
490
|
else:
|
|
489
491
|
raise ValueError(f"Opcode {opcode} is not defined.")
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|