Replies: 1 comment 5 replies
-
Thank you for your question! I need a bit more information before I can say for certain what is wrong. I'd need to see the original ASN.1 schema to be able to check against your implementation.
The choice is
If you're encoding to DER, CER, or BER (which are the only supported formats currently), it shouldn't matter because the format always has a tag, length, value, even when the string has a fixed size. (When support for PER is added, this will change, because it needs the constraints to properly decode and encode the message, but this is not available in the library yet).
Yes, this is required to match what is provided in the ASN.1 schema in order to be able to encode and decode the message, it does matter, so that's probably at least one place where your code is failing. |
Beta Was this translation helpful? Give feedback.
-
So, I'm trying to expand on the 61850 tests to include SV (61850-9-2) messages. I'm pretty sure that my hangup is fully understanding both the library and how the types are mapped. I've spent a lot of time reading the docs, but it's all starting to run together. The goose stuff works great, but I'm hoping to contribute to the other data types of the standards.
Starting with the existing test case that's working for goose, I tried to expand the enum to allow for the savpdu.
This left the implementation of the sv enums:
But when I run the decoder:
I get the following output:
Calling the function on a goose message works perfectly and I can access all of the data, but the sampled values do not work.
There are several places where I could see potential errors. The first is finding out what "choice" the decoder is looking for. I'm new to Rust (I've literally been using it for about 2 weeks), and I'm not sure how to debug what the library is looking for.
Another is regarding the way I mapped the asdu. In the standard, there are several specifically sized OctetStrings (size(1), size(2), size(4). Does this need to be specified some way in the enum, or do I leave it as a generic OctetString.
The last is regarding the "application" tag. I'm not sure what the number does, but I did have to make them unique for the code to compile. Goose was 1, so I used 0 and 3 in this example (2 is being used in an MMS example I'm also working on). I don't anticipate that the value really matters here, but if it does, then I've probably got it wrong.
Thanks in advance for any pointers.
Beta Was this translation helpful? Give feedback.
All reactions