Class: TimexDatalinkClient::Protocol7::Eeprom::Speech
- Inherits:
-
Object
- Object
- TimexDatalinkClient::Protocol7::Eeprom::Speech
- Defined in:
- lib/timex_datalink_client/protocol_7/eeprom/speech.rb
Constant Summary collapse
- NICKNAME_LENGTH_WITHOUT_DEVICE =
10
- NICKNAME_LENGTH_WITH_DEVICE =
14
- NICKNAME_SUFFIXES =
[ [0x353, 0x3fd, 0x04d, 0x003, 0x28d], [0x353, 0x3fd, 0x04d, 0x003, 0x27b], [0x3fb, 0x363, 0x039, 0x03c], [0x3fb, 0x361, 0x039, 0x03c, 0x194, 0x3fd, 0x04b, 0x003, 0x144, 0x327], [0x3fb, 0x1ae, 0x030, 0x329, 0x03c, 0x3fb, 0x030, 0x320, 0x03c, 0x039, 0x124], [0x3fb, 0x353, 0x003, 0x1ae, 0x2e6, 0x18e], [0x361, 0x039, 0x03c, 0x144, 0x3fd, 0x04b], [0x3fb, 0x361, 0x33e], [0x1cb, 0x039, 0x03c, 0x144, 0x3fd, 0x04b], [0x039, 0x35a, 0x1ae, 0x3fd, 0x04b, 0x18e, 0x381], [0x039, 0x35a, 0x31c, 0x381], [0x353, 0x3fd, 0x04d, 0x003, 0x28d, 0x07b, 0x094], [0x1e0, 0x1ab], [0x253, 0x3fd, 0x04d, 0x182], [0x353, 0x3fd, 0x04d, 0x003, 0x357, 0x10c, 0x3fd, 0x04d] ]
- HEADER_VALUE_1_BASE =
0x0b
- HEADER_VALUE_1_DEVICE_NICK =
4
- HEADER_VALUE_2_BASE =
0x00
- HEADER_VALUE_2_PHRASES =
26
- HEADER_VALUE_2_DEVICE_NICK =
8
- HEADER_VALUE_3_BASE =
0x1a
- HEADER_VALUE_3_PHRASES =
2
- HEADER_VALUE_3_DEVICE_NICK =
8
- HEADER_VALUE_4_DEVICE_BASE =
8
- HEADER_VALUE_4_PHRASE =
2
- HEADER_VALUE_4_BASES =
[0x1a, 0x1a, 0x1a, 0x1f, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a]
- HEADER_VALUE_4_DEVICE_MULTIPLIERS =
[5, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 5, 5, 5]
- HEADER_VALUE_4_DEVICE_INDEXES =
[ [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0, 1, 11], [0, 1, 11, 12], [0, 1, 11, 12, 13] ]
- HEADER_VALUE_4_USER_MULTIPLIERS =
[0, 0, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5]
- HEADER_VALUE_4_USER_INDEXES =
[ [], [], [2], [2, 5], [3, 4, 10], [3, 4, 5, 10], [3, 4, 5, 6, 10], [3, 4, 5, 6, 7, 10], [3, 4, 5, 6, 7, 8, 10], [3, 4, 5, 6, 7, 8, 9, 10], [2, 3, 4, 5, 6, 7, 8, 9, 10], [2, 3, 4, 5, 6, 7, 8, 9, 10], [2, 3, 4, 5, 6, 7, 8, 9, 10], [2, 3, 4, 5, 6, 7, 8, 9, 10] ]
- HEADER_VALUE_5_BASE =
0x8d
- HEADER_VALUE_5_DEVICE_BASE =
-107
- HEADER_VALUE_5_DEVICE_INDEXES =
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]
- HEADER_VALUE_5_DEVICE_MULTIPLIER =
5
- HEADER_VALUE_5_USER_BASE =
0
- HEADER_VALUE_5_USER_INDEXES =
[14]
- HEADER_VALUE_5_USER_MULTIPLIER =
5
- HEADER_VALUE_5_PHRASE =
2
- HEADER_VALUE_5_PHRASE_PACKET =
5
- PACKETS_TERMINATOR =
0x05
Constants included from Helpers::FourByteFormatter
Helpers::FourByteFormatter::BYTE_NULL, Helpers::FourByteFormatter::BYTE_TERMINATOR_ENDF, Helpers::FourByteFormatter::BYTE_TERMINATOR_ENDR
Instance Attribute Summary collapse
-
#device_nickname ⇒ Object
Returns the value of attribute device_nickname.
-
#phrases ⇒ Object
Returns the value of attribute phrases.
-
#user_nickname ⇒ Object
Returns the value of attribute user_nickname.
Instance Method Summary collapse
-
#initialize(phrases: [], device_nickname: [], user_nickname: []) ⇒ Speech
constructor
Create a Speech instance.
-
#packet ⇒ Array<Integer>
Compile data for nicknames and phrases.
Methods included from Helpers::LsbMsbFormatter
Methods included from Helpers::FourByteFormatter
Constructor Details
#initialize(phrases: [], device_nickname: [], user_nickname: []) ⇒ Speech
Create a Speech instance.
110 111 112 113 114 |
# File 'lib/timex_datalink_client/protocol_7/eeprom/speech.rb', line 110 def initialize(phrases: [], device_nickname: [], user_nickname: []) @phrases = phrases @device_nickname = device_nickname @user_nickname = user_nickname end |
Instance Attribute Details
#device_nickname ⇒ Object
Returns the value of attribute device_nickname.
102 103 104 |
# File 'lib/timex_datalink_client/protocol_7/eeprom/speech.rb', line 102 def device_nickname @device_nickname end |
#phrases ⇒ Object
Returns the value of attribute phrases.
102 103 104 |
# File 'lib/timex_datalink_client/protocol_7/eeprom/speech.rb', line 102 def phrases @phrases end |
#user_nickname ⇒ Object
Returns the value of attribute user_nickname.
102 103 104 |
# File 'lib/timex_datalink_client/protocol_7/eeprom/speech.rb', line 102 def user_nickname @user_nickname end |
Instance Method Details
#packet ⇒ Array<Integer>
Compile data for nicknames and phrases.
119 120 121 |
# File 'lib/timex_datalink_client/protocol_7/eeprom/speech.rb', line 119 def packet header + nickname_bytes + formatted_phrases + [PACKETS_TERMINATOR] end |