timex_datalink_client 0.6.0 → 0.8.0

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 (29) hide show
  1. checksums.yaml +4 -4
  2. data/lib/timex_datalink_client/helpers/four_byte_formatter.rb +29 -0
  3. data/lib/timex_datalink_client/protocol_4/alarm.rb +59 -0
  4. data/lib/timex_datalink_client/protocol_4/eeprom/anniversary.rb +44 -0
  5. data/lib/timex_datalink_client/protocol_4/eeprom/appointment.rb +49 -0
  6. data/lib/timex_datalink_client/protocol_4/eeprom/list.rb +43 -0
  7. data/lib/timex_datalink_client/protocol_4/eeprom/phone_number.rb +56 -0
  8. data/lib/timex_datalink_client/protocol_4/eeprom.rb +95 -0
  9. data/lib/timex_datalink_client/protocol_4/end.rb +20 -0
  10. data/lib/timex_datalink_client/protocol_4/sound_options.rb +42 -0
  11. data/lib/timex_datalink_client/protocol_4/sound_theme.rb +65 -0
  12. data/lib/timex_datalink_client/protocol_4/start.rb +20 -0
  13. data/lib/timex_datalink_client/protocol_4/sync.rb +40 -0
  14. data/lib/timex_datalink_client/protocol_4/time.rb +77 -0
  15. data/lib/timex_datalink_client/protocol_4/wrist_app.rb +67 -0
  16. data/lib/timex_datalink_client/protocol_7/eeprom/activity.rb +94 -0
  17. data/lib/timex_datalink_client/protocol_7/eeprom/calendar/event.rb +33 -0
  18. data/lib/timex_datalink_client/protocol_7/eeprom/calendar.rb +91 -0
  19. data/lib/timex_datalink_client/protocol_7/eeprom/games.rb +124 -0
  20. data/lib/timex_datalink_client/protocol_7/eeprom/phone_number.rb +79 -0
  21. data/lib/timex_datalink_client/protocol_7/eeprom/speech.rb +228 -0
  22. data/lib/timex_datalink_client/protocol_7/eeprom.rb +76 -0
  23. data/lib/timex_datalink_client/protocol_7/end.rb +20 -0
  24. data/lib/timex_datalink_client/protocol_7/phrase_builder.rb +70 -0
  25. data/lib/timex_datalink_client/protocol_7/start.rb +20 -0
  26. data/lib/timex_datalink_client/protocol_7/sync.rb +40 -0
  27. data/lib/timex_datalink_client/version.rb +1 -1
  28. data/lib/timex_datalink_client.rb +34 -5
  29. metadata +42 -3
@@ -0,0 +1,228 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "timex_datalink_client/helpers/four_byte_formatter"
4
+
5
+ class TimexDatalinkClient
6
+ class Protocol7
7
+ class Eeprom
8
+ class Speech
9
+ include Helpers::FourByteFormatter
10
+
11
+ NICKNAME_LENGTH_WITHOUT_DEVICE = 10
12
+ NICKNAME_LENGTH_WITH_DEVICE = 14
13
+
14
+ NICKNAME_SUFFIXES = [
15
+ [0x353, 0x3fd, 0x04d, 0x003, 0x28d],
16
+ [0x353, 0x3fd, 0x04d, 0x003, 0x27b],
17
+ [0x3fb, 0x363, 0x039, 0x03c],
18
+ [0x3fb, 0x361, 0x039, 0x03c, 0x194, 0x3fd, 0x04b, 0x003, 0x144, 0x327],
19
+ [0x3fb, 0x1ae, 0x030, 0x329, 0x03c, 0x3fb, 0x030, 0x320, 0x03c, 0x039, 0x124],
20
+ [0x3fb, 0x353, 0x003, 0x1ae, 0x2e6, 0x18e],
21
+ [0x361, 0x039, 0x03c, 0x144, 0x3fd, 0x04b],
22
+ [0x3fb, 0x361, 0x33e],
23
+ [0x1cb, 0x039, 0x03c, 0x144, 0x3fd, 0x04b],
24
+ [0x039, 0x35a, 0x1ae, 0x3fd, 0x04b, 0x18e, 0x381],
25
+ [0x039, 0x35a, 0x31c, 0x381],
26
+ [0x353, 0x3fd, 0x04d, 0x003, 0x28d, 0x07b, 0x094],
27
+ [0x1e0, 0x1ab],
28
+ [0x253, 0x3fd, 0x04d, 0x182],
29
+ [0x353, 0x3fd, 0x04d, 0x003, 0x357, 0x10c, 0x3fd, 0x04d]
30
+ ]
31
+
32
+ HEADER_VALUE_1_BASE = 0x0b
33
+ HEADER_VALUE_1_DEVICE_NICK = 4
34
+
35
+ HEADER_VALUE_2_BASE = 0x00
36
+ HEADER_VALUE_2_PHRASES = 26
37
+ HEADER_VALUE_2_DEVICE_NICK = 8
38
+
39
+ HEADER_VALUE_3_BASE = 0x1a
40
+ HEADER_VALUE_3_PHRASES = 2
41
+ HEADER_VALUE_3_DEVICE_NICK = 8
42
+
43
+ HEADER_VALUE_4_DEVICE_BASE = 8
44
+ HEADER_VALUE_4_PHRASE = 2
45
+
46
+ HEADER_VALUE_4_BASES = [0x1a, 0x1a, 0x1a, 0x1f, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a]
47
+ HEADER_VALUE_4_DEVICE_MULTIPLIERS = [5, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 5, 5, 5]
48
+
49
+ HEADER_VALUE_4_DEVICE_INDEXES = [
50
+ [0],
51
+ [0],
52
+ [0],
53
+ [0],
54
+ [0],
55
+ [0],
56
+ [0],
57
+ [0],
58
+ [0],
59
+ [0],
60
+ [0],
61
+ [0, 1, 11],
62
+ [0, 1, 11, 12],
63
+ [0, 1, 11, 12, 13]
64
+ ]
65
+
66
+ HEADER_VALUE_4_USER_MULTIPLIERS = [0, 0, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5]
67
+
68
+ HEADER_VALUE_4_USER_INDEXES = [
69
+ [],
70
+ [],
71
+ [2],
72
+ [2, 5],
73
+ [3, 4, 10],
74
+ [3, 4, 5, 10],
75
+ [3, 4, 5, 6, 10],
76
+ [3, 4, 5, 6, 7, 10],
77
+ [3, 4, 5, 6, 7, 8, 10],
78
+ [3, 4, 5, 6, 7, 8, 9, 10],
79
+ [2, 3, 4, 5, 6, 7, 8, 9, 10],
80
+ [2, 3, 4, 5, 6, 7, 8, 9, 10],
81
+ [2, 3, 4, 5, 6, 7, 8, 9, 10],
82
+ [2, 3, 4, 5, 6, 7, 8, 9, 10]
83
+ ]
84
+
85
+ HEADER_VALUE_5_BASE = 0x8d
86
+
87
+ HEADER_VALUE_5_DEVICE_BASE = -107
88
+ HEADER_VALUE_5_DEVICE_INDEXES = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]
89
+ HEADER_VALUE_5_DEVICE_MULTIPLIER = 5
90
+
91
+ HEADER_VALUE_5_USER_BASE = 0
92
+ HEADER_VALUE_5_USER_INDEXES = [14]
93
+ HEADER_VALUE_5_USER_MULTIPLIER = 5
94
+
95
+ HEADER_VALUE_5_PHRASE = 2
96
+ HEADER_VALUE_5_PHRASE_PACKET = 5
97
+
98
+ PACKETS_TERMINATOR = 0x05
99
+
100
+ attr_accessor :phrases, :device_nickname, :user_nickname
101
+
102
+ # Create a Speech instance.
103
+ #
104
+ # @param phrases [Array<Array<Integer>>] Two-dimensional array of phrases.
105
+ # @param device_nickname [Array<Integer>] Device nickname.
106
+ # @param user_nickname [Array<Integer>] User nickname.
107
+ # @return [Speech] Speech instance.
108
+ def initialize(phrases: [], device_nickname: [], user_nickname: [])
109
+ @phrases = phrases
110
+ @device_nickname = device_nickname
111
+ @user_nickname = user_nickname
112
+ end
113
+
114
+ # Compile data for nicknames and phrases.
115
+ #
116
+ # @return [Array<Integer>] Compiled data of all nicknames and phrases.
117
+ def packet
118
+ header + nickname_bytes + formatted_phrases + [PACKETS_TERMINATOR]
119
+ end
120
+
121
+ private
122
+
123
+ def header
124
+ all_values = [header_value_1, header_value_2, header_value_3] + header_values_4 + header_values_5
125
+
126
+ all_values.flat_map { |value| value.divmod(256).reverse }
127
+ end
128
+
129
+ def header_value_1
130
+ value_1 = HEADER_VALUE_1_BASE + phrases.count
131
+ value_1 += HEADER_VALUE_1_DEVICE_NICK if device_nickname.any?
132
+
133
+ value_1
134
+ end
135
+
136
+ def header_value_2
137
+ value_2 = HEADER_VALUE_2_BASE
138
+ value_2 += HEADER_VALUE_2_PHRASES if phrases.any?
139
+ value_2 += HEADER_VALUE_2_DEVICE_NICK if phrases.any? && device_nickname.any?
140
+
141
+ value_2
142
+ end
143
+
144
+ def header_value_3
145
+ value_3 = HEADER_VALUE_3_BASE
146
+ value_3 += HEADER_VALUE_3_DEVICE_NICK if device_nickname.any?
147
+ value_3 += HEADER_VALUE_3_PHRASES * phrases.count
148
+
149
+ value_3
150
+ end
151
+
152
+ def header_values_4
153
+ value_4_length = device_nickname.any? ? NICKNAME_LENGTH_WITH_DEVICE : NICKNAME_LENGTH_WITHOUT_DEVICE
154
+
155
+ value_4_length.times.flat_map do |value_4_index|
156
+ device_value = HEADER_VALUE_4_DEVICE_INDEXES[value_4_index].sum { |device_index| packet_lengths[device_index] }
157
+ device_value *= HEADER_VALUE_4_DEVICE_MULTIPLIERS[value_4_index]
158
+
159
+ user_value = HEADER_VALUE_4_USER_INDEXES[value_4_index].sum { |device_index| packet_lengths[device_index] }
160
+ user_value *= HEADER_VALUE_4_USER_MULTIPLIERS[value_4_index]
161
+
162
+ value = device_value + user_value
163
+ value += HEADER_VALUE_4_BASES[value_4_index]
164
+ value += HEADER_VALUE_4_PHRASE * phrases.count
165
+ value += HEADER_VALUE_4_DEVICE_BASE if device_nickname.any?
166
+
167
+ value
168
+ end
169
+ end
170
+
171
+ def header_values_5
172
+ phrases.each_index.flat_map do |phrase_index|
173
+ value = HEADER_VALUE_5_BASE
174
+
175
+ if device_nickname.any?
176
+ device_value = HEADER_VALUE_5_DEVICE_INDEXES.sum { |device_index| packet_lengths[device_index] }
177
+ device_value *= HEADER_VALUE_5_DEVICE_MULTIPLIER
178
+ device_value += HEADER_VALUE_5_DEVICE_BASE
179
+
180
+ value += device_value
181
+ end
182
+
183
+ if user_nickname.any?
184
+ user_value = HEADER_VALUE_5_USER_INDEXES.sum { |device_index| packet_lengths[device_index] }
185
+ user_value *= HEADER_VALUE_5_USER_MULTIPLIER
186
+ user_value += HEADER_VALUE_5_USER_BASE
187
+
188
+ value += user_value
189
+ end
190
+
191
+ value += HEADER_VALUE_5_PHRASE * phrases.count
192
+ value += HEADER_VALUE_5_PHRASE_PACKET * phrases.first(phrase_index).sum { |phrase| 1 + phrase.length / 4 }
193
+
194
+ value
195
+ end
196
+ end
197
+
198
+ def nickname_bytes
199
+ four_byte_format_for(nicknames_with_suffixes)
200
+ end
201
+
202
+ def packet_lengths
203
+ nicknames_with_suffixes.map { |nickname| 1 + nickname.length / 4 }
204
+ end
205
+
206
+ def nickname_format
207
+ format = [device_nickname] * 2
208
+ format += [user_nickname] * 9
209
+ format += [device_nickname] * 4 if device_nickname.any?
210
+
211
+ format
212
+ end
213
+
214
+ def nicknames_with_suffixes
215
+ nickname_format.each_with_index.map do |nickname, nickname_index|
216
+ nickname + NICKNAME_SUFFIXES[nickname_index]
217
+ end
218
+ end
219
+
220
+ def formatted_phrases
221
+ return [] if phrases.empty?
222
+
223
+ four_byte_format_for(phrases)
224
+ end
225
+ end
226
+ end
227
+ end
228
+ end
@@ -0,0 +1,76 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "timex_datalink_client/helpers/cpacket_paginator"
4
+ require "timex_datalink_client/helpers/crc_packets_wrapper"
5
+
6
+ class TimexDatalinkClient
7
+ class Protocol7
8
+ class Eeprom
9
+ include Helpers::CpacketPaginator
10
+ prepend Helpers::CrcPacketsWrapper
11
+
12
+ # FIXME use arrays for array models
13
+ # FIXME: check Array<Integer> yardoc around places
14
+
15
+ CPACKET_SECT = [0x90, 0x05]
16
+ CPACKET_DATA = [0x91, 0x05]
17
+ CPACKET_END = [0x92, 0x05]
18
+
19
+ CPACKET_SECT_WELCOME = [
20
+ 0x44, 0x53, 0x49, 0x20, 0x54, 0x6f, 0x79, 0x73, 0x20, 0x70, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x74, 0x73, 0x2e,
21
+ 0x2e, 0x2e, 0x65, 0x42, 0x72, 0x61, 0x69, 0x6e, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00
22
+ ]
23
+
24
+ CPACKET_DATA_LENGTH = 32
25
+
26
+ attr_accessor :activities, :games, :calendar, :phone_numbers, :speech
27
+
28
+ # Create an Eeprom instance.
29
+ #
30
+ # @param activities [Array<Activity>, nil] Activities to be added to EEPROM data.
31
+ # @param games [Games, nil] Games to be added to EEPROM data.
32
+ # @param calendar [Array<Calendar>, nil] Calendar to be added to EEPROM data.
33
+ # @param phone_numbers [Array<PhoneNumber>, nil] Phone numbers to be added to EEPROM data.
34
+ # @param speech [Speech, nil] Speech to be added to EEPROM data.
35
+ # @return [Eeprom] Eeprom instance.
36
+ def initialize(activities: nil, games: nil, calendar: nil, phone_numbers: nil, speech: nil)
37
+ @activities = activities
38
+ @games = games
39
+ @calendar = calendar
40
+ @phone_numbers = phone_numbers
41
+ @speech = speech
42
+ end
43
+
44
+ # Compile packets for EEPROM data.
45
+ #
46
+ # @return [Array<Array<Integer>>] Two-dimensional array of integers that represent bytes.
47
+ def packets
48
+ [header] + payloads + [CPACKET_END]
49
+ end
50
+
51
+ private
52
+
53
+ def header
54
+ [
55
+ CPACKET_SECT,
56
+ payloads.length,
57
+ CPACKET_SECT_WELCOME
58
+ ].flatten
59
+ end
60
+
61
+ def payloads
62
+ paginate_cpackets(header: CPACKET_DATA, length: CPACKET_DATA_LENGTH, cpackets: all_packets)
63
+ end
64
+
65
+ def all_packets
66
+ [].tap do |packets|
67
+ packets.concat(Activity.packets(activities)) if activities
68
+ packets.concat(games.packet) if games
69
+ packets.concat(calendar.packet) if calendar
70
+ packets.concat(PhoneNumber.packets(phone_numbers)) if phone_numbers
71
+ packets.concat(speech.packet) if speech
72
+ end
73
+ end
74
+ end
75
+ end
76
+ end
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "timex_datalink_client/helpers/crc_packets_wrapper"
4
+
5
+ class TimexDatalinkClient
6
+ class Protocol7
7
+ class End
8
+ prepend Helpers::CrcPacketsWrapper
9
+
10
+ CPACKET_SKIP = [0x21]
11
+
12
+ # Compile packets for data end command.
13
+ #
14
+ # @return [Array<Array<Integer>>] Two-dimensional array of integers that represent bytes.
15
+ def packets
16
+ [CPACKET_SKIP]
17
+ end
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,70 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "mdb"
4
+
5
+ class TimexDatalinkClient
6
+ class Protocol7
7
+ class PhraseBuilder
8
+ class WordNotFound < StandardError; end
9
+
10
+ attr_accessor :database
11
+
12
+ # Create a PhraseBuilder instance.
13
+ #
14
+ # @param database [String] Database file to compile phrase data from.
15
+ # @return [PhraseBuilder] PhraseBuilder instance.
16
+ def initialize(database:)
17
+ @database = database
18
+ end
19
+
20
+ # Compile vocabulary IDs for protocol 7 phrases.
21
+ #
22
+ # @param words [Array<String>] Array of words.
23
+ # @raise [WordNotFound] Word not found in protocol 7 database.
24
+ # @return [Array<Integer>] Array of protocol 7 vocabulary IDs.
25
+ def vocab_ids_for(*words)
26
+ words.flat_map do |word|
27
+ vocab = vocab_for_word(word)
28
+
29
+ raise(WordNotFound, "#{word} is not a valid word!") unless vocab
30
+
31
+ vocab_links = vocab_links_for_vocab(vocab)
32
+
33
+ vocab_links.map do |vocab_link|
34
+ linked_vocab = vocab_for_vocab_link(vocab_link)
35
+
36
+ linked_vocab[:"PC Index"].to_i
37
+ end
38
+ end
39
+ end
40
+
41
+ private
42
+
43
+ def mdb
44
+ @mdb ||= Mdb.open(database)
45
+ end
46
+
47
+ def vocab_table
48
+ @vocab_table ||= mdb["Vocab"]
49
+ end
50
+
51
+ def vocab_links_table
52
+ @vocab_links_table ||= mdb["Vocab Links"]
53
+ end
54
+
55
+ def vocab_for_word(word)
56
+ vocab_table.detect { |vocab| vocab[:Label].casecmp?(word) }
57
+ end
58
+
59
+ def vocab_links_for_vocab(vocab)
60
+ links = vocab_links_table.select { |vocab_link| vocab_link[:"PC Index"] == vocab[:"PC Index"] }
61
+
62
+ links.sort_by { |link| link[:Sequence].to_i }
63
+ end
64
+
65
+ def vocab_for_vocab_link(vocab_link)
66
+ vocab_table.detect { |vocab| vocab[:"PC Index"] == vocab_link[:"eBrain Index"] }
67
+ end
68
+ end
69
+ end
70
+ end
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "timex_datalink_client/helpers/crc_packets_wrapper"
4
+
5
+ class TimexDatalinkClient
6
+ class Protocol7
7
+ class Start
8
+ prepend Helpers::CrcPacketsWrapper
9
+
10
+ CPACKET_START = [0x20, 0x00, 0x00, 0x07]
11
+
12
+ # Compile packets for data start command.
13
+ #
14
+ # @return [Array<Array<Integer>>] Two-dimensional array of integers that represent bytes.
15
+ def packets
16
+ [CPACKET_START]
17
+ end
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,40 @@
1
+ # frozen_string_literal: true
2
+
3
+ class TimexDatalinkClient
4
+ class Protocol7
5
+ class Sync
6
+ PING_BYTE = [0x78]
7
+ SYNC_1_BYTE = [0x55]
8
+ SYNC_2_BYTE = [0xaa]
9
+
10
+ SYNC_2_LENGTH = 5
11
+
12
+ attr_accessor :length
13
+
14
+ # Create a Sync instance.
15
+ #
16
+ # @param length [Integer] Number of 0x55 sync bytes to use.
17
+ # @return [Sync] Sync instance.
18
+ def initialize(length: 300)
19
+ @length = length
20
+ end
21
+
22
+ # Compile packets for syncronization data.
23
+ #
24
+ # @return [Array<Array<Integer>>] Two-dimensional array of integers that represent bytes.
25
+ def packets
26
+ [PING_BYTE + render_sync_1 + render_sync_2]
27
+ end
28
+
29
+ private
30
+
31
+ def render_sync_1
32
+ SYNC_1_BYTE * length
33
+ end
34
+
35
+ def render_sync_2
36
+ SYNC_2_BYTE * SYNC_2_LENGTH
37
+ end
38
+ end
39
+ end
40
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class TimexDatalinkClient
4
- VERSION = "0.6.0"
4
+ VERSION = "0.8.0"
5
5
  end
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "timex_datalink_client/version"
4
3
  require "timex_datalink_client/notebook_adapter"
4
+ require "timex_datalink_client/version"
5
5
 
6
6
  require "timex_datalink_client/protocol_1/alarm"
7
7
  require "timex_datalink_client/protocol_1/eeprom"
@@ -29,6 +29,32 @@ require "timex_datalink_client/protocol_3/sync"
29
29
  require "timex_datalink_client/protocol_3/time"
30
30
  require "timex_datalink_client/protocol_3/wrist_app"
31
31
 
32
+ require "timex_datalink_client/protocol_4/alarm"
33
+ require "timex_datalink_client/protocol_4/eeprom"
34
+ require "timex_datalink_client/protocol_4/eeprom/anniversary"
35
+ require "timex_datalink_client/protocol_4/eeprom/appointment"
36
+ require "timex_datalink_client/protocol_4/eeprom/list"
37
+ require "timex_datalink_client/protocol_4/eeprom/phone_number"
38
+ require "timex_datalink_client/protocol_4/end"
39
+ require "timex_datalink_client/protocol_4/sound_options"
40
+ require "timex_datalink_client/protocol_4/sound_theme"
41
+ require "timex_datalink_client/protocol_4/start"
42
+ require "timex_datalink_client/protocol_4/sync"
43
+ require "timex_datalink_client/protocol_4/time"
44
+ require "timex_datalink_client/protocol_4/wrist_app"
45
+
46
+ require "timex_datalink_client/protocol_7/eeprom"
47
+ require "timex_datalink_client/protocol_7/eeprom/activity"
48
+ require "timex_datalink_client/protocol_7/eeprom/calendar"
49
+ require "timex_datalink_client/protocol_7/eeprom/calendar/event"
50
+ require "timex_datalink_client/protocol_7/eeprom/games"
51
+ require "timex_datalink_client/protocol_7/eeprom/phone_number"
52
+ require "timex_datalink_client/protocol_7/eeprom/speech"
53
+ require "timex_datalink_client/protocol_7/end"
54
+ require "timex_datalink_client/protocol_7/phrase_builder"
55
+ require "timex_datalink_client/protocol_7/start"
56
+ require "timex_datalink_client/protocol_7/sync"
57
+
32
58
  require "timex_datalink_client/protocol_9/alarm"
33
59
  require "timex_datalink_client/protocol_9/eeprom"
34
60
  require "timex_datalink_client/protocol_9/eeprom/chrono"
@@ -46,17 +72,20 @@ class TimexDatalinkClient
46
72
 
47
73
  # Create a TimexDatalinkClient instance.
48
74
  #
49
- # @param serial_device [String] Path to serial device.
75
+ # @param serial_device [String, nil] Path to serial device.
50
76
  # @param models [Array<Protocol1::Sync, Protocol1::Start, Protocol1::Time, Protocol1::TimeName, Protocol1::Alarm,
51
77
  # Protocol1::Eeprom, Protocol1::End, Protocol3::Sync, Protocol3::Start, Protocol3::Time, Protocol3::Alarm,
52
78
  # Protocol3::Eeprom, Protocol3::SoundTheme, Protocol3::SoundOptions, Protocol3::WristApp, Protocol3::End,
53
- # Protocol9::Sync, Protocol9::Start, Protocol9::Time, Protocol9::TimeName, Protocol9::Timer, Protocol9::Alarm,
54
- # Protocol9::Eeprom, Protocol9::SoundOptions, Protocol9::End>] Models to compile data for.
79
+ # Protocol4::Sync, Protocol4::Start, Protocol4::Time, Protocol4::Alarm, Protocol4::Eeprom, Protocol4::SoundTheme,
80
+ # Protocol4::SoundOptions, Protocol4::WristApp, Protocol4::End, Protocol7::Sync, Protocol7::Start,
81
+ # Protocol7::Eeprom, Protocol7::End, Protocol9::Sync, Protocol9::Start, Protocol9::Time, Protocol9::TimeName,
82
+ # Protocol9::Timer, Protocol9::Alarm, Protocol9::Eeprom, Protocol9::SoundOptions, Protocol9::End>] Models to compile
83
+ # data for.
55
84
  # @param byte_sleep [Integer, nil] Time to sleep after sending byte.
56
85
  # @param packet_sleep [Integer, nil] Time to sleep after sending packet of bytes.
57
86
  # @param verbose [Boolean] Write verbose output to console.
58
87
  # @return [TimexDatalinkClient] TimexDatalinkClient instance.
59
- def initialize(serial_device:, models: [], byte_sleep: nil, packet_sleep: nil, verbose: false)
88
+ def initialize(serial_device: nil, models: [], byte_sleep: nil, packet_sleep: nil, verbose: false)
60
89
  @serial_device = serial_device
61
90
  @models = models
62
91
  @byte_sleep = byte_sleep
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: timex_datalink_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Maxwell Pray
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-09-15 00:00:00.000000000 Z
11
+ date: 2022-12-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: crc
@@ -38,6 +38,20 @@ dependencies:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: 0.6.0
41
+ - !ruby/object:Gem::Dependency
42
+ name: mdb
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: 0.5.0
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: 0.5.0
41
55
  - !ruby/object:Gem::Dependency
42
56
  name: rspec
43
57
  requirement: !ruby/object:Gem::Requirement
@@ -90,6 +104,7 @@ files:
90
104
  - lib/timex_datalink_client/helpers/char_encoders.rb
91
105
  - lib/timex_datalink_client/helpers/cpacket_paginator.rb
92
106
  - lib/timex_datalink_client/helpers/crc_packets_wrapper.rb
107
+ - lib/timex_datalink_client/helpers/four_byte_formatter.rb
93
108
  - lib/timex_datalink_client/helpers/length_packet_wrapper.rb
94
109
  - lib/timex_datalink_client/notebook_adapter.rb
95
110
  - lib/timex_datalink_client/protocol_1/alarm.rb
@@ -116,6 +131,30 @@ files:
116
131
  - lib/timex_datalink_client/protocol_3/sync.rb
117
132
  - lib/timex_datalink_client/protocol_3/time.rb
118
133
  - lib/timex_datalink_client/protocol_3/wrist_app.rb
134
+ - lib/timex_datalink_client/protocol_4/alarm.rb
135
+ - lib/timex_datalink_client/protocol_4/eeprom.rb
136
+ - lib/timex_datalink_client/protocol_4/eeprom/anniversary.rb
137
+ - lib/timex_datalink_client/protocol_4/eeprom/appointment.rb
138
+ - lib/timex_datalink_client/protocol_4/eeprom/list.rb
139
+ - lib/timex_datalink_client/protocol_4/eeprom/phone_number.rb
140
+ - lib/timex_datalink_client/protocol_4/end.rb
141
+ - lib/timex_datalink_client/protocol_4/sound_options.rb
142
+ - lib/timex_datalink_client/protocol_4/sound_theme.rb
143
+ - lib/timex_datalink_client/protocol_4/start.rb
144
+ - lib/timex_datalink_client/protocol_4/sync.rb
145
+ - lib/timex_datalink_client/protocol_4/time.rb
146
+ - lib/timex_datalink_client/protocol_4/wrist_app.rb
147
+ - lib/timex_datalink_client/protocol_7/eeprom.rb
148
+ - lib/timex_datalink_client/protocol_7/eeprom/activity.rb
149
+ - lib/timex_datalink_client/protocol_7/eeprom/calendar.rb
150
+ - lib/timex_datalink_client/protocol_7/eeprom/calendar/event.rb
151
+ - lib/timex_datalink_client/protocol_7/eeprom/games.rb
152
+ - lib/timex_datalink_client/protocol_7/eeprom/phone_number.rb
153
+ - lib/timex_datalink_client/protocol_7/eeprom/speech.rb
154
+ - lib/timex_datalink_client/protocol_7/end.rb
155
+ - lib/timex_datalink_client/protocol_7/phrase_builder.rb
156
+ - lib/timex_datalink_client/protocol_7/start.rb
157
+ - lib/timex_datalink_client/protocol_7/sync.rb
119
158
  - lib/timex_datalink_client/protocol_9/alarm.rb
120
159
  - lib/timex_datalink_client/protocol_9/eeprom.rb
121
160
  - lib/timex_datalink_client/protocol_9/eeprom/chrono.rb
@@ -128,7 +167,7 @@ files:
128
167
  - lib/timex_datalink_client/protocol_9/time_name.rb
129
168
  - lib/timex_datalink_client/protocol_9/timer.rb
130
169
  - lib/timex_datalink_client/version.rb
131
- homepage: https://github.com/synthead/timex_datalink_client/tree/v0.6.0
170
+ homepage: https://github.com/synthead/timex_datalink_client/tree/v0.8.0
132
171
  licenses:
133
172
  - MIT
134
173
  metadata: {}