milo icon indicating copy to clipboard operation
milo copied to clipboard

add encodeBuiltinType and encodeBuiltinTypeArray to UaEncoder interface

Open vpriscan opened this issue 7 months ago • 2 comments

  • added common encodeBuiltinType and encodeBuiltinTypeArray to UaEncoder interface

  • aligning implementations in OpcUaJsonEncoder, OpcUaXmlEncoder and OpcUaBinaryEncoder

vpriscan avatar May 19 '25 12:05 vpriscan

I'm not really sure about these changes.

We didn't discuss this at any point, so I'm not sure why they're necessary at all. It's also odd that they are only for the encoder and not for the decoder as well?

I'm not keen on making API changes with 1.0 releasing this week.

kevinherron avatar May 19 '25 12:05 kevinherron

@kevinherron In our software that uses Milo, we have value:Object and dataType:OpcUaDataType variables. We want to encode this Object value with UaEncoder (json, xml or binary), but all encodeBuiltin* functions that accept Object value are all private in UaEncoder implementations. To avoid having to re-implement those functions (large switch-cases), it would be highly useful to move them to UaEncoder interface, or at least make them public in each implementation.

Equivalent would also be useful for UaDecoder as well.

vpriscan avatar May 19 '25 13:05 vpriscan