| 1234567891011121314151617181920212223242526272829 |
- import pathlib
- test_file = pathlib.Path(__file__)
- test_dir = test_file.parent
- project_dir = test_dir.parent
- import sys
- sys.path.append(str(project_dir.absolute()))
- import source as communication
- def main():
- print("Starting test.")
- sample = communication.field("move_x", int)
- sample.set(255)
- print("Sample is: " + str(sample.get()))
- print("Sample as bytes: " + str(sample.encoder().code()))
- encoded = sample.encoder().code()
- sample_2 = communication.field("move_x", int)
- sample_2.decoder().load(encoded)
- print("Sample 2 (decoded sample): " + str(sample_2.get()))
- if __name__ == "__main__":
- main()
|