pdu_sms 0.2.2 → 1.0.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a560cefebc50cea65ac1fa3e2d2c8806157500d8
4
- data.tar.gz: b181a063478093c3e5d190188ca1872ef873f040
3
+ metadata.gz: 21e7822c2f42631f3fa30b013e054876e0e65ad6
4
+ data.tar.gz: c909734c9498853e93a66d5665e81c75c4da0e80
5
5
  SHA512:
6
- metadata.gz: 5c9c5745bc04b440abdf1d1b7768c1e10720366dc51c5bbe810768c1ff14e04d88ae51dc0916a54f954c6b28f5a1a542760b62c004af8b753162f7d752c69e1c
7
- data.tar.gz: d965d612c272ebfade71dd99df18bd34b8b40c8d161b3422515d5159a09c36e2e8a85ed5f4d1c2e9795637d4dcba25761625d713c4cc81d8bfbd8c24b20fa2ad
6
+ metadata.gz: 1908ac6a5279d55ff1dd52215a275791a67e4598da3a025c6cde9241065ec0389b66b521bcd4e8436d305bb7d88a60d53aa43fdc2be2e515ea89ff91f5a4f5ad
7
+ data.tar.gz: 8656344019193f462f025d0d4cf89f948780cd4e672b6f193950609c6689efdb37fad3fa8788d10bbf9db675537ede2839740e015b57fc53b6cf25e15f6f13da
data/README.md CHANGED
@@ -28,6 +28,10 @@ Or install it yourself as:
28
28
  encode_pdu_ms[0].get_hex #=> "0001000B911732547698F0000008C8329BFD0E8542"
29
29
  encode_pdu_ms[0].get_message #=> "Hello!!!"
30
30
  encode_pdu_ms[0].get_phone_number #=> "+71234567890"
31
+ encode_pdu_ms[0].length #=> 20
32
+ encode_pdu_ms[0].id_message #=> 0
33
+ encode_pdu_ms[0].all_parts #=> 0
34
+ encode_pdu_ms[0].part_number #=> 0
31
35
 
32
36
  decode_pdu_ms = PacketDataUnit.decode('0001000B911732547698F0000008C8329BFD0E8542')
33
37
  decode_pdu_ms.get_hex #=> "0001000B911732547698F0000008C8329BFD0E8542"
@@ -122,16 +122,13 @@ module PduSms
122
122
  end
123
123
 
124
124
  def length
125
- pdu = ''
126
125
  if @pdu_type.message_type_indicator_out?
127
- pdu << @pdu_type.get_hex << @mr.get_hex << @da.get_hex << @pid.get_hex << @dcs.get_hex << @vp.get_hex << @udl.get_hex << @ud.get_hex
126
+ size = (@pdu_type.get_hex << @mr.get_hex << @da.get_hex << @pid.get_hex << @dcs.get_hex << @vp.get_hex << @udl.get_hex << @ud.get_hex).to_i(16).to_s(2).length
128
127
  elsif @pdu_type.message_type_indicator_in?
129
- pdu << @pdu_type.get_hex << @oa.get_hex << @pid.get_hex << @dcs.get_hex << @scts.get_hex << @udl.get_hex << @ud.get_hex
128
+ size = (@sca.get_hex << @pdu_type.get_hex << @oa.get_hex << @pid.get_hex << @dcs.get_hex << @scts.get_hex << @udl.get_hex << @ud.get_hex).to_i(16).to_s(2).length
130
129
  else
131
130
  raise PacketDataUnitError, 'oops SMS-SUBMIT not supported by this version of the library'
132
131
  end
133
-
134
- size = pdu.to_i(16).to_s(2).length
135
132
  if (size % 8).zero?
136
133
  size / 8
137
134
  else
@@ -139,6 +136,18 @@ module PduSms
139
136
  end
140
137
  end
141
138
 
139
+ def id_message
140
+ @ud.get_ied1.to_i(16)
141
+ end
142
+
143
+ def all_parts
144
+ @ud.get_ied2.to_i(16)
145
+ end
146
+
147
+ def part_number
148
+ @ud.get_ied3.to_i(16)
149
+ end
150
+
142
151
  end
143
152
  end
144
153
 
@@ -1,3 +1,3 @@
1
1
  module PduSms
2
- VERSION = "0.2.2"
2
+ VERSION = "1.0.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pdu_sms
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mikhail Stolyarov
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-08-13 00:00:00.000000000 Z
11
+ date: 2017-08-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -105,7 +105,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
105
105
  version: '0'
106
106
  requirements: []
107
107
  rubyforge_project:
108
- rubygems_version: 2.6.12
108
+ rubygems_version: 2.5.1
109
109
  signing_key:
110
110
  specification_version: 4
111
111
  summary: PDU SMS coding and decoding library