OpenCyphal / pycyphal

Python implementation of the Cyphal protocol stack.
https://pycyphal.readthedocs.io/
MIT License
119 stars 106 forks source link

Local port generalization #155

Open pavel-kirienko opened 3 years ago

pavel-kirienko commented 3 years ago

Nodes should be able to observe messages published by themselves and invoke services served by themselves circumventing the transport (since UAVCAN does not define loopback transfers). This generalization will simplify architecting complex applications. Advanced implementations like libuavcan/uavcan.rs, I suppose, should also support this.

Publishers should inject outgoing transfers into subscribers of the same subject-ID if such exist aside from sending their transfers to the network. From here:

https://github.com/UAVCAN/pyuavcan/blob/fdada810f29db3f800bd6148a62b76a3e841346d/pyuavcan/presentation/_port/_publisher.py#L187

forward the serialized transfer to:

https://github.com/UAVCAN/pyuavcan/blob/fdada810f29db3f800bd6148a62b76a3e841346d/pyuavcan/presentation/_port/_subscriber.py#L313-L314

Likewise for services.