Explorar o código

Add support for transporting the raw byte value

Robin Harper %!s(int64=12) %!d(string=hai) anos
pai
achega
375661f729
Modificáronse 1 ficheiros con 3 adicións e 0 borrados
  1. 3 0
      ber.go

+ 3 - 0
ber.go

@@ -12,6 +12,7 @@ type Packet struct {
 	TagType     uint8
 	TagType     uint8
 	Tag         uint8
 	Tag         uint8
 	Value       interface{}
 	Value       interface{}
+	ByteValue   []byte
 	Data        *bytes.Buffer
 	Data        *bytes.Buffer
 	Children    []*Packet
 	Children    []*Packet
 	Description string
 	Description string
@@ -298,6 +299,8 @@ func decodePacket(data []byte) (*Packet, []byte) {
 		}
 		}
 	} else if p.ClassType == ClassUniversal {
 	} else if p.ClassType == ClassUniversal {
 		p.Data.Write(data[datapos : datapos+datalen])
 		p.Data.Write(data[datapos : datapos+datalen])
+		p.ByteValue = value_data
+
 		switch p.Tag {
 		switch p.Tag {
 		case TagEOC:
 		case TagEOC:
 		case TagBoolean:
 		case TagBoolean: