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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a328956e282ef7fc3fc65942183c4373d304850c
4
- data.tar.gz: '049b381a5922987c282f21f39562416c76265ccb'
3
+ metadata.gz: 2a7aecb0c4a396e5e8c2ce339c2308327c065e83
4
+ data.tar.gz: e44bbcee41a9bf7ccde484d2f2deb40a1176c0b8
5
5
  SHA512:
6
- metadata.gz: 20ee3a2d4016d80b24b44b05f128c2c37791c712e9c925900615ef460aa2d753f474f7c952d68aa1a3e63bab4ce7dec1b0191abf8442a761943bf98687b78f02
7
- data.tar.gz: dff6d02731671b3074e915f5ff224686c28ccd9b857286b56f2cbb4e6ffc12dd42df33765ed9ec49326488e511bff6a06e8e701ca3fe3cdd45817c7992e2982d
6
+ metadata.gz: 6f02138aa2d1f4c2962e1c8f7caa8ea0c332d8e93999d9fc43730f8a5ebb9f127eaeaabb7758da811cbad1ab2b95727d7dc190fc44dc0df67ac211dbaaa7489d
7
+ data.tar.gz: 8d72dc43ae9df0e701240377eeb268fd4a7b78b872658044bbe04778ea1b021e7f15774ffd2652af393a34913c770d70f3c8f857b4693ce9c06ce468351a0429
@@ -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
@@ -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 = :http
7
- config.protocol = :mqtt
8
- # config.host = 'eu72.resiot.io'
9
- config.host = 'localhost'
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
@@ -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
- # JSON.parse(response)
31
- response
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
@@ -52,10 +52,4 @@ end
52
52
  # Monkey patch since Bunny use the rails method .empty?
53
53
  class NilClass
54
54
  def empty?; true end
55
- end
56
- # Example
57
- =begin
58
- require 'lora-rb'
59
- lora=LoraClient.new
60
- lora.send_cmd(eui: 'BE7A00000000123C')
61
- =end
55
+ end
@@ -1,5 +1,5 @@
1
1
  module LoraRb
2
2
  def self.version
3
- "0.6.0"
3
+ "0.7.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.6.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-04-07 00:00:00.000000000 Z
13
+ date: 2017-06-29 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: json