huawei_e3131 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/lib/huawei_e3131.rb +12 -6
- metadata +1 -1
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e55f08ef77bc60226dfd1822bfa67cac71433d6d92afe444baef67d5e58bf590
|
4
|
+
data.tar.gz: 11553f13b4821dab27d12314bd11f7a9a03cf760cc6f8bce060db37078f7254e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7b794c33554210fb9c0bcf969c9dde176b5481a0cf6314103617b4485c7fc14c4e34e9e0fc93d142493b72eba96cbc982fbf470fdd6a4db239270200f0235826
|
7
|
+
data.tar.gz: d192a6fc29e347f337a943b6c323647881c7b7194419d1bd153c2cfec9f68b3476848a4f3e1d056bca416b46fc0685b809e2d67c8fee664ff816f385ecc802ef
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/lib/huawei_e3131.rb
CHANGED
@@ -4,6 +4,8 @@
|
|
4
4
|
|
5
5
|
require 'rexle'
|
6
6
|
require 'rest_client'
|
7
|
+
require 'rexle-builder'
|
8
|
+
|
7
9
|
|
8
10
|
|
9
11
|
# HOWTO: Switching the Huawei E3131 to network controller mode
|
@@ -45,16 +47,20 @@ class HuaweiE3131
|
|
45
47
|
|
46
48
|
def messages()
|
47
49
|
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
50
|
+
options = {PageIndex: 1, ReadCount: 20, BoxType: 1, SortType: 0,
|
51
|
+
Ascending: 0, UnreadPreferred: 0}
|
52
|
+
|
53
|
+
a = RexleBuilder.new(options, debug: false).to_a
|
54
|
+
a[0] = 'request'
|
55
|
+
xml = Rexle.new(a).xml(declaration: false)
|
56
|
+
|
57
|
+
response = RestClient.post "http://#{@host}/api/sms/sms-list", xml.to_s,
|
58
|
+
:content_type => "text/xml"
|
53
59
|
|
54
60
|
Rexle.new(response.body).root.xpath('Messages/Message').map do |message|
|
55
61
|
|
56
62
|
message.xpath('./*').inject({}) do |r,x|
|
57
|
-
x.text ? r.merge(x.name => x) : r
|
63
|
+
x.text ? r.merge(x.name => x.text.unescape) : r
|
58
64
|
end
|
59
65
|
|
60
66
|
end
|
metadata
CHANGED
metadata.gz.sig
CHANGED
Binary file
|