hilink 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
- data/lib/hilink.rb +1 -69
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4cba55d74717973ed7b5afc525491281eaf43a5a
|
4
|
+
data.tar.gz: 1238b03a6e15a8efde8c5971c2f7ce503feed1bd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: efae533d427e1d05c37a76aa19cfa37039a449bd9cd502fa65592c16b678308e8162c1e70302f4422d35bfca2ae217c5c5c11b4dbac78f81c8d3d2989c6781cd
|
7
|
+
data.tar.gz: 61d0a903e2397a8dce0e117c017dfca38b5bc134e5bd6de2e4cc73687f4b6655a8a37d564615b65cbe9a261d4133dd1fa22fbb889cbba33286b50e782d1939aa
|
data/lib/hilink.rb
CHANGED
@@ -151,78 +151,10 @@ module Hilink
|
|
151
151
|
end
|
152
152
|
|
153
153
|
def send( str )
|
154
|
+
return :error => "Sorry, doesn't work!"
|
154
155
|
send_request( "send", :content => str, :codeType => "CodeType" )
|
155
156
|
end
|
156
157
|
end
|
157
158
|
end
|
158
159
|
end
|
159
160
|
|
160
|
-
#puts Hilink::USSD::send( "*100#" )
|
161
|
-
#exit
|
162
|
-
|
163
|
-
#puts Hilink::switch_to_debug
|
164
|
-
#exit
|
165
|
-
|
166
|
-
puts Hilink::Modem::switch_to_hilink
|
167
|
-
exit
|
168
|
-
|
169
|
-
puts Hilink::switch_to_modem
|
170
|
-
exit
|
171
|
-
|
172
|
-
puts Hilink::Dialup::connect
|
173
|
-
puts Hilink::Dialup::disconnect
|
174
|
-
exit
|
175
|
-
|
176
|
-
|
177
|
-
#puts Hilink::SMS::send( "93999699", "hello there" )
|
178
|
-
puts Hilink::SMS::list.inspect
|
179
|
-
Hilink::SMS::list['Messages']['Message'].each{|m|
|
180
|
-
puts m.inspect
|
181
|
-
Hilink::SMS::delete( m['Index'] )
|
182
|
-
}
|
183
|
-
exit
|
184
|
-
|
185
|
-
#puts Hilink::send_request( "device/information" )
|
186
|
-
message = "Hello from Smileplug"
|
187
|
-
=begin
|
188
|
-
puts Hilink::send_request( "sms/send-sms",
|
189
|
-
{ :Index => -1,
|
190
|
-
:Phones => ["93999699"],
|
191
|
-
:Sca => '',
|
192
|
-
:Content => message,
|
193
|
-
:Length => message.length,
|
194
|
-
:Reserved => 1,
|
195
|
-
:Date => Time.now.strftime('%Y-%m-%d %H:%M:%S') } )
|
196
|
-
=end
|
197
|
-
#puts Hilink::send_request( "monitoring/check-notifications" )
|
198
|
-
#puts Hilink::send_request( "monitoring/status" )
|
199
|
-
puts Hilink::send_request( "sms/sms-list",
|
200
|
-
{ :PageIndex => 1,
|
201
|
-
:ReadCount => 20,
|
202
|
-
:BoxType => 1,
|
203
|
-
:SortType => 0,
|
204
|
-
:Ascending => 0,
|
205
|
-
:UnreadPreferred => 0 } )
|
206
|
-
puts Hilink::send_request( "sms/delete-sms", { :Index => 20067 } )
|
207
|
-
|
208
|
-
exit
|
209
|
-
|
210
|
-
a = Document.new
|
211
|
-
( a.add_element "Index" ).text = -1
|
212
|
-
a.write $stdout
|
213
|
-
|
214
|
-
exit
|
215
|
-
|
216
|
-
url = 'http://192.168.1.1/api/monitoring/status'
|
217
|
-
url = 'http://192.168.1.1/api/device/information'
|
218
|
-
|
219
|
-
# get the XML data as a string
|
220
|
-
xml_data = Net::HTTP.get_response(URI.parse(url)).body
|
221
|
-
|
222
|
-
puts xml_data.inspect
|
223
|
-
# extract event information
|
224
|
-
doc = REXML::Document.new(xml_data)
|
225
|
-
|
226
|
-
XPath.each( doc, "//response/*" ){|a|
|
227
|
-
puts a.inspect, a.text
|
228
|
-
}
|