lora-rb 0.7.2 → 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +11 -1
- data/lib/config/private.yml +2 -0
- data/lib/config/private_EXAMPLE.yml +2 -0
- data/lib/lora-rb/http/call.rb +4 -5
- data/lib/version.rb +1 -1
- 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: 2e741ccd715377f07a8ffbbb22fe91f833ccec4a
|
4
|
+
data.tar.gz: 4d02bcf8d4b566e6c182ed2f63cb6a99080a8cc2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c37b0380a04d8bc486e5269d4910c416564ab2c35b8838f35ff4d649cbf90661980a40c22ae16c4b8c0c7932ac92abee486058853e606a569e37e68bfe296423
|
7
|
+
data.tar.gz: 7d2d70038ada006a99eeefd2322905c756c4adb9f0b6e48160c104724263fdb0eea5a479127b9c2e758c6d1c8e00fcad2b1ae0011d894b85fb8f67bd406984c7
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,16 @@
|
|
1
|
+
v0.8.0 [☰](https://bitbucket.org/fractalgarden/loriot-rb/branches/compare/v0.7.0..v0.8.0) July 11th, 2017
|
2
|
+
------------------------------
|
3
|
+
* Send_cmd now accept param confirmed true/false
|
4
|
+
* New param connector_id
|
5
|
+
* Http response now contains the request as well
|
6
|
+
|
7
|
+
v0.7.2 June 30th, 2017
|
8
|
+
------------------------------
|
9
|
+
* Configuration yaml now use Erb if available
|
10
|
+
|
1
11
|
v0.7.1 June 30th, 2017
|
2
12
|
------------------------------
|
3
|
-
* Fixed send cmd for http protocol: It now returns a hash, previously a string
|
13
|
+
* Fixed send cmd for http protocol: It now returns a hash, previously a string
|
4
14
|
|
5
15
|
v0.7.0 [☰](https://bitbucket.org/fractalgarden/loriot-rb/branches/compare/v0.6.0..v0.7.0) June 29th, 2017
|
6
16
|
------------------------------
|
data/lib/config/private.yml
CHANGED
@@ -3,6 +3,8 @@ defaults: &defaults
|
|
3
3
|
appid: "a1b2c3d4e5f60001"
|
4
4
|
#token: "zHcD-1ouz3ytyOLE6SMhwA"
|
5
5
|
token: "17e3ce759c444b3977f4adbf9dd0e010"
|
6
|
+
# Some provider may use it
|
7
|
+
connector_id: "69643d32"
|
6
8
|
test_eui: "BE7A00000000123C"
|
7
9
|
#foo: add every variable you need and use it with => LoraRb::Settings.foo
|
8
10
|
# bar: sub variable are accessible with hash => LoraRb::Settings.foo[:bar]
|
data/lib/lora-rb/http/call.rb
CHANGED
@@ -15,17 +15,16 @@ module LoraRb
|
|
15
15
|
json_request = {
|
16
16
|
"Command": "",
|
17
17
|
"appEUI": options[:appid],
|
18
|
-
"askConfirmation":
|
18
|
+
"askConfirmation": options[:confirmed],
|
19
19
|
"devEUI": options[:eui],
|
20
20
|
"payload": options[:data],
|
21
|
-
"hexIdConnector":
|
21
|
+
"hexIdConnector": LoraRb::Settings.connector_id,
|
22
22
|
"port": options[:port],
|
23
23
|
"raw": false
|
24
24
|
}
|
25
25
|
|
26
26
|
puts "#{Time.now} Cmq request: #{json_request}" if options[:debug]
|
27
|
-
response = HTTP.headers(_http_headers)
|
28
|
-
.post("https://#{@host}/api/application/#{@appid}/nodes/#{options[:eui]}/downlink", json: json_request)
|
27
|
+
response = HTTP.headers(_http_headers).post("https://#{@host}/api/application/#{@appid}/nodes/#{options[:eui]}/downlink", json: json_request)
|
29
28
|
return response if options[:debug] == :full
|
30
29
|
# Return the json hash from the string
|
31
30
|
ar = response.to_a
|
@@ -34,7 +33,7 @@ module LoraRb
|
|
34
33
|
# {"Content-Type"=>"application/json", "Date"=>"Thu, 29 Jun 2017 16:32:37 GMT", "Content-Length"=>"109", "Connection"=>"close"},
|
35
34
|
# "{\"error\":\"Node [AppEui: 1234, DevEui: abcd000000001234] not found in your collection.\",\"code\":2}"
|
36
35
|
# ]
|
37
|
-
{'status_code' => ar[0]}.merge(ar[1]).merge(JSON.parse(ar[2]))
|
36
|
+
{'status_code' => ar[0], 'request' => json_request}.merge(ar[1]).merge(JSON.parse(ar[2]))
|
38
37
|
end
|
39
38
|
|
40
39
|
# Uplink: http waits data with an http server.
|
data/lib/version.rb
CHANGED