gm3156 0.0.1 → 0.0.3

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.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +5 -5
  3. data/TODO.md +0 -3
  4. data/lib/gm3156/record.rb +2 -2
  5. metadata +30 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 15bff36286b3a2400520c9c60c84127385383c6c1ec0de527623d293e8ddafae
4
- data.tar.gz: 67484565194ee5906d774ed712693f16c064b5b10fd789421b5d29dc6c0bbb96
3
+ metadata.gz: 48208a6f3fca90cc99840644e9a113bc94bf11b123a91e671a382b5f8f9a7981
4
+ data.tar.gz: 2f6638e2eefbb544e5b287d3c9129dc21852ed9894c014b4076209f2f00c24ef
5
5
  SHA512:
6
- metadata.gz: 2dda4bbb3f0ab63ef8cd6418c80b9bd1ccfbf9afe2286624aa2ec391cb7a9a8387f5c1e2236be567c4df92b380139079e989e7c95958ae799230330eb80ce6e1
7
- data.tar.gz: f1192b16b8ca6d3fbc6003d2af7776a96f65e38c3bda37d74018d075729ea65eb0b0c27014ffa4e107a54ec46adfd5eb04571d46adc3266702cdbd3065a9cdf7
6
+ metadata.gz: d0fcd84053352eec612974ce8e702096535d162319b67a72e28821869bf04d3fabaef7ee7d7c8c00e653793cee531d94cfc84ccd87d1cbf56045ac72c12f9494
7
+ data.tar.gz: 01ff5e0d6447b102178c210090a8a7fea962be80f14b29d98f12972554f893056667c4de51cd36827116348b6a170f2dacb7e315514eb34200e6678d7c4a8366
data/README.md CHANGED
@@ -4,11 +4,11 @@
4
4
  This driver was written for **Digital Sound Level Meter** with USB (type **GM1356**) serial number: `HA:1303162` ordered from China via Aliexpress. My sonometer works with **SoundLab** `Sound Level Meter v. 1.0.0.20, build 2016-07-20` delivered by [Benetech Poland](https://benetech-poland.pl/) (thank you very much for this). I was trying to run it with SoundLab downloaded from Bogen website, but it couldn't connect to the device. It means my driver may not work with some GM1356 devices.
5
5
 
6
6
  ## Installation
7
- After cloning this git repository make sure you have `ruby` interpretter and `bundler` gem. Then go to the main directory and run:
7
+ First make sure you have `ruby` interpreter installed. Then run:
8
8
 
9
- ```bundle install```
9
+ ```gem install gm3156```
10
10
 
11
- Now make sure that your `users` have access to your device. In my case I had to create `/etc/udev/rules.d/90-usbpermission.rules` with such content:
11
+ Now make sure that `users` have access to your device. In my case I had to create `/etc/udev/rules.d/90-usbpermission.rules` with such content:
12
12
 
13
13
  ```SUBSYSTEMS=="usb",ATTRS{idProduct}=="74e3",ATTRS{idVendor}=="64bd",GROUP="users",MODE="0666"```
14
14
 
@@ -21,11 +21,11 @@ And after all reconnect your device if it was already connected.
21
21
  ## Usage
22
22
  If you want to print real time data from your sonometer, run:
23
23
 
24
- ```./bin/gm3156```
24
+ ```gm3156```
25
25
 
26
26
  For more options:
27
27
 
28
- ```./bin/gm3156 --help```
28
+ ```gm3156 --help```
29
29
 
30
30
  ## Protocol
31
31
  I used Wireshark with USBPcap to sniff communication between my device and SoundLab on Windows in order to understend the protocol. Protocol is described in [PROTOCOL.md](PROTOCOL.md).
data/TODO.md CHANGED
@@ -1,7 +1,4 @@
1
1
  * figure out why some packets are invalid and handle it properly instead of retrying
2
- * add editing settings feature
3
- * write help for `./bin/gm3156`
4
2
  * write api documentation
5
- * create gem
6
3
  * handle reconnecting device / unconnected device etc. exceptions
7
4
  * test if it's stable
@@ -6,11 +6,11 @@ module GM3156
6
6
  class Record
7
7
  def initialize(message)
8
8
  self.timestamp = Time.now
9
- self.spl = extract_spl(message)
9
+ self.spl = assign_spl(message)
10
10
  self.settings = Settings.new(message)
11
11
  end
12
12
 
13
- def extract_spl(message)
13
+ def assign_spl(message)
14
14
  message[0..3].to_i(16).to_s.insert(-2, '.').to_f
15
15
  end
16
16
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gm3156
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Maciej Ciemborowicz
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-05-31 00:00:00.000000000 Z
11
+ date: 2019-06-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: hidapi
@@ -24,6 +24,34 @@ dependencies:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
26
  version: 0.1.9
27
+ - !ruby/object:Gem::Dependency
28
+ name: rubocop
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: 0.71.0
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: 0.71.0
41
+ - !ruby/object:Gem::Dependency
42
+ name: pry
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: 0.12.2
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: 0.12.2
27
55
  description: Digital Sound Level Meter Gm1356 USB driver for Linux.
28
56
  email: maciej.ciemborowicz+rubygems@gmail.com
29
57
  executables: