diff options
author | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2014-05-13 05:00:49 +0200 |
---|---|---|
committer | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2014-05-13 05:00:49 +0200 |
commit | f4d03c969ed12762b15718f799236d5d18700064 (patch) | |
tree | a52af8cc64e74678371ca0d77ba51e6c5c9fd17b | |
parent | b05ed3a2011a71fa7818ac8b5d3ac73e0f2a1cce (diff) |
smpp: Implement parsing of SMPPGenericNack
-rw-r--r-- | codec/SMPPGenericNack.st | 28 | ||||
-rw-r--r-- | package.xml | 1 | ||||
-rw-r--r-- | test/SMPPMessageTest.st | 11 |
3 files changed, 40 insertions, 0 deletions
diff --git a/codec/SMPPGenericNack.st b/codec/SMPPGenericNack.st new file mode 100644 index 0000000..0b0fb78 --- /dev/null +++ b/codec/SMPPGenericNack.st @@ -0,0 +1,28 @@ +" + (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: SMPPGenericNack [ + SMPPGenericNack class >> messageType [ + ^self genericNack + ] + + SMPPGenericNack class >> tlvDescription [ + ^OrderedCollection new + ] +] + diff --git a/package.xml b/package.xml index e96047f..6f737a4 100644 --- a/package.xml +++ b/package.xml @@ -9,6 +9,7 @@ <filein>codec/SMPPBindTransmitterBody.st</filein> <filein>codec/SMPPBindTransceiver.st</filein> <filein>codec/SMPPEnquireLink.st</filein> + <filein>codec/SMPPGenericNack.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 39dc2e8..08eeacf 100644 --- a/test/SMPPMessageTest.st +++ b/test/SMPPMessageTest.st @@ -42,6 +42,11 @@ TestCase subclass: SMPPMessageTest [ 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r03] ] + exampleGenericNack [ + ^#[16r00 16r00 16r00 16r10 16r80 16r00 16r00 16r00 + 16r00 16r00 16r00 16r03 16r6A 16rEC 16r9D 16rCB] + ] + testReadMessage [ | msg | msg := SMPPMessage readFrom: self examplePdu readStream. @@ -90,4 +95,10 @@ TestCase subclass: SMPPMessageTest [ msg := SMPPMessage readFrom: self exampleEnquire readStream. self assert: msg body class equals: SMPPEnquireLink. ] + + testGenericNack [ + | msg | + msg := SMPPMessage readFrom: self exampleGenericNack readStream. + self assert: msg body class equals: SMPPGenericNack. + ] ] |