tlv: Introduce a LV type as well.
This will be used by GSM 04.11 RP-IEs
This commit is contained in:
parent
6ddaa3cd5b
commit
564087a32d
12
core/TLV.st
12
core/TLV.st
|
@ -1,5 +1,5 @@
|
|||
"
|
||||
(C) 2012 by Holger Hans Peter Freyther
|
||||
(C) 2012-2014 by Holger Hans Peter Freyther
|
||||
All Rights Reserved
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
|
@ -57,6 +57,11 @@ Object subclass: TLVDescription [
|
|||
^ #tagOnly
|
||||
]
|
||||
|
||||
lengthValue [
|
||||
<category: 'type'>
|
||||
^#lv
|
||||
]
|
||||
|
||||
new [
|
||||
<category: 'creation'>
|
||||
^ super basicNew
|
||||
|
@ -182,6 +187,11 @@ Object subclass: TLVDescription [
|
|||
self typeKind: self class tagLengthValue
|
||||
]
|
||||
|
||||
beLV [
|
||||
<category: 'creation'>
|
||||
self typeKind: self class lengthValue
|
||||
]
|
||||
|
||||
beLen16 [
|
||||
<category: 'creation'>
|
||||
len_size := 2.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
"
|
||||
(C) 2012 by Holger Hans Peter Freyther
|
||||
(C) 2012,2014 by Holger Hans Peter Freyther
|
||||
All Rights Reserved
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
|
@ -39,6 +39,11 @@ TestCase subclass: TLVDescriptionTest [
|
|||
self assert: tlv instVarName = #bla.
|
||||
|
||||
tlv tag: 16r23.
|
||||
self assert: tlv tag = 16r23
|
||||
self assert: tlv tag = 16r23.
|
||||
|
||||
tlv beLV.
|
||||
self assert: tlv typeKind = #lv.
|
||||
tlv beTLV.
|
||||
self assert: tlv typeKind = #tlv.
|
||||
]
|
||||
]
|
||||
|
|
Reference in New Issue