Implement support for BACnet MS/TP frame encoding/decoding.#11
Implement support for BACnet MS/TP frame encoding/decoding.#11de-vri-es wants to merge 8 commits intoninjasource:mainfrom
Conversation
|
Amazing, thanks! I will only be able to look at this when I'm back from holiday on the 6th of April. |
|
Sure, no rush! Enjoy your holiday :) |
1faebff to
3cc1ed0
Compare
You can not assume that the source/target network uses BACnet/IP, even when you are a BACnet/IP device. Preserving the address as-is is important to let BACnet routers function properly.
And rename `DataLinkFunction` to `BvllFunction`.
|
Also added support for COBS-encoded MS/TP frames now. For now, it relies on a patched version of And otherwise, the actual encode/decode functions used are easy to extract, and they're under a compatible license (Mozilla Public License 2.0). So they could be included in the implementation instead of depending on |
| @@ -207,7 +207,10 @@ impl<'a> NetworkPdu<'a> { | |||
| #[cfg_attr(feature = "alloc", bacnet_macros::remove_lifetimes_from_fn_args)] | |||
| pub fn decode(reader: &mut Reader, buf: &'a [u8]) -> Result<Self, Error> { | |||
| // ignore version | |||
There was a problem hiding this comment.
Nit, you can remove this comment now.
| bacnet-macros = { path = "./bacnet-macros", version = "0.1.0" } | ||
|
|
||
| # https://github.com/cbiffle/corncobs/pull/5 | ||
| corncobs = { git = "https://github.com/de-vri-es/corncobs", rev = "68025686e0547fac483baabb63c8066065023d88" } |
There was a problem hiding this comment.
I think this needs to be a crates.io dependency rather
How would you feel about moving the in-place COBS encoder into this crate if the Either way, I prefer to wait a bit before removing COBS support from the PR, if that's no problem for you :) |
This PR makes a number of changes to support encoding and decoding MS/TP frames, to allow using the library with BACnet over RS-485.
In a nutshell:
data_linkmodule =>ipDataLinkstruct =>IpFrameDataLinkFunctionenum =>BvllFunctionnetwork_protocol::mstpmodule with aMstpFramestruct and anMstpFrameTypeenum.(Code written by hand, no AI used.)