onkyo_eiscp_ruby 2.1.5 → 2.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +5 -4
- data/VERSION +1 -1
- data/lib/eiscp/parser/eiscp_parser.rb +0 -1
- data/lib/eiscp/receiver/discovery.rb +14 -12
- data/lib/eiscp.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d3dd4eba4824a8b6f5698a427829515653a327f7e7a9a3439b0c66be8ed71ce1
|
4
|
+
data.tar.gz: 5e747f4b17191a38c76067df0461f9a59b7e0e116a78f34c6d8507e1ff06b2f2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c0053cc9c49574d835e967190edeea8519dd99ef25f3c397046274fb3da3d319292719cc5c002f0a839d69d8da271ad274cf4f449cfbab695c8c00acdeb0df42
|
7
|
+
data.tar.gz: 60476141723946c9741f957fea30e3b0709c13907155619e559cd403f6d2abf5c88bd693153cf33a35d47f9f3b07d3444ef14880f641b91d8628e83d9232f812
|
data/README.md
CHANGED
@@ -56,7 +56,7 @@ Using the Library
|
|
56
56
|
`VERSION`)
|
57
57
|
|
58
58
|
* You can do most everything through the `Receiver` and `Message` objects. If you
|
59
|
-
want to accept user input you will probably want to use the Parser module. Be
|
59
|
+
want to accept user input you will probably want to use the `Parser` module. Be
|
60
60
|
sure to check out the RDocs or dig through the source code. I try to keep it
|
61
61
|
well commented/documented, and there's more functionality to the library than
|
62
62
|
is shown here:
|
@@ -82,7 +82,7 @@ Using the Library
|
|
82
82
|
EISCP::Receiver.discover
|
83
83
|
```
|
84
84
|
|
85
|
-
* Create `Receiver` object from first discovered
|
85
|
+
* Create `Receiver` object from first discovered receiver on the LAN
|
86
86
|
|
87
87
|
```ruby
|
88
88
|
receiver = EISCP::Receiver.new
|
@@ -104,8 +104,9 @@ Using the Library
|
|
104
104
|
end
|
105
105
|
```
|
106
106
|
|
107
|
-
* Receivers created without a block will not connect automatically.
|
108
|
-
|
107
|
+
* `Receivers` created without a block will not connect automatically. If you try
|
108
|
+
to send a command it will connect transparently, otherwise you can use the
|
109
|
+
`connect` method to explicitly open a socket to the receiver.
|
109
110
|
|
110
111
|
```ruby
|
111
112
|
receiver.connect
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.1.
|
1
|
+
2.1.6
|
@@ -28,21 +28,23 @@ module EISCP
|
|
28
28
|
# Returns an array of discovered Receiver objects.
|
29
29
|
#
|
30
30
|
def discover(discovery_port = Receiver::ONKYO_PORT)
|
31
|
-
sock = UDPSocket.new
|
32
|
-
sock.setsockopt(Socket::SOL_SOCKET, Socket::SO_BROADCAST, true)
|
33
|
-
sock.send(ONKYO_MAGIC, 0, '<broadcast>', discovery_port)
|
34
31
|
data = []
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
32
|
+
Socket.ip_address_list.each do | addr |
|
33
|
+
if addr.ipv4?
|
34
|
+
sock = UDPSocket.new
|
35
|
+
sock.setsockopt(Socket::SOL_SOCKET, Socket::SO_BROADCAST, true)
|
36
|
+
sock.bind(addr.ip_address, discovery_port)
|
37
|
+
sock.send(ONKYO_MAGIC, 0, '<broadcast>', discovery_port)
|
38
|
+
loop do
|
39
|
+
msg, addr = sock.recvfrom_nonblock(1024)
|
40
|
+
data << Receiver.new(addr[2], ecn_string_to_ecn_array(msg))
|
41
|
+
rescue IO::WaitReadable
|
42
|
+
io = IO.select([sock], nil, nil, 0.5)
|
43
|
+
break if io.nil?
|
44
|
+
end
|
44
45
|
end
|
45
46
|
end
|
47
|
+
return data
|
46
48
|
end
|
47
49
|
end
|
48
50
|
end
|
data/lib/eiscp.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: onkyo_eiscp_ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Rodrigues
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-11-18 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: "\n Control Onkyo receivers over the network.Use the provided binary
|
14
14
|
or\n require the library for use in your scripts.\n "
|