timex_datalink_client 0.4.0 → 0.4.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
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: '082ddc8969ac82b8858b2f68fd9c8f34b7f53b46eccc407200615eba75b00821'
|
|
4
|
+
data.tar.gz: 99ae5a09d43fe26bf849808be2bceb18350d1c97e8fce962ee2a367a07a12677
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 13adc215949a1c2af60c9d65da0e5ad8b780e27bf4f1009cc29ff85f7ffab3f9b912ae7f8cab1b785c14de28ece73036335eff2f7f85b78da9e2ca0e16e63eaa
|
|
7
|
+
data.tar.gz: 43a8a73d8e9194295e83f7794e4b0c86d90b0b04b236b1f8b6779a267d33a6cc3af2de9b45efbab5112fa1dd26a4858a7a3c6755f49c6636e90782d5a49e6ce8
|
|
@@ -4,22 +4,23 @@ class TimexDatalinkClient
|
|
|
4
4
|
class Helpers
|
|
5
5
|
module CharEncoders
|
|
6
6
|
CHARS = "0123456789abcdefghijklmnopqrstuvwxyz !\"#$%&'()*+,-./:\\;=@?_|<>[]"
|
|
7
|
+
EEPROM_CHARS = "0123456789abcdefghijklmnopqrstuvwxyz !\"#$%&'()*+,-./:\\;=@?_|<>["
|
|
8
|
+
PHONE_CHARS = "0123456789cfhpw "
|
|
9
|
+
INVALID_CHAR = " "
|
|
7
10
|
|
|
8
11
|
EEPROM_TERMINATOR = 0x3f
|
|
9
12
|
|
|
10
|
-
PHONE_CHARS = "0123456789cfhpw "
|
|
11
|
-
|
|
12
13
|
def chars_for(string_chars, char_map: CHARS, length: nil, pad: false)
|
|
13
14
|
formatted_chars = string_chars.downcase[0..length.to_i - 1]
|
|
14
15
|
formatted_chars = formatted_chars.ljust(length) if pad
|
|
15
16
|
|
|
16
17
|
formatted_chars.each_char.map do |char|
|
|
17
|
-
char_map.index(char)
|
|
18
|
+
char_map.index(char) || char_map.index(INVALID_CHAR)
|
|
18
19
|
end
|
|
19
20
|
end
|
|
20
21
|
|
|
21
22
|
def eeprom_chars_for(string_chars)
|
|
22
|
-
chars = chars_for(string_chars, length: 31).append(EEPROM_TERMINATOR)
|
|
23
|
+
chars = chars_for(string_chars, char_map: EEPROM_CHARS, length: 31).append(EEPROM_TERMINATOR)
|
|
23
24
|
|
|
24
25
|
packed_int = chars.each_with_index.sum do |char, index|
|
|
25
26
|
char << (6 * index)
|
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.4.
|
|
4
|
+
version: 0.4.1
|
|
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-
|
|
11
|
+
date: 2022-09-11 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: crc
|
|
@@ -80,7 +80,7 @@ dependencies:
|
|
|
80
80
|
- - "~>"
|
|
81
81
|
- !ruby/object:Gem::Version
|
|
82
82
|
version: 0.0.9
|
|
83
|
-
description:
|
|
83
|
+
description:
|
|
84
84
|
email: synthead@gmail.com
|
|
85
85
|
executables: []
|
|
86
86
|
extensions: []
|
|
@@ -106,7 +106,7 @@ files:
|
|
|
106
106
|
- lib/timex_datalink_client/time.rb
|
|
107
107
|
- lib/timex_datalink_client/version.rb
|
|
108
108
|
- lib/timex_datalink_client/wrist_app.rb
|
|
109
|
-
homepage: https://github.com/synthead/timex_datalink_client
|
|
109
|
+
homepage: https://github.com/synthead/timex_datalink_client/tree/v0.4.1
|
|
110
110
|
licenses:
|
|
111
111
|
- MIT
|
|
112
112
|
metadata: {}
|
|
@@ -128,5 +128,5 @@ requirements: []
|
|
|
128
128
|
rubygems_version: 3.3.7
|
|
129
129
|
signing_key:
|
|
130
130
|
specification_version: 4
|
|
131
|
-
summary:
|
|
131
|
+
summary: Write data to Timex Datalink devices with an optical sensor
|
|
132
132
|
test_files: []
|