From ccdb0f5207c0c3578ea6e808b20c7651253596e2 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Tue, 13 May 2014 04:47:00 +0200 Subject: [PATCH] smpp: Be able to parse the SMPP Enquire Link --- codec/SMPPEnquireLink.st | 28 ++++++++++++++++++++++++++++ package.xml | 1 + test/SMPPMessageTest.st | 11 +++++++++++ 3 files changed, 40 insertions(+) create mode 100644 codec/SMPPEnquireLink.st diff --git a/codec/SMPPEnquireLink.st b/codec/SMPPEnquireLink.st new file mode 100644 index 0000000..34c442b --- /dev/null +++ b/codec/SMPPEnquireLink.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 . +" + +SMPPBodyBase subclass: SMPPEnquireLink [ + + SMPPEnquireLink class >> messageType [ + ^self enquireLink + ] + + SMPPEnquireLink class >> tlvDescription [ + ^OrderedCollection new + ] +] diff --git a/package.xml b/package.xml index cbc7ca9..e96047f 100644 --- a/package.xml +++ b/package.xml @@ -8,6 +8,7 @@ codec/SMPPBodyBase.st codec/SMPPBindTransmitterBody.st codec/SMPPBindTransceiver.st + codec/SMPPEnquireLink.st codec/attributes/SMPPOctetString.st codec/attributes/SMPPInteger.st diff --git a/test/SMPPMessageTest.st b/test/SMPPMessageTest.st index 4e1a5d0..39dc2e8 100644 --- a/test/SMPPMessageTest.st +++ b/test/SMPPMessageTest.st @@ -37,6 +37,11 @@ TestCase subclass: SMPPMessageTest [ 16r00] ] + exampleEnquire [ + ^#[16r00 16r00 16r00 16r10 16r00 16r00 16r00 16r15 + 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r03] + ] + testReadMessage [ | msg | msg := SMPPMessage readFrom: self examplePdu readStream. @@ -79,4 +84,10 @@ TestCase subclass: SMPPMessageTest [ self assert: msg body class equals: SMPPBindTransceiver. self assert: msg body systemdId equals: 'AAAAAAAAAA'. ] + + testEnquireLink [ + | msg | + msg := SMPPMessage readFrom: self exampleEnquire readStream. + self assert: msg body class equals: SMPPEnquireLink. + ] ]