Add Python
as a supported programming language
#244
-
I would be interested in using the serialization protocol source code in my GSE backend implemented in Python (Flask, Streamlit etc...). Is there any work planned to generate the source code in Python or to autogenerate the python bindings? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
There are Python bindings for ASN1SCC developed in 3rd party software and integrated in the TASTE virtual machine (download from https://taste.tools) The core bindings are generated by the DMT toolset ( The simplest way to generate the Python bindings is to run:
The bindings allow to create instances of the ASN.1 types using a Python
DMT's The For example, if you want to set a single field of a a variable with an instance of another (ctype) variable, you cannot do that. The Get/Set API only works with raw values (integers, boolean, enumerated, and array elements) - not with structured types. Higher level APIs have been developed in TASTE to overcome this limitation, in the following tools: These tools allow to set values using the ASN.1 Value Notation - making it easier than calling the low-level _Set() functions for each field one by one. The
This will open a standalone graphical editor: This editor exists in the form of a Python widget that can be used in a larger application. As you can see there are many possibilities to combine the use of asn1scc and Python as all the essential building bricks are there. Let me know if you have any additional or specific questions. |
Beta Was this translation helpful? Give feedback.
There are Python bindings for ASN1SCC developed in 3rd party software and integrated in the TASTE virtual machine (download from https://taste.tools)
The core bindings are generated by the DMT toolset (
git clone https://gitrepos.estec.esa.int/taste/dmt ; cd dmt; make install
). You may check this article that gives an example to use it: https://www.thanassis.space/asn1.htmlThe simplest way to generate the Python bindings is to run:
The bindings allow to create instances of the ASN.1 types using a Python
ctypes
interface. You can read and change the values using a simple Get/Set API, and call the uPER and ACN encoding and decoding functions wh…