lora-rb 0.7.2 → 0.8.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 65935a9836184e221c76a727751adb7fe7552aef
4
- data.tar.gz: 45a1d54a69049c88a046a27e19c4b5b60be96d69
3
+ metadata.gz: 2e741ccd715377f07a8ffbbb22fe91f833ccec4a
4
+ data.tar.gz: 4d02bcf8d4b566e6c182ed2f63cb6a99080a8cc2
5
5
  SHA512:
6
- metadata.gz: 3147f9a4026a9a59bcd75920dc0e40f32bad5334d9b9e4ecd4afd4a4b98173094bb2fb79aeba07c558763b2f3ca88c6b5e5a779938f71a369bb18efb52bc769f
7
- data.tar.gz: bcada6d152bbcf4e9e29c676f96fc2a494540f7a65e4d013ee6be73e4155c67faf57b789a9fbc8fdf01bf8b09a38991d8caed2348c4f977ed7acdf2874d306ed
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
  ------------------------------
@@ -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]
@@ -2,6 +2,8 @@ defaults: &defaults
2
2
  # Insert your credentials provided by Lora
3
3
  appid:
4
4
  token:
5
+ # Some provider may use it
6
+ connector_id:
5
7
  # Insert your device for test purpose
6
8
  test_eui:
7
9
  #foo: add every variable you need and use it with => LoraRb::Settings.foo
@@ -15,17 +15,16 @@ module LoraRb
15
15
  json_request = {
16
16
  "Command": "",
17
17
  "appEUI": options[:appid],
18
- "askConfirmation": true,
18
+ "askConfirmation": options[:confirmed],
19
19
  "devEUI": options[:eui],
20
20
  "payload": options[:data],
21
- "hexIdConnector": "69643d32",
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
@@ -1,5 +1,5 @@
1
1
  module LoraRb
2
2
  def self.version
3
- "0.7.2"
3
+ "0.8.0"
4
4
  end
5
5
  end
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.7.2
4
+ version: 0.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marco Mastrodonato