m2x-mqtt 0.0.2 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 10d2fcae61b639f4b3f1e48b83c87e84bb6cc8be
4
- data.tar.gz: 7673b850fd7e3cdce12e646a223eb99d9d9738f2
3
+ metadata.gz: b32c44de80c644544251f8503c5de3c44c58a32e
4
+ data.tar.gz: 5db185ffe40fe7ee3524474102ddee4eb508457d
5
5
  SHA512:
6
- metadata.gz: 03f12ff0cff0d3256ddf0a976816fd027fe2951d4ce57f09f61f3fe5c382ee874811493107e03f13c594e862ae971ea34020b3d52c50fd2c3061a38680d25511
7
- data.tar.gz: eccaa695c26e042b2cec5f8b208b0425f0e06f245692db77f3737411cba07ebc0d08ef99acd56a3150a755c542367c2cdf6ad8b049fdb22f66e7eacb360d2884
6
+ metadata.gz: 7a533bbe8ca5150fdcfaebb6d1cc5eb757374453165d4d2cc50b2eb26a325df4d1160a2d9a6d15253491dd34347a8f4cde34488c1fb2ad4a9df865b838c1a24f
7
+ data.tar.gz: 81e8bbe9f3161cd6e0da6a96c8f19325146f9b32dcbf9e786b5aa31fd46b2a3170828f260dbafc8aadefd5e5667c3acb1e11da2384ef232472f5feb86dc81002
data/README.md CHANGED
@@ -46,6 +46,15 @@ This provides an interface to your data in M2X
46
46
 
47
47
  Refer to the documentation on each class for further usage instructions.
48
48
 
49
+ ## Time
50
+
51
+ For devices that do not have a Real Time Clock, M2X provides a set of endpoints that returns the server's time.
52
+
53
+ ```ruby
54
+ m2x.time
55
+ => {"seconds"=>1435970368, "millis"=>1435970368451, "iso8601"=>"2015-07-04T00:39:28.451Z"}
56
+ ```
57
+
49
58
  ## Example
50
59
 
51
60
  In order to run this example, you will need a `Device ID` and `API Key`. If you don't have any, access your M2X account, create a new [Device](https://m2x.att.com/devices), and copy the `Device ID` and `API Key` values. The following script will send your CPU load average to three different streams named `load_1m`, `load_5m` and `load_15`. Check that there's no need to create a stream in order to write values into it.
@@ -28,6 +28,12 @@ module M2X
28
28
  client.get_response
29
29
  end
30
30
 
31
+ def time
32
+ client.subscribe
33
+ client.get("/time")
34
+ client.get_response["body"]
35
+ end
36
+
31
37
  def device(id)
32
38
  M2X::MQTT::Device.new(client, "id" => id)
33
39
  end
@@ -1,5 +1,5 @@
1
1
  module M2X
2
2
  class MQTT
3
- VERSION = "0.0.2"
3
+ VERSION = "0.1.0"
4
4
  end
5
5
  end
@@ -18,4 +18,6 @@ Gem::Specification.new do |s|
18
18
  "lib/**/*.rb",
19
19
  "*.gemspec"
20
20
  ]
21
+
22
+ s.add_dependency "mqtt", "~> 0"
21
23
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: m2x-mqtt
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Leandro López
@@ -10,8 +10,22 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2015-03-17 00:00:00.000000000 Z
14
- dependencies: []
13
+ date: 2015-07-04 00:00:00.000000000 Z
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: mqtt
17
+ requirement: !ruby/object:Gem::Requirement
18
+ requirements:
19
+ - - "~>"
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ requirements:
26
+ - - "~>"
27
+ - !ruby/object:Gem::Version
28
+ version: '0'
15
29
  description: AT&T’s M2X is a cloud-based fully managed data storage service for network
16
30
  connected machine-to-machine (M2M) devices. From trucks and turbines to vending
17
31
  machines and freight containers, M2X enables the devices that power your business