ant-wireless 0.1.0.pre.20210617213631 → 0.1.0.pre.20210715102740
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ant.rb +4 -8
- data/lib/ant/channel.rb +1 -0
- data/lib/ant/channel/event_callbacks.rb +15 -15
- data/lib/ant/response_callbacks.rb +4 -4
- data/lib/ant/wireless.rb +2 -0
- metadata +3 -28
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 60051597c316ed311fb5c3203f5903e62f46e107c2094ae379db5dbf07c8232e
|
4
|
+
data.tar.gz: 41a4cc508416234557867b3fd0ac8c27c5d856cea90c7531fb99f29106028ec8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 22d0cf3c237e478f41ed217a67ce07a13e1dea8584142bee797fa7085cbf5e24445758cba5b2d29f7ca2ea50f973e20bb231e6579c50647bf286bb94e935f144
|
7
|
+
data.tar.gz: 3ce7d04e91583044385715746750f9bfd83dcbd06831a0e38f8c123f57e05fd778c6eaf13e5f9a6d770e85156c8406f7c195eab637a620dc6b5fa99f66ff829f
|
data/lib/ant.rb
CHANGED
@@ -14,9 +14,6 @@ module Ant
|
|
14
14
|
# Package version
|
15
15
|
VERSION = '0.0.1'
|
16
16
|
|
17
|
-
# Version control revision
|
18
|
-
REVISION = %q$Revision$
|
19
|
-
|
20
17
|
|
21
18
|
# A Range for matching valid ANT device numbers
|
22
19
|
VALID_DEVICE_NUMBERS = ( 0...65535 ).freeze
|
@@ -42,11 +39,10 @@ module Ant
|
|
42
39
|
autoload :DataUtilities, 'ant/mixins'
|
43
40
|
|
44
41
|
|
45
|
-
### Set up the given +
|
46
|
-
###
|
47
|
-
def self::
|
48
|
-
self.
|
49
|
-
self.on_response( &self.method(:handle_response_callback) )
|
42
|
+
### Set up the given +object+ as the handler for response callbacks. It must
|
43
|
+
### respond to :handle_response_callback.
|
44
|
+
def self::set_response_handler( object=Ant::ResponseCallbacks )
|
45
|
+
self.on_response( &object.method(:handle_response_callback) )
|
50
46
|
end
|
51
47
|
|
52
48
|
|
data/lib/ant/channel.rb
CHANGED
@@ -17,10 +17,6 @@ module Ant::Channel::EventCallbacks
|
|
17
17
|
include Ant::DataUtilities
|
18
18
|
|
19
19
|
|
20
|
-
# Loggability API -- send logs to the Ant logger
|
21
|
-
log_to :ant
|
22
|
-
|
23
|
-
|
24
20
|
# Mapping of response message IDs to handler methods
|
25
21
|
HANDLER_METHODS = {
|
26
22
|
Ant::EVENT_CHANNEL_CLOSED => :on_event_channel_closed,
|
@@ -51,17 +47,8 @@ module Ant::Channel::EventCallbacks
|
|
51
47
|
SEQUENCE_NUMBER_MASK = 0xE0
|
52
48
|
|
53
49
|
|
54
|
-
|
55
|
-
|
56
|
-
handler_method = HANDLER_METHODS[ event_id ] or
|
57
|
-
raise "Unhandled channel event %p" % [ event_id ]
|
58
|
-
|
59
|
-
if self.respond_to?( handler_method )
|
60
|
-
self.public_send( handler_method, channel_num, data )
|
61
|
-
else
|
62
|
-
Ant::Channel::EventCallbacks.log_event_callback( channel_num, handler_method, event_id, data )
|
63
|
-
end
|
64
|
-
end
|
50
|
+
# Loggability API -- send logs to the Ant logger
|
51
|
+
log_to :ant
|
65
52
|
|
66
53
|
|
67
54
|
### Log the channel event by default.
|
@@ -75,6 +62,19 @@ module Ant::Channel::EventCallbacks
|
|
75
62
|
end
|
76
63
|
|
77
64
|
|
65
|
+
### Default callback hook -- handles event callbacks.
|
66
|
+
def handle_event_callback( channel_num, event_id, data )
|
67
|
+
handler_method = HANDLER_METHODS[ event_id ] or
|
68
|
+
raise "Unhandled channel event %p" % [ event_id ]
|
69
|
+
|
70
|
+
if self.respond_to?( handler_method )
|
71
|
+
self.public_send( handler_method, channel_num, data )
|
72
|
+
else
|
73
|
+
Ant::Channel::EventCallbacks.log_event_callback( channel_num, handler_method, event_id, data )
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|
77
|
+
|
78
78
|
### Handle an TX event.
|
79
79
|
def on_event_tx( channel_num, data )
|
80
80
|
# self.log.info "Broadcast message on channel %d was transmitted." % [ channel_num ]
|
@@ -95,7 +95,7 @@ module Ant::ResponseCallbacks
|
|
95
95
|
|
96
96
|
|
97
97
|
### Default callback hook -- handles response callbacks.
|
98
|
-
def handle_response_callback( channel_num, message_id, data )
|
98
|
+
def self::handle_response_callback( channel_num, message_id, data )
|
99
99
|
handler_method = HANDLER_METHODS[ message_id ] or
|
100
100
|
raise "Unhandled response message ID %p" % [ message_id ]
|
101
101
|
|
@@ -118,9 +118,9 @@ module Ant::ResponseCallbacks
|
|
118
118
|
end
|
119
119
|
|
120
120
|
|
121
|
-
|
122
|
-
|
123
|
-
|
121
|
+
###############
|
122
|
+
module_function
|
123
|
+
###############
|
124
124
|
|
125
125
|
### Handle version number response messages.
|
126
126
|
def on_version( channel_num, data )
|
data/lib/ant/wireless.rb
CHANGED
metadata
CHANGED
@@ -1,40 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ant-wireless
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.0.pre.
|
4
|
+
version: 0.1.0.pre.20210715102740
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Granger
|
8
8
|
- Mahlon E. Smith
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
|
-
cert_chain:
|
12
|
-
-
|
13
|
-
-----BEGIN CERTIFICATE-----
|
14
|
-
MIID+DCCAmCgAwIBAgIBAzANBgkqhkiG9w0BAQsFADAiMSAwHgYDVQQDDBdnZWQv
|
15
|
-
REM9RmFlcmllTVVEL0RDPW9yZzAeFw0yMDEyMjQyMDU1MjlaFw0yMTEyMjQyMDU1
|
16
|
-
MjlaMCIxIDAeBgNVBAMMF2dlZC9EQz1GYWVyaWVNVUQvREM9b3JnMIIBojANBgkq
|
17
|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0ikZ73xns4Hdo
|
32
|
-
XxdLdd92F5ovxA23j/rKe/IDwqr6FpDkU3nPXH/Qp0TVGv9zZnVJc/Z6ChkuWj8z
|
33
|
-
pW7JAyyiiHZgKKDReDrA2LA7Zs3o/7KA6UtUH0FHf8LYhcK+pfHk6RtjRe65ffw+
|
34
|
-
MCh97sQ/Z/MOusb5+QddBmB+k8EicXyGNl4b5L4XpL7fIQu+Y96TB3JEJlShxFD9
|
35
|
-
k9FjI4d9EP54gS/4
|
36
|
-
-----END CERTIFICATE-----
|
37
|
-
date: 2021-06-17 00:00:00.000000000 Z
|
11
|
+
cert_chain: []
|
12
|
+
date: 2021-07-15 00:00:00.000000000 Z
|
38
13
|
dependencies:
|
39
14
|
- !ruby/object:Gem::Dependency
|
40
15
|
name: rake-compiler
|