onkyo_eiscp_ruby 0.0.2 → 2.1.1
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 +7 -0
- data/README.md +213 -29
- data/VERSION +1 -1
- data/bin/mock_receiver.rb +25 -0
- data/bin/onkyo.rb +85 -23
- data/bin/onkyo_server.rb +8 -0
- data/eiscp-commands.yaml +3911 -3900
- data/lib/eiscp.rb +9 -7
- data/lib/eiscp/dictionary.rb +54 -0
- data/lib/eiscp/dictionary/dictionary_generators.rb +63 -0
- data/lib/eiscp/dictionary/dictionary_helpers.rb +116 -0
- data/lib/eiscp/message.rb +123 -0
- data/lib/eiscp/parser.rb +24 -0
- data/lib/eiscp/parser/dynamic_value_parser.rb +9 -0
- data/lib/eiscp/parser/eiscp_parser.rb +37 -0
- data/lib/eiscp/parser/human_readable_parser.rb +29 -0
- data/lib/eiscp/parser/iscp_parser.rb +28 -0
- data/lib/eiscp/receiver.rb +203 -0
- data/lib/eiscp/receiver/command_methods.rb +28 -0
- data/lib/eiscp/receiver/discovery.rb +49 -0
- data/onkyo_eiscp_ruby.gemspec +16 -13
- data/test/tc_dictionary.rb +45 -0
- data/test/tc_message.rb +26 -0
- data/test/tc_parser.rb +34 -0
- data/test/tc_receiver.rb +7 -0
- metadata +37 -32
- data/bin/onkyo-server.rb +0 -7
- data/lib/eiscp/command.rb +0 -80
- data/lib/eiscp/eiscp.rb +0 -125
- data/lib/eiscp/eiscp_packet.rb +0 -51
- data/lib/eiscp/eiscp_server.rb +0 -21
- data/lib/eiscp/iscp_message.rb +0 -24
- data/test/tc_command.rb +0 -30
- data/test/tc_eiscp.rb +0 -6
- data/test/tc_eiscp_packet.rb +0 -17
- data/test/tc_iscp_message.rb +0 -14
data/test/tc_command.rb
DELETED
@@ -1,30 +0,0 @@
|
|
1
|
-
require_relative "../lib/eiscp/command.rb"
|
2
|
-
require "test/unit"
|
3
|
-
|
4
|
-
class TestCommand < Test::Unit::TestCase
|
5
|
-
|
6
|
-
def test_command_to_name
|
7
|
-
assert_equal(Command.command_to_name("PWR"), "system-power")
|
8
|
-
end
|
9
|
-
|
10
|
-
def test_name_to_command
|
11
|
-
assert_equal(Command.name_to_command("system-power"), "PWR")
|
12
|
-
end
|
13
|
-
|
14
|
-
def test_command_value_to_value_name
|
15
|
-
assert_equal(Command.command_value_to_value_name("PWR", "01"), "on")
|
16
|
-
end
|
17
|
-
|
18
|
-
def test_command_value_name_to_value
|
19
|
-
assert_equal(Command.command_value_name_to_value("PWR", "on"), "01")
|
20
|
-
end
|
21
|
-
|
22
|
-
def test_description_from_name
|
23
|
-
assert_equal(Command.description_from_name("system-power"), "System Power Command")
|
24
|
-
end
|
25
|
-
|
26
|
-
def test_description_from_command
|
27
|
-
assert_equal(Command.description_from_command("PWR"), "System Power Command")
|
28
|
-
end
|
29
|
-
|
30
|
-
end
|
data/test/tc_eiscp.rb
DELETED
data/test/tc_eiscp_packet.rb
DELETED
@@ -1,17 +0,0 @@
|
|
1
|
-
require_relative "../lib/eiscp/eiscp_packet.rb"
|
2
|
-
require "test/unit"
|
3
|
-
|
4
|
-
class TestEISCPPacket < Test::Unit::TestCase
|
5
|
-
|
6
|
-
DISCOVERY_STRING = "ISCP\x00\x00\x00\x10\x00\x00\x00\n\x01\x00\x00\x00!xECNQSTN\r"
|
7
|
-
DISCOVERY_PACKET = EISCPPacket.new('ECN', 'QSTN', 'x', '!')
|
8
|
-
|
9
|
-
def test_create_discovery_packet_string
|
10
|
-
assert_equal(DISCOVERY_PACKET.to_s, DISCOVERY_STRING)
|
11
|
-
end
|
12
|
-
|
13
|
-
def test_parse_discovery_packet_string
|
14
|
-
assert_equal(EISCPPacket.parse(DISCOVERY_STRING).to_s, DISCOVERY_PACKET.to_s)
|
15
|
-
end
|
16
|
-
|
17
|
-
end
|
data/test/tc_iscp_message.rb
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
require_relative "../lib/eiscp/iscp_message.rb"
|
2
|
-
require "test/unit"
|
3
|
-
|
4
|
-
class TestISCPMessage < Test::Unit::TestCase
|
5
|
-
|
6
|
-
def test_create_discovery_iscp_message
|
7
|
-
assert_equal(ISCPMessage.new("ECN", "QSTN", "x", "!").to_s, "!xECNQSTN\r")
|
8
|
-
end
|
9
|
-
|
10
|
-
def test_parse_discovery_iscp_message
|
11
|
-
assert_equal(ISCPMessage.parse("!xECNQSTN\r").to_s, "!xECNQSTN\r")
|
12
|
-
end
|
13
|
-
|
14
|
-
end
|