From cae888b9f2aa1a5b7826d2c4cb4de37f1274d39c Mon Sep 17 00:00:00 2001 From: jonathan Date: Thu, 26 Sep 2019 15:44:26 +0200 Subject: [PATCH] add type id 0x00 support --- ua/enums.go | 1 + ua/variant.go | 1 + 2 files changed, 2 insertions(+) diff --git a/ua/enums.go b/ua/enums.go index 6131fd02..ec5018c6 100644 --- a/ua/enums.go +++ b/ua/enums.go @@ -58,6 +58,7 @@ const ( type TypeID byte const ( + TypeIDNull TypeID = 0 // not part of specification but some servers (e.g. Prosys) return it anyway TypeIDBoolean TypeID = 1 TypeIDSByte TypeID = 2 TypeIDByte TypeID = 3 diff --git a/ua/variant.go b/ua/variant.go index e5ad89b5..e1fca5de 100644 --- a/ua/variant.go +++ b/ua/variant.go @@ -542,6 +542,7 @@ func (m *Variant) Time() time.Time { var variantTypeToTypeID = map[reflect.Type]TypeID{} var variantTypeIDToType = map[TypeID]reflect.Type{ + TypeIDNull: reflect.TypeOf(nil), TypeIDBoolean: reflect.TypeOf(false), TypeIDSByte: reflect.TypeOf(int8(0)), TypeIDByte: reflect.TypeOf(uint8(0)),