lora-rb 0.6.0 → 0.7.0
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 +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/config/config.rb +4 -5
- data/lib/lora-rb/http/call.rb +9 -9
- data/lib/lora-rb/mqtt/call.rb +1 -7
- data/lib/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2a7aecb0c4a396e5e8c2ce339c2308327c065e83
|
4
|
+
data.tar.gz: e44bbcee41a9bf7ccde484d2f2deb40a1176c0b8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6f02138aa2d1f4c2962e1c8f7caa8ea0c332d8e93999d9fc43730f8a5ebb9f127eaeaabb7758da811cbad1ab2b95727d7dc190fc44dc0df67ac211dbaaa7489d
|
7
|
+
data.tar.gz: 8d72dc43ae9df0e701240377eeb268fd4a7b78b872658044bbe04778ea1b021e7f15774ffd2652af393a34913c770d70f3c8f857b4693ce9c06ce468351a0429
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,7 @@
|
|
1
|
+
v0.7.0 [☰](https://bitbucket.org/fractalgarden/loriot-rb/branches/compare/v0.6.0..v0.7.0) June 29th, 2017
|
2
|
+
------------------------------
|
3
|
+
* Http send cmd now return an hash with all the network data
|
4
|
+
|
1
5
|
v0.6.0 [☰](https://bitbucket.org/fractalgarden/loriot-rb/branches/compare/v0.5.0..v0.6.0) June 28th, 2017
|
2
6
|
------------------------------
|
3
7
|
* Now support mqtt to get and receive data throught RabbitMQ
|
data/lib/config/config.rb
CHANGED
@@ -3,9 +3,8 @@ LoraRb.configure do |config|
|
|
3
3
|
# config.protocol = :tls
|
4
4
|
# config.host = 'eu1.loriot.io'
|
5
5
|
# config.port = 737
|
6
|
-
# config.protocol = :
|
7
|
-
config.
|
8
|
-
|
9
|
-
config.host = '
|
10
|
-
config.port = 80
|
6
|
+
# config.protocol = :mqtt
|
7
|
+
# config.host = 'localhost'
|
8
|
+
config.protocol = :http
|
9
|
+
config.host = 'eu72.resiot.io'
|
11
10
|
end
|
data/lib/lora-rb/http/call.rb
CHANGED
@@ -26,9 +26,15 @@ module LoraRb
|
|
26
26
|
puts "#{Time.now} Cmq request: #{json_request}" if options[:debug]
|
27
27
|
response = HTTP.headers(_http_headers)
|
28
28
|
.post("https://#{@host}/api/application/#{@appid}/nodes/#{options[:eui]}/downlink", json: json_request)
|
29
|
+
return response if options[:debug]
|
29
30
|
# Return the json hash from the string
|
30
|
-
|
31
|
-
|
31
|
+
ar = response.to_a
|
32
|
+
# Example:
|
33
|
+
# [500,
|
34
|
+
# {"Content-Type"=>"application/json", "Date"=>"Thu, 29 Jun 2017 16:32:37 GMT", "Content-Length"=>"109", "Connection"=>"close"},
|
35
|
+
# "{\"error\":\"Node [AppEui: 1234, DevEui: abcd000000001234] not found in your collection.\",\"code\":2}"
|
36
|
+
# ]
|
37
|
+
{'status_code' => ar[0]}.merge(ar[1]).merge(JSON.parse(ar[2])).to_json
|
32
38
|
end
|
33
39
|
|
34
40
|
# Uplink: http waits data with an http server.
|
@@ -51,10 +57,4 @@ module LoraRb
|
|
51
57
|
end
|
52
58
|
|
53
59
|
end
|
54
|
-
end
|
55
|
-
# Example
|
56
|
-
=begin
|
57
|
-
require 'lora-rb'
|
58
|
-
lora=LoraClient.new
|
59
|
-
lora.send_cmd(eui: 'BE7A00000000123C')
|
60
|
-
=end
|
60
|
+
end
|
data/lib/lora-rb/mqtt/call.rb
CHANGED
data/lib/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lora-rb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Marco Mastrodonato
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2017-
|
13
|
+
date: 2017-06-29 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: json
|