Pure MoonBit OPC UA Binary Encoding primitives and data-model codecs.
import {
"oilleelssq-wq/moonua" @moonua,
}
let writer = @moonua.UaWriter::new()
writer.write_node_id(@moonua.NodeId::numeric(1, 1000))
writer.write_qualified_name(@moonua.QualifiedName::new(1, "Device"))
let bytes = writer.to_bytes()moon fmt --check
moon check --deny-warn
moon test --deny-warn
moon test --target wasm
moon info
moon run examples/nodeid_demo --target wasm-gcpub(all) suberror UaError {
Truncated(Int, Int)
InvalidLength(Int)
LimitExceeded(Int, Int)
InvalidUtf8
InvalidNodeIdEncoding(UInt)
InvalidGuidLength(Int)
InvalidValue(String)
}pub(all) struct LocalizedText {
locale : String?
text : String?
}pub(all) enum NodeIdIdentifier {
Numeric(UInt)
String(String)
Guid(Bytes)
Opaque(Bytes)
}pub(all) struct QualifiedName {
namespace_index : UInt16
name : String
}pub(all) struct UaLimits {
max_byte_length : Int
}Install
Download zipPure MoonBit OPC UA Binary Encoding primitives and data-model codecs.