diff options
author | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2014-05-13 05:02:51 +0200 |
---|---|---|
committer | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2014-05-13 05:02:51 +0200 |
commit | efb09d0f74aa792dc453b379112c37b780a9ddf1 (patch) | |
tree | 25afde14f30b1c80cdbf51b21e9bde16ebbd1eb2 | |
parent | f4d03c969ed12762b15718f799236d5d18700064 (diff) |
smpp: Implement the unbind message type
-rw-r--r-- | codec/SMPPUnbind.st | 29 | ||||
-rw-r--r-- | package.xml | 1 | ||||
-rw-r--r-- | test/SMPPMessageTest.st | 11 |
3 files changed, 41 insertions, 0 deletions
diff --git a/codec/SMPPUnbind.st b/codec/SMPPUnbind.st new file mode 100644 index 0000000..f4e23ac --- /dev/null +++ b/codec/SMPPUnbind.st @@ -0,0 +1,29 @@ +" + (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/>. +" + +SMPPBodyBase subclass: SMPPUnbind [ + SMPPUnbind class >> messageType [ + ^self unbind + ] + + SMPPUnbind class >> tlvDescription [ + ^OrderedCollection new + ] +] + + diff --git a/package.xml b/package.xml index 6f737a4..f4635e7 100644 --- a/package.xml +++ b/package.xml @@ -10,6 +10,7 @@ <filein>codec/SMPPBindTransceiver.st</filein> <filein>codec/SMPPEnquireLink.st</filein> <filein>codec/SMPPGenericNack.st</filein> + <filein>codec/SMPPUnbind.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 08eeacf..08caac9 100644 --- a/test/SMPPMessageTest.st +++ b/test/SMPPMessageTest.st @@ -47,6 +47,11 @@ TestCase subclass: SMPPMessageTest [ 16r00 16r00 16r00 16r03 16r6A 16rEC 16r9D 16rCB] ] + exampleUnbind [ + ^#[16r00 16r00 16r00 16r10 16r00 16r00 16r00 16r06 + 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r06] + ] + testReadMessage [ | msg | msg := SMPPMessage readFrom: self examplePdu readStream. @@ -101,4 +106,10 @@ TestCase subclass: SMPPMessageTest [ msg := SMPPMessage readFrom: self exampleGenericNack readStream. self assert: msg body class equals: SMPPGenericNack. ] + + testExampleUnbind [ + | msg | + msg := SMPPMessage readFrom: self exampleUnbind readStream. + self assert: msg body class equals: SMPPUnbind. + ] ] |