trigger_switch_d 0.1.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.
- data/COPYING.txt +674 -0
- data/LICENSE.txt +54 -0
- data/README.rdoc +106 -0
- data/bin/teach +44 -0
- data/bin/tsd +68 -0
- data/bin/turn_off +42 -0
- data/bin/turn_on +39 -0
- data/doc/classes/Tellstick/Tellstick.html +117 -0
- data/doc/classes/Tellstick/TellstickIO.html +265 -0
- data/doc/classes/Tellstick/TellstickIO.src/M000020.html +18 -0
- data/doc/classes/Tellstick/TellstickIO.src/M000021.html +20 -0
- data/doc/classes/Tellstick/TellstickIO.src/M000022.html +26 -0
- data/doc/classes/Tellstick/TellstickIO.src/M000023.html +19 -0
- data/doc/classes/Tellstick/TellstickIO.src/M000024.html +26 -0
- data/doc/classes/Tellstick/TellstickIO.src/M000025.html +16 -0
- data/doc/classes/Tellstick/TellstickIO.src/M000026.html +16 -0
- data/doc/classes/Tellstick/TellstickIO.src/M000027.html +24 -0
- data/doc/classes/Tellstick.html +204 -0
- data/doc/classes/Tellstick.src/M000019.html +25 -0
- data/doc/classes/TriggerSwitchD/Action.html +165 -0
- data/doc/classes/TriggerSwitchD/Action.src/M000015.html +28 -0
- data/doc/classes/TriggerSwitchD/Action.src/M000016.html +18 -0
- data/doc/classes/TriggerSwitchD/Application.html +203 -0
- data/doc/classes/TriggerSwitchD/Application.src/M000017.html +21 -0
- data/doc/classes/TriggerSwitchD/Application.src/M000018.html +40 -0
- data/doc/classes/TriggerSwitchD/ConfigFactory/Config.html +127 -0
- data/doc/classes/TriggerSwitchD/ConfigFactory/Config.src/M000014.html +23 -0
- data/doc/classes/TriggerSwitchD/ConfigFactory.html +141 -0
- data/doc/classes/TriggerSwitchD/ConfigFactory.src/M000013.html +24 -0
- data/doc/classes/TriggerSwitchD/IPC.html +134 -0
- data/doc/classes/TriggerSwitchD/IPC.src/M000012.html +32 -0
- data/doc/classes/TriggerSwitchD/Schedule/InstanceMethods.html +242 -0
- data/doc/classes/TriggerSwitchD/Schedule/InstanceMethods.src/M000005.html +19 -0
- data/doc/classes/TriggerSwitchD/Schedule/InstanceMethods.src/M000006.html +18 -0
- data/doc/classes/TriggerSwitchD/Schedule/InstanceMethods.src/M000007.html +23 -0
- data/doc/classes/TriggerSwitchD/Schedule/InstanceMethods.src/M000008.html +19 -0
- data/doc/classes/TriggerSwitchD/Schedule/InstanceMethods.src/M000009.html +19 -0
- data/doc/classes/TriggerSwitchD/Schedule/InstanceMethods.src/M000010.html +18 -0
- data/doc/classes/TriggerSwitchD/Schedule/InstanceMethods.src/M000011.html +18 -0
- data/doc/classes/TriggerSwitchD/Schedule.html +147 -0
- data/doc/classes/TriggerSwitchD/Schedule.src/M000004.html +19 -0
- data/doc/classes/TriggerSwitchD/SwitchFactory.html +135 -0
- data/doc/classes/TriggerSwitchD/SwitchFactory.src/M000003.html +20 -0
- data/doc/classes/TriggerSwitchD.html +212 -0
- data/doc/classes/TriggerSwitchD.src/M000001.html +22 -0
- data/doc/classes/TriggerSwitchD.src/M000002.html +27 -0
- data/doc/created.rid +1 -0
- data/doc/files/lib/tellstick/protocol/nexa_rb.html +126 -0
- data/doc/files/lib/tellstick/protocol/not_connected_rb.html +126 -0
- data/doc/files/lib/tellstick/protocol/null_protocol_rb.html +126 -0
- data/doc/files/lib/tellstick/protocol/plain_text_rb.html +126 -0
- data/doc/files/lib/tellstick/protocol/proove_rb.html +126 -0
- data/doc/files/lib/tellstick/protocol/protocol_loader_rb.html +126 -0
- data/doc/files/lib/tellstick/protocol/rising_sun_rb.html +126 -0
- data/doc/files/lib/tellstick/protocol/waveman_rb.html +126 -0
- data/doc/files/lib/tellstick/tellstick_io_rb.html +135 -0
- data/doc/files/lib/tellstick/tellstick_rb.html +135 -0
- data/doc/files/lib/tellstick_rb.html +134 -0
- data/doc/files/lib/trigger_switch_d/action_rb.html +126 -0
- data/doc/files/lib/trigger_switch_d/application_rb.html +136 -0
- data/doc/files/lib/trigger_switch_d/config_rb.html +126 -0
- data/doc/files/lib/trigger_switch_d/daylight_rb.html +126 -0
- data/doc/files/lib/trigger_switch_d/ipc_rb.html +126 -0
- data/doc/files/lib/trigger_switch_d/schedule_rb.html +126 -0
- data/doc/files/lib/trigger_switch_d/switch_rb.html +126 -0
- data/doc/files/lib/trigger_switch_d/trigger_switch_d_helper_rb.html +126 -0
- data/doc/files/lib/trigger_switch_d_rb.html +140 -0
- data/doc/fr_class_index.html +38 -0
- data/doc/fr_file_index.html +46 -0
- data/doc/fr_method_index.html +53 -0
- data/doc/index.html +24 -0
- data/features/execute_schedule.feature +20 -0
- data/features/group_aliases.feature +31 -0
- data/features/handle_switches.feature +36 -0
- data/features/listen_for_client_call.feature +23 -0
- data/features/persistent_schedule.feature +70 -0
- data/features/proove_protocol.feature +20 -0
- data/features/schedule.feature +25 -0
- data/features/simple_string_protocol.feature +35 -0
- data/features/step_definitions/execute_schedule_steps.rb +16 -0
- data/features/step_definitions/group_aliases_steps.rb +24 -0
- data/features/step_definitions/handle_switches_steps.rb +21 -0
- data/features/step_definitions/listen_for_client_call_steps.rb +34 -0
- data/features/step_definitions/persistent_schedule_steps.rb +18 -0
- data/features/step_definitions/proove_protocol_steps.rb +3 -0
- data/features/step_definitions/schedule_steps.rb +9 -0
- data/features/step_definitions/shared_steps.rb +75 -0
- data/features/step_definitions/simple_string_protocol_steps.rb +3 -0
- data/features/step_definitions/sunrise_steps.rb +22 -0
- data/features/step_definitions/tellstick_connected_steps.rb +21 -0
- data/features/sunrise.feature +22 -0
- data/features/sunset.feature +22 -0
- data/features/support/action_helpers.rb +10 -0
- data/features/support/env.rb +7 -0
- data/features/support/listen_for_client_call_helper.rb +71 -0
- data/features/support/proove_helpers.rb +6 -0
- data/features/support/sunrise_helper.rb +8 -0
- data/features/tellstick_connected.feature +14 -0
- data/lib/tellstick/protocol/nexa.rb +48 -0
- data/lib/tellstick/protocol/not_connected.rb +42 -0
- data/lib/tellstick/protocol/null_protocol.rb +41 -0
- data/lib/tellstick/protocol/plain_text.rb +35 -0
- data/lib/tellstick/protocol/proove.rb +83 -0
- data/lib/tellstick/protocol/protocol_loader.rb +26 -0
- data/lib/tellstick/protocol/rising_sun.rb +42 -0
- data/lib/tellstick/protocol/waveman.rb +29 -0
- data/lib/tellstick/tellstick.rb +73 -0
- data/lib/tellstick/tellstick_io.rb +80 -0
- data/lib/tellstick.rb +20 -0
- data/lib/trigger_switch_d/action.rb +83 -0
- data/lib/trigger_switch_d/application.rb +89 -0
- data/lib/trigger_switch_d/config.rb +83 -0
- data/lib/trigger_switch_d/daylight.rb +114 -0
- data/lib/trigger_switch_d/ipc.rb +39 -0
- data/lib/trigger_switch_d/schedule.rb +95 -0
- data/lib/trigger_switch_d/switch.rb +37 -0
- data/lib/trigger_switch_d/trigger_switch_d_helper.rb +44 -0
- data/lib/trigger_switch_d.rb +26 -0
- data/spec/spec_helper.rb +22 -0
- data/spec/tellstick/protocol/nexa_spec.rb +57 -0
- data/spec/tellstick/protocol/proove_spec.rb +61 -0
- data/spec/tellstick/protocol/rising_sun_spec.rb +56 -0
- data/spec/tellstick/protocol/waveman_spec.rb +57 -0
- data/spec/tellstick/tellstick_io_spec.rb +31 -0
- data/spec/tellstick/tellstick_spec.rb +86 -0
- data/spec/trigger_switch_d/application_spec.rb +144 -0
- data/spec/trigger_switch_d/config_spec.rb +94 -0
- data/spec/trigger_switch_d/daylight_spec.rb +39 -0
- data/spec/trigger_switch_d/ipc_spec.rb +119 -0
- data/spec/trigger_switch_d/schedule_spec.rb +103 -0
- data/spec/trigger_switch_d/trigger_switch_d_spec_helpers.rb +24 -0
- data/trigger_switch_d.gemspec +43 -0
- metadata +206 -0
@@ -0,0 +1,265 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
7
|
+
<head>
|
8
|
+
<title>Class: Tellstick::TellstickIO</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
10
|
+
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
11
|
+
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
12
|
+
<script type="text/javascript">
|
13
|
+
// <![CDATA[
|
14
|
+
|
15
|
+
function popupCode( url ) {
|
16
|
+
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
17
|
+
}
|
18
|
+
|
19
|
+
function toggleCode( id ) {
|
20
|
+
if ( document.getElementById )
|
21
|
+
elem = document.getElementById( id );
|
22
|
+
else if ( document.all )
|
23
|
+
elem = eval( "document.all." + id );
|
24
|
+
else
|
25
|
+
return false;
|
26
|
+
|
27
|
+
elemStyle = elem.style;
|
28
|
+
|
29
|
+
if ( elemStyle.display != "block" ) {
|
30
|
+
elemStyle.display = "block"
|
31
|
+
} else {
|
32
|
+
elemStyle.display = "none"
|
33
|
+
}
|
34
|
+
|
35
|
+
return true;
|
36
|
+
}
|
37
|
+
|
38
|
+
// Make codeblocks hidden by default
|
39
|
+
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
40
|
+
|
41
|
+
// ]]>
|
42
|
+
</script>
|
43
|
+
|
44
|
+
</head>
|
45
|
+
<body>
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
<div id="classHeader">
|
50
|
+
<table class="header-table">
|
51
|
+
<tr class="top-aligned-row">
|
52
|
+
<td><strong>Class</strong></td>
|
53
|
+
<td class="class-name-in-header">Tellstick::TellstickIO</td>
|
54
|
+
</tr>
|
55
|
+
<tr class="top-aligned-row">
|
56
|
+
<td><strong>In:</strong></td>
|
57
|
+
<td>
|
58
|
+
<a href="../../files/lib/tellstick/tellstick_io_rb.html">
|
59
|
+
lib/tellstick/tellstick_io.rb
|
60
|
+
</a>
|
61
|
+
<br />
|
62
|
+
</td>
|
63
|
+
</tr>
|
64
|
+
|
65
|
+
<tr class="top-aligned-row">
|
66
|
+
<td><strong>Parent:</strong></td>
|
67
|
+
<td>
|
68
|
+
Object
|
69
|
+
</td>
|
70
|
+
</tr>
|
71
|
+
</table>
|
72
|
+
</div>
|
73
|
+
<!-- banner header -->
|
74
|
+
|
75
|
+
<div id="bodyContent">
|
76
|
+
|
77
|
+
|
78
|
+
|
79
|
+
<div id="contextContent">
|
80
|
+
|
81
|
+
<div id="description">
|
82
|
+
<p>
|
83
|
+
IO stream associated with the tellstick
|
84
|
+
</p>
|
85
|
+
|
86
|
+
</div>
|
87
|
+
|
88
|
+
|
89
|
+
</div>
|
90
|
+
|
91
|
+
<div id="method-list">
|
92
|
+
<h3 class="section-bar">Methods</h3>
|
93
|
+
|
94
|
+
<div class="name-list">
|
95
|
+
<a href="#M000023">close</a>
|
96
|
+
<a href="#M000027">connected?</a>
|
97
|
+
<a href="#M000026">gets</a>
|
98
|
+
<a href="#M000022">gets</a>
|
99
|
+
<a href="#M000020">new</a>
|
100
|
+
<a href="#M000024">open</a>
|
101
|
+
<a href="#M000021">puts</a>
|
102
|
+
<a href="#M000025">puts</a>
|
103
|
+
</div>
|
104
|
+
</div>
|
105
|
+
|
106
|
+
</div>
|
107
|
+
|
108
|
+
|
109
|
+
<!-- if includes -->
|
110
|
+
|
111
|
+
<div id="section">
|
112
|
+
|
113
|
+
|
114
|
+
|
115
|
+
|
116
|
+
|
117
|
+
|
118
|
+
|
119
|
+
|
120
|
+
<!-- if method_list -->
|
121
|
+
<div id="methods">
|
122
|
+
<h3 class="section-bar">Public Class methods</h3>
|
123
|
+
|
124
|
+
<div id="method-M000020" class="method-detail">
|
125
|
+
<a name="M000020"></a>
|
126
|
+
|
127
|
+
<div class="method-heading">
|
128
|
+
<a href="TellstickIO.src/M000020.html" target="Code" class="method-signature"
|
129
|
+
onclick="popupCode('TellstickIO.src/M000020.html');return false;">
|
130
|
+
<span class="method-name">new</span><span class="method-args">()</span>
|
131
|
+
</a>
|
132
|
+
</div>
|
133
|
+
|
134
|
+
<div class="method-description">
|
135
|
+
</div>
|
136
|
+
</div>
|
137
|
+
|
138
|
+
<h3 class="section-bar">Public Instance methods</h3>
|
139
|
+
|
140
|
+
<div id="method-M000023" class="method-detail">
|
141
|
+
<a name="M000023"></a>
|
142
|
+
|
143
|
+
<div class="method-heading">
|
144
|
+
<a href="TellstickIO.src/M000023.html" target="Code" class="method-signature"
|
145
|
+
onclick="popupCode('TellstickIO.src/M000023.html');return false;">
|
146
|
+
<span class="method-name">close</span><span class="method-args">()</span>
|
147
|
+
</a>
|
148
|
+
</div>
|
149
|
+
|
150
|
+
<div class="method-description">
|
151
|
+
<p>
|
152
|
+
<a href="TellstickIO.html#M000023">close</a> tellstick stream
|
153
|
+
</p>
|
154
|
+
</div>
|
155
|
+
</div>
|
156
|
+
|
157
|
+
<div id="method-M000027" class="method-detail">
|
158
|
+
<a name="M000027"></a>
|
159
|
+
|
160
|
+
<div class="method-heading">
|
161
|
+
<a href="TellstickIO.src/M000027.html" target="Code" class="method-signature"
|
162
|
+
onclick="popupCode('TellstickIO.src/M000027.html');return false;">
|
163
|
+
<span class="method-name">connected?</span><span class="method-args">()</span>
|
164
|
+
</a>
|
165
|
+
</div>
|
166
|
+
|
167
|
+
<div class="method-description">
|
168
|
+
<p>
|
169
|
+
true if connected
|
170
|
+
</p>
|
171
|
+
</div>
|
172
|
+
</div>
|
173
|
+
|
174
|
+
<div id="method-M000026" class="method-detail">
|
175
|
+
<a name="M000026"></a>
|
176
|
+
|
177
|
+
<div class="method-heading">
|
178
|
+
<a href="TellstickIO.src/M000026.html" target="Code" class="method-signature"
|
179
|
+
onclick="popupCode('TellstickIO.src/M000026.html');return false;">
|
180
|
+
<span class="method-name">gets</span><span class="method-args">()</span>
|
181
|
+
</a>
|
182
|
+
</div>
|
183
|
+
|
184
|
+
<div class="method-description">
|
185
|
+
</div>
|
186
|
+
</div>
|
187
|
+
|
188
|
+
<div id="method-M000022" class="method-detail">
|
189
|
+
<a name="M000022"></a>
|
190
|
+
|
191
|
+
<div class="method-heading">
|
192
|
+
<a href="TellstickIO.src/M000022.html" target="Code" class="method-signature"
|
193
|
+
onclick="popupCode('TellstickIO.src/M000022.html');return false;">
|
194
|
+
<span class="method-name">gets</span><span class="method-args">()</span>
|
195
|
+
</a>
|
196
|
+
</div>
|
197
|
+
|
198
|
+
<div class="method-description">
|
199
|
+
<p>
|
200
|
+
reads string from tellstick
|
201
|
+
</p>
|
202
|
+
</div>
|
203
|
+
</div>
|
204
|
+
|
205
|
+
<div id="method-M000024" class="method-detail">
|
206
|
+
<a name="M000024"></a>
|
207
|
+
|
208
|
+
<div class="method-heading">
|
209
|
+
<a href="TellstickIO.src/M000024.html" target="Code" class="method-signature"
|
210
|
+
onclick="popupCode('TellstickIO.src/M000024.html');return false;">
|
211
|
+
<span class="method-name">open</span><span class="method-args">()</span>
|
212
|
+
</a>
|
213
|
+
</div>
|
214
|
+
|
215
|
+
<div class="method-description">
|
216
|
+
<p>
|
217
|
+
opens tellstick stream
|
218
|
+
</p>
|
219
|
+
</div>
|
220
|
+
</div>
|
221
|
+
|
222
|
+
<div id="method-M000021" class="method-detail">
|
223
|
+
<a name="M000021"></a>
|
224
|
+
|
225
|
+
<div class="method-heading">
|
226
|
+
<a href="TellstickIO.src/M000021.html" target="Code" class="method-signature"
|
227
|
+
onclick="popupCode('TellstickIO.src/M000021.html');return false;">
|
228
|
+
<span class="method-name">puts</span><span class="method-args">(input)</span>
|
229
|
+
</a>
|
230
|
+
</div>
|
231
|
+
|
232
|
+
<div class="method-description">
|
233
|
+
<p>
|
234
|
+
writes input string to tellstick
|
235
|
+
</p>
|
236
|
+
</div>
|
237
|
+
</div>
|
238
|
+
|
239
|
+
<div id="method-M000025" class="method-detail">
|
240
|
+
<a name="M000025"></a>
|
241
|
+
|
242
|
+
<div class="method-heading">
|
243
|
+
<a href="TellstickIO.src/M000025.html" target="Code" class="method-signature"
|
244
|
+
onclick="popupCode('TellstickIO.src/M000025.html');return false;">
|
245
|
+
<span class="method-name">puts</span><span class="method-args">(input)</span>
|
246
|
+
</a>
|
247
|
+
</div>
|
248
|
+
|
249
|
+
<div class="method-description">
|
250
|
+
</div>
|
251
|
+
</div>
|
252
|
+
|
253
|
+
|
254
|
+
</div>
|
255
|
+
|
256
|
+
|
257
|
+
</div>
|
258
|
+
|
259
|
+
|
260
|
+
<div id="validator-badges">
|
261
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
262
|
+
</div>
|
263
|
+
|
264
|
+
</body>
|
265
|
+
</html>
|
@@ -0,0 +1,18 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html>
|
7
|
+
<head>
|
8
|
+
<title>new (Tellstick::TellstickIO)</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
10
|
+
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
|
+
</head>
|
12
|
+
<body class="standalone-code">
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/tellstick/tellstick_io.rb, line 26</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>
|
15
|
+
<span class="ruby-identifier">open</span>
|
16
|
+
<span class="ruby-keyword kw">end</span></pre>
|
17
|
+
</body>
|
18
|
+
</html>
|
@@ -0,0 +1,20 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html>
|
7
|
+
<head>
|
8
|
+
<title>puts (Tellstick::TellstickIO)</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
10
|
+
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
|
+
</head>
|
12
|
+
<body class="standalone-code">
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/tellstick/tellstick_io.rb, line 31</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">puts</span>(<span class="ruby-identifier">input</span>)
|
15
|
+
<span class="ruby-identifier">input</span>.<span class="ruby-identifier">scan</span>(<span class="ruby-regexp re">/.{1,8}/</span>).<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">str</span><span class="ruby-operator">|</span>
|
16
|
+
<span class="ruby-constant">Ftd2xx</span>.<span class="ruby-identifier">write</span>(<span class="ruby-ivar">@handle</span>,<span class="ruby-identifier">str</span>)
|
17
|
+
<span class="ruby-keyword kw">end</span>
|
18
|
+
<span class="ruby-keyword kw">end</span></pre>
|
19
|
+
</body>
|
20
|
+
</html>
|
@@ -0,0 +1,26 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html>
|
7
|
+
<head>
|
8
|
+
<title>gets (Tellstick::TellstickIO)</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
10
|
+
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
|
+
</head>
|
12
|
+
<body class="standalone-code">
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/tellstick/tellstick_io.rb, line 38</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">gets</span>
|
15
|
+
<span class="ruby-identifier">reply</span> = <span class="ruby-value str">""</span>
|
16
|
+
<span class="ruby-identifier">bytes_read</span> = <span class="ruby-value">1</span>
|
17
|
+
<span class="ruby-identifier">c</span> = <span class="ruby-value str">" "</span>
|
18
|
+
<span class="ruby-keyword kw">while</span> (<span class="ruby-identifier">bytes_read</span> <span class="ruby-operator">!=</span> <span class="ruby-value">0</span>) <span class="ruby-keyword kw">and</span> (<span class="ruby-identifier">c</span> <span class="ruby-operator">!=</span> <span class="ruby-value str">"\n"</span>)
|
19
|
+
<span class="ruby-identifier">c</span> = <span class="ruby-value str">" "</span>
|
20
|
+
<span class="ruby-identifier">bytes_read</span> = <span class="ruby-constant">Ftd2xx</span>.<span class="ruby-identifier">read</span>(<span class="ruby-ivar">@handle</span>,<span class="ruby-identifier">c</span>)
|
21
|
+
<span class="ruby-identifier">reply</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">c</span>
|
22
|
+
<span class="ruby-keyword kw">end</span>
|
23
|
+
<span class="ruby-identifier">reply</span>
|
24
|
+
<span class="ruby-keyword kw">end</span></pre>
|
25
|
+
</body>
|
26
|
+
</html>
|
@@ -0,0 +1,19 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html>
|
7
|
+
<head>
|
8
|
+
<title>close (Tellstick::TellstickIO)</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
10
|
+
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
|
+
</head>
|
12
|
+
<body class="standalone-code">
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/tellstick/tellstick_io.rb, line 51</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">close</span>
|
15
|
+
<span class="ruby-constant">Ftd2xx</span>.<span class="ruby-identifier">ft_close</span>(<span class="ruby-ivar">@handle</span>)
|
16
|
+
<span class="ruby-ivar">@handle</span> = <span class="ruby-keyword kw">nil</span>
|
17
|
+
<span class="ruby-keyword kw">end</span></pre>
|
18
|
+
</body>
|
19
|
+
</html>
|
@@ -0,0 +1,26 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html>
|
7
|
+
<head>
|
8
|
+
<title>open (Tellstick::TellstickIO)</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
10
|
+
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
|
+
</head>
|
12
|
+
<body class="standalone-code">
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/tellstick/tellstick_io.rb, line 57</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">open</span>
|
15
|
+
<span class="ruby-constant">Ftd2xx</span>.<span class="ruby-identifier">ft_set_vidpid</span>(<span class="ruby-value">0x1781</span>,<span class="ruby-value">0x0c30</span>)
|
16
|
+
<span class="ruby-identifier">device_index</span> = <span class="ruby-constant">Ftd2xx</span>.<span class="ruby-identifier">create_device_info_list</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>
|
17
|
+
<span class="ruby-ivar">@handle</span> = <span class="ruby-constant">Ftd2xx</span>.<span class="ruby-identifier">open</span>(<span class="ruby-identifier">device_index</span>)
|
18
|
+
<span class="ruby-constant">Ftd2xx</span>.<span class="ruby-identifier">ft_set_baud_rate</span>(<span class="ruby-ivar">@handle</span>,<span class="ruby-value">4800</span>)
|
19
|
+
<span class="ruby-constant">Ftd2xx</span>.<span class="ruby-identifier">ft_set_timeouts</span>(<span class="ruby-ivar">@handle</span>,<span class="ruby-value">5000</span>,<span class="ruby-value">0</span>)
|
20
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@handle</span> <span class="ruby-operator">==</span> <span class="ruby-keyword kw">nil</span>
|
21
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">puts</span>(<span class="ruby-identifier">input</span>);<span class="ruby-keyword kw">end</span>
|
22
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">gets</span>;<span class="ruby-keyword kw">end</span>
|
23
|
+
<span class="ruby-keyword kw">end</span>
|
24
|
+
<span class="ruby-keyword kw">end</span></pre>
|
25
|
+
</body>
|
26
|
+
</html>
|
@@ -0,0 +1,16 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html>
|
7
|
+
<head>
|
8
|
+
<title>puts (Tellstick::TellstickIO)</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
10
|
+
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
|
+
</head>
|
12
|
+
<body class="standalone-code">
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/tellstick/tellstick_io.rb, line 64</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">puts</span>(<span class="ruby-identifier">input</span>);<span class="ruby-keyword kw">end</span></pre>
|
15
|
+
</body>
|
16
|
+
</html>
|
@@ -0,0 +1,16 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html>
|
7
|
+
<head>
|
8
|
+
<title>gets (Tellstick::TellstickIO)</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
10
|
+
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
|
+
</head>
|
12
|
+
<body class="standalone-code">
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/tellstick/tellstick_io.rb, line 65</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">gets</span>;<span class="ruby-keyword kw">end</span></pre>
|
15
|
+
</body>
|
16
|
+
</html>
|
@@ -0,0 +1,24 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html>
|
7
|
+
<head>
|
8
|
+
<title>connected? (Tellstick::TellstickIO)</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
10
|
+
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
|
+
</head>
|
12
|
+
<body class="standalone-code">
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/tellstick/tellstick_io.rb, line 70</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">connected?</span>
|
15
|
+
<span class="ruby-identifier">close</span>
|
16
|
+
<span class="ruby-identifier">open</span>
|
17
|
+
<span class="ruby-identifier">puts</span>(<span class="ruby-value str">"S+"</span>)
|
18
|
+
<span class="ruby-identifier">answer</span> = <span class="ruby-identifier">gets</span>
|
19
|
+
<span class="ruby-identifier">close</span>
|
20
|
+
<span class="ruby-identifier">open</span>
|
21
|
+
<span class="ruby-identifier">answer</span> <span class="ruby-operator">==</span> <span class="ruby-value str">"+S\r\n"</span>
|
22
|
+
<span class="ruby-keyword kw">end</span></pre>
|
23
|
+
</body>
|
24
|
+
</html>
|
@@ -0,0 +1,204 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
7
|
+
<head>
|
8
|
+
<title>Module: Tellstick</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
10
|
+
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
11
|
+
<link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
|
12
|
+
<script type="text/javascript">
|
13
|
+
// <![CDATA[
|
14
|
+
|
15
|
+
function popupCode( url ) {
|
16
|
+
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
17
|
+
}
|
18
|
+
|
19
|
+
function toggleCode( id ) {
|
20
|
+
if ( document.getElementById )
|
21
|
+
elem = document.getElementById( id );
|
22
|
+
else if ( document.all )
|
23
|
+
elem = eval( "document.all." + id );
|
24
|
+
else
|
25
|
+
return false;
|
26
|
+
|
27
|
+
elemStyle = elem.style;
|
28
|
+
|
29
|
+
if ( elemStyle.display != "block" ) {
|
30
|
+
elemStyle.display = "block"
|
31
|
+
} else {
|
32
|
+
elemStyle.display = "none"
|
33
|
+
}
|
34
|
+
|
35
|
+
return true;
|
36
|
+
}
|
37
|
+
|
38
|
+
// Make codeblocks hidden by default
|
39
|
+
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
40
|
+
|
41
|
+
// ]]>
|
42
|
+
</script>
|
43
|
+
|
44
|
+
</head>
|
45
|
+
<body>
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
<div id="classHeader">
|
50
|
+
<table class="header-table">
|
51
|
+
<tr class="top-aligned-row">
|
52
|
+
<td><strong>Module</strong></td>
|
53
|
+
<td class="class-name-in-header">Tellstick</td>
|
54
|
+
</tr>
|
55
|
+
<tr class="top-aligned-row">
|
56
|
+
<td><strong>In:</strong></td>
|
57
|
+
<td>
|
58
|
+
<a href="../files/lib/tellstick/protocol/nexa_rb.html">
|
59
|
+
lib/tellstick/protocol/nexa.rb
|
60
|
+
</a>
|
61
|
+
<br />
|
62
|
+
<a href="../files/lib/tellstick/protocol/not_connected_rb.html">
|
63
|
+
lib/tellstick/protocol/not_connected.rb
|
64
|
+
</a>
|
65
|
+
<br />
|
66
|
+
<a href="../files/lib/tellstick/protocol/null_protocol_rb.html">
|
67
|
+
lib/tellstick/protocol/null_protocol.rb
|
68
|
+
</a>
|
69
|
+
<br />
|
70
|
+
<a href="../files/lib/tellstick/protocol/plain_text_rb.html">
|
71
|
+
lib/tellstick/protocol/plain_text.rb
|
72
|
+
</a>
|
73
|
+
<br />
|
74
|
+
<a href="../files/lib/tellstick/protocol/proove_rb.html">
|
75
|
+
lib/tellstick/protocol/proove.rb
|
76
|
+
</a>
|
77
|
+
<br />
|
78
|
+
<a href="../files/lib/tellstick/protocol/protocol_loader_rb.html">
|
79
|
+
lib/tellstick/protocol/protocol_loader.rb
|
80
|
+
</a>
|
81
|
+
<br />
|
82
|
+
<a href="../files/lib/tellstick/protocol/rising_sun_rb.html">
|
83
|
+
lib/tellstick/protocol/rising_sun.rb
|
84
|
+
</a>
|
85
|
+
<br />
|
86
|
+
<a href="../files/lib/tellstick/protocol/waveman_rb.html">
|
87
|
+
lib/tellstick/protocol/waveman.rb
|
88
|
+
</a>
|
89
|
+
<br />
|
90
|
+
<a href="../files/lib/tellstick/tellstick_rb.html">
|
91
|
+
lib/tellstick/tellstick.rb
|
92
|
+
</a>
|
93
|
+
<br />
|
94
|
+
<a href="../files/lib/tellstick/tellstick_io_rb.html">
|
95
|
+
lib/tellstick/tellstick_io.rb
|
96
|
+
</a>
|
97
|
+
<br />
|
98
|
+
</td>
|
99
|
+
</tr>
|
100
|
+
|
101
|
+
</table>
|
102
|
+
</div>
|
103
|
+
<!-- banner header -->
|
104
|
+
|
105
|
+
<div id="bodyContent">
|
106
|
+
|
107
|
+
|
108
|
+
|
109
|
+
<div id="contextContent">
|
110
|
+
|
111
|
+
<div id="description">
|
112
|
+
<p>
|
113
|
+
The <a href="Tellstick.html">Tellstick</a> module represents the virtual
|
114
|
+
equivalent of the hardware usb dongle. Use <a
|
115
|
+
href="Tellstick.html#M000019">create</a> with <a
|
116
|
+
href="Tellstick/TellstickIO.html#M000020">TellstickIO.new</a> as the output
|
117
|
+
</p>
|
118
|
+
|
119
|
+
</div>
|
120
|
+
|
121
|
+
|
122
|
+
</div>
|
123
|
+
|
124
|
+
<div id="method-list">
|
125
|
+
<h3 class="section-bar">Methods</h3>
|
126
|
+
|
127
|
+
<div class="name-list">
|
128
|
+
<a href="#M000019">create</a>
|
129
|
+
</div>
|
130
|
+
</div>
|
131
|
+
|
132
|
+
</div>
|
133
|
+
|
134
|
+
|
135
|
+
<!-- if includes -->
|
136
|
+
|
137
|
+
<div id="section">
|
138
|
+
|
139
|
+
<div id="class-list">
|
140
|
+
<h3 class="section-bar">Classes and Modules</h3>
|
141
|
+
|
142
|
+
Class <a href="Tellstick/Tellstick.html" class="link">Tellstick::Tellstick</a><br />
|
143
|
+
Class <a href="Tellstick/TellstickIO.html" class="link">Tellstick::TellstickIO</a><br />
|
144
|
+
|
145
|
+
</div>
|
146
|
+
|
147
|
+
|
148
|
+
|
149
|
+
|
150
|
+
|
151
|
+
|
152
|
+
|
153
|
+
<!-- if method_list -->
|
154
|
+
<div id="methods">
|
155
|
+
<h3 class="section-bar">Public Instance methods</h3>
|
156
|
+
|
157
|
+
<div id="method-M000019" class="method-detail">
|
158
|
+
<a name="M000019"></a>
|
159
|
+
|
160
|
+
<div class="method-heading">
|
161
|
+
<a href="Tellstick.src/M000019.html" target="Code" class="method-signature"
|
162
|
+
onclick="popupCode('Tellstick.src/M000019.html');return false;">
|
163
|
+
<span class="method-name">create</span><span class="method-args">(output,protocol_name="plain_text")</span>
|
164
|
+
</a>
|
165
|
+
</div>
|
166
|
+
|
167
|
+
<div class="method-description">
|
168
|
+
<p>
|
169
|
+
takes any kind of IO, but specifically <a
|
170
|
+
href="Tellstick/TellstickIO.html">TellstickIO</a>, as output and the name
|
171
|
+
of the transmission protocol. It returns an instance of <a
|
172
|
+
href="Tellstick.html">Tellstick</a>.
|
173
|
+
</p>
|
174
|
+
<p>
|
175
|
+
The protocol is mixed into <a href="Tellstick.html">Tellstick</a> with the
|
176
|
+
methods:
|
177
|
+
</p>
|
178
|
+
<ul>
|
179
|
+
<li>turn_on
|
180
|
+
|
181
|
+
</li>
|
182
|
+
<li>turn_off
|
183
|
+
|
184
|
+
</li>
|
185
|
+
<li>teach <em>(if the protocol supports it)</em>
|
186
|
+
|
187
|
+
</li>
|
188
|
+
</ul>
|
189
|
+
</div>
|
190
|
+
</div>
|
191
|
+
|
192
|
+
|
193
|
+
</div>
|
194
|
+
|
195
|
+
|
196
|
+
</div>
|
197
|
+
|
198
|
+
|
199
|
+
<div id="validator-badges">
|
200
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
201
|
+
</div>
|
202
|
+
|
203
|
+
</body>
|
204
|
+
</html>
|