summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--codec/SMPPBindTransceiver.st24
-rw-r--r--package.xml1
-rw-r--r--test/SMPPMessageTest.st15
3 files changed, 40 insertions, 0 deletions
diff --git a/codec/SMPPBindTransceiver.st b/codec/SMPPBindTransceiver.st
new file mode 100644
index 0000000..7513447
--- /dev/null
+++ b/codec/SMPPBindTransceiver.st
@@ -0,0 +1,24 @@
+"
+ (C) 2014 by Holger Hans Peter Freyther
+ All Rights Reserved
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Affero General Public License as
+ published by the Free Software Foundation, either version 3 of the
+ License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Affero General Public License for more details.
+
+ You should have received a copy of the GNU Affero General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+"
+
+SMPPBindTransmitterBody subclass: SMPPBindTransceiver [
+ SMPPBindTransceiver class >> messageType [
+ ^self bindTransceiver
+ ]
+]
+
diff --git a/package.xml b/package.xml
index 74dc6fd..cbc7ca9 100644
--- a/package.xml
+++ b/package.xml
@@ -7,6 +7,7 @@
<filein>codec/SMPPBodyBase.st</filein>
<filein>codec/SMPPBindTransmitterBody.st</filein>
+ <filein>codec/SMPPBindTransceiver.st</filein>
<filein>codec/attributes/SMPPOctetString.st</filein>
<filein>codec/attributes/SMPPInteger.st</filein>
diff --git a/test/SMPPMessageTest.st b/test/SMPPMessageTest.st
index e1b1d0e..4e1a5d0 100644
--- a/test/SMPPMessageTest.st
+++ b/test/SMPPMessageTest.st
@@ -29,6 +29,14 @@ TestCase subclass: SMPPMessageTest [
16r54 16r31 16r00 16r00 16r01 16r01 16r00]
]
+ exampleBind [
+ ^#[16r00 16r00 16r00 16r21 16r00 16r00 16r00 16r09
+ 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r02
+ 16r41 16r41 16r41 16r41 16r41 16r41 16r41 16r41
+ 16r41 16r41 16r00 16r00 16r00 16r34 16r00 16r00
+ 16r00]
+ ]
+
testReadMessage [
| msg |
msg := SMPPMessage readFrom: self examplePdu readStream.
@@ -64,4 +72,11 @@ TestCase subclass: SMPPMessageTest [
toMessage) asByteArray.
self assert: data equals: self examplePdu.
]
+
+ testBindTrx [
+ | msg |
+ msg := SMPPMessage readFrom: self exampleBind readStream.
+ self assert: msg body class equals: SMPPBindTransceiver.
+ self assert: msg body systemdId equals: 'AAAAAAAAAA'.
+ ]
]