Anonymous | Login | Signup for a new account | 2024-03-28 15:01 UTC |
Main | My View | View Issues | Change Log | Roadmap |
View Issue Details [ Jump to Notes ] | [ Issue History ] [ Print ] | ||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | ||||
0000824 | Taste | [All Projects] ASN.1 Compiler v4 | public | 2018-12-18 14:30 | 2020-08-31 18:24 | ||||
Reporter | cavada@fbk.eu | ||||||||
Assigned To | gmamais | ||||||||
Priority | normal | Severity | feature | Reproducibility | have not tried | ||||
Status | closed | Resolution | fixed | ||||||
Platform | OS | OS Version | |||||||
Summary | 0000824: Support hooks in encoding functions | ||||||||
Description | Having hooks in encoding functions may simplify the customization of ACN encodings. For example, suppose you have messages containing packets:
In the example, T-Packet.length is the size (in bits) of each packet. I propose to have a mechanims to allow inserting hooks during the encoding, only for those structures that need to be involved. Here is an example:
my_encoding_patcher, like for mapping-functions, is a function meant to be implemented by the user, which receives: a fresh bitstream objects, set to point to the first bit in the buffer encoding the packet which need to be patched, and the number of bits that were used to encode the packet.
The generated encoding function might be modified as follow:
| ||||||||
Tags | No tags attached. | ||||||||
Attached Files | |||||||||
Notes | |
(0003557) gmamais (developer) 2019-01-12 17:55 edited on: 2019-01-12 18:01 |
I am proposing a small variation of the above approach. In particular, I 'm proposing the following: Two new ACN properties will be introduced: With these two new properties the user will be able to write:
The ASN.1 compiler will generate another struct for T-Packet which has the post-encoding-function property. The new struct will be as follows in this example
In other words, this stuct will have as many members as the NULL fields with save-position property. The encoding function of T-Packet will be modified as follows: Now, in the encoding function of the T_Packet, before encoding the NULL fields the position of the bitstream will be saved. E.g.
At the end of the encoding function, the user-defined function will be called passing as parameters a pointer to the bitStreamPositions variable with the saved points and the actual bit stream. my_encoding_patcher(&bitStreamPositions, pBitStrm); the prototype of the function will be like following
Please tell me if you agree with this approach in order to proceed with the implementation. |
(0003558) maxime (administrator) 2019-01-16 10:22 |
I fully agree with that approach. The name "bitStreamPosition" should be prefixed to avoid duplicates. Also in the post-encoding function parameters, what size will you pass? The size of the SEQUENCE which has a post-encoding, or the size of the full packet in which this SEQUENCE may be contained? |
(0003559) cavada@fbk.eu (reporter) 2019-01-17 08:40 |
The proposed approach is fine with me. I did not mention it, but of course a similar mechanism should be available for pre-decoding hooks. Pre-decoding hooks change the encoded stream before the decoding function get called. |
(0003560) cavada@fbk.eu (reporter) 2019-01-17 08:42 |
@maxime: in my example, size is the number of bits of the element which has a post-encoding function (T-Packet in the example.) |
(0003562) gmamais (developer) 2019-01-27 15:18 |
fixed in latest commit. |
(0003564) maxime (administrator) 2019-02-13 10:17 |
@roberto, is the resolution ok for you? Can we close the ticket? |
(0003566) cavada@fbk.eu (reporter) 2019-02-13 10:40 |
About the encoding, solution is satisfying. However, complete solution should include also similar solution for customization of decoding. I don't know if this should be done in a separate issue, or in the scope of this one. |
(0003573) gmamais (developer) 2019-02-16 09:55 |
Can you provide an example where this functionality (i.e. decoding hook functions) will be useful?
In the above example, the post-encoding-function will behave as implemented (i.e. patch bitstream with special calculated values), while the post-decoding-function will calculate the CRC (from the contents of the bitstream) and compare the value as sent by the sender. If the values match the function should return OK, otherwise an error. In this case, the post-decoding function acts as a validator and not as a "patch function". |
(0003593) maxime (administrator) 2019-03-27 13:27 |
I think the CRC validator is the main use case, and it is fully relevant. |
(0003601) michal_kurowski_n7s (reporter) 2019-03-29 13:13 |
I think by My comments are as follows -> |
(0003630) gmamais (developer) 2019-05-05 14:57 |
a new ACN attribute with name post-decoding-validator was added that acts as a post validator. The generic post-decoding-function attribute was not added because there is currently no clear use case of it. |
Issue History | |||
Date Modified | Username | Field | Change |
2018-12-18 14:30 | cavada@fbk.eu | New Issue | |
2018-12-19 08:39 | maxime | Assigned To |
=> gmamais |
2018-12-19 08:39 | maxime | Status |
new => assigned |
2018-12-19 08:41 | maxime | Description Updated | View Revisions |
2019-01-12 17:55 | gmamais | Note Added: 0003557 | |
2019-01-12 17:56 | gmamais | Note Edited: 0003557 | View Revisions |
2019-01-12 17:57 | gmamais | Note Edited: 0003557 | View Revisions |
2019-01-12 17:58 | gmamais | Status |
assigned => feedback |
2019-01-12 18:01 | gmamais | Note Edited: 0003557 | View Revisions |
2019-01-16 10:22 | maxime | Note Added: 0003558 | |
2019-01-17 08:40 | cavada@fbk.eu | Note Added: 0003559 | |
2019-01-17 08:40 | cavada@fbk.eu | Status |
feedback => assigned |
2019-01-17 08:42 | cavada@fbk.eu | Note Added: 0003560 | |
2019-01-27 15:18 | gmamais | Note Added: 0003562 | |
2019-01-27 15:18 | gmamais | Status |
assigned => resolved |
2019-01-27 15:18 | gmamais | Resolution |
open => fixed |
2019-02-13 10:17 | maxime | Note Added: 0003564 | |
2019-02-13 10:40 | cavada@fbk.eu | Note Added: 0003566 | |
2019-02-13 10:40 | cavada@fbk.eu | Status |
resolved => feedback |
2019-02-13 10:40 | cavada@fbk.eu | Resolution |
fixed => reopened |
2019-02-16 09:55 | gmamais | Note Added: 0003573 | |
2019-03-27 13:27 | maxime | Note Added: 0003593 | |
2019-03-29 13:13 | michal_kurowski_n7s | Note Added: 0003601 | |
2019-05-05 14:57 | gmamais | Note Added: 0003630 | |
2019-05-05 14:57 | gmamais | Status |
feedback => resolved |
2019-05-05 14:57 | gmamais | Resolution |
reopened => fixed |
2020-08-31 18:24 | maxime | Status |
resolved => closed |
Copyright © 2000 - 2011 MantisBT Group |