@Override public int calculateByteSizeOfBody() { int bodyLength = 0; bodyLength += PduUtil.calculateByteSizeOfNullTerminatedString(this.serviceType); bodyLength += PduUtil.calculateByteSizeOfAddress(this.sourceAddress); bodyLength += PduUtil.calculateByteSizeOfAddress(this.destAddress); bodyLength += 3; // esmClass, priority, protocolId bodyLength += PduUtil.calculateByteSizeOfNullTerminatedString(this.scheduleDeliveryTime); bodyLength += PduUtil.calculateByteSizeOfNullTerminatedString(this.validityPeriod); bodyLength += 5; // regDelivery, replace, dataCoding, defaultMsgId, messageLength bytes bodyLength += getShortMessageLength(); return bodyLength; }
@Override public int calculateByteSizeOfBody() { int bodyLength = 0; bodyLength += PduUtil.calculateByteSizeOfNullTerminatedString(this.serviceType); bodyLength += PduUtil.calculateByteSizeOfAddress(this.sourceAddress); bodyLength += PduUtil.calculateByteSizeOfAddress(this.destAddress); bodyLength += 3; // esmClass, priority, protocolId bodyLength += PduUtil.calculateByteSizeOfNullTerminatedString(this.scheduleDeliveryTime); bodyLength += PduUtil.calculateByteSizeOfNullTerminatedString(this.validityPeriod); bodyLength += 5; // regDelivery, replace, dataCoding, defaultMsgId, messageLength bytes bodyLength += getShortMessageLength(); return bodyLength; }
@Override public int calculateByteSizeOfBody() { int bodyLength = 0; bodyLength += PduUtil.calculateByteSizeOfNullTerminatedString(this.serviceType); bodyLength += PduUtil.calculateByteSizeOfAddress(this.sourceAddress); bodyLength += PduUtil.calculateByteSizeOfAddress(this.destAddress); bodyLength += 3; // esmClass, priority, protocolId bodyLength += PduUtil.calculateByteSizeOfNullTerminatedString(this.scheduleDeliveryTime); bodyLength += PduUtil.calculateByteSizeOfNullTerminatedString(this.validityPeriod); bodyLength += 5; // regDelivery, replace, dataCoding, defaultMsgId, messageLength bytes bodyLength += getShortMessageLength(); return bodyLength; }
@Override public int calculateByteSizeOfBody() { int bodyLength = 0; bodyLength += PduUtil.calculateByteSizeOfNullTerminatedString(this.serviceType); bodyLength += PduUtil.calculateByteSizeOfAddress(this.sourceAddress); bodyLength += PduUtil.calculateByteSizeOfAddress(this.destAddress); bodyLength += 3; // esmClass, priority, protocolId bodyLength += PduUtil.calculateByteSizeOfNullTerminatedString(this.scheduleDeliveryTime); bodyLength += PduUtil.calculateByteSizeOfNullTerminatedString(this.validityPeriod); bodyLength += 5; // regDelivery, replace, dataCoding, defaultMsgId, messageLength bytes bodyLength += getShortMessageLength(); return bodyLength; }
if (dev.getShortMessageLength() == 0) {
@Override public void writeBody(ChannelBuffer buffer) throws UnrecoverablePduException, RecoverablePduException { ChannelBufferUtil.writeNullTerminatedString(buffer, this.serviceType); ChannelBufferUtil.writeAddress(buffer, this.sourceAddress); ChannelBufferUtil.writeAddress(buffer, this.destAddress); buffer.writeByte(this.esmClass); buffer.writeByte(this.protocolId); buffer.writeByte(this.priority); ChannelBufferUtil.writeNullTerminatedString(buffer, this.scheduleDeliveryTime); ChannelBufferUtil.writeNullTerminatedString(buffer, this.validityPeriod); buffer.writeByte(this.registeredDelivery); buffer.writeByte(this.replaceIfPresent); buffer.writeByte(this.dataCoding); buffer.writeByte(this.defaultMsgId); buffer.writeByte((byte)getShortMessageLength()); if (this.shortMessage != null) { buffer.writeBytes(this.shortMessage); } }
@Override public void writeBody(ChannelBuffer buffer) throws UnrecoverablePduException, RecoverablePduException { ChannelBufferUtil.writeNullTerminatedString(buffer, this.serviceType); ChannelBufferUtil.writeAddress(buffer, this.sourceAddress); ChannelBufferUtil.writeAddress(buffer, this.destAddress); buffer.writeByte(this.esmClass); buffer.writeByte(this.protocolId); buffer.writeByte(this.priority); ChannelBufferUtil.writeNullTerminatedString(buffer, this.scheduleDeliveryTime); ChannelBufferUtil.writeNullTerminatedString(buffer, this.validityPeriod); buffer.writeByte(this.registeredDelivery); buffer.writeByte(this.replaceIfPresent); buffer.writeByte(this.dataCoding); buffer.writeByte(this.defaultMsgId); buffer.writeByte((byte)getShortMessageLength()); if (this.shortMessage != null) { buffer.writeBytes(this.shortMessage); } }
@Override public void writeBody(ChannelBuffer buffer) throws UnrecoverablePduException, RecoverablePduException { ChannelBufferUtil.writeNullTerminatedString(buffer, this.serviceType); ChannelBufferUtil.writeAddress(buffer, this.sourceAddress); ChannelBufferUtil.writeAddress(buffer, this.destAddress); buffer.writeByte(this.esmClass); buffer.writeByte(this.protocolId); buffer.writeByte(this.priority); ChannelBufferUtil.writeNullTerminatedString(buffer, this.scheduleDeliveryTime); ChannelBufferUtil.writeNullTerminatedString(buffer, this.validityPeriod); buffer.writeByte(this.registeredDelivery); buffer.writeByte(this.replaceIfPresent); buffer.writeByte(this.dataCoding); buffer.writeByte(this.defaultMsgId); buffer.writeByte((byte)getShortMessageLength()); if (this.shortMessage != null) { buffer.writeBytes(this.shortMessage); } }
@Override public void writeBody(ChannelBuffer buffer) throws UnrecoverablePduException, RecoverablePduException { ChannelBufferUtil.writeNullTerminatedString(buffer, this.serviceType); ChannelBufferUtil.writeAddress(buffer, this.sourceAddress); ChannelBufferUtil.writeAddress(buffer, this.destAddress); buffer.writeByte(this.esmClass); buffer.writeByte(this.protocolId); buffer.writeByte(this.priority); ChannelBufferUtil.writeNullTerminatedString(buffer, this.scheduleDeliveryTime); ChannelBufferUtil.writeNullTerminatedString(buffer, this.validityPeriod); buffer.writeByte(this.registeredDelivery); buffer.writeByte(this.replaceIfPresent); buffer.writeByte(this.dataCoding); buffer.writeByte(this.defaultMsgId); buffer.writeByte((byte)getShortMessageLength()); if (this.shortMessage != null) { buffer.writeBytes(this.shortMessage); } }