anthill_smpp_ruby 0.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (154) hide show
  1. data/MIT-LICENSE +21 -0
  2. data/README +30 -0
  3. data/anthill_smpp_ruby.gemspec +18 -0
  4. data/changelog +43 -0
  5. data/data/dumps/random_command.dump +1 -0
  6. data/data/dumps/smpp_alert_notification.dump +1 -0
  7. data/data/dumps/smpp_bind_receiver.dump +1 -0
  8. data/data/dumps/smpp_bind_receiver_resp.dump +1 -0
  9. data/data/dumps/smpp_bind_transceiver.dump +1 -0
  10. data/data/dumps/smpp_bind_transceiver_1.dump +2 -0
  11. data/data/dumps/smpp_bind_transceiver_resp.dump +1 -0
  12. data/data/dumps/smpp_bind_transmitter.dump +1 -0
  13. data/data/dumps/smpp_bind_transmitter_resp.dump +1 -0
  14. data/data/dumps/smpp_broadcast_sm.dump +1 -0
  15. data/data/dumps/smpp_broadcast_sm_resp.dump +1 -0
  16. data/data/dumps/smpp_cancel_broadcast_sm.dump +1 -0
  17. data/data/dumps/smpp_cancel_broadcast_sm_resp.dump +1 -0
  18. data/data/dumps/smpp_cancel_sm.dump +1 -0
  19. data/data/dumps/smpp_cancel_sm_resp.dump +1 -0
  20. data/data/dumps/smpp_data_sm.dump +1 -0
  21. data/data/dumps/smpp_data_sm_resp.dump +1 -0
  22. data/data/dumps/smpp_deliver_sm.dump +1 -0
  23. data/data/dumps/smpp_deliver_sm_resp.dump +1 -0
  24. data/data/dumps/smpp_enquire_link.dump +1 -0
  25. data/data/dumps/smpp_enquire_link_resp.dump +1 -0
  26. data/data/dumps/smpp_generic_nack.dump +1 -0
  27. data/data/dumps/smpp_outbind.dump +1 -0
  28. data/data/dumps/smpp_query_broadcast_sm.dump +1 -0
  29. data/data/dumps/smpp_query_broadcast_sm_resp.dump +1 -0
  30. data/data/dumps/smpp_query_broadcast_sm_resp_1.dump +1 -0
  31. data/data/dumps/smpp_query_sm.dump +1 -0
  32. data/data/dumps/smpp_query_sm_resp.dump +1 -0
  33. data/data/dumps/smpp_replace_sm.dump +1 -0
  34. data/data/dumps/smpp_replace_sm_resp.dump +1 -0
  35. data/data/dumps/smpp_submit_multi.dump +1 -0
  36. data/data/dumps/smpp_submit_multi_resp.dump +1 -0
  37. data/data/dumps/smpp_submit_sm.dump +1 -0
  38. data/data/dumps/smpp_submit_sm_resp.dump +1 -0
  39. data/data/dumps/smpp_unbind.dump +1 -0
  40. data/data/dumps/smpp_unbind_resp.dump +1 -0
  41. data/data/pdus/random_command.xml +35 -0
  42. data/data/pdus/smpp_alert_notification.xml +14 -0
  43. data/data/pdus/smpp_alert_notification_no_optional.xml +13 -0
  44. data/data/pdus/smpp_bind_receiver.xml +17 -0
  45. data/data/pdus/smpp_bind_receiver_resp.xml +12 -0
  46. data/data/pdus/smpp_bind_receiver_resp_no_optional.xml +11 -0
  47. data/data/pdus/smpp_bind_transceiver.xml +17 -0
  48. data/data/pdus/smpp_bind_transceiver_resp.xml +12 -0
  49. data/data/pdus/smpp_bind_transceiver_resp_no_optional.xml +11 -0
  50. data/data/pdus/smpp_bind_transmitter.xml +17 -0
  51. data/data/pdus/smpp_bind_transmitter_resp.xml +12 -0
  52. data/data/pdus/smpp_bind_transmitter_resp_no_optional.xml +11 -0
  53. data/data/pdus/smpp_broadcast_sm.xml +47 -0
  54. data/data/pdus/smpp_broadcast_sm_no_optional.xml +26 -0
  55. data/data/pdus/smpp_broadcast_sm_resp.xml +14 -0
  56. data/data/pdus/smpp_broadcast_sm_resp_no_optional.xml +8 -0
  57. data/data/pdus/smpp_cancel_broadcast_sm.xml +17 -0
  58. data/data/pdus/smpp_cancel_broadcast_sm_no_optional.xml +15 -0
  59. data/data/pdus/smpp_cancel_broadcast_sm_resp.xml +7 -0
  60. data/data/pdus/smpp_cancel_sm.xml +18 -0
  61. data/data/pdus/smpp_cancel_sm_resp.xml +10 -0
  62. data/data/pdus/smpp_commands.xsd +914 -0
  63. data/data/pdus/smpp_data_sm.xml +58 -0
  64. data/data/pdus/smpp_data_sm_no_optional.xml +17 -0
  65. data/data/pdus/smpp_data_sm_resp.xml +15 -0
  66. data/data/pdus/smpp_data_sm_resp_no_optional.xml +8 -0
  67. data/data/pdus/smpp_deliver_sm.xml +46 -0
  68. data/data/pdus/smpp_deliver_sm_no_optional.xml +25 -0
  69. data/data/pdus/smpp_deliver_sm_resp.xml +14 -0
  70. data/data/pdus/smpp_deliver_sm_resp_no_optional.xml +8 -0
  71. data/data/pdus/smpp_enquire_link.xml +10 -0
  72. data/data/pdus/smpp_enquire_link_resp.xml +10 -0
  73. data/data/pdus/smpp_generic_nack.xml +10 -0
  74. data/data/pdus/smpp_outbind.xml +12 -0
  75. data/data/pdus/smpp_query_broadcast_sm.xml +12 -0
  76. data/data/pdus/smpp_query_broadcast_sm_no_optional.xml +11 -0
  77. data/data/pdus/smpp_query_broadcast_sm_resp.xml +17 -0
  78. data/data/pdus/smpp_query_broadcast_sm_resp_no_optional.xml +15 -0
  79. data/data/pdus/smpp_query_sm.xml +11 -0
  80. data/data/pdus/smpp_query_sm_resp.xml +11 -0
  81. data/data/pdus/smpp_replace_sm.xml +18 -0
  82. data/data/pdus/smpp_replace_sm_no_optional.xml +17 -0
  83. data/data/pdus/smpp_replace_sm_resp.xml +7 -0
  84. data/data/pdus/smpp_submit_multi.xml +73 -0
  85. data/data/pdus/smpp_submit_multi_no_optional.xml +51 -0
  86. data/data/pdus/smpp_submit_multi_resp.xml +35 -0
  87. data/data/pdus/smpp_submit_sm.xml +57 -0
  88. data/data/pdus/smpp_submit_sm_no_optional.xml +28 -0
  89. data/data/pdus/smpp_submit_sm_resp.xml +8 -0
  90. data/data/pdus/smpp_unbind.xml +10 -0
  91. data/data/pdus/smpp_unbind_resp.xml +10 -0
  92. data/examples/dump_viewer.rb +298 -0
  93. data/examples/pdu_composer.rb +1331 -0
  94. data/knownbugs +24 -0
  95. data/lib/anthill_smpp_ruby.rb +83 -0
  96. data/lib/i_smpp_outputter.rb +425 -0
  97. data/lib/pdu/smpp_alert_notification.rb +132 -0
  98. data/lib/pdu/smpp_bind.rb +102 -0
  99. data/lib/pdu/smpp_bind_receiver.rb +29 -0
  100. data/lib/pdu/smpp_bind_receiver_resp.rb +30 -0
  101. data/lib/pdu/smpp_bind_resp.rb +100 -0
  102. data/lib/pdu/smpp_bind_transceiver.rb +29 -0
  103. data/lib/pdu/smpp_bind_transceiver_resp.rb +31 -0
  104. data/lib/pdu/smpp_bind_transmitter.rb +29 -0
  105. data/lib/pdu/smpp_bind_transmitter_resp.rb +30 -0
  106. data/lib/pdu/smpp_broadcast_sm.rb +566 -0
  107. data/lib/pdu/smpp_broadcast_sm_resp.rb +130 -0
  108. data/lib/pdu/smpp_cancel_broadcast_sm.rb +143 -0
  109. data/lib/pdu/smpp_cancel_broadcast_sm_resp.rb +60 -0
  110. data/lib/pdu/smpp_cancel_sm.rb +110 -0
  111. data/lib/pdu/smpp_cancel_sm_resp.rb +60 -0
  112. data/lib/pdu/smpp_data_sm.rb +679 -0
  113. data/lib/pdu/smpp_data_sm_resp.rb +148 -0
  114. data/lib/pdu/smpp_deliver_sm.rb +458 -0
  115. data/lib/pdu/smpp_deliver_sm_resp.rb +137 -0
  116. data/lib/pdu/smpp_enquire_link.rb +59 -0
  117. data/lib/pdu/smpp_enquire_link_resp.rb +61 -0
  118. data/lib/pdu/smpp_generic_nack.rb +61 -0
  119. data/lib/pdu/smpp_outbind.rb +71 -0
  120. data/lib/pdu/smpp_pdu.rb +90 -0
  121. data/lib/pdu/smpp_query_broadcast_sm.rb +120 -0
  122. data/lib/pdu/smpp_query_broadcast_sm_resp.rb +192 -0
  123. data/lib/pdu/smpp_query_sm.rb +92 -0
  124. data/lib/pdu/smpp_query_sm_resp.rb +92 -0
  125. data/lib/pdu/smpp_replace_sm.rb +172 -0
  126. data/lib/pdu/smpp_replace_sm_resp.rb +61 -0
  127. data/lib/pdu/smpp_resp.rb +40 -0
  128. data/lib/pdu/smpp_submit_multi.rb +517 -0
  129. data/lib/pdu/smpp_submit_multi_resp.rb +90 -0
  130. data/lib/pdu/smpp_submit_sm.rb +591 -0
  131. data/lib/pdu/smpp_submit_sm_resp.rb +72 -0
  132. data/lib/pdu/smpp_unbind.rb +60 -0
  133. data/lib/pdu/smpp_unbind_resp.rb +61 -0
  134. data/lib/smpp_constants.rb +917 -0
  135. data/lib/smpp_csv_outputter.rb +1601 -0
  136. data/lib/smpp_datatypes.rb +89 -0
  137. data/lib/smpp_decoder.rb +627 -0
  138. data/lib/smpp_encoder.rb +495 -0
  139. data/lib/smpp_hex_outputter.rb +36 -0
  140. data/lib/smpp_outputter_base.rb +315 -0
  141. data/lib/smpp_structures.rb +98 -0
  142. data/lib/smpp_txt_outputter.rb +1895 -0
  143. data/lib/smpp_validator.rb +373 -0
  144. data/lib/smpp_xml_outputter.rb +34 -0
  145. data/roadmap +18 -0
  146. data/setup.rb +1585 -0
  147. data/test/anthill_smpp_test.rb +29 -0
  148. data/test/smpp_codec_test.rb +30 -0
  149. data/test/smpp_datatypes_test.rb +69 -0
  150. data/test/smpp_outputter_test.rb +1261 -0
  151. data/test/smpp_parsing_test.rb +1758 -0
  152. data/test/smpp_rawdump_test.rb +2095 -0
  153. data/test/smpp_validator_test.rb +441 -0
  154. metadata +206 -0
@@ -0,0 +1,1601 @@
1
+ #
2
+ # Copyright 2007 Majoron.com (developers@majoron.com)
3
+ # Original sources are available at www.majoron.com
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+ #
17
+
18
+
19
+ module Majoron
20
+
21
+ module AntHill
22
+ module SMPP
23
+ class SMPPCSVOutputter < AntHill::TxtOutputter
24
+ include SMPPOutputterBase
25
+
26
+
27
+ def initialize(ostream, showesm = true, showfmt = true)
28
+ super(ostream)
29
+ initialize_smpp_outputter_base()
30
+ @show_esminfo = showesm
31
+ @show_fmtinfo = showfmt
32
+ end
33
+
34
+
35
+ # Output header
36
+ def output_header(header)
37
+ command_name = get_command_name(header.command_id())
38
+ error_name = get_error_name(header.command_status())
39
+
40
+ # Output command lengtht
41
+ ostream << Outputter::HEADER << Outputter::SEPARATOR
42
+ ostream << Outputter::SEPARATOR << FieldsName::COMMAND_LENGTH
43
+ ostream << Outputter::SEPARATOR << header.command_length().to_s
44
+ ostream << Outputter::SEPARATOR
45
+
46
+ # Show hex dump
47
+ encoder.reset_buffer()
48
+ encoder.encode_unsigned32(header.command_length())
49
+ byte_buffer1 = AntHill::ByteBuffer.new(encoder.get_buffer())
50
+ byte_buffer1.write_dump(ostream)
51
+ ostream << "\n"
52
+
53
+ # Output command id
54
+ ostream << Outputter::HEADER << Outputter::SEPARATOR
55
+ ostream << Outputter::SEPARATOR << FieldsName::COMMAND_ID
56
+ ostream << Outputter::SEPARATOR << Outputter::HEXSIGN
57
+ ostream << sprintf("%X", header.command_id()) << Outputter::EQUAL
58
+ ostream << command_name << Outputter::SEPARATOR
59
+
60
+ # Show hex dump
61
+ encoder.reset_buffer()
62
+ encoder.encode_unsigned32(header.command_id())
63
+ byte_buffer2 = AntHill::ByteBuffer.new(encoder.get_buffer())
64
+ byte_buffer2.write_dump(ostream)
65
+ ostream << "\n"
66
+
67
+ # Output command status
68
+ ostream << Outputter::HEADER << Outputter::SEPARATOR
69
+ ostream << Outputter::SEPARATOR << FieldsName::COMMAND_STATUS
70
+ ostream << Outputter::SEPARATOR << header.command_status().to_s
71
+ ostream << Outputter::EQUAL << error_name << Outputter::SEPARATOR
72
+
73
+ # Show hex dump
74
+ encoder.reset_buffer()
75
+ encoder.encode_unsigned32(header.command_status())
76
+ byte_buffer3 = AntHill::ByteBuffer.new(encoder.get_buffer())
77
+ byte_buffer3.write_dump(ostream)
78
+ ostream << "\n"
79
+
80
+ # Output sequence number
81
+ ostream << Outputter::HEADER << Outputter::SEPARATOR
82
+ ostream << Outputter::SEPARATOR << FieldsName::SEQUENCE_NUMBER
83
+ ostream << Outputter::SEPARATOR << header.sequence_number().to_s
84
+ ostream << Outputter::SEPARATOR
85
+
86
+ # Show hex dump
87
+ encoder.reset_buffer()
88
+ encoder.encode_unsigned32(header.sequence_number())
89
+ byte_buffer4 = AntHill::ByteBuffer.new(encoder.get_buffer())
90
+ byte_buffer4.write_dump(ostream)
91
+ ostream << "\n"
92
+ end
93
+
94
+ # Output mandatory fields
95
+ def output_system_id(system_id)
96
+ ostream << Outputter::MANDATORY << Outputter::SEPARATOR
97
+ ostream << Outputter::SEPARATOR << FieldsName::SYSTEM_ID
98
+ ostream << Outputter::SEPARATOR << system_id.to_s
99
+ ostream << Outputter::SEPARATOR
100
+
101
+ # Show hex dump
102
+ encoder.reset_buffer()
103
+ encoder.encode_system_id(system_id)
104
+ byte_buffer = AntHill::ByteBuffer.new(encoder.get_buffer())
105
+ byte_buffer.write_dump(ostream)
106
+ ostream << "\n"
107
+ end
108
+
109
+ def output_password(password)
110
+ ostream << Outputter::MANDATORY << Outputter::SEPARATOR
111
+ ostream << Outputter::SEPARATOR << FieldsName::PASSWORD
112
+ ostream << Outputter::SEPARATOR << password.to_s
113
+ ostream << Outputter::SEPARATOR
114
+
115
+ # Show hex dump
116
+ encoder.reset_buffer()
117
+ encoder.encode_password(password)
118
+ byte_buffer = AntHill::ByteBuffer.new(encoder.get_buffer())
119
+ byte_buffer.write_dump(ostream)
120
+ ostream << "\n"
121
+ end
122
+
123
+ def output_system_type(system_type)
124
+ ostream << Outputter::MANDATORY << Outputter::SEPARATOR
125
+ ostream << Outputter::SEPARATOR << FieldsName::SYSTEM_TYPE
126
+ ostream << Outputter::SEPARATOR << system_type.to_s
127
+ ostream << Outputter::SEPARATOR
128
+
129
+
130
+ # Show hex dump
131
+ encoder.reset_buffer()
132
+ encoder.encode_system_type(system_type)
133
+ byte_buffer = AntHill::ByteBuffer.new(encoder.get_buffer())
134
+ byte_buffer.write_dump(ostream)
135
+ ostream << "\n"
136
+ end
137
+
138
+ def output_interface_version(interface_version)
139
+ ostream << Outputter::MANDATORY << Outputter::SEPARATOR
140
+ ostream << Outputter::SEPARATOR << FieldsName::INTERFACE_VERSION
141
+ ostream << Outputter::SEPARATOR << Outputter::HEXSIGN
142
+ ostream << sprintf("%X", interface_version) << Outputter::SEPARATOR
143
+
144
+ # Show hex dump
145
+ encoder.reset_buffer()
146
+ encoder.encode_interface_version(interface_version)
147
+ byte_buffer = AntHill::ByteBuffer.new(encoder.get_buffer())
148
+ byte_buffer.write_dump(ostream)
149
+ ostream << "\n"
150
+ end
151
+
152
+ def output_addr_ton(addr_ton)
153
+ ostream << Outputter::MANDATORY << Outputter::SEPARATOR
154
+ ostream << Outputter::SEPARATOR << FieldsName::ADDR_TON
155
+ ostream << Outputter::SEPARATOR << addr_ton.to_s
156
+ ostream << Outputter::SEPARATOR
157
+
158
+ # Show hex dump
159
+ encoder.reset_buffer()
160
+ encoder.encode_addr_ton(addr_ton)
161
+ byte_buffer = AntHill::ByteBuffer.new(encoder.get_buffer())
162
+ byte_buffer.write_dump(ostream)
163
+ ostream << "\n"
164
+ end
165
+
166
+ def output_addr_npi(addr_npi)
167
+ ostream << Outputter::MANDATORY << Outputter::SEPARATOR
168
+ ostream << Outputter::SEPARATOR << FieldsName::ADDR_NPI
169
+ ostream << Outputter::SEPARATOR << addr_npi.to_s
170
+ ostream << Outputter::SEPARATOR
171
+
172
+ # Show hex dump
173
+ encoder.reset_buffer()
174
+ encoder.encode_addr_npi(addr_npi)
175
+ byte_buffer = AntHill::ByteBuffer.new(encoder.get_buffer())
176
+ byte_buffer.write_dump(ostream)
177
+ ostream << "\n"
178
+ end
179
+
180
+ def output_address_range(address_range)
181
+ ostream << Outputter::MANDATORY << Outputter::SEPARATOR
182
+ ostream << Outputter::SEPARATOR << FieldsName::ADDRESS_RANGE
183
+ ostream << Outputter::SEPARATOR << address_range.to_s
184
+ ostream << Outputter::SEPARATOR
185
+
186
+ # Show hex dump
187
+ encoder.reset_buffer()
188
+ encoder.encode_address_range(address_range)
189
+ byte_buffer = AntHill::ByteBuffer.new(encoder.get_buffer())
190
+ byte_buffer.write_dump(ostream)
191
+ ostream << "\n"
192
+ end
193
+
194
+ def output_service_type(service_type)
195
+ ostream << Outputter::MANDATORY << Outputter::SEPARATOR
196
+ ostream << Outputter::SEPARATOR << FieldsName::SERVICE_TYPE
197
+ ostream << Outputter::SEPARATOR << service_type.to_s
198
+ ostream << Outputter::SEPARATOR
199
+
200
+ # Show hex dump
201
+ encoder.reset_buffer()
202
+ encoder.encode_service_type(service_type)
203
+ byte_buffer = AntHill::ByteBuffer.new(encoder.get_buffer())
204
+ byte_buffer.write_dump(ostream)
205
+ ostream << "\n"
206
+ end
207
+
208
+ def output_source_addr_ton(addr_ton)
209
+ ostream << Outputter::MANDATORY << Outputter::SEPARATOR
210
+ ostream << Outputter::SEPARATOR << FieldsName::SOURCE_ADDR_TON
211
+ ostream << Outputter::SEPARATOR << addr_ton.to_s
212
+ ostream << Outputter::SEPARATOR
213
+
214
+ # Show hex dump
215
+ encoder.reset_buffer()
216
+ encoder.encode_addr_ton(addr_ton)
217
+ byte_buffer = AntHill::ByteBuffer.new(encoder.get_buffer())
218
+ byte_buffer.write_dump(ostream)
219
+ ostream << "\n"
220
+ end
221
+
222
+ def output_source_addr_npi(addr_npi)
223
+ ostream << Outputter::MANDATORY << Outputter::SEPARATOR
224
+ ostream << Outputter::SEPARATOR << FieldsName::SOURCE_ADDR_NPI
225
+ ostream << Outputter::SEPARATOR << addr_npi.to_s
226
+ ostream << Outputter::SEPARATOR
227
+
228
+ # Show hex dump
229
+ encoder.reset_buffer()
230
+ encoder.encode_addr_npi(addr_npi)
231
+ byte_buffer = AntHill::ByteBuffer.new(encoder.get_buffer())
232
+ byte_buffer.write_dump(ostream)
233
+ ostream << "\n"
234
+ end
235
+
236
+ def output_source_addr21(source_addr)
237
+ ostream << Outputter::MANDATORY << Outputter::SEPARATOR
238
+ ostream << Outputter::SEPARATOR << FieldsName::SOURCE_ADDR
239
+ ostream << Outputter::SEPARATOR << source_addr.to_s
240
+ ostream << Outputter::SEPARATOR
241
+
242
+ # Show hex dump
243
+ encoder.reset_buffer()
244
+ encoder.encode_source_addr21(source_addr)
245
+ byte_buffer = AntHill::ByteBuffer.new(encoder.get_buffer())
246
+ byte_buffer.write_dump(ostream)
247
+ ostream << "\n"
248
+ end
249
+
250
+ def output_source_addr65(source_addr)
251
+ ostream << Outputter::MANDATORY << Outputter::SEPARATOR
252
+ ostream << Outputter::SEPARATOR << FieldsName::SOURCE_ADDR
253
+ ostream << Outputter::SEPARATOR << source_addr.to_s
254
+ ostream << Outputter::SEPARATOR
255
+
256
+ # Show hex dump
257
+ encoder.reset_buffer()
258
+ encoder.encode_source_addr65(source_addr)
259
+ byte_buffer = AntHill::ByteBuffer.new(encoder.get_buffer())
260
+ byte_buffer.write_dump(ostream)
261
+ ostream << "\n"
262
+ end
263
+
264
+ def output_dest_addr_ton(dest_addr_ton)
265
+ ostream << Outputter::MANDATORY << Outputter::SEPARATOR
266
+ ostream << Outputter::SEPARATOR << FieldsName::DEST_ADDR_TON
267
+ ostream << Outputter::SEPARATOR << dest_addr_ton.to_s
268
+ ostream << Outputter::SEPARATOR
269
+
270
+ # Show hex dump
271
+ encoder.reset_buffer()
272
+ encoder.encode_dest_addr_ton(dest_addr_ton)
273
+ byte_buffer = AntHill::ByteBuffer.new(encoder.get_buffer())
274
+ byte_buffer.write_dump(ostream)
275
+ ostream << "\n"
276
+ end
277
+
278
+ def output_dest_addr_npi(dest_addr_npi)
279
+ ostream << Outputter::MANDATORY << Outputter::SEPARATOR
280
+ ostream << Outputter::SEPARATOR << FieldsName::DEST_ADDR_NPI
281
+ ostream << Outputter::SEPARATOR << dest_addr_npi.to_s
282
+ ostream << Outputter::SEPARATOR
283
+
284
+ # Show hex dump
285
+ encoder.reset_buffer()
286
+ encoder.encode_dest_addr_npi(dest_addr_npi)
287
+ byte_buffer = AntHill::ByteBuffer.new(encoder.get_buffer())
288
+ byte_buffer.write_dump(ostream)
289
+ ostream << "\n"
290
+ end
291
+
292
+ def output_dest_addr21(dest_addr)
293
+ ostream << Outputter::MANDATORY << Outputter::SEPARATOR
294
+ ostream << Outputter::SEPARATOR << FieldsName::DEST_ADDR
295
+ ostream << Outputter::SEPARATOR << dest_addr.to_s
296
+ ostream << Outputter::SEPARATOR
297
+
298
+ # Show hex dump
299
+ encoder.reset_buffer()
300
+ encoder.encode_dest_addr21(dest_addr)
301
+ byte_buffer = AntHill::ByteBuffer.new(encoder.get_buffer())
302
+ byte_buffer.write_dump(ostream)
303
+ ostream << "\n"
304
+ end
305
+
306
+ def output_dest_addr65(dest_addr)
307
+ ostream << Outputter::MANDATORY << Outputter::SEPARATOR
308
+ ostream << Outputter::SEPARATOR << FieldsName::DEST_ADDR
309
+ ostream << Outputter::SEPARATOR << dest_addr.to_s
310
+ ostream << Outputter::SEPARATOR
311
+
312
+ # Show hex dump
313
+ encoder.reset_buffer()
314
+ encoder.encode_dest_addr65(dest_addr)
315
+ byte_buffer = AntHill::ByteBuffer.new(encoder.get_buffer())
316
+ byte_buffer.write_dump(ostream)
317
+ ostream << "\n"
318
+ end
319
+
320
+ def output_esm_class(esm_class)
321
+ ostream << Outputter::MANDATORY << Outputter::SEPARATOR
322
+ ostream << Outputter::SEPARATOR << FieldsName::DEST_ADDR
323
+ ostream << Outputter::SEPARATOR << esm_class.to_s
324
+ ostream << Outputter::SEPARATOR
325
+
326
+ # Show hex dump
327
+ encoder.reset_buffer()
328
+ encoder.encode_esm_class(esm_class)
329
+ byte_buffer = AntHill::ByteBuffer.new(encoder.get_buffer())
330
+ byte_buffer.write_dump(ostream)
331
+ ostream << "\n"
332
+ end
333
+
334
+ def output_protocol_id(protocol_id)
335
+ ostream << Outputter::MANDATORY << Outputter::SEPARATOR
336
+ ostream << Outputter::SEPARATOR << FieldsName::DEST_ADDR
337
+ ostream << Outputter::SEPARATOR << protocol_id.to_s
338
+ ostream << Outputter::SEPARATOR
339
+
340
+ # Show hex dump
341
+ encoder.reset_buffer()
342
+ encoder.encode_protocol_id(protocol_id)
343
+ byte_buffer = AntHill::ByteBuffer.new(encoder.get_buffer())
344
+ byte_buffer.write_dump(ostream)
345
+ ostream << "\n"
346
+ end
347
+
348
+ def output_priority_flag(priority_flag)
349
+ ostream << Outputter::MANDATORY << Outputter::SEPARATOR
350
+ ostream << Outputter::SEPARATOR << FieldsName::DEST_ADDR
351
+ ostream << Outputter::SEPARATOR << priority_flag.to_s
352
+ ostream << Outputter::SEPARATOR
353
+
354
+ # Show hex dump
355
+ encoder.reset_buffer()
356
+ encoder.encode_priority_flag(priority_flag)
357
+ byte_buffer = AntHill::ByteBuffer.new(encoder.get_buffer())
358
+ byte_buffer.write_dump(ostream)
359
+ ostream << "\n"
360
+ end
361
+
362
+ def output_schedule_delivery_time(schedule_delivery_time)
363
+ ostream << Outputter::MANDATORY << Outputter::SEPARATOR
364
+ ostream << Outputter::SEPARATOR << FieldsName::SCHEDULE_DELIVERY_TIME
365
+ ostream << Outputter::SEPARATOR << schedule_delivery_time.to_s
366
+ ostream << Outputter::SEPARATOR
367
+
368
+ # Show hex dump
369
+ encoder.reset_buffer()
370
+ encoder.encode_schedule_delivery_time(schedule_delivery_time)
371
+ byte_buffer = AntHill::ByteBuffer.new(encoder.get_buffer())
372
+ byte_buffer.write_dump(ostream)
373
+ ostream << "\n"
374
+ end
375
+
376
+ def output_validity_period(validity_period)
377
+ ostream << Outputter::MANDATORY << Outputter::SEPARATOR
378
+ ostream << Outputter::SEPARATOR << FieldsName::VALIDITY_PERIOD
379
+ ostream << Outputter::SEPARATOR << validity_period.to_s
380
+ ostream << Outputter::SEPARATOR
381
+
382
+ # Show hex dump
383
+ encoder.reset_buffer()
384
+ encoder.encode_validity_period(validity_period)
385
+ byte_buffer = AntHill::ByteBuffer.new(encoder.get_buffer())
386
+ byte_buffer.write_dump(ostream)
387
+ ostream << "\n"
388
+ end
389
+
390
+ def output_registered_delivery(registered_delivery)
391
+ ostream << Outputter::MANDATORY << Outputter::SEPARATOR
392
+ ostream << Outputter::SEPARATOR << FieldsName::REGISTERED_DELIVERY
393
+ ostream << Outputter::SEPARATOR << registered_delivery.to_s
394
+ ostream << Outputter::SEPARATOR
395
+
396
+ # Show hex dump
397
+ encoder.reset_buffer()
398
+ encoder.encode_registered_delivery(registered_delivery)
399
+ byte_buffer = AntHill::ByteBuffer.new(encoder.get_buffer())
400
+ byte_buffer.write_dump(ostream)
401
+ ostream << "\n"
402
+ end
403
+
404
+ def output_replace_if_present_flag(replace_if_present_flag)
405
+ ostream << Outputter::MANDATORY << Outputter::SEPARATOR
406
+ ostream << Outputter::SEPARATOR << FieldsName::DEST_ADDR
407
+ ostream << Outputter::SEPARATOR << replace_if_present_flag.to_s
408
+ ostream << Outputter::SEPARATOR
409
+
410
+ # Show hex dump
411
+ encoder.reset_buffer()
412
+ encoder.encode_replace_if_present_flag(replace_if_present_flag)
413
+ byte_buffer = AntHill::ByteBuffer.new(encoder.get_buffer())
414
+ byte_buffer.write_dump(ostream)
415
+ ostream << "\n"
416
+ end
417
+
418
+ def output_data_coding(data_coding)
419
+ ostream << Outputter::MANDATORY << Outputter::SEPARATOR
420
+ ostream << Outputter::SEPARATOR << FieldsName::DEST_ADDR
421
+ ostream << Outputter::SEPARATOR << data_coding.to_s
422
+ ostream << Outputter::SEPARATOR
423
+
424
+ # Show hex dump
425
+ encoder.reset_buffer()
426
+ encoder.encode_data_coding(data_coding)
427
+ byte_buffer = AntHill::ByteBuffer.new(encoder.get_buffer())
428
+ byte_buffer.write_dump(ostream)
429
+ ostream << "\n"
430
+ end
431
+
432
+ def output_sm_default_msg_id(sm_default_msg_id)
433
+ ostream << Outputter::MANDATORY << Outputter::SEPARATOR
434
+ ostream << Outputter::SEPARATOR << FieldsName::SM_DEFAULT_MSG_ID
435
+ ostream << Outputter::SEPARATOR << sm_default_msg_id.to_s
436
+ ostream << Outputter::SEPARATOR
437
+
438
+ # Show hex dump
439
+ encoder.reset_buffer()
440
+ encoder.encode_sm_default_msg_id(sm_default_msg_id)
441
+ byte_buffer = AntHill::ByteBuffer.new(encoder.get_buffer())
442
+ byte_buffer.write_dump(ostream)
443
+ ostream << "\n"
444
+ end
445
+
446
+ def output_sm_length(sm_length)
447
+ ostream << Outputter::MANDATORY << Outputter::SEPARATOR
448
+ ostream << Outputter::SEPARATOR << FieldsName::SM_LENGTH
449
+ ostream << Outputter::SEPARATOR << sm_length.to_s
450
+ ostream << Outputter::SEPARATOR
451
+
452
+ # Show hex dump
453
+ encoder.reset_buffer()
454
+ encoder.encode_sm_length(sm_length)
455
+ byte_buffer = AntHill::ByteBuffer.new(encoder.get_buffer())
456
+ byte_buffer.write_dump(ostream)
457
+ ostream << "\n"
458
+ end
459
+
460
+ def output_short_message(short_message)
461
+ ostream << Outputter::MANDATORY << Outputter::SEPARATOR
462
+ ostream << Outputter::SEPARATOR << FieldsName::SHORT_MESSAGE
463
+ ostream << Outputter::SEPARATOR
464
+ if !short_message.nil?
465
+ buffer = AntHill::ByteBuffer.new(short_message)
466
+ buffer.write_dump(ostream)
467
+ end
468
+ ostream << Outputter::SEPARATOR
469
+
470
+ # Show hex dump
471
+ encoder.reset_buffer()
472
+ encoder.encode_short_message(short_message)
473
+ byte_buffer = AntHill::ByteBuffer.new(encoder.get_buffer())
474
+ byte_buffer.write_dump(ostream)
475
+ ostream << "\n"
476
+ end
477
+
478
+ def output_message_id(message_id)
479
+ ostream << Outputter::MANDATORY << Outputter::SEPARATOR
480
+ ostream << Outputter::SEPARATOR << FieldsName::MESSAGE_ID
481
+ ostream << Outputter::SEPARATOR << message_id.to_s
482
+ ostream << Outputter::SEPARATOR
483
+
484
+ # Show hex dump
485
+ encoder.reset_buffer()
486
+ encoder.encode_message_id(message_id)
487
+ byte_buffer = AntHill::ByteBuffer.new(encoder.get_buffer())
488
+ byte_buffer.write_dump(ostream)
489
+ ostream << "\n"
490
+ end
491
+
492
+ def output_esme_addr_ton(esme_addr_ton)
493
+ ostream << Outputter::MANDATORY << Outputter::SEPARATOR
494
+ ostream << Outputter::SEPARATOR << FieldsName::ESME_ADDR_TON
495
+ ostream << Outputter::SEPARATOR << esme_addr_ton.to_s
496
+ ostream << Outputter::SEPARATOR
497
+
498
+ # Show hex dump
499
+ encoder.reset_buffer()
500
+ encoder.encode_esme_addr_ton(esme_addr_ton)
501
+ byte_buffer = AntHill::ByteBuffer.new(encoder.get_buffer())
502
+ byte_buffer.write_dump(ostream)
503
+ ostream << "\n"
504
+ end
505
+
506
+ def output_esme_addr_npi(esme_addr_npi)
507
+ ostream << Outputter::MANDATORY << Outputter::SEPARATOR
508
+ ostream << Outputter::SEPARATOR << FieldsName::ESME_ADDR_NPI
509
+ ostream << Outputter::SEPARATOR << esme_addr_npi.to_s
510
+ ostream << Outputter::SEPARATOR
511
+
512
+ # Show hex dump
513
+ encoder.reset_buffer()
514
+ encoder.encode_esme_addr_npi(esme_addr_npi)
515
+ byte_buffer = AntHill::ByteBuffer.new(encoder.get_buffer())
516
+ byte_buffer.write_dump(ostream)
517
+ ostream << "\n"
518
+ end
519
+
520
+ def output_esme_addr(esme_addr)
521
+ ostream << Outputter::MANDATORY << Outputter::SEPARATOR
522
+ ostream << Outputter::SEPARATOR << FieldsName::ESME_ADDR
523
+ ostream << Outputter::SEPARATOR << esme_addr.to_s
524
+ ostream << Outputter::SEPARATOR
525
+
526
+ # Show hex dump
527
+ encoder.reset_buffer()
528
+ encoder.encode_esme_addr(esme_addr)
529
+ byte_buffer = AntHill::ByteBuffer.new(encoder.get_buffer())
530
+ byte_buffer.write_dump(ostream)
531
+ ostream << "\n"
532
+ end
533
+
534
+ def output_number_of_dest(number_of_dest)
535
+ ostream << Outputter::MANDATORY << Outputter::SEPARATOR
536
+ ostream << Outputter::SEPARATOR << FieldsName::NUMBER_OF_DEST
537
+ ostream << Outputter::SEPARATOR << number_of_dest.to_s
538
+ ostream << Outputter::SEPARATOR
539
+
540
+ # Show hex dump
541
+ encoder.reset_buffer()
542
+ encoder.encode_number_of_dest(number_of_dest)
543
+ byte_buffer = AntHill::ByteBuffer.new(encoder.get_buffer())
544
+ byte_buffer.write_dump(ostream)
545
+ ostream << "\n"
546
+ end
547
+
548
+ def output_dest_addresses(dest_addresses)
549
+ ostream << Outputter::MANDATORY << Outputter::SEPARATOR
550
+ ostream << Outputter::SEPARATOR << FieldsName::DEST_ADDRESSES
551
+ ostream << Outputter::SEPARATOR
552
+
553
+ 0.upto(dest_addresses.size() -1) do |i|
554
+ # Output destination address
555
+ ostream << Outputter::LCURLYBRACE if i == 0
556
+ ostream << Outputter::LBRACKET << FieldsName::DESTFLAG
557
+ ostream << Outputter::COLON << Outputter::SPACE
558
+ ostream << dest_addresses[i].dest_flag()
559
+ case dest_addresses[i].dest_flag()
560
+ when DestFlag::SME_ADDRESS
561
+ ostream << Outputter::SPACE << FieldsName::TON
562
+ ostream << Outputter::COLON << Outputter::SPACE
563
+ ostream << dest_addresses[i].address.ton()
564
+ ostream << Outputter::SPACE << FieldsName::NPI
565
+ ostream << Outputter::COLON << Outputter::SPACE
566
+ ostream << dest_addresses[i].address.npi()
567
+ ostream << Outputter::SPACE << FieldsName::ADDRESS
568
+ ostream << Outputter::COLON << Outputter::SPACE
569
+ ostream << dest_addresses[i].address.address()
570
+ when DestFlag::DISTR_LIST_NAME
571
+ ostream << Outputter::SPACE << FieldsName::DISTR_LIST_NAME
572
+ ostream << Outputter::COLON << Outputter::SPACE
573
+ ostream << dest_addresses[i].distr_list_name()
574
+ else
575
+ ostream << Outputter::SPACE << FieldsName::INV_DEST_FLAG
576
+ ostream << Outputter::SPACE
577
+ end
578
+ ostream << Outputter::RBRACKET
579
+
580
+ #Next or last element
581
+ if i != dest_addresses.size() - 1
582
+ ostream << Outputter::COMMA
583
+ else
584
+ ostream << Outputter::RCURLYBRACE
585
+ end
586
+ end
587
+ ostream << Outputter::SEPARATOR
588
+
589
+ # Show hex dump
590
+ encoder.reset_buffer()
591
+ encoder.encode_dest_addresses(dest_addresses)
592
+ byte_buffer = AntHill::ByteBuffer.new(encoder.get_buffer())
593
+ byte_buffer.write_dump(ostream)
594
+ ostream << "\n"
595
+ end
596
+
597
+ def output_no_unsuccess(no_unsuccess)
598
+ ostream << Outputter::MANDATORY << Outputter::SEPARATOR
599
+ ostream << Outputter::SEPARATOR << FieldsName::NO_UNSUCCESS
600
+ ostream << Outputter::SEPARATOR << no_unsuccess.to_s
601
+ ostream << Outputter::SEPARATOR
602
+
603
+ # Show hex dump
604
+ encoder.reset_buffer()
605
+ encoder.encode_no_unsuccess(no_unsuccess)
606
+ byte_buffer = AntHill::ByteBuffer.new(encoder.get_buffer())
607
+ byte_buffer.write_dump(ostream)
608
+ ostream << "\n"
609
+ end
610
+
611
+ def output_unsuccess_smes(unsuccess_smes)
612
+ ostream << Outputter::MANDATORY << Outputter::SEPARATOR
613
+ ostream << Outputter::SEPARATOR << FieldsName::UNSUCCESS_SMES
614
+ ostream << Outputter::SEPARATOR
615
+
616
+ 0.upto(unsuccess_smes.size() -1) do |i|
617
+ # Output destination address
618
+ ostream << Outputter::LCURLYBRACE if i == 0
619
+ ostream << Outputter::LBRACKET << FieldsName::ERROR_STATUS_CODE
620
+ ostream << Outputter::COLON << Outputter::SPACE
621
+ ostream << unsuccess_smes[i].error_status_code.to_s
622
+
623
+ ostream << Outputter::SPACE << FieldsName::TON
624
+ ostream << Outputter::COLON << Outputter::SPACE
625
+ ostream << unsuccess_smes[i].sme_address().ton()
626
+ ostream << Outputter::SPACE << FieldsName::NPI
627
+ ostream << Outputter::COLON << Outputter::SPACE
628
+ ostream << unsuccess_smes[i].sme_address().npi()
629
+ ostream << Outputter::SPACE << FieldsName::NPI
630
+ ostream << Outputter::COLON << Outputter::SPACE
631
+ ostream << unsuccess_smes[i].sme_address().address()
632
+ ostream << Outputter::RBRACKET
633
+
634
+ #Next or last element
635
+ if i != unsuccess_smes.size() - 1
636
+ ostream << Outputter::COMMA
637
+ else
638
+ ostream << Outputter::RCURLYBRACE
639
+ end
640
+ end
641
+ ostream << Outputter::SEPARATOR
642
+
643
+ # Show hex dump
644
+ encoder.reset_buffer()
645
+ encoder.encode_unsuccess_smes(unsuccess_smes)
646
+ byte_buffer = AntHill::ByteBuffer.new(encoder.get_buffer())
647
+ byte_buffer.write_dump(ostream)
648
+ ostream << "\n"
649
+ end
650
+
651
+ def output_final_date(final_date)
652
+ ostream << Outputter::MANDATORY << Outputter::SEPARATOR
653
+ ostream << Outputter::SEPARATOR << FieldsName::FINAL_DATE
654
+ ostream << Outputter::SEPARATOR << final_date.to_s
655
+ ostream << Outputter::SEPARATOR
656
+
657
+ # Show hex dump
658
+ encoder.reset_buffer()
659
+ encoder.encode_final_date(final_date)
660
+ byte_buffer = AntHill::ByteBuffer.new(encoder.get_buffer())
661
+ byte_buffer.write_dump(ostream)
662
+ ostream << "\n"
663
+ end
664
+
665
+ def output_message_state(message_state)
666
+ message_state_name = get_message_state_name(message_state)
667
+ ostream << Outputter::MANDATORY << Outputter::SEPARATOR
668
+ ostream << Outputter::SEPARATOR << FieldsName::ERROR_CODE
669
+ ostream << Outputter::SEPARATOR << message_state.to_s
670
+ ostream << Outputter::EQUAL << message_state_name
671
+ ostream << Outputter::SEPARATOR
672
+
673
+ # Show hex dump
674
+ encoder.reset_buffer()
675
+ encoder.encode_message_state(message_state)
676
+ byte_buffer = AntHill::ByteBuffer.new(encoder.get_buffer())
677
+ byte_buffer.write_dump(ostream)
678
+ ostream << "\n"
679
+ end
680
+
681
+ def output_error_code(error_code)
682
+ ostream << Outputter::MANDATORY << Outputter::SEPARATOR
683
+ ostream << Outputter::SEPARATOR << FieldsName::ERROR_CODE
684
+ ostream << Outputter::SEPARATOR << error_code.to_s
685
+ ostream << Outputter::SEPARATOR
686
+
687
+ # Show hex dump
688
+ encoder.reset_buffer()
689
+ encoder.encode_error_code(error_code)
690
+ byte_buffer = AntHill::ByteBuffer.new(encoder.get_buffer())
691
+ byte_buffer.write_dump(ostream)
692
+ ostream << "\n"
693
+ end
694
+
695
+ def output_message_state_tlv(message_state, len)
696
+ message_state_name = get_message_state_name(message_state)
697
+ ostream << Outputter::OPTIONAL_ << Outputter::SEPARATOR << len.to_s
698
+ ostream << Outputter::SEPARATOR << FieldsName::MESSAGE_STATE
699
+ ostream << Outputter::SEPARATOR << message_state.to_s
700
+ ostream << Outputter::EQUAL << message_state_name
701
+ ostream << Outputter::SEPARATOR
702
+
703
+ # Show hex dump
704
+ encoder.reset_buffer()
705
+ encoder.encode_message_state_tlv(message_state, len)
706
+ byte_buffer = AntHill::ByteBuffer.new(encoder.get_buffer())
707
+ byte_buffer.write_dump(ostream)
708
+ ostream << "\n"
709
+ end
710
+
711
+ def output_broadcast_area_identifier(broadcast_area_identifier, len)
712
+ 0.upto(broadcast_area_identifier.size() -1) do | i |
713
+ # Output field
714
+ ostream << Outputter::MANDATORY << Outputter::SEPARATOR << len[i].to_s
715
+ ostream << Outputter::SEPARATOR << FieldsName::BROADCAST_AREA_IDENTIFIER
716
+ ostream << Outputter::SEPARATOR
717
+
718
+
719
+ if broadcast_area_identifier[i].value().size()
720
+ buffer = AntHill::ByteBuffer.new(broadcast_area_identifier[i].value())
721
+ buffer.write_dump(ostream)
722
+
723
+ if @show_fmtinfo
724
+ area_format_code = 0
725
+ if RUBY_VERSION >= "1.9.0"
726
+ area_format_code = broadcast_area_identifier[i].value()[0].ord
727
+ else
728
+ area_format_code = broadcast_area_identifier[i].value()[0]
729
+ end
730
+ # area_format_code = broadcast_area_identifier[i].value()[0]
731
+ area_format_name = get_area_format_name(area_format_code)
732
+ ostream << sprintf("%s%d", Outputter::COMMA, area_format_code)
733
+ ostream << sprintf("%s%s", Outputter::EQUAL, area_format_name)
734
+ end
735
+ end
736
+ ostream << Outputter::SEPARATOR
737
+
738
+
739
+ encoder.reset_buffer()
740
+ encoder.encode_broadcast_area_identifier_single(broadcast_area_identifier[i], len[i])
741
+ byte_buffer = AntHill::ByteBuffer.new(encoder.get_buffer())
742
+ byte_buffer.write_dump(ostream)
743
+ ostream << "\n"
744
+ end
745
+ end
746
+
747
+ def output_broadcast_rep_num(broadcast_rep_num, len)
748
+ ostream << Outputter::MANDATORY << Outputter::SEPARATOR << len.to_s
749
+ ostream << Outputter::SEPARATOR << FieldsName::BROADCAST_REP_NUM
750
+ ostream << Outputter::SEPARATOR << broadcast_rep_num.to_s
751
+ ostream << Outputter::SEPARATOR
752
+
753
+ # Show hex dump
754
+ encoder.reset_buffer()
755
+ encoder.encode_broadcast_rep_num(broadcast_rep_num, len)
756
+ byte_buffer = AntHill::ByteBuffer.new(encoder.get_buffer())
757
+ byte_buffer.write_dump(ostream)
758
+ ostream << "\n"
759
+ end
760
+
761
+ def output_broadcast_frequency_interval(broadcast_frequency_interval, len)
762
+ ostream << Outputter::MANDATORY << Outputter::SEPARATOR << len.to_s
763
+ ostream << Outputter::SEPARATOR << FieldsName::BROADCAST_FREQUENCY_INTERVAL
764
+ ostream << Outputter::SEPARATOR
765
+ if !broadcast_frequency_interval.nil?
766
+ buffer = AntHill::ByteBuffer.new(broadcast_frequency_interval)
767
+ buffer.write_dump(ostream)
768
+ end
769
+ ostream << Outputter::SEPARATOR
770
+
771
+ # Show hex dump
772
+ encoder.reset_buffer()
773
+ encoder.encode_broadcast_frequency_interval(broadcast_frequency_interval, len)
774
+ byte_buffer = AntHill::ByteBuffer.new(encoder.get_buffer())
775
+ byte_buffer.write_dump(ostream)
776
+ ostream << "\n"
777
+
778
+ end
779
+
780
+ def output_broadcast_content_type(broadcast_content_type, len)
781
+ ostream << Outputter::MANDATORY << Outputter::SEPARATOR << len.to_s
782
+ ostream << Outputter::SEPARATOR << FieldsName::BROADCAST_CONTENT_TYPE
783
+ ostream << Outputter::SEPARATOR
784
+ if !broadcast_content_type.nil?
785
+ buffer = AntHill::ByteBuffer.new(broadcast_content_type)
786
+ buffer.write_dump(ostream)
787
+ end
788
+ ostream << Outputter::SEPARATOR
789
+
790
+ # Show hex dump
791
+ encoder.reset_buffer()
792
+ encoder.encode_broadcast_content_type(broadcast_content_type, len)
793
+ byte_buffer = AntHill::ByteBuffer.new(encoder.get_buffer())
794
+ byte_buffer.write_dump(ostream)
795
+ ostream << "\n"
796
+ end
797
+
798
+ def output_broadcast_area_success(broadcast_area_success, len)
799
+ ostream << Outputter::OPTIONAL_ << Outputter::SEPARATOR << len.to_s
800
+ ostream << Outputter::SEPARATOR << FieldsName::BROADCAST_AREA_SUCCESS
801
+ ostream << Outputter::SEPARATOR << broadcast_area_success.to_s
802
+ ostream << Outputter::SEPARATOR
803
+
804
+ # Show hex dump
805
+ encoder.reset_buffer()
806
+ encoder.encode_broadcast_area_success(broadcast_area_success, len)
807
+ byte_buffer = AntHill::ByteBuffer.new(encoder.get_buffer())
808
+ byte_buffer.write_dump(ostream)
809
+ ostream << "\n"
810
+ end
811
+
812
+
813
+
814
+ # Methods to output optional fields
815
+ def output_sc_interface_version(sc_interface_version, len)
816
+ raise Errors::INTERFACE_NOT_IMPLEMENTED
817
+ end
818
+
819
+ def output_ms_availability_status(ms_availability_status, len)
820
+ ostream << Outputter::OPTIONAL_ << Outputter::SEPARATOR << len.to_s
821
+ ostream << Outputter::SEPARATOR << FieldsName::SOURCE_ADDR_NPI
822
+ ostream << Outputter::SEPARATOR << ms_availability_status.to_s
823
+ ostream << Outputter::SEPARATOR
824
+
825
+ # Show hex dump
826
+ encoder.reset_buffer()
827
+ encoder.encode_ms_availability_status(ms_availability_status, len)
828
+ byte_buffer = AntHill::ByteBuffer.new(encoder.get_buffer())
829
+ byte_buffer.write_dump(ostream)
830
+ ostream << "\n"
831
+ end
832
+
833
+ def output_alert_on_msg_delivery(alert_on_msg_delivery, len)
834
+ ostream << Outputter::OPTIONAL_ << Outputter::SEPARATOR << len.to_s
835
+ ostream << Outputter::SEPARATOR << FieldsName::ALERT_ON_MSG_DELIVERY
836
+ ostream << Outputter::SEPARATOR << alert_on_msg_delivery.to_s
837
+ ostream << Outputter::SEPARATOR
838
+
839
+ # Show hex dump
840
+ encoder.reset_buffer()
841
+ encoder.encode_alert_on_msg_delivery(alert_on_msg_delivery, len)
842
+ byte_buffer = AntHill::ByteBuffer.new(encoder.get_buffer())
843
+ byte_buffer.write_dump(ostream)
844
+ ostream << "\n"
845
+ end
846
+
847
+ def output_broadcast_channel_indicator(broadcast_channel_indicator, len)
848
+ ostream << Outputter::OPTIONAL_ << Outputter::SEPARATOR << len.to_s
849
+ ostream << Outputter::SEPARATOR << FieldsName::BROADCAST_CHANNEL_INDICATOR
850
+ ostream << Outputter::SEPARATOR << broadcast_channel_indicator.to_s
851
+ ostream << Outputter::SEPARATOR
852
+
853
+ # Show hex dump
854
+ encoder.reset_buffer()
855
+ encoder.encode_broadcast_channel_indicator(broadcast_channel_indicator, len)
856
+ byte_buffer = AntHill::ByteBuffer.new(encoder.get_buffer())
857
+ byte_buffer.write_dump(ostream)
858
+ ostream << "\n"
859
+ end
860
+
861
+ def output_broadcast_content_type_info(broadcast_content_type_info, len)
862
+ ostream << Outputter::OPTIONAL_ << Outputter::SEPARATOR << len.to_s
863
+ ostream << Outputter::SEPARATOR << FieldsName::BROADCAST_MESSAGE_CLASS
864
+ ostream << Outputter::SEPARATOR
865
+ if !broadcast_content_type_info.nil?
866
+ buffer = AntHill::ByteBuffer.new(broadcast_content_type_info)
867
+ buffer.write_dump(ostream)
868
+ end
869
+ ostream << Outputter::SEPARATOR
870
+
871
+ # Show hex dump
872
+ encoder.reset_buffer()
873
+ encoder.encode_broadcast_content_type_info(broadcast_content_type_info, len)
874
+ byte_buffer = AntHill::ByteBuffer.new(encoder.get_buffer())
875
+ byte_buffer.write_dump(ostream)
876
+ ostream << "\n"
877
+ end
878
+
879
+ def output_broadcast_message_class(broadcast_message_class, len)
880
+ ostream << Outputter::OPTIONAL_ << Outputter::SEPARATOR << len.to_s
881
+ ostream << Outputter::SEPARATOR << FieldsName::BROADCAST_MESSAGE_CLASS
882
+ ostream << Outputter::SEPARATOR << broadcast_message_class.to_s
883
+ ostream << Outputter::SEPARATOR
884
+
885
+ # Show hex dump
886
+ encoder.reset_buffer()
887
+ encoder.encode_broadcast_message_class(broadcast_message_class, len)
888
+ byte_buffer = AntHill::ByteBuffer.new(encoder.get_buffer())
889
+ byte_buffer.write_dump(ostream)
890
+ ostream << "\n"
891
+ end
892
+
893
+ def output_broadcast_service_group(broadcast_service_group, len)
894
+ ostream << Outputter::OPTIONAL_ << Outputter::SEPARATOR << len.to_s
895
+ ostream << Outputter::SEPARATOR << FieldsName::BROADCAST_SERVICE_GROUP
896
+ ostream << Outputter::SEPARATOR
897
+ if !broadcast_service_group.nil?
898
+ buffer = AntHill::ByteBuffer.new(broadcast_service_group)
899
+ buffer.write_dump(ostream)
900
+ end
901
+ ostream << Outputter::SEPARATOR
902
+
903
+ # Show hex dump
904
+ encoder.reset_buffer()
905
+ encoder.encode_broadcast_service_group(broadcast_service_group, len)
906
+ byte_buffer = AntHill::ByteBuffer.new(encoder.get_buffer())
907
+ byte_buffer.write_dump(ostream)
908
+ ostream << "\n"
909
+ end
910
+
911
+ def output_callback_num(callback_num, len)
912
+ ostream << Outputter::OPTIONAL_ << Outputter::SEPARATOR << len.to_s
913
+ ostream << Outputter::SEPARATOR << FieldsName::CALLBACK_NUM
914
+ ostream << Outputter::SEPARATOR
915
+ if !callback_num.nil?
916
+ buffer = AntHill::ByteBuffer.new(callback_num)
917
+ buffer.write_dump(ostream)
918
+ end
919
+ ostream << Outputter::SEPARATOR
920
+
921
+ # Show hex dump
922
+ encoder.reset_buffer()
923
+ encoder.encode_callback_num(callback_num, len)
924
+ byte_buffer = AntHill::ByteBuffer.new(encoder.get_buffer())
925
+ byte_buffer.write_dump(ostream)
926
+ ostream << "\n"
927
+ end
928
+
929
+ def output_callback_num_atag(callback_num_atag, len)
930
+ ostream << Outputter::OPTIONAL_ << Outputter::SEPARATOR << len.to_s
931
+ ostream << Outputter::SEPARATOR << FieldsName::CALLBACK_NUM_ATAG
932
+ ostream << Outputter::SEPARATOR
933
+ if !callback_num_atag.nil?
934
+ buffer = AntHill::ByteBuffer.new(callback_num_atag)
935
+ buffer.write_dump(ostream)
936
+ end
937
+ ostream << Outputter::SEPARATOR
938
+
939
+ # Show hex dump
940
+ encoder.reset_buffer()
941
+ encoder.encode_callback_num_atag(callback_num_atag, len)
942
+ byte_buffer = AntHill::ByteBuffer.new(encoder.get_buffer())
943
+ byte_buffer.write_dump(ostream)
944
+ ostream << "\n"
945
+ end
946
+
947
+ def output_callback_num_pres_ind(callback_num_pres_ind, len)
948
+ ostream << Outputter::OPTIONAL_ << Outputter::SEPARATOR << len.to_s
949
+ ostream << Outputter::SEPARATOR << FieldsName::CALLBACK_NUM_PRES_IND
950
+ ostream << Outputter::SEPARATOR << callback_num_pres_ind.to_s
951
+ ostream << Outputter::SEPARATOR
952
+
953
+ # Show hex dump
954
+ encoder.reset_buffer()
955
+ encoder.encode_callback_num_pres_ind(callback_num_pres_ind, len)
956
+ byte_buffer = AntHill::ByteBuffer.new(encoder.get_buffer())
957
+ byte_buffer.write_dump(ostream)
958
+ ostream << "\n"
959
+ end
960
+
961
+ def output_dest_addr_subunit(dest_addr_subunit, len)
962
+ ostream << Outputter::OPTIONAL_ << Outputter::SEPARATOR << len.to_s
963
+ ostream << Outputter::SEPARATOR << FieldsName::DEST_ADDR_SUBUNIT
964
+ ostream << Outputter::SEPARATOR << dest_addr_subunit.to_s
965
+ ostream << Outputter::SEPARATOR
966
+
967
+ # Show hex dump
968
+ encoder.reset_buffer()
969
+ encoder.encode_dest_addr_subunit(dest_addr_subunit, len)
970
+ byte_buffer = AntHill::ByteBuffer.new(encoder.get_buffer())
971
+ byte_buffer.write_dump(ostream)
972
+ ostream << "\n"
973
+ end
974
+
975
+ def output_dest_subaddress(dest_subaddress, len)
976
+ ostream << Outputter::OPTIONAL_ << Outputter::SEPARATOR << len.to_s
977
+ ostream << Outputter::SEPARATOR << FieldsName::DEST_SUBADDRESS
978
+ ostream << Outputter::SEPARATOR
979
+ if !dest_subaddress.nil?
980
+ buffer = AntHill::ByteBuffer.new(dest_subaddress)
981
+ buffer.write_dump(ostream)
982
+ end
983
+ ostream << Outputter::SEPARATOR
984
+
985
+ # Show hex dump
986
+ encoder.reset_buffer()
987
+ encoder.encode_dest_subaddress(dest_subaddress, len)
988
+ byte_buffer = AntHill::ByteBuffer.new(encoder.get_buffer())
989
+ byte_buffer.write_dump(ostream)
990
+ ostream << "\n"
991
+ end
992
+
993
+ def output_display_time(display_time, len)
994
+ ostream << Outputter::OPTIONAL_ << Outputter::SEPARATOR << len.to_s
995
+ ostream << Outputter::SEPARATOR << FieldsName::DISPLAY_TIME
996
+ ostream << Outputter::SEPARATOR << display_time.to_s
997
+ ostream << Outputter::SEPARATOR
998
+
999
+ # Show hex dump
1000
+ encoder.reset_buffer()
1001
+ encoder.encode_display_time(display_time, len)
1002
+ byte_buffer = AntHill::ByteBuffer.new(encoder.get_buffer())
1003
+ byte_buffer.write_dump(ostream)
1004
+ ostream << "\n"
1005
+ end
1006
+
1007
+ def output_language_indicator(language_indicator, len)
1008
+ ostream << Outputter::OPTIONAL_ << Outputter::SEPARATOR << len.to_s
1009
+ ostream << Outputter::SEPARATOR << FieldsName::LANGUAGE_INDICATOR
1010
+ ostream << Outputter::SEPARATOR << language_indicator.to_s
1011
+ ostream << Outputter::SEPARATOR
1012
+
1013
+ # Show hex dump
1014
+ encoder.reset_buffer()
1015
+ encoder.encode_language_indicator(language_indicator, len)
1016
+ byte_buffer = AntHill::ByteBuffer.new(encoder.get_buffer())
1017
+ byte_buffer.write_dump(ostream)
1018
+ ostream << "\n"
1019
+ end
1020
+
1021
+ def output_message_payload(message_payload, len)
1022
+ ostream << Outputter::OPTIONAL_ << Outputter::SEPARATOR << len.to_s
1023
+ ostream << Outputter::SEPARATOR << FieldsName::MESSAGE_PAYLOAD
1024
+ ostream << Outputter::SEPARATOR
1025
+ if !message_payload.nil?
1026
+ buffer = AntHill::ByteBuffer.new(message_payload)
1027
+ buffer.write_dump(ostream)
1028
+ end
1029
+ ostream << Outputter::SEPARATOR
1030
+
1031
+ # Show hex dump
1032
+ encoder.reset_buffer()
1033
+ encoder.encode_message_payload(message_payload, len)
1034
+ byte_buffer = AntHill::ByteBuffer.new(encoder.get_buffer())
1035
+ byte_buffer.write_dump(ostream)
1036
+ ostream << "\n"
1037
+ end
1038
+
1039
+ def output_ms_validity(ms_validity, len)
1040
+ ostream << Outputter::OPTIONAL_ << Outputter::SEPARATOR << len.to_s
1041
+ ostream << Outputter::SEPARATOR << FieldsName::MS_VALIDITY
1042
+ ostream << Outputter::SEPARATOR << ms_validity.to_s
1043
+ ostream << Outputter::SEPARATOR
1044
+
1045
+ # Show hex dump
1046
+ encoder.reset_buffer()
1047
+ encoder.encode_ms_validity(ms_validity, len)
1048
+ byte_buffer = AntHill::ByteBuffer.new(encoder.get_buffer())
1049
+ byte_buffer.write_dump(ostream)
1050
+ ostream << "\n"
1051
+ end
1052
+
1053
+ def output_payload_type(payload_type, len)
1054
+ ostream << Outputter::OPTIONAL_ << Outputter::SEPARATOR << len.to_s
1055
+ ostream << Outputter::SEPARATOR << FieldsName::PAYLOAD_TYPE
1056
+ ostream << Outputter::SEPARATOR << payload_type.to_s
1057
+ ostream << Outputter::SEPARATOR
1058
+
1059
+ # Show hex dump
1060
+ encoder.reset_buffer()
1061
+ encoder.encode_payload_type(payload_type, len)
1062
+ byte_buffer = AntHill::ByteBuffer.new(encoder.get_buffer())
1063
+ byte_buffer.write_dump(ostream)
1064
+ ostream << "\n"
1065
+ end
1066
+
1067
+ def output_privacy_indicator(privacy_indicator, len)
1068
+ ostream << Outputter::OPTIONAL_ << Outputter::SEPARATOR << len.to_s
1069
+ ostream << Outputter::SEPARATOR << FieldsName::PRIVACY_INDICATOR
1070
+ ostream << Outputter::SEPARATOR << privacy_indicator.to_s
1071
+ ostream << Outputter::SEPARATOR
1072
+
1073
+ # Show hex dump
1074
+ encoder.reset_buffer()
1075
+ encoder.encode_privacy_indicator(privacy_indicator, len)
1076
+ byte_buffer = AntHill::ByteBuffer.new(encoder.get_buffer())
1077
+ byte_buffer.write_dump(ostream)
1078
+ ostream << "\n"
1079
+ end
1080
+
1081
+ def output_sms_signal(sms_signal, len)
1082
+ ostream << Outputter::OPTIONAL_ << Outputter::SEPARATOR << len.to_s
1083
+ ostream << Outputter::SEPARATOR << FieldsName::SMS_SIGNAL
1084
+ ostream << Outputter::SEPARATOR << sms_signal.to_s
1085
+ ostream << Outputter::SEPARATOR
1086
+
1087
+ # Show hex dump
1088
+ encoder.reset_buffer()
1089
+ encoder.encode_sms_signal(sms_signal, len)
1090
+ byte_buffer = AntHill::ByteBuffer.new(encoder.get_buffer())
1091
+ byte_buffer.write_dump(ostream)
1092
+ ostream << "\n"
1093
+ end
1094
+
1095
+ def output_source_addr_subunit(source_addr_subunit, len)
1096
+ ostream << Outputter::OPTIONAL_ << Outputter::SEPARATOR << len.to_s
1097
+ ostream << Outputter::SEPARATOR << FieldsName::SOURCE_ADDR_SUBUNIT
1098
+ ostream << Outputter::SEPARATOR << source_addr_subunit.to_s
1099
+ ostream << Outputter::SEPARATOR
1100
+
1101
+ # Show hex dump
1102
+ encoder.reset_buffer()
1103
+ encoder.encode_source_addr_subunit(source_addr_subunit, len)
1104
+ byte_buffer = AntHill::ByteBuffer.new(encoder.get_buffer())
1105
+ byte_buffer.write_dump(ostream)
1106
+ ostream << "\n"
1107
+ end
1108
+
1109
+ def output_source_port(source_port, len)
1110
+ ostream << Outputter::OPTIONAL_ << Outputter::SEPARATOR << len.to_s
1111
+ ostream << Outputter::SEPARATOR << FieldsName::SOURCE_PORT
1112
+ ostream << Outputter::SEPARATOR << source_port.to_s
1113
+ ostream << Outputter::SEPARATOR
1114
+
1115
+ # Show hex dump
1116
+ encoder.reset_buffer()
1117
+ encoder.encode_source_port(source_port, len)
1118
+ byte_buffer = AntHill::ByteBuffer.new(encoder.get_buffer())
1119
+ byte_buffer.write_dump(ostream)
1120
+ ostream << "\n"
1121
+ end
1122
+
1123
+ def output_source_subaddress(source_subaddress, len)
1124
+ ostream << Outputter::OPTIONAL_ << Outputter::SEPARATOR << len.to_s
1125
+ ostream << Outputter::SEPARATOR << FieldsName::SOURCE_SUBADDRESS
1126
+ ostream << Outputter::SEPARATOR
1127
+ if !source_subaddress.nil?
1128
+ buffer = AntHill::ByteBuffer.new(source_subaddress)
1129
+ buffer.write_dump(ostream)
1130
+ end
1131
+ ostream << Outputter::SEPARATOR
1132
+
1133
+ # Show hex dump
1134
+ encoder.reset_buffer()
1135
+ encoder.encode_source_subaddress(source_subaddress, len)
1136
+ byte_buffer = AntHill::ByteBuffer.new(encoder.get_buffer())
1137
+ byte_buffer.write_dump(ostream)
1138
+ ostream << "\n"
1139
+ end
1140
+
1141
+ def output_user_message_reference(user_message_reference, len)
1142
+ ostream << Outputter::OPTIONAL_ << Outputter::SEPARATOR << len.to_s
1143
+ ostream << Outputter::SEPARATOR << FieldsName::USER_MESSAGE_REFERENCE
1144
+ ostream << Outputter::SEPARATOR << user_message_reference.to_s
1145
+ ostream << Outputter::SEPARATOR
1146
+
1147
+ # Show hex dump
1148
+ encoder.reset_buffer()
1149
+ encoder.encode_user_message_reference(user_message_reference, len)
1150
+ byte_buffer = AntHill::ByteBuffer.new(encoder.get_buffer())
1151
+ byte_buffer.write_dump(ostream)
1152
+ ostream << "\n"
1153
+ end
1154
+
1155
+ def output_broadcast_error_status(broadcast_error_status, len)
1156
+ ostream << Outputter::OPTIONAL_ << Outputter::SEPARATOR << len.to_s
1157
+ ostream << Outputter::SEPARATOR << FieldsName::BROADCAST_ERROR_STATUS
1158
+ ostream << Outputter::SEPARATOR << broadcast_error_status.to_s
1159
+ ostream << Outputter::SEPARATOR
1160
+
1161
+ # Show hex dump
1162
+ encoder.reset_buffer()
1163
+ encoder.encode_broadcast_error_status(broadcast_error_status, len)
1164
+ byte_buffer = AntHill::ByteBuffer.new(encoder.get_buffer())
1165
+ byte_buffer.write_dump(ostream)
1166
+ ostream << "\n"
1167
+ end
1168
+
1169
+ def output_failed_broadcast_area_identifier(failed_broadcast_area_identifier, len)
1170
+ 0.upto(failed_broadcast_area_identifier.size() -1) do | i |
1171
+ # Output field
1172
+ ostream << Outputter::MANDATORY << Outputter::SEPARATOR << len[i].to_s
1173
+ ostream << Outputter::SEPARATOR << FieldsName::FAILED_BROADCAST_AREA_IDENTIFIER
1174
+ ostream << Outputter::SEPARATOR
1175
+
1176
+
1177
+ if failed_broadcast_area_identifier[i].value().size()
1178
+ buffer = AntHill::ByteBuffer.new(failed_broadcast_area_identifier[i].value())
1179
+ buffer.write_dump(ostream)
1180
+
1181
+ if @show_fmtinfo
1182
+ area_format_code = 0
1183
+ if RUBY_VERSION >= "1.9.0"
1184
+ area_format_code = failed_broadcast_area_identifier[i].value()[0].ord
1185
+ else
1186
+ area_format_code = failed_broadcast_area_identifier[i].value()[0]
1187
+ end
1188
+ # area_format_code = failed_broadcast_area_identifier[i].value()[0]
1189
+ area_format_name = get_area_format_name(area_format_code)
1190
+ ostream << sprintf("%s%d", Outputter::COMMA, area_format_code)
1191
+ ostream << sprintf("%s%s", Outputter::EQUAL, area_format_name)
1192
+ end
1193
+ end
1194
+ ostream << Outputter::SEPARATOR
1195
+
1196
+
1197
+ encoder.reset_buffer()
1198
+ encoder.encode_failed_broadcast_area_identifier_single(failed_broadcast_area_identifier[i], len[i])
1199
+ byte_buffer = AntHill::ByteBuffer.new(encoder.get_buffer())
1200
+ byte_buffer.write_dump(ostream)
1201
+ ostream << "\n"
1202
+ end
1203
+ end
1204
+
1205
+ def output_broadcast_content_type_opt(broadcast_content_type, len)
1206
+ ostream << Outputter::OPTIONAL_ << Outputter::SEPARATOR << len.to_s
1207
+ ostream << Outputter::SEPARATOR << FieldsName::BROADCAST_CONTENT_TYPE
1208
+ ostream << Outputter::SEPARATOR
1209
+ if !broadcast_content_type.nil?
1210
+ buffer = AntHill::ByteBuffer.new(broadcast_content_type)
1211
+ buffer.write_dump(ostream)
1212
+ end
1213
+ ostream << Outputter::SEPARATOR
1214
+
1215
+ # Show hex dump
1216
+ encoder.reset_buffer()
1217
+ encoder.encode_broadcast_content_type(broadcast_content_type, len)
1218
+ byte_buffer = AntHill::ByteBuffer.new(encoder.get_buffer())
1219
+ byte_buffer.write_dump(ostream)
1220
+ ostream << "\n"
1221
+ end
1222
+
1223
+ def output_source_network_type(source_network_type, len)
1224
+ ostream << Outputter::OPTIONAL_ << Outputter::SEPARATOR << len.to_s
1225
+ ostream << Outputter::SEPARATOR << FieldsName::SOURCE_NETWORK_TYPE
1226
+ ostream << Outputter::SEPARATOR << source_network_type.to_s
1227
+ ostream << Outputter::SEPARATOR
1228
+
1229
+ # Show hex dump
1230
+ encoder.reset_buffer()
1231
+ encoder.encode_source_network_type(source_network_type, len)
1232
+ byte_buffer = AntHill::ByteBuffer.new(encoder.get_buffer())
1233
+ byte_buffer.write_dump(ostream)
1234
+ ostream << "\n"
1235
+ end
1236
+
1237
+ def output_source_bearer_type(source_bearer_type, len)
1238
+ ostream << Outputter::OPTIONAL_ << Outputter::SEPARATOR << len.to_s
1239
+ ostream << Outputter::SEPARATOR << FieldsName::SOURCE_BEARER_TYPE
1240
+ ostream << Outputter::SEPARATOR << source_bearer_type.to_s
1241
+ ostream << Outputter::SEPARATOR
1242
+
1243
+ # Show hex dump
1244
+ encoder.reset_buffer()
1245
+ encoder.encode_source_bearer_type(source_bearer_type, len)
1246
+ byte_buffer = AntHill::ByteBuffer.new(encoder.get_buffer())
1247
+ byte_buffer.write_dump(ostream)
1248
+ ostream << "\n"
1249
+ end
1250
+
1251
+ def output_source_telematics_id(source_telematics_id, len)
1252
+ ostream << Outputter::OPTIONAL_ << Outputter::SEPARATOR << len.to_s
1253
+ ostream << Outputter::SEPARATOR << FieldsName::SOURCE_TELEMATICS_ID
1254
+ ostream << Outputter::SEPARATOR << source_telematics_id.to_s
1255
+ ostream << Outputter::SEPARATOR
1256
+
1257
+ # Show hex dump
1258
+ encoder.reset_buffer()
1259
+ encoder.encode_source_telematics_id(source_telematics_id, len)
1260
+ byte_buffer = AntHill::ByteBuffer.new(encoder.get_buffer())
1261
+ byte_buffer.write_dump(ostream)
1262
+ ostream << "\n"
1263
+ end
1264
+
1265
+ def output_destination_port(destination_port, len)
1266
+ ostream << Outputter::OPTIONAL_ << Outputter::SEPARATOR << len.to_s
1267
+ ostream << Outputter::SEPARATOR << FieldsName::DESTINATION_PORT
1268
+ ostream << Outputter::SEPARATOR << destination_port.to_s
1269
+ ostream << Outputter::SEPARATOR
1270
+
1271
+ # Show hex dump
1272
+ encoder.reset_buffer()
1273
+ encoder.encode_destination_port(destination_port, len)
1274
+ byte_buffer = AntHill::ByteBuffer.new(encoder.get_buffer())
1275
+ byte_buffer.write_dump(ostream)
1276
+ ostream << "\n"
1277
+ end
1278
+
1279
+ def output_dest_network_type(dest_network_type, len)
1280
+ ostream << Outputter::OPTIONAL_ << Outputter::SEPARATOR << len.to_s
1281
+ ostream << Outputter::SEPARATOR << FieldsName::DEST_NETWORK_TYPE
1282
+ ostream << Outputter::SEPARATOR << dest_network_type.to_s
1283
+ ostream << Outputter::SEPARATOR
1284
+
1285
+ # Show hex dump
1286
+ encoder.reset_buffer()
1287
+ encoder.encode_dest_network_type(dest_network_type, len)
1288
+ byte_buffer = AntHill::ByteBuffer.new(encoder.get_buffer())
1289
+ byte_buffer.write_dump(ostream)
1290
+ ostream << "\n"
1291
+ end
1292
+
1293
+ def output_dest_bearer_type(dest_bearer_type, len)
1294
+ ostream << Outputter::OPTIONAL_ << Outputter::SEPARATOR << len.to_s
1295
+ ostream << Outputter::SEPARATOR << FieldsName::DEST_BEARER_TYPE
1296
+ ostream << Outputter::SEPARATOR << dest_bearer_type.to_s
1297
+ ostream << Outputter::SEPARATOR
1298
+
1299
+ # Show hex dump
1300
+ encoder.reset_buffer()
1301
+ encoder.encode_dest_bearer_type(dest_bearer_type, len)
1302
+ byte_buffer = AntHill::ByteBuffer.new(encoder.get_buffer())
1303
+ byte_buffer.write_dump(ostream)
1304
+ ostream << "\n"
1305
+ end
1306
+
1307
+ def output_dest_telematics_id(dest_telematics_id, len)
1308
+ ostream << Outputter::OPTIONAL_ << Outputter::SEPARATOR << len.to_s
1309
+ ostream << Outputter::SEPARATOR << FieldsName::DEST_TELEMATICS_ID
1310
+ ostream << Outputter::SEPARATOR << dest_telematics_id.to_s
1311
+ ostream << Outputter::SEPARATOR
1312
+
1313
+ # Show hex dump
1314
+ encoder.reset_buffer()
1315
+ encoder.encode_dest_telematics_id(dest_telematics_id, len)
1316
+ byte_buffer = AntHill::ByteBuffer.new(encoder.get_buffer())
1317
+ byte_buffer.write_dump(ostream)
1318
+ ostream << "\n"
1319
+ end
1320
+
1321
+ def output_sar_msg_ref_num(sar_msg_ref_num, len)
1322
+ ostream << Outputter::OPTIONAL_ << Outputter::SEPARATOR << len.to_s
1323
+ ostream << Outputter::SEPARATOR << FieldsName::SAR_MSG_REF_NUM
1324
+ ostream << Outputter::SEPARATOR << sar_msg_ref_num.to_s
1325
+ ostream << Outputter::SEPARATOR
1326
+
1327
+ # Show hex dump
1328
+ encoder.reset_buffer()
1329
+ encoder.encode_sar_msg_ref_num(sar_msg_ref_num, len)
1330
+ byte_buffer = AntHill::ByteBuffer.new(encoder.get_buffer())
1331
+ byte_buffer.write_dump(ostream)
1332
+ ostream << "\n"
1333
+ end
1334
+
1335
+ def output_sar_total_segments(sar_total_segments, len)
1336
+ ostream << Outputter::OPTIONAL_ << Outputter::SEPARATOR << len.to_s
1337
+ ostream << Outputter::SEPARATOR << FieldsName::SAR_TOTAL_SEGMENTS
1338
+ ostream << Outputter::SEPARATOR << sar_total_segments.to_s
1339
+ ostream << Outputter::SEPARATOR
1340
+
1341
+ # Show hex dump
1342
+ encoder.reset_buffer()
1343
+ encoder.encode_sar_total_segments(sar_total_segments, len)
1344
+ byte_buffer = AntHill::ByteBuffer.new(encoder.get_buffer())
1345
+ byte_buffer.write_dump(ostream)
1346
+ ostream << "\n"
1347
+ end
1348
+
1349
+ def output_sar_segment_seqnum(sar_segment_seqnum, len)
1350
+ ostream << Outputter::OPTIONAL_ << Outputter::SEPARATOR << len.to_s
1351
+ ostream << Outputter::SEPARATOR << FieldsName::SAR_SEGMENT_SEQNUM
1352
+ ostream << Outputter::SEPARATOR << sar_segment_seqnum.to_s
1353
+ ostream << Outputter::SEPARATOR
1354
+
1355
+ # Show hex dump
1356
+ encoder.reset_buffer()
1357
+ encoder.encode_sar_segment_seqnum(sar_segment_seqnum, len)
1358
+ byte_buffer = AntHill::ByteBuffer.new(encoder.get_buffer())
1359
+ byte_buffer.write_dump(ostream)
1360
+ ostream << "\n"
1361
+ end
1362
+
1363
+ def output_more_messages_to_send(more_messages_to_send, len)
1364
+ ostream << Outputter::OPTIONAL_ << Outputter::SEPARATOR << len.to_s
1365
+ ostream << Outputter::SEPARATOR << FieldsName::MORE_MESSAGES_TO_SEND
1366
+ ostream << Outputter::SEPARATOR << more_messages_to_send.to_s
1367
+ ostream << Outputter::SEPARATOR
1368
+
1369
+ # Show hex dump
1370
+ encoder.reset_buffer()
1371
+ encoder.encode_more_messages_to_send(more_messages_to_send, len)
1372
+ byte_buffer = AntHill::ByteBuffer.new(encoder.get_buffer())
1373
+ byte_buffer.write_dump(ostream)
1374
+ ostream << "\n"
1375
+ end
1376
+
1377
+ def output_qos_time_to_live(qos_time_to_live, len)
1378
+ ostream << Outputter::OPTIONAL_ << Outputter::SEPARATOR << len.to_s
1379
+ ostream << Outputter::SEPARATOR << FieldsName::QOS_TIME_TO_LIVE
1380
+ ostream << Outputter::SEPARATOR << qos_time_to_live.to_s
1381
+ ostream << Outputter::SEPARATOR
1382
+
1383
+ # Show hex dump
1384
+ encoder.reset_buffer()
1385
+ encoder.encode_qos_time_to_live(qos_time_to_live, len)
1386
+ byte_buffer = AntHill::ByteBuffer.new(encoder.get_buffer())
1387
+ byte_buffer.write_dump(ostream)
1388
+ ostream << "\n"
1389
+ end
1390
+
1391
+ def output_set_dpf(set_dpf, len)
1392
+ ostream << Outputter::OPTIONAL_ << Outputter::SEPARATOR << len.to_s
1393
+ ostream << Outputter::SEPARATOR << FieldsName::SET_DPF
1394
+ ostream << Outputter::SEPARATOR << set_dpf.to_s
1395
+ ostream << Outputter::SEPARATOR
1396
+
1397
+ # Show hex dump
1398
+ encoder.reset_buffer()
1399
+ encoder.encode_set_dpf(set_dpf, len)
1400
+ byte_buffer = AntHill::ByteBuffer.new(encoder.get_buffer())
1401
+ byte_buffer.write_dump(ostream)
1402
+ ostream << "\n"
1403
+ end
1404
+
1405
+ def output_receipted_message_id(receipted_message_id, len)
1406
+ ostream << Outputter::OPTIONAL_ << Outputter::SEPARATOR << len.to_s
1407
+ ostream << Outputter::SEPARATOR << FieldsName::RECEIPTED_MESSAGE_ID
1408
+ ostream << Outputter::SEPARATOR << receipted_message_id.to_s
1409
+ ostream << Outputter::SEPARATOR
1410
+
1411
+ # Show hex dump
1412
+ encoder.reset_buffer()
1413
+ encoder.encode_receipted_message_id(receipted_message_id, len)
1414
+ byte_buffer = AntHill::ByteBuffer.new(encoder.get_buffer())
1415
+ byte_buffer.write_dump(ostream)
1416
+ ostream << "\n"
1417
+ end
1418
+
1419
+ def output_message_state_tlv_opt(message_state, len)
1420
+ message_state_name = get_message_state_name(message_state)
1421
+ ostream << Outputter::OPTIONAL_ << Outputter::SEPARATOR << len.to_s
1422
+ ostream << Outputter::SEPARATOR << FieldsName::MESSAGE_STATE
1423
+ ostream << Outputter::SEPARATOR << message_state.to_s
1424
+ ostream << Outputter::EQUAL << message_state_name
1425
+ ostream << Outputter::SEPARATOR
1426
+
1427
+ # Show hex dump
1428
+ encoder.reset_buffer()
1429
+ encoder.encode_message_state_tlv(message_state, len)
1430
+ byte_buffer = AntHill::ByteBuffer.new(encoder.get_buffer())
1431
+ byte_buffer.write_dump(ostream)
1432
+ ostream << "\n"
1433
+ end
1434
+
1435
+ def output_network_error_code(network_error_code, len)
1436
+ network_name = get_network_error_name(network_error_code.network_code())
1437
+ ostream << Outputter::OPTIONAL_ << Outputter::SEPARATOR << len.to_s
1438
+ ostream << Outputter::SEPARATOR << FieldsName::NETWORK_ERROR_CODE
1439
+ ostream << Outputter::SEPARATOR << network_error_code.network_code.to_s
1440
+ ostream << Outputter::EQUAL << network_name.to_s
1441
+ ostream << Outputter::COMMA << network_error_code.error_code.to_s
1442
+ ostream << Outputter::SEPARATOR
1443
+
1444
+ # Show hex dump
1445
+ encoder.reset_buffer()
1446
+ encoder.encode_network_error_code(network_error_code, len)
1447
+ byte_buffer = AntHill::ByteBuffer.new(encoder.get_buffer())
1448
+ byte_buffer.write_dump(ostream)
1449
+ ostream << "\n"
1450
+ end
1451
+
1452
+ def output_ms_msg_wait_facilities(ms_msg_wait_facilities, len)
1453
+ ostream << Outputter::OPTIONAL_ << Outputter::SEPARATOR << len.to_s
1454
+ ostream << Outputter::SEPARATOR << FieldsName::MS_MSG_WAIT_FACILITIES
1455
+ ostream << Outputter::SEPARATOR << ms_msg_wait_facilities.to_s
1456
+ ostream << Outputter::SEPARATOR
1457
+
1458
+ # Show hex dump
1459
+ encoder.reset_buffer()
1460
+ encoder.encode_ms_msg_wait_facilities(ms_msg_wait_facilities, len)
1461
+ byte_buffer = AntHill::ByteBuffer.new(encoder.get_buffer())
1462
+ byte_buffer.write_dump(ostream)
1463
+ ostream << "\n"
1464
+ end
1465
+
1466
+ def output_number_of_messages(number_of_messages, len)
1467
+ ostream << Outputter::OPTIONAL_ << Outputter::SEPARATOR << len.to_s
1468
+ ostream << Outputter::SEPARATOR << FieldsName::NUMBER_OF_MESSAGES
1469
+ ostream << Outputter::SEPARATOR << number_of_messages.to_s
1470
+ ostream << Outputter::SEPARATOR
1471
+
1472
+ # Show hex dump
1473
+ encoder.reset_buffer()
1474
+ encoder.encode_number_of_messages(number_of_messages, len)
1475
+ byte_buffer = AntHill::ByteBuffer.new(encoder.get_buffer())
1476
+ byte_buffer.write_dump(ostream)
1477
+ ostream << "\n"
1478
+ end
1479
+
1480
+ def output_its_reply_type(its_reply_type, len)
1481
+ ostream << Outputter::OPTIONAL_ << Outputter::SEPARATOR << len.to_s
1482
+ ostream << Outputter::SEPARATOR << FieldsName::ITS_REPLY_TYPE
1483
+ ostream << Outputter::SEPARATOR << its_reply_type.to_s
1484
+ ostream << Outputter::SEPARATOR
1485
+
1486
+ # Show hex dump
1487
+ encoder.reset_buffer()
1488
+ encoder.encode_its_reply_type(its_reply_type, len)
1489
+ byte_buffer = AntHill::ByteBuffer.new(encoder.get_buffer())
1490
+ byte_buffer.write_dump(ostream)
1491
+ ostream << "\n"
1492
+ end
1493
+
1494
+ def output_its_session_info(its_session_info, len)
1495
+ ostream << Outputter::OPTIONAL_ << Outputter::SEPARATOR << len.to_s
1496
+ ostream << Outputter::SEPARATOR << FieldsName::ITS_SESSION_INFO
1497
+ ostream << Outputter::SEPARATOR << its_session_info.to_s
1498
+ ostream << Outputter::SEPARATOR
1499
+
1500
+ # Show hex dump
1501
+ encoder.reset_buffer()
1502
+ encoder.encode_its_session_info(its_session_info, len)
1503
+ byte_buffer = AntHill::ByteBuffer.new(encoder.get_buffer())
1504
+ byte_buffer.write_dump(ostream)
1505
+ ostream << "\n"
1506
+ end
1507
+
1508
+ def output_user_response_code(user_response_code, len)
1509
+ ostream << Outputter::OPTIONAL_ << Outputter::SEPARATOR << len.to_s
1510
+ ostream << Outputter::SEPARATOR << FieldsName::USER_RESPONSE_CODE
1511
+ ostream << Outputter::SEPARATOR << user_response_code.to_s
1512
+ ostream << Outputter::SEPARATOR
1513
+
1514
+ # Show hex dump
1515
+ encoder.reset_buffer()
1516
+ encoder.encode_user_response_code(user_response_code, len)
1517
+ byte_buffer = AntHill::ByteBuffer.new(encoder.get_buffer())
1518
+ byte_buffer.write_dump(ostream)
1519
+ ostream << "\n"
1520
+ end
1521
+
1522
+ def output_delivery_failure_reason(delivery_failure_reason, len)
1523
+ ostream << Outputter::OPTIONAL_ << Outputter::SEPARATOR << len.to_s
1524
+ ostream << Outputter::SEPARATOR << FieldsName::DELIVERY_FAILURE_REASON
1525
+ ostream << Outputter::SEPARATOR << delivery_failure_reason.to_s
1526
+ ostream << Outputter::SEPARATOR
1527
+
1528
+ # Show hex dump
1529
+ encoder.reset_buffer()
1530
+ encoder.encode_delivery_failure_reason(delivery_failure_reason, len)
1531
+ byte_buffer = AntHill::ByteBuffer.new(encoder.get_buffer())
1532
+ byte_buffer.write_dump(ostream)
1533
+ ostream << "\n"
1534
+ end
1535
+
1536
+ def output_additional_status_info_text(additional_status_info_text, len)
1537
+ ostream << Outputter::OPTIONAL_ << Outputter::SEPARATOR << len.to_s
1538
+ ostream << Outputter::SEPARATOR << FieldsName::ADDITIONAL_STATUS_INFO_TEXT
1539
+ ostream << Outputter::SEPARATOR
1540
+ if !additional_status_info_text.nil?
1541
+ buffer = AntHill::ByteBuffer.new(additional_status_info_text)
1542
+ buffer.write_dump(ostream)
1543
+ end
1544
+ ostream << Outputter::SEPARATOR
1545
+
1546
+ # Show hex dump
1547
+ encoder.reset_buffer()
1548
+ encoder.encode_additional_status_info_text(additional_status_info_text, len)
1549
+ byte_buffer = AntHill::ByteBuffer.new(encoder.get_buffer())
1550
+ byte_buffer.write_dump(ostream)
1551
+ ostream << "\n"
1552
+ end
1553
+
1554
+ def output_dpf_result(dpf_result, len)
1555
+ ostream << Outputter::OPTIONAL_ << Outputter::SEPARATOR << len.to_s
1556
+ ostream << Outputter::SEPARATOR << FieldsName::DPF_RESULT
1557
+ ostream << Outputter::SEPARATOR << dpf_result.to_s
1558
+ ostream << Outputter::SEPARATOR
1559
+
1560
+ # Show hex dump
1561
+ encoder.reset_buffer()
1562
+ encoder.encode_dpf_result(dpf_result, len)
1563
+ byte_buffer = AntHill::ByteBuffer.new(encoder.get_buffer())
1564
+ byte_buffer.write_dump(ostream)
1565
+ ostream << "\n"
1566
+ end
1567
+
1568
+ def output_broadcast_end_time(broadcast_end_time, len)
1569
+ ostream << Outputter::OPTIONAL_ << Outputter::SEPARATOR << len.to_s
1570
+ ostream << Outputter::SEPARATOR << FieldsName::BROADCAST_END_TIME
1571
+ ostream << Outputter::SEPARATOR << broadcast_end_time.to_s
1572
+ ostream << Outputter::SEPARATOR
1573
+
1574
+ # Show hex dump
1575
+ encoder.reset_buffer()
1576
+ encoder.encode_broadcast_end_time(broadcast_end_time, len)
1577
+ byte_buffer = AntHill::ByteBuffer.new(encoder.get_buffer())
1578
+ byte_buffer.write_dump(ostream)
1579
+ ostream << "\n"
1580
+ end
1581
+
1582
+
1583
+ def output_ussd_service_op(ussd_service_op, len)
1584
+ ostream << Outputter::OPTIONAL_ << Outputter::SEPARATOR << len.to_s
1585
+ ostream << Outputter::SEPARATOR << FieldsName::USSD_SERVICE_OP
1586
+ ostream << Outputter::SEPARATOR << ussd_service_op.to_s
1587
+ ostream << Outputter::SEPARATOR
1588
+
1589
+ # Show hex dump
1590
+ encoder.reset_buffer()
1591
+ encoder.encode_ussd_service_op(ussd_service_op, len)
1592
+ byte_buffer = AntHill::ByteBuffer.new(encoder.get_buffer())
1593
+ byte_buffer.write_dump(ostream)
1594
+ ostream << "\n"
1595
+ end
1596
+
1597
+ end
1598
+
1599
+ end
1600
+ end
1601
+ end