Giter Site home page Giter Site logo

BACnet encoding about rasn HOT 3 OPEN

bachp avatar bachp commented on July 28, 2024
BACnet encoding

from rasn.

Comments (3)

XAMPPRocky avatar XAMPPRocky commented on July 28, 2024 1

Thank you for your issue! I am aware of BACnet through reading about ASN.1, though I never really looked much into it. I would be open to including BACnet as an encoding in the rasn crate, provided that the standard for the format is openly available for me to read and verify. It certainly seems to be used widely enough to merit being included.

On whether 1 or 2 would be preferable, I think as long 1 doesn't require unreasonable amount of changes, having it as an option might work, though it might be easier to define it as its own type, and just use the free functions in src/de/parser.rs for parsing.

from rasn.

bachp avatar bachp commented on July 28, 2024

I did some first trials and option 1, to add it to the existing BER encoder turned out the be not a good idea. So I went with option 2 and created a separate encoder.

I already managed to sucessfully encode Null and Bool. But now I'm not sure how to best move forward with signed and unsigned integers an real/float values

For the two integer types I decided to encode them both via encode_integer. This is fine as I can use the tag number to distingush them.

However I'm not sure what to do with the real. There is no encode_real yet. Should I add an encode_real to the encoder trait, or is there an other way how application tagged types should be encoded that don't correspond to any existing universal type?

from rasn.

XAMPPRocky avatar XAMPPRocky commented on July 28, 2024

Well Real types should have {encode, decode}_real methods on Encoder and Decoder. I just haven't added it yet, because real types are the most difficult to understand and implement IMO. Another unresolved question is what would be the appropriate type to use in Rust for Real types, as I'm pretty sure (though could be wrong, see X.680) real types can be wider than f64. Help figuring out a good enough solution would be appreciated.

from rasn.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.