aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2010-11-27 13:38:40 +0100
committerHolger Hans Peter Freyther <zecke@selfish.org>2010-11-27 14:00:26 +0100
commitafd83ce44567fbf50ddf50f934b5e4ec668a724b (patch)
tree7b5034d8dd1e67858cc8c053be166cc14bc90970
parent117b78df17f6dd8682c25ae8cf9083f8367dae3f (diff)
Messages: Introduce a IEBase base class and share it for GSM48 and GSM0808
-rw-r--r--BSSMAP.st12
-rw-r--r--GSM48.st12
-rw-r--r--Messages.st20
-rw-r--r--package.xml2
4 files changed, 23 insertions, 23 deletions
diff --git a/BSSMAP.st b/BSSMAP.st
index b73ec66..60f7fff 100644
--- a/BSSMAP.st
+++ b/BSSMAP.st
@@ -1,4 +1,4 @@
-Object subclass: GSM0808IE [
+IEBase subclass: GSM0808IE [
<category: 'osmo-message'>
<comment: 'Base class of IEs for GSM0808'>
@@ -6,16 +6,6 @@ Object subclass: GSM0808IE [
"Return if this IE is a TLV or a TV"
^ false
]
-
- type [
- "Go through the elementId of the class"
- ^ self class elementId
- ]
-
- writeOn: aMsg [
- aMsg putByte: self class elementId.
- self writeOnDirect: aMsg.
- ]
]
Object subclass: GSM0808Helper [
diff --git a/GSM48.st b/GSM48.st
index 29e60b8..87f117f 100644
--- a/GSM48.st
+++ b/GSM48.st
@@ -4,18 +4,8 @@
IEs for GSM48MSG
"""
-Object subclass: GSM48IE [
+IEBase subclass: GSM48IE [
<comment: 'I am a Information Element for GSM48'>
-
- writeOnDirect: aMsg [
- "This should be implemented by the subclass"
- self subclassResponsibility
- ]
-
- writeOn: aMsg [
- aMsg putByte: self class elementId.
- self writeOnDirect: aMsg.
- ]
]
GSM48IE subclass: GSM48SimpleData [
diff --git a/Messages.st b/Messages.st
index 13f9b54..4bb616d 100644
--- a/Messages.st
+++ b/Messages.st
@@ -1,4 +1,24 @@
"General IE based message handling"
+
+Object subclass: IEBase [
+ <comment: 'I am a base for IE types'>
+
+ type [
+ "Go through the elementId of the class"
+ ^ self class elementId
+ ]
+
+ writeOnDirect: aMsg [
+ "This should be implemented by the subclass"
+ self subclassResponsibility
+ ]
+
+ writeOn: aMsg [
+ aMsg putByte: self class elementId.
+ self writeOnDirect: aMsg.
+ ]
+]
+
Object subclass: DataIE [
| data |
diff --git a/package.xml b/package.xml
index 00e11f2..430f493 100644
--- a/package.xml
+++ b/package.xml
@@ -4,9 +4,9 @@
<prereq>OsmoNetwork</prereq>
<prereq>OsmoLogging</prereq>
+ <filein>Messages.st</filein>
<filein>BSSAP.st</filein>
<filein>BSSMAP.st</filein>
- <filein>Messages.st</filein>
<filein>GSM48.st</filein>
<filein>SCCPHandler.st</filein>
<filein>TestPhone.st</filein>