mosesacs-sdk 0.0.3 → 0.0.4

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,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ODU0MjJjMzQ3ZjYxOTE5NDIwYTc4ZGE2YjFlYjc1MzM5NzZiOTBhYg==
4
+ MjEzMGY1ZTJmNTk4OWRiZTg5ZTdhNTIzY2E2OTlhNmU2OTVkZWQyZA==
5
5
  data.tar.gz: !binary |-
6
- Y2JjYWVjMTk4MjI1YTM3MzMyYzc3ZWY2MzRhM2QwNzUyNGM0MTgzNw==
6
+ YzgzZmZiMjk1OGQ5Zjk5YzU4OGRmNzRkYzczOTFhNjlkNDA2Nzc4YQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- MDExMzZjYjc1Njg3Njg1MTYyYmU3YmE2ZGJlOTQwZDA2MTkzYjYyNmJhMDE4
10
- Y2M5ZTcyZWI3YWM3YWUyZjI2YjNmMjU3NjU2OGJjZTIyZjE3OTE4ODdiZTE4
11
- YThhNDk5MzM1ZTlhNDNhMGVlM2IzMGIxMTVkZDMyYjI0OTcxYzQ=
9
+ NzViY2Q5ZTI1YzJmMzI5N2QwYzkyNjAxMmFiNDVhOTIwMTcwMzYzM2QzNzBl
10
+ MTk0YjU5YTI4YjVhZDc4ZjQ4NTQyOWMxY2U0ZThlMDZhZDliNzM0YTNhNGZi
11
+ NDFlNjg1NjRhNjIwZjk3ZWE0MDFkM2RlNDgyYzY1ZDczMWMyY2Q=
12
12
  data.tar.gz: !binary |-
13
- NDdhNmJhZTRlMWEzN2I2NTQ0Njc4YmZhN2I1MjIzZjU1YzZiNGNhM2U2ZTA0
14
- M2U5NmZjMDU3MjViMDFhY2JiZGFhYjRkZWQ3OGJmNzE4M2UzZmFlZWUxOTEw
15
- ZTZiODk3Y2M4ZjM5NjE3MjZkNGUyNDhhM2E2YjZiYzgxMGJlYzE=
13
+ Mzk1MzdlYzAyZmMzY2Y0ZTI0M2U0M2JjNTY4ZDg4MWQ3Zjk0ZDA2M2UzYjk2
14
+ ZTdjNmI2ODM4ZWY2N2U2ODUyMTAwMmJhMjY4ZjMxMDc3YjhjODRlY2MzNDdk
15
+ YzMzN2M3MTg2YTRkYzViODBhNTlhMzcyODRkMTUyNGZkNGI5MjY=
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'mosesacs-sdk'
4
+
5
+ serial = 'A54FD'
6
+
7
+ conn = MosesacsSdk::Client.new 'localhost', '9292'
8
+ conn.CancelTransfer(serial)
9
+
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'mosesacs-sdk'
4
+
5
+ serial = 'A54FD'
6
+
7
+ conn = MosesacsSdk::Client.new 'localhost', '9292'
8
+ conn.Download(serial, "http://baalba", "user", "pass", "1 Firmware Upgrade Image", "5234123")
9
+
@@ -0,0 +1,12 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'mosesacs-sdk'
4
+
5
+ serial = 'A54FD'
6
+
7
+ conn = MosesacsSdk::Client.new 'localhost', '9292'
8
+ conn.ScheduleDownload(serial, "http://baalba", "user", "pass", "1 Firmware Upgrade Image", "5234123", [
9
+ {"windowstart" => "123", "windowend" => "160", "windowmode" => "3 When Idle", "usermessage" => "usermessage", "maxretries" => "3"},
10
+ {"windowstart" => "300", "windowend" => "500", "windowmode" => "1 At Any Time", "usermessage" => "usermessage", "maxretries" => "5"}
11
+ ])
12
+
@@ -51,7 +51,7 @@ module MosesacsSdk
51
51
  end
52
52
 
53
53
  def GetParameterValues (serial, leaf)
54
- @ws.send({"Cmd" => "readMib #{serial} #{leaf}"}.to_json)
54
+ @ws.send({"MsgType" => "command", "Data" => {"command" => "readMib #{serial} #{leaf}"}}.to_json)
55
55
  resp = @q.pop
56
56
 
57
57
  doc = Nokogiri::XML(resp)
@@ -71,6 +71,24 @@ module MosesacsSdk
71
71
  puts resp if resp != ""
72
72
  end
73
73
 
74
+ def Download (serial, url, username, password, filetype, filesize)
75
+ @ws.send({"MsgType" => "command", "Data" => {"command" => "download", "serial" => serial, "url" => url, "username" => username, "password" => password, "filetype" => filetype, "filesize" => filesize}}.to_json)
76
+ resp = @q.pop
77
+ puts resp if resp != ""
78
+ end
79
+
80
+ def CancelTransfer (serial)
81
+ @ws.send({"MsgType" => "command", "Data" => {"command" => "canceltransfer", "serial" => serial}}.to_json)
82
+ resp = @q.pop
83
+ puts resp if resp != ""
84
+ end
85
+
86
+ def ScheduleDownload(serial, url, username, password, filetype, filesize, windows)
87
+ @ws.send({"MsgType" => "command", "Data" => {"command" => "scheduledownload", "serial" => serial, "url" => url, "username" => username, "password" => password, "filetype" => filetype, "filesize" => filesize, "windows" => windows}}.to_json)
88
+ resp = @q.pop
89
+ puts resp if resp != ""
90
+ end
91
+
74
92
  end
75
93
 
76
94
  end
@@ -1,3 +1,3 @@
1
1
  module MosesacsSdk
2
- VERSION = "0.0.3"
3
- end
2
+ VERSION = "0.0.4"
3
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mosesacs-sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Luca Cervasio
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-04-23 00:00:00.000000000 Z
11
+ date: 2016-05-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
@@ -80,8 +80,11 @@ files:
80
80
  - Gemfile
81
81
  - LICENSE
82
82
  - README.md
83
+ - examples/canceltransfer.rb
83
84
  - examples/change_du_state.rb
85
+ - examples/download.rb
84
86
  - examples/readmib.rb
87
+ - examples/scheduledownload.rb
85
88
  - lib/mosesacs-sdk.rb
86
89
  - lib/mosesacs-sdk/client.rb
87
90
  - lib/mosesacs-sdk/version.rb