rodos middleware in python
Project description
This is a port of the rodos middleware to Python
RODOS is dependable real-time operating system used in satellites see rodos gitlab. The rodos middleware Python package was created to facilitate the development of PC software, that connects to a remote microcontroller. E.g. debugging embedded applications, displaying data, easier development in python instead of c++. It is writte in pure python dependent on pyserial and the operating system's UDP/rfcomm(bluetooth) stack
install the package with pip install rodos
. Here is an example how to use in conjunction with the struct package, that comes handy for parsing data
#!/bin/python3
import time
import struct
import rodos
# from rodos import *
def topicHandler(data):
try:
unpacked = struct.unpack("qI4b", data)
print("timeNow = ", unpacked[0])
print("msgIndex = ", unpacked[1])
except Exception as e:
print(e)
print(data)
luart = rodos.LinkinterfaceUART(path="/dev/rfcomm2")
gwUart = rodos.Gateway(luart)
gwUart.run()
linux2rodos = rodos.Topic(1002)
rodos2linux = rodos.Topic(1003)
rodos2linux.addSubscriber(topicHandler) # <<<<<< register callback
cnt = 0
while True:
cnt += 1
time.sleep(1)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.