PyVLCB 0.2.7__tar.gz → 0.2.8__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.7/src/PyVLCB.egg-info → pyvlcb-0.2.8}/PKG-INFO +1 -1
- {pyvlcb-0.2.7 → pyvlcb-0.2.8}/pyproject.toml +1 -1
- {pyvlcb-0.2.7 → pyvlcb-0.2.8/src/PyVLCB.egg-info}/PKG-INFO +1 -1
- {pyvlcb-0.2.7 → pyvlcb-0.2.8}/src/PyVLCB.egg-info/SOURCES.txt +1 -0
- pyvlcb-0.2.8/src/pyvlcb/tests/test_opcodes.py +23 -0
- {pyvlcb-0.2.7 → pyvlcb-0.2.8}/src/pyvlcb/tests/test_vlcb.py +1 -0
- {pyvlcb-0.2.7 → pyvlcb-0.2.8}/src/pyvlcb/vlcbformat.py +4 -3
- {pyvlcb-0.2.7 → pyvlcb-0.2.8}/LICENSE +0 -0
- {pyvlcb-0.2.7 → pyvlcb-0.2.8}/README.md +0 -0
- {pyvlcb-0.2.7 → pyvlcb-0.2.8}/setup.cfg +0 -0
- {pyvlcb-0.2.7 → pyvlcb-0.2.8}/src/PyVLCB.egg-info/dependency_links.txt +0 -0
- {pyvlcb-0.2.7 → pyvlcb-0.2.8}/src/PyVLCB.egg-info/requires.txt +0 -0
- {pyvlcb-0.2.7 → pyvlcb-0.2.8}/src/PyVLCB.egg-info/top_level.txt +0 -0
- {pyvlcb-0.2.7 → pyvlcb-0.2.8}/src/pyvlcb/__init__.py +0 -0
- {pyvlcb-0.2.7 → pyvlcb-0.2.8}/src/pyvlcb/canusb.py +0 -0
- {pyvlcb-0.2.7 → pyvlcb-0.2.8}/src/pyvlcb/exceptions.py +0 -0
- {pyvlcb-0.2.7 → pyvlcb-0.2.8}/src/pyvlcb/tests/run_tests.py +0 -0
- {pyvlcb-0.2.7 → pyvlcb-0.2.8}/src/pyvlcb/tests/test_canusb4.py +0 -0
- {pyvlcb-0.2.7 → pyvlcb-0.2.8}/src/pyvlcb/utils.py +0 -0
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import unittest
|
|
2
|
+
|
|
3
|
+
import os
|
|
4
|
+
|
|
5
|
+
from pyvlcb import VLCB, VLCBFormat, VLCBOpcode
|
|
6
|
+
|
|
7
|
+
## Test for VLCB library
|
|
8
|
+
# Test that the OpCodes are formatted correctly (particular the format field)
|
|
9
|
+
class TestOpCodes(unittest.TestCase):
|
|
10
|
+
# Check each of the format entries exist in the field_formats list
|
|
11
|
+
def test_opcode_format(self):
|
|
12
|
+
for thisopcode in VLCBOpcode.opcodes.keys():
|
|
13
|
+
|
|
14
|
+
if VLCBOpcode.opcodes[thisopcode]['format'] == "":
|
|
15
|
+
continue
|
|
16
|
+
field_codes = VLCBOpcode.opcodes[thisopcode]['format'].split(',')
|
|
17
|
+
for this_code in field_codes:
|
|
18
|
+
#print (f"Checking Opcode {thisopcode} format :{this_code}:")
|
|
19
|
+
self.assertTrue(this_code in VLCBOpcode.field_formats.keys())
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
if __name__ == '__main__':
|
|
23
|
+
unittest.main()
|
|
@@ -336,7 +336,7 @@ class VLCBOpcode:
|
|
|
336
336
|
'F9': {'opc': 'ASOF3', 'title': 'Accessory Short OFF', 'format': 'NN,DNHigh_DNLow,Byte1,Byte2,Byte3', 'minpri': 3, 'comment': 'Indicates an OFF event using the short event number of 2 LS bytes with three added data bytes.'},
|
|
337
337
|
'FA': {'opc': 'DDES', 'title': 'Device data event (short mode)', 'format': 'DNHigh_DNLow,Byte1,Byte2,Byte3,Byte4,Byte5', 'minpri': 3, 'comment': 'Function is the same as F6 but uses device addressing so can relate data to a device attached to a node. e.g. one of several RFID readers attached to a single node.'},
|
|
338
338
|
'FB': {'opc': 'DDRS', 'title': 'Device data response (short mode)', 'format': 'DNHigh_DNLow,Byte1,Byte2,Byte3,Byte4,Byte5', 'minpri': 3, 'comment': 'The response to a request for data from a device. (0x5B)'},
|
|
339
|
-
'FC': {'opc': 'DDWS', 'title': 'Write data', 'format': 'DNHigh_DNLow,
|
|
339
|
+
'FC': {'opc': 'DDWS', 'title': 'Write data', 'format': 'DNHigh_DNLow,Byte1,Byte2,Byte3,Byte4,Byte5', 'minpri': 0, 'comment': 'Used to write data to a device such as an RFID tag. For RC522 byte1 should be 0.'},
|
|
340
340
|
'FD': {'opc': 'ARSON3', 'title': 'Accessory Short Response Event', 'format': 'NN,DNHigh_DNLow,Byte1,Byte2,Byte3', 'minpri': 3, 'comment': "Indicates an ON response event with with three added data bytes. A response event is a reply to a status request (ASRQ) without producing an ON or OFF event."},
|
|
341
341
|
'FE': {'opc': 'ARSOF3', 'title': 'Accessory Short Response Event', 'format': 'NN,DNHigh_DNLow,Byte1,Byte2,Byte3', 'minpri': 3, 'comment': "Indicates an OFF response event with with three added data bytes. A response event is a reply to a status request (ASRQ) without producing an ON or OFF event."},
|
|
342
342
|
'FF': {'opc': 'EXTC6', 'title': 'Extended op-code with 6 data bytes', 'format': 'ExtOpc,Byte1,Byte2,Byte3,Byte4,Byte5,Byte6', 'minpri': 3, 'comment': 'Used if the basic set of 32 OPCs is not enough. Allows an additional 256 OPCs'}
|
|
@@ -353,8 +353,9 @@ class VLCBOpcode:
|
|
|
353
353
|
"Consist": [2, "num"], # Consist ID
|
|
354
354
|
"Index": [2, "num"], # Index of loco in consist
|
|
355
355
|
"Status": [2, "hex"],
|
|
356
|
-
"NN": [4, "num"],
|
|
357
|
-
"
|
|
356
|
+
"NN": [4, "num"], # Node number
|
|
357
|
+
"NNIndex": [2, "num"], # Index for the node variable value
|
|
358
|
+
"AllocCode": [2, "num"], # Specific allocation code
|
|
358
359
|
"SpeedDir": [2, "hex"],
|
|
359
360
|
"SpeedFlag": [2, "hex"], # Speed flags DDD-DDDDD
|
|
360
361
|
"Fnum": [2, "num"], # Function number
|
|
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
|