ansible4ozw 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/ansible.rb +47 -0
- data/lib/ansible/ansible_callback.rb +142 -0
- data/lib/ansible/ansible_device.rb +68 -0
- data/lib/ansible/ansible_value.rb +179 -0
- data/lib/ansible/config.rb +92 -0
- data/lib/ansible/devices/ansible_dimmer.rb +80 -0
- data/lib/ansible/devices/ansible_switch.rb +66 -0
- data/lib/ansible/knx/EIBConnection.rb +2371 -0
- data/lib/ansible/knx/dpt/canonical_1bit.rb +54 -0
- data/lib/ansible/knx/dpt/dpt1.rb +224 -0
- data/lib/ansible/knx/dpt/dpt10.rb +85 -0
- data/lib/ansible/knx/dpt/dpt11.rb +72 -0
- data/lib/ansible/knx/dpt/dpt12.rb +61 -0
- data/lib/ansible/knx/dpt/dpt13.rb +100 -0
- data/lib/ansible/knx/dpt/dpt14.rb +87 -0
- data/lib/ansible/knx/dpt/dpt15.rb +72 -0
- data/lib/ansible/knx/dpt/dpt16.rb +67 -0
- data/lib/ansible/knx/dpt/dpt17.rb +65 -0
- data/lib/ansible/knx/dpt/dpt18.rb +66 -0
- data/lib/ansible/knx/dpt/dpt19.rb +100 -0
- data/lib/ansible/knx/dpt/dpt2.rb +156 -0
- data/lib/ansible/knx/dpt/dpt3.rb +104 -0
- data/lib/ansible/knx/dpt/dpt4.rb +75 -0
- data/lib/ansible/knx/dpt/dpt5.rb +124 -0
- data/lib/ansible/knx/dpt/dpt6.rb +73 -0
- data/lib/ansible/knx/dpt/dpt7.rb +146 -0
- data/lib/ansible/knx/dpt/dpt8.rb +118 -0
- data/lib/ansible/knx/dpt/dpt9.rb +204 -0
- data/lib/ansible/knx/dpt/tests/test_dpt10.rb +45 -0
- data/lib/ansible/knx/dpt/tests/test_dpt9.rb +60 -0
- data/lib/ansible/knx/hexdump.rb +113 -0
- data/lib/ansible/knx/knx_dpt.rb +58 -0
- data/lib/ansible/knx/knx_dpt_scalar.rb +62 -0
- data/lib/ansible/knx/knx_eistypes.rb +76 -0
- data/lib/ansible/knx/knx_protocol.rb +99 -0
- data/lib/ansible/knx/knx_scene.rb +48 -0
- data/lib/ansible/knx/knx_tools.rb +76 -0
- data/lib/ansible/knx/knx_transceiver.rb +237 -0
- data/lib/ansible/knx/knx_value.rb +327 -0
- data/lib/ansible/openzwave/ozw_constants.rb +11 -0
- data/lib/ansible/openzwave/ozw_headers.rb +80 -0
- data/lib/ansible/openzwave/ozw_remote_manager.rb +7615 -0
- data/lib/ansible/openzwave/ozw_types.rb +406 -0
- data/lib/ansible/orbiter_proxy.rb +12 -0
- data/lib/ansible/transceiver.rb +63 -0
- data/lib/ansible/zwave/types/valuetype_bool.rb +74 -0
- data/lib/ansible/zwave/types/valuetype_button.rb +63 -0
- data/lib/ansible/zwave/types/valuetype_byte.rb +78 -0
- data/lib/ansible/zwave/types/valuetype_decimal.rb +64 -0
- data/lib/ansible/zwave/types/valuetype_int.rb +63 -0
- data/lib/ansible/zwave/types/valuetype_list.rb +64 -0
- data/lib/ansible/zwave/types/valuetype_short.rb +63 -0
- data/lib/ansible/zwave/types/valuetype_string.rb +61 -0
- data/lib/ansible/zwave/zwave_command_classes.rb +113 -0
- data/lib/ansible/zwave/zwave_node.rb +5 -0
- data/lib/ansible/zwave/zwave_protocol.rb +52 -0
- data/lib/ansible/zwave/zwave_transceiver.rb +435 -0
- data/lib/ansible/zwave/zwave_value.rb +193 -0
- metadata +108 -0
@@ -0,0 +1,80 @@
|
|
1
|
+
=begin
|
2
|
+
Project Ansible - An extensible home automation scripting framework
|
3
|
+
----------------------------------------------------
|
4
|
+
Copyright (c) 2011 Elias Karakoulakis <elias.karakoulakis@gmail.com>
|
5
|
+
|
6
|
+
SOFTWARE NOTICE AND LICENSE
|
7
|
+
|
8
|
+
Project Ansible is free software: you can redistribute it and/or modify
|
9
|
+
it under the terms of the GNU Lesser General Public License as published
|
10
|
+
by the Free Software Foundation, either version 3 of the License,
|
11
|
+
or (at your option) any later version.
|
12
|
+
|
13
|
+
Project Ansible is distributed in the hope that it will be useful,
|
14
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
15
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
16
|
+
GNU Lesser General Public License for more details.
|
17
|
+
|
18
|
+
You should have received a copy of the GNU Lesser General Public License
|
19
|
+
along with Project Ansible. If not, see <http://www.gnu.org/licenses/>.
|
20
|
+
|
21
|
+
for more information on the LGPL, see:
|
22
|
+
http://en.wikipedia.org/wiki/GNU_Lesser_General_Public_License
|
23
|
+
=end
|
24
|
+
|
25
|
+
require 'ansible_device'
|
26
|
+
|
27
|
+
module Ansible
|
28
|
+
|
29
|
+
# a Dimmer is a Switch with additional capabilites (duh)
|
30
|
+
class Dimmer < Switch
|
31
|
+
|
32
|
+
def link
|
33
|
+
dimming = @hashmap[:dimming]
|
34
|
+
status = @hashmap[:dimming_status]
|
35
|
+
master = @hashmap[:master_control]
|
36
|
+
unless dimming.is_a?AnsibleValue
|
37
|
+
raise "#{self}.link: must supply AnsibleValues for :dimming!"
|
38
|
+
end
|
39
|
+
# map dimming value updates to master_control
|
40
|
+
dimming.add_callback(:onUpdate, self) { |sender, cb, args|
|
41
|
+
puts " (#{sender.class}) #{sender} input value updated! args=#{args}"
|
42
|
+
# convert value domains
|
43
|
+
cv = sender.as_canonical_value
|
44
|
+
newval = master.to_protocol_value(cv)
|
45
|
+
puts " #{self} setting output #{output} +++ cv=#{cv} newval=#{newval}"
|
46
|
+
target.set(newval)
|
47
|
+
# also update status value, if defined
|
48
|
+
status.set(newval) unless status.nil?
|
49
|
+
}
|
50
|
+
# also update dimming status value, if defined
|
51
|
+
master.add_callback(:onUpdate, self) { |sender, cb, args|
|
52
|
+
# convert value domains
|
53
|
+
cv = sender.as_canonical_value
|
54
|
+
newval = master.to_protocol_value(cv)
|
55
|
+
#
|
56
|
+
status = @hashmap[:switch_status]
|
57
|
+
puts " updating dimming status value (#{status}) new val=#{newval}!"
|
58
|
+
status.set(newval)
|
59
|
+
} if status.is_a?AnsibleValue
|
60
|
+
# call upstream linking method in Switch, if any
|
61
|
+
super()
|
62
|
+
=begin
|
63
|
+
knx_dimm_val.add_callback(:onUpdate) { |sender, cb, args|
|
64
|
+
puts "KNX value #{sender} updated! args=#{args} canonical=#{sender.as_canonical_value}"
|
65
|
+
zwval = sender.current_value.data * 99 / 255
|
66
|
+
zwave_dimm_val.set(zwval.round) # FIXME convert value domains
|
67
|
+
}
|
68
|
+
if knx_dimmstatus_val then
|
69
|
+
zwave_dimm_val.add_callback(:onUpdate) { | sender, cb, args|
|
70
|
+
puts "ZWave value #{sender} HAS CHANGED #{args}"
|
71
|
+
knxval = sender.current_value.data * 255 / 99
|
72
|
+
knx_dimmstatus_val.set(knxval.round)
|
73
|
+
}
|
74
|
+
end
|
75
|
+
=end
|
76
|
+
end
|
77
|
+
|
78
|
+
end #class
|
79
|
+
|
80
|
+
end
|
@@ -0,0 +1,66 @@
|
|
1
|
+
=begin
|
2
|
+
Project Ansible - An extensible home automation scripting framework
|
3
|
+
----------------------------------------------------
|
4
|
+
Copyright (c) 2011 Elias Karakoulakis <elias.karakoulakis@gmail.com>
|
5
|
+
|
6
|
+
SOFTWARE NOTICE AND LICENSE
|
7
|
+
|
8
|
+
Project Ansible is free software: you can redistribute it and/or modify
|
9
|
+
it under the terms of the GNU Lesser General Public License as published
|
10
|
+
by the Free Software Foundation, either version 3 of the License,
|
11
|
+
or (at your option) any later version.
|
12
|
+
|
13
|
+
Project Ansible is distributed in the hope that it will be useful,
|
14
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
15
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
16
|
+
GNU Lesser General Public License for more details.
|
17
|
+
|
18
|
+
You should have received a copy of the GNU Lesser General Public License
|
19
|
+
along with Project Ansible. If not, see <http://www.gnu.org/licenses/>.
|
20
|
+
|
21
|
+
for more information on the LGPL, see:
|
22
|
+
http://en.wikipedia.org/wiki/GNU_Lesser_General_Public_License
|
23
|
+
=end
|
24
|
+
|
25
|
+
require 'ansible_device'
|
26
|
+
|
27
|
+
module Ansible
|
28
|
+
|
29
|
+
#
|
30
|
+
# a Switch is a device controlled by a boolean state: False/Off/0 and True/On/1
|
31
|
+
class Switch < Device
|
32
|
+
|
33
|
+
def link
|
34
|
+
switch = @hashmap[:switch]
|
35
|
+
status = @hashmap[:switch_status]
|
36
|
+
master = @hashmap[:master_control]
|
37
|
+
unless [switch, master].select{ |v| not v.is_a? AnsibleValue }.empty?
|
38
|
+
raise "#{self}.link: must supply AnsibleValues for :master_control and :switch!"
|
39
|
+
end
|
40
|
+
# map switch value updates to master_control
|
41
|
+
switch.add_callback(:onUpdate, self) { |sender, cb, args|
|
42
|
+
puts " (#{sender.class}) #{sender} input value updated! args=#{args}"
|
43
|
+
# convert value domains
|
44
|
+
cv = sender.as_canonical_value
|
45
|
+
newval = master.to_protocol_value(cv)
|
46
|
+
puts " #{self} setting master #{master} +++ cv=#{cv} newval=#{newval}"
|
47
|
+
master.set(newval)
|
48
|
+
}
|
49
|
+
# also update status value, if defined
|
50
|
+
if status.is_a?AnsibleValue then
|
51
|
+
puts "...also adding status feedback command #{status}"
|
52
|
+
master.add_callback(:onUpdate, self) { |sender, cb, args|
|
53
|
+
# convert value domains
|
54
|
+
cv = sender.as_canonical_value
|
55
|
+
newval = master.to_protocol_value(cv)
|
56
|
+
#
|
57
|
+
status = @hashmap[:switch_status]
|
58
|
+
puts " updating on/off status value (#{status}) new val=#{newval}!"
|
59
|
+
status.set(newval)
|
60
|
+
}
|
61
|
+
end
|
62
|
+
end #def
|
63
|
+
|
64
|
+
end
|
65
|
+
|
66
|
+
end
|
@@ -0,0 +1,2371 @@
|
|
1
|
+
#
|
2
|
+
# EIBD client library
|
3
|
+
# Copyright (C) 2005-2011 Martin Koegler <mkoegler@auto.tuwien.ac.at>
|
4
|
+
#
|
5
|
+
# This program is free software; you can redistribute it and/or modify
|
6
|
+
# it under the terms of the GNU General Public License as published by
|
7
|
+
# the Free Software Foundation; either version 2 of the License, or
|
8
|
+
# (at your option) any later version.
|
9
|
+
#
|
10
|
+
# In addition to the permissions in the GNU General Public License,
|
11
|
+
# you may link the compiled version of this file into combinations
|
12
|
+
# with other programs, and distribute those combinations without any
|
13
|
+
# restriction coming from the use of this file. (The General Public
|
14
|
+
# License restrictions do apply in other respects; for example, they
|
15
|
+
# cover modification of the file, and distribution when not linked into
|
16
|
+
# a combine executable.)
|
17
|
+
#
|
18
|
+
# This program is distributed in the hope that it will be useful,
|
19
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
20
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
21
|
+
# GNU General Public License for more details.
|
22
|
+
#
|
23
|
+
# You should have received a copy of the GNU General Public License
|
24
|
+
# along with this program; if not, write to the Free Software
|
25
|
+
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
26
|
+
#
|
27
|
+
|
28
|
+
|
29
|
+
require 'hexdump'
|
30
|
+
require 'socket'
|
31
|
+
include Socket::Constants
|
32
|
+
|
33
|
+
class EIBBuffer
|
34
|
+
attr_accessor :buffer
|
35
|
+
def initialize(buf = [])
|
36
|
+
@buffer = buf
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
class EIBAddr
|
41
|
+
attr_accessor :data
|
42
|
+
def initialize(value = 0)
|
43
|
+
@data = value
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
class EIBInt8
|
48
|
+
attr_accessor :data
|
49
|
+
def initialize(value = 0)
|
50
|
+
@data = value
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
class EIBInt16
|
55
|
+
attr_accessor :data
|
56
|
+
def initialize(value = 0)
|
57
|
+
@data = value
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
class EIBInt32
|
62
|
+
attr_accessor :data
|
63
|
+
def initialize(value = 0)
|
64
|
+
@data = value
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
68
|
+
class EIBConnection
|
69
|
+
def initialize()
|
70
|
+
@data = []
|
71
|
+
@readlen = 0
|
72
|
+
@datalen = 0
|
73
|
+
@fd = nil
|
74
|
+
@errno = 0
|
75
|
+
@__complete = nil
|
76
|
+
end
|
77
|
+
|
78
|
+
def EIBSocketLocal(path)
|
79
|
+
puts "EIBSocketLocal(path=#{path})" if $DEBUG
|
80
|
+
if @fd != nil
|
81
|
+
@errno = Errno::EUSERS
|
82
|
+
return -1
|
83
|
+
end
|
84
|
+
fd = UNIXSocket.new(path)
|
85
|
+
@data = []
|
86
|
+
@readlen = 0
|
87
|
+
@fd = fd
|
88
|
+
return 0
|
89
|
+
end
|
90
|
+
|
91
|
+
def EIBSocketRemote(host, port = 6720)
|
92
|
+
puts "EIBSocketURL(host=#{host} port=#{port})" if $DEBUG
|
93
|
+
if @fd != nil
|
94
|
+
@errno = Errno::EUSERS
|
95
|
+
return -1
|
96
|
+
end
|
97
|
+
fd = TCPSocket.new(host, port)
|
98
|
+
@data = []
|
99
|
+
@readlen = 0
|
100
|
+
@fd = fd
|
101
|
+
return 0
|
102
|
+
end
|
103
|
+
|
104
|
+
def EIBSocketURL(url)
|
105
|
+
if url.start_with?('local:')
|
106
|
+
return EIBSocketLocal(url[6..-1])
|
107
|
+
end
|
108
|
+
if url.start_with?('ip:')
|
109
|
+
parts=url.split(':')
|
110
|
+
if (parts.length == 2)
|
111
|
+
parts << "6720"
|
112
|
+
end
|
113
|
+
return EIBSocketRemote(parts[1], parts[2].to_i)
|
114
|
+
end
|
115
|
+
@errno = Errno::EINVAL
|
116
|
+
return -1
|
117
|
+
end
|
118
|
+
|
119
|
+
def EIBComplete()
|
120
|
+
if @__complete == nil
|
121
|
+
@errno = Errno::EINVAL
|
122
|
+
return -1
|
123
|
+
end
|
124
|
+
return @__complete
|
125
|
+
end
|
126
|
+
|
127
|
+
def EIBClose()
|
128
|
+
if @fd == nil
|
129
|
+
@errno = Errno::EINVAL
|
130
|
+
return -1
|
131
|
+
end
|
132
|
+
@fd.close()
|
133
|
+
@fd = nil
|
134
|
+
end
|
135
|
+
|
136
|
+
def EIBClose_sync()
|
137
|
+
puts "EIBClose_sync()" if $DEBUG
|
138
|
+
EIBReset()
|
139
|
+
return EIBClose()
|
140
|
+
end
|
141
|
+
|
142
|
+
def __EIB_SendRequest(data)
|
143
|
+
if @fd == nil
|
144
|
+
@errno = Errno::ECONNRESET
|
145
|
+
return -1
|
146
|
+
end
|
147
|
+
if data.length < 2 or data.length > 0xffff
|
148
|
+
@errno = Errno::EINVAL
|
149
|
+
return -1
|
150
|
+
end
|
151
|
+
data = [ (data.length>>8)&0xff, (data.length)&0xff ] + data
|
152
|
+
#puts "__EIB_SendRequest(data=#{data.inspect} length=#{data.length})" if $DEBUG
|
153
|
+
result = data.pack("C*")
|
154
|
+
@fd.send(result, 0)
|
155
|
+
#puts "__EIB_SendRequest sent #{result.length} bytes: #{result.hexdump}" if $DEBUG
|
156
|
+
return 0
|
157
|
+
end
|
158
|
+
|
159
|
+
def EIB_Poll_FD()
|
160
|
+
if @fd == nil
|
161
|
+
@errno = Errno::EINVAL
|
162
|
+
return -1
|
163
|
+
end
|
164
|
+
return @fd
|
165
|
+
end
|
166
|
+
|
167
|
+
def EIB_Poll_Complete()
|
168
|
+
puts "__EIB_Poll_Complete()" if $DEBUG
|
169
|
+
if __EIB_CheckRequest(false) == -1
|
170
|
+
return -1
|
171
|
+
end
|
172
|
+
if @readlen < 2 or (@readlen >= 2 and @readlen < @datalen + 2)
|
173
|
+
return 0
|
174
|
+
end
|
175
|
+
return 1
|
176
|
+
end
|
177
|
+
|
178
|
+
def __EIB_GetRequest()
|
179
|
+
puts "__EIB_GetRequest()" if $DEBUG
|
180
|
+
while true
|
181
|
+
if __EIB_CheckRequest(true) == -1
|
182
|
+
return -1
|
183
|
+
end
|
184
|
+
if @readlen >= 2 and @readlen >= @datalen + 2
|
185
|
+
@readlen = 0
|
186
|
+
return 0
|
187
|
+
end
|
188
|
+
end
|
189
|
+
end
|
190
|
+
|
191
|
+
def __EIB_CheckRequest(block)
|
192
|
+
puts "__EIB_CheckRequest(block=#{block})" if $DEBUG
|
193
|
+
if @fd == nil
|
194
|
+
@errno = Errno::ECONNRESET
|
195
|
+
return -1
|
196
|
+
end
|
197
|
+
if @readlen == 0
|
198
|
+
@head = []
|
199
|
+
@data = []
|
200
|
+
end
|
201
|
+
if @readlen < 2
|
202
|
+
maxlen = 2-@readlen
|
203
|
+
result = block ? @fd.recv(maxlen) : @fd.recv_nonblock(maxlen)
|
204
|
+
raise Errno::ECONNRESET if block and (result.length == 0)
|
205
|
+
puts "__EIB_CheckRequest received #{result.length} bytes: #{result.inspect})" if $DEBUG
|
206
|
+
if result.length > 0
|
207
|
+
@head.concat(result.split('').collect{|c| c.unpack('c')[0]})
|
208
|
+
end
|
209
|
+
puts "__EIB_CheckRequest @head after recv. = #{@head.inspect})" if $DEBUG
|
210
|
+
@readlen += result.length
|
211
|
+
end
|
212
|
+
if @readlen < 2
|
213
|
+
return 0
|
214
|
+
end
|
215
|
+
@datalen = (@head[0] << 8) | @head[1]
|
216
|
+
if @readlen < @datalen + 2
|
217
|
+
maxlen = @datalen + 2 -@readlen
|
218
|
+
result = block ? @fd.recv(maxlen) : @fd.recv_nonblock(maxlen)
|
219
|
+
raise Errno::ECONNRESET if block and (result.length == 0)
|
220
|
+
puts "__EIB_CheckRequest received #{result.length} bytes: #{result.inspect})" if $DEBUG
|
221
|
+
if result.length > 0
|
222
|
+
@data.concat(result.split('').collect{|c| c.unpack('c')[0]})
|
223
|
+
puts "__EIB_CheckRequest @data after recv. = #{@data.inspect})" if $DEBUG
|
224
|
+
end
|
225
|
+
@readlen += result.length
|
226
|
+
end #if
|
227
|
+
return 0
|
228
|
+
end
|
229
|
+
|
230
|
+
def __EIBGetAPDU_Complete()
|
231
|
+
puts "__EIBGetAPDU_Complete()" if $DEBUG
|
232
|
+
@__complete = nil
|
233
|
+
if __EIB_GetRequest() == -1
|
234
|
+
return -1
|
235
|
+
end
|
236
|
+
if (((@data[0])<<8)|(@data[0+1])) != 37 or @data.length < 2
|
237
|
+
@errno = Errno::ECONNRESET
|
238
|
+
return -1
|
239
|
+
end
|
240
|
+
@buf.buffer = @data[2..-1]
|
241
|
+
return @buf.buffer.length
|
242
|
+
end
|
243
|
+
|
244
|
+
|
245
|
+
def EIBGetAPDU_async(buf)
|
246
|
+
puts "EIBGetAPDU_async()" if $DEBUG
|
247
|
+
ibuf = [0] * 2;
|
248
|
+
@buf = buf
|
249
|
+
@__complete = __EIBGetAPDU_Complete()
|
250
|
+
return 0
|
251
|
+
end
|
252
|
+
|
253
|
+
def EIBGetAPDU(buf)
|
254
|
+
puts "EIBGetAPDU()" if $DEBUG
|
255
|
+
if EIBGetAPDU_async(buf) == -1
|
256
|
+
return -1
|
257
|
+
end
|
258
|
+
return EIBComplete()
|
259
|
+
end
|
260
|
+
|
261
|
+
def __EIBGetAPDU_Src_Complete()
|
262
|
+
puts "__EIBGetAPDU_Src_Complete()" if $DEBUG
|
263
|
+
@__complete = nil
|
264
|
+
if __EIB_GetRequest() == -1
|
265
|
+
return -1
|
266
|
+
end
|
267
|
+
if (((@data[0])<<8)|(@data[0+1])) != 37 or @data.length < 4
|
268
|
+
@errno = Errno::ECONNRESET
|
269
|
+
return -1
|
270
|
+
end
|
271
|
+
if @ptr5 != nil
|
272
|
+
@ptr5.data = (((@data[2])<<8)|(@data[2+1]))
|
273
|
+
end
|
274
|
+
@buf.buffer = @data[4..-1]
|
275
|
+
return @buf.buffer.length
|
276
|
+
end
|
277
|
+
|
278
|
+
|
279
|
+
def EIBGetAPDU_Src_async(buf, src)
|
280
|
+
puts "EIBGetAPDU_Src_async()" if $DEBUG
|
281
|
+
ibuf = [0] * 2;
|
282
|
+
@buf = buf
|
283
|
+
@ptr5 = src
|
284
|
+
@__complete = __EIBGetAPDU_Src_Complete()
|
285
|
+
return 0
|
286
|
+
end
|
287
|
+
|
288
|
+
def EIBGetAPDU_Src(buf, src)
|
289
|
+
puts "EIBGetAPDU_Src()" if $DEBUG
|
290
|
+
if EIBGetAPDU_Src_async(buf, src) == -1
|
291
|
+
return -1
|
292
|
+
end
|
293
|
+
return EIBComplete()
|
294
|
+
end
|
295
|
+
|
296
|
+
def __EIBGetBusmonitorPacket_Complete()
|
297
|
+
puts "__EIBGetBusmonitorPacket_Complete()" if $DEBUG
|
298
|
+
@__complete = nil
|
299
|
+
if __EIB_GetRequest() == -1
|
300
|
+
return -1
|
301
|
+
end
|
302
|
+
if (((@data[0])<<8)|(@data[0+1])) != 20 or @data.length < 2
|
303
|
+
@errno = Errno::ECONNRESET
|
304
|
+
return -1
|
305
|
+
end
|
306
|
+
@buf.buffer = @data[2..-1]
|
307
|
+
return @buf.buffer.length
|
308
|
+
end
|
309
|
+
|
310
|
+
|
311
|
+
def EIBGetBusmonitorPacket_async(buf)
|
312
|
+
puts "EIBGetBusmonitorPacket_async()" if $DEBUG
|
313
|
+
ibuf = [0] * 2;
|
314
|
+
@buf = buf
|
315
|
+
@__complete = __EIBGetBusmonitorPacket_Complete()
|
316
|
+
return 0
|
317
|
+
end
|
318
|
+
|
319
|
+
def EIBGetBusmonitorPacket(buf)
|
320
|
+
puts "EIBGetBusmonitorPacket()" if $DEBUG
|
321
|
+
if EIBGetBusmonitorPacket_async(buf) == -1
|
322
|
+
return -1
|
323
|
+
end
|
324
|
+
return EIBComplete()
|
325
|
+
end
|
326
|
+
|
327
|
+
def __EIBGetGroup_Src_Complete()
|
328
|
+
puts "__EIBGetGroup_Src_Complete()" if $DEBUG
|
329
|
+
@__complete = nil
|
330
|
+
if __EIB_GetRequest() == -1
|
331
|
+
return -1
|
332
|
+
end
|
333
|
+
if (((@data[0])<<8)|(@data[0+1])) != 39 or @data.length < 6
|
334
|
+
@errno = Errno::ECONNRESET
|
335
|
+
return -1
|
336
|
+
end
|
337
|
+
if @ptr5 != nil
|
338
|
+
@ptr5.data = (((@data[2])<<8)|(@data[2+1]))
|
339
|
+
end
|
340
|
+
if @ptr6 != nil
|
341
|
+
@ptr6.data = (((@data[4])<<8)|(@data[4+1]))
|
342
|
+
end
|
343
|
+
@buf.buffer = @data[6..-1]
|
344
|
+
return @buf.buffer.length
|
345
|
+
end
|
346
|
+
|
347
|
+
|
348
|
+
def EIBGetGroup_Src_async(buf, src, dest)
|
349
|
+
puts "EIBGetGroup_Src_async()" if $DEBUG
|
350
|
+
ibuf = [0] * 2;
|
351
|
+
@buf = buf
|
352
|
+
@ptr5 = src
|
353
|
+
@ptr6 = dest
|
354
|
+
@__complete = __EIBGetGroup_Src_Complete()
|
355
|
+
return 0
|
356
|
+
end
|
357
|
+
|
358
|
+
def EIBGetGroup_Src(buf, src, dest)
|
359
|
+
puts "EIBGetGroup_Src()" if $DEBUG
|
360
|
+
if EIBGetGroup_Src_async(buf, src, dest) == -1
|
361
|
+
return -1
|
362
|
+
end
|
363
|
+
return EIBComplete()
|
364
|
+
end
|
365
|
+
|
366
|
+
def __EIBGetTPDU_Complete()
|
367
|
+
puts "__EIBGetTPDU_Complete()" if $DEBUG
|
368
|
+
@__complete = nil
|
369
|
+
if __EIB_GetRequest() == -1
|
370
|
+
return -1
|
371
|
+
end
|
372
|
+
if (((@data[0])<<8)|(@data[0+1])) != 37 or @data.length < 4
|
373
|
+
@errno = Errno::ECONNRESET
|
374
|
+
return -1
|
375
|
+
end
|
376
|
+
if @ptr5 != nil
|
377
|
+
@ptr5.data = (((@data[2])<<8)|(@data[2+1]))
|
378
|
+
end
|
379
|
+
@buf.buffer = @data[4..-1]
|
380
|
+
return @buf.buffer.length
|
381
|
+
end
|
382
|
+
|
383
|
+
|
384
|
+
def EIBGetTPDU_async(buf, src)
|
385
|
+
puts "EIBGetTPDU_async()" if $DEBUG
|
386
|
+
ibuf = [0] * 2;
|
387
|
+
@buf = buf
|
388
|
+
@ptr5 = src
|
389
|
+
@__complete = __EIBGetTPDU_Complete()
|
390
|
+
return 0
|
391
|
+
end
|
392
|
+
|
393
|
+
def EIBGetTPDU(buf, src)
|
394
|
+
puts "EIBGetTPDU()" if $DEBUG
|
395
|
+
if EIBGetTPDU_async(buf, src) == -1
|
396
|
+
return -1
|
397
|
+
end
|
398
|
+
return EIBComplete()
|
399
|
+
end
|
400
|
+
|
401
|
+
def __EIB_Cache_Clear_Complete()
|
402
|
+
puts "__EIB_Cache_Clear_Complete()" if $DEBUG
|
403
|
+
@__complete = nil
|
404
|
+
if __EIB_GetRequest() == -1
|
405
|
+
return -1
|
406
|
+
end
|
407
|
+
if (((@data[0])<<8)|(@data[0+1])) != 114 or @data.length < 2
|
408
|
+
@errno = Errno::ECONNRESET
|
409
|
+
return -1
|
410
|
+
end
|
411
|
+
return 0
|
412
|
+
end
|
413
|
+
|
414
|
+
|
415
|
+
def EIB_Cache_Clear_async()
|
416
|
+
puts "EIB_Cache_Clear_async()" if $DEBUG
|
417
|
+
ibuf = [0] * 2;
|
418
|
+
ibuf[0] = 0
|
419
|
+
ibuf[1] = 114
|
420
|
+
md = caller[0].match(/`(\w*)'/); clr = md and md[1] or caller[0]
|
421
|
+
puts("#{clr} calling __EIB_SendRequest, ibuf=#{ibuf.inspect}") if $DEBUG
|
422
|
+
if __EIB_SendRequest(ibuf) == -1
|
423
|
+
return -1
|
424
|
+
end
|
425
|
+
@__complete = __EIB_Cache_Clear_Complete()
|
426
|
+
return 0
|
427
|
+
end
|
428
|
+
|
429
|
+
def EIB_Cache_Clear()
|
430
|
+
puts "EIB_Cache_Clear()" if $DEBUG
|
431
|
+
if EIB_Cache_Clear_async() == -1
|
432
|
+
return -1
|
433
|
+
end
|
434
|
+
return EIBComplete()
|
435
|
+
end
|
436
|
+
|
437
|
+
def __EIB_Cache_Disable_Complete()
|
438
|
+
puts "__EIB_Cache_Disable_Complete()" if $DEBUG
|
439
|
+
@__complete = nil
|
440
|
+
if __EIB_GetRequest() == -1
|
441
|
+
return -1
|
442
|
+
end
|
443
|
+
if (((@data[0])<<8)|(@data[0+1])) != 113 or @data.length < 2
|
444
|
+
@errno = Errno::ECONNRESET
|
445
|
+
return -1
|
446
|
+
end
|
447
|
+
return 0
|
448
|
+
end
|
449
|
+
|
450
|
+
|
451
|
+
def EIB_Cache_Disable_async()
|
452
|
+
puts "EIB_Cache_Disable_async()" if $DEBUG
|
453
|
+
ibuf = [0] * 2;
|
454
|
+
ibuf[0] = 0
|
455
|
+
ibuf[1] = 113
|
456
|
+
md = caller[0].match(/`(\w*)'/); clr = md and md[1] or caller[0]
|
457
|
+
puts("#{clr} calling __EIB_SendRequest, ibuf=#{ibuf.inspect}") if $DEBUG
|
458
|
+
if __EIB_SendRequest(ibuf) == -1
|
459
|
+
return -1
|
460
|
+
end
|
461
|
+
@__complete = __EIB_Cache_Disable_Complete()
|
462
|
+
return 0
|
463
|
+
end
|
464
|
+
|
465
|
+
def EIB_Cache_Disable()
|
466
|
+
puts "EIB_Cache_Disable()" if $DEBUG
|
467
|
+
if EIB_Cache_Disable_async() == -1
|
468
|
+
return -1
|
469
|
+
end
|
470
|
+
return EIBComplete()
|
471
|
+
end
|
472
|
+
|
473
|
+
def __EIB_Cache_Enable_Complete()
|
474
|
+
puts "__EIB_Cache_Enable_Complete()" if $DEBUG
|
475
|
+
@__complete = nil
|
476
|
+
if __EIB_GetRequest() == -1
|
477
|
+
return -1
|
478
|
+
end
|
479
|
+
if (((@data[0])<<8)|(@data[0+1])) != 1
|
480
|
+
@errno = Errno::EBUSY
|
481
|
+
return -1
|
482
|
+
end
|
483
|
+
if (((@data[0])<<8)|(@data[0+1])) != 112 or @data.length < 2
|
484
|
+
@errno = Errno::ECONNRESET
|
485
|
+
return -1
|
486
|
+
end
|
487
|
+
return 0
|
488
|
+
end
|
489
|
+
|
490
|
+
|
491
|
+
def EIB_Cache_Enable_async()
|
492
|
+
puts "EIB_Cache_Enable_async()" if $DEBUG
|
493
|
+
ibuf = [0] * 2;
|
494
|
+
ibuf[0] = 0
|
495
|
+
ibuf[1] = 112
|
496
|
+
md = caller[0].match(/`(\w*)'/); clr = md and md[1] or caller[0]
|
497
|
+
puts("#{clr} calling __EIB_SendRequest, ibuf=#{ibuf.inspect}") if $DEBUG
|
498
|
+
if __EIB_SendRequest(ibuf) == -1
|
499
|
+
return -1
|
500
|
+
end
|
501
|
+
@__complete = __EIB_Cache_Enable_Complete()
|
502
|
+
return 0
|
503
|
+
end
|
504
|
+
|
505
|
+
def EIB_Cache_Enable()
|
506
|
+
puts "EIB_Cache_Enable()" if $DEBUG
|
507
|
+
if EIB_Cache_Enable_async() == -1
|
508
|
+
return -1
|
509
|
+
end
|
510
|
+
return EIBComplete()
|
511
|
+
end
|
512
|
+
|
513
|
+
def __EIB_Cache_Read_Complete()
|
514
|
+
puts "__EIB_Cache_Read_Complete()" if $DEBUG
|
515
|
+
@__complete = nil
|
516
|
+
if __EIB_GetRequest() == -1
|
517
|
+
return -1
|
518
|
+
end
|
519
|
+
if (((@data[0])<<8)|(@data[0+1])) != 117 or @data.length < 2
|
520
|
+
@errno = Errno::ECONNRESET
|
521
|
+
return -1
|
522
|
+
end
|
523
|
+
if (((@data[4])<<8)|(@data[4+1])) == 0
|
524
|
+
@errno = Errno::ENODEV
|
525
|
+
return -1
|
526
|
+
end
|
527
|
+
if @data.length <= 6
|
528
|
+
@errno = Errno::ENOENT
|
529
|
+
return -1
|
530
|
+
end
|
531
|
+
if @ptr5 != nil
|
532
|
+
@ptr5.data = (((@data[2])<<8)|(@data[2+1]))
|
533
|
+
end
|
534
|
+
@buf.buffer = @data[6..-1]
|
535
|
+
return @buf.buffer.length
|
536
|
+
end
|
537
|
+
|
538
|
+
|
539
|
+
def EIB_Cache_Read_async(dst, src, buf)
|
540
|
+
puts "EIB_Cache_Read_async()" if $DEBUG
|
541
|
+
ibuf = [0] * 4;
|
542
|
+
@buf = buf
|
543
|
+
@ptr5 = src
|
544
|
+
ibuf[2] = ((dst>>8)&0xff)
|
545
|
+
ibuf[3] = ((dst)&0xff)
|
546
|
+
ibuf[0] = 0
|
547
|
+
ibuf[1] = 117
|
548
|
+
md = caller[0].match(/`(\w*)'/); clr = md and md[1] or caller[0]
|
549
|
+
puts("#{clr} calling __EIB_SendRequest, ibuf=#{ibuf.inspect}") if $DEBUG
|
550
|
+
if __EIB_SendRequest(ibuf) == -1
|
551
|
+
return -1
|
552
|
+
end
|
553
|
+
@__complete = __EIB_Cache_Read_Complete()
|
554
|
+
return 0
|
555
|
+
end
|
556
|
+
|
557
|
+
def EIB_Cache_Read(dst, src, buf)
|
558
|
+
puts "EIB_Cache_Read()" if $DEBUG
|
559
|
+
if EIB_Cache_Read_async(dst, src, buf) == -1
|
560
|
+
return -1
|
561
|
+
end
|
562
|
+
return EIBComplete()
|
563
|
+
end
|
564
|
+
|
565
|
+
def __EIB_Cache_Read_Sync_Complete()
|
566
|
+
puts "__EIB_Cache_Read_Sync_Complete()" if $DEBUG
|
567
|
+
@__complete = nil
|
568
|
+
if __EIB_GetRequest() == -1
|
569
|
+
return -1
|
570
|
+
end
|
571
|
+
if (((@data[0])<<8)|(@data[0+1])) != 116 or @data.length < 2
|
572
|
+
@errno = Errno::ECONNRESET
|
573
|
+
return -1
|
574
|
+
end
|
575
|
+
if (((@data[4])<<8)|(@data[4+1])) == 0
|
576
|
+
@errno = Errno::ENODEV
|
577
|
+
return -1
|
578
|
+
end
|
579
|
+
if @data.length <= 6
|
580
|
+
@errno = Errno::ENOENT
|
581
|
+
return -1
|
582
|
+
end
|
583
|
+
if @ptr5 != nil
|
584
|
+
@ptr5.data = (((@data[2])<<8)|(@data[2+1]))
|
585
|
+
end
|
586
|
+
@buf.buffer = @data[6..-1]
|
587
|
+
return @buf.buffer.length
|
588
|
+
end
|
589
|
+
|
590
|
+
|
591
|
+
def EIB_Cache_Read_Sync_async(dst, src, buf, age)
|
592
|
+
puts "EIB_Cache_Read_Sync_async()" if $DEBUG
|
593
|
+
ibuf = [0] * 6;
|
594
|
+
@buf = buf
|
595
|
+
@ptr5 = src
|
596
|
+
ibuf[2] = ((dst>>8)&0xff)
|
597
|
+
ibuf[3] = ((dst)&0xff)
|
598
|
+
ibuf[4] = ((age>>8)&0xff)
|
599
|
+
ibuf[5] = ((age)&0xff)
|
600
|
+
ibuf[0] = 0
|
601
|
+
ibuf[1] = 116
|
602
|
+
md = caller[0].match(/`(\w*)'/); clr = md and md[1] or caller[0]
|
603
|
+
puts("#{clr} calling __EIB_SendRequest, ibuf=#{ibuf.inspect}") if $DEBUG
|
604
|
+
if __EIB_SendRequest(ibuf) == -1
|
605
|
+
return -1
|
606
|
+
end
|
607
|
+
@__complete = __EIB_Cache_Read_Sync_Complete()
|
608
|
+
return 0
|
609
|
+
end
|
610
|
+
|
611
|
+
def EIB_Cache_Read_Sync(dst, src, buf, age)
|
612
|
+
puts "EIB_Cache_Read_Sync()" if $DEBUG
|
613
|
+
if EIB_Cache_Read_Sync_async(dst, src, buf, age) == -1
|
614
|
+
return -1
|
615
|
+
end
|
616
|
+
return EIBComplete()
|
617
|
+
end
|
618
|
+
|
619
|
+
def __EIB_Cache_Remove_Complete()
|
620
|
+
puts "__EIB_Cache_Remove_Complete()" if $DEBUG
|
621
|
+
@__complete = nil
|
622
|
+
if __EIB_GetRequest() == -1
|
623
|
+
return -1
|
624
|
+
end
|
625
|
+
if (((@data[0])<<8)|(@data[0+1])) != 115 or @data.length < 2
|
626
|
+
@errno = Errno::ECONNRESET
|
627
|
+
return -1
|
628
|
+
end
|
629
|
+
return 0
|
630
|
+
end
|
631
|
+
|
632
|
+
|
633
|
+
def EIB_Cache_Remove_async(dest)
|
634
|
+
puts "EIB_Cache_Remove_async()" if $DEBUG
|
635
|
+
ibuf = [0] * 4;
|
636
|
+
ibuf[2] = ((dest>>8)&0xff)
|
637
|
+
ibuf[3] = ((dest)&0xff)
|
638
|
+
ibuf[0] = 0
|
639
|
+
ibuf[1] = 115
|
640
|
+
md = caller[0].match(/`(\w*)'/); clr = md and md[1] or caller[0]
|
641
|
+
puts("#{clr} calling __EIB_SendRequest, ibuf=#{ibuf.inspect}") if $DEBUG
|
642
|
+
if __EIB_SendRequest(ibuf) == -1
|
643
|
+
return -1
|
644
|
+
end
|
645
|
+
@__complete = __EIB_Cache_Remove_Complete()
|
646
|
+
return 0
|
647
|
+
end
|
648
|
+
|
649
|
+
def EIB_Cache_Remove(dest)
|
650
|
+
puts "EIB_Cache_Remove()" if $DEBUG
|
651
|
+
if EIB_Cache_Remove_async(dest) == -1
|
652
|
+
return -1
|
653
|
+
end
|
654
|
+
return EIBComplete()
|
655
|
+
end
|
656
|
+
|
657
|
+
def __EIB_Cache_LastUpdates_Complete()
|
658
|
+
puts "__EIB_Cache_LastUpdates_Complete()" if $DEBUG
|
659
|
+
@__complete = nil
|
660
|
+
if __EIB_GetRequest() == -1
|
661
|
+
return -1
|
662
|
+
end
|
663
|
+
if (((@data[0])<<8)|(@data[0+1])) != 118 or @data.length < 2
|
664
|
+
@errno = Errno::ECONNRESET
|
665
|
+
return -1
|
666
|
+
end
|
667
|
+
if @ptr4 != nil
|
668
|
+
@ptr4.data = (((@data[2])<<8)|(@data[2+1]))
|
669
|
+
end
|
670
|
+
@buf.buffer = @data[4..-1]
|
671
|
+
return @buf.buffer.length
|
672
|
+
end
|
673
|
+
|
674
|
+
|
675
|
+
def EIB_Cache_LastUpdates_async(start, timeout, buf, ende)
|
676
|
+
puts "EIB_Cache_LastUpdates_async()" if $DEBUG
|
677
|
+
ibuf = [0] * 5;
|
678
|
+
@buf = buf
|
679
|
+
@ptr4 = ende
|
680
|
+
ibuf[2] = ((start>>8)&0xff)
|
681
|
+
ibuf[3] = ((start)&0xff)
|
682
|
+
ibuf[4] = ((timeout)&0xff)
|
683
|
+
ibuf[0] = 0
|
684
|
+
ibuf[1] = 118
|
685
|
+
md = caller[0].match(/`(\w*)'/); clr = md and md[1] or caller[0]
|
686
|
+
puts("#{clr} calling __EIB_SendRequest, ibuf=#{ibuf.inspect}") if $DEBUG
|
687
|
+
if __EIB_SendRequest(ibuf) == -1
|
688
|
+
return -1
|
689
|
+
end
|
690
|
+
@__complete = __EIB_Cache_LastUpdates_Complete()
|
691
|
+
return 0
|
692
|
+
end
|
693
|
+
|
694
|
+
def EIB_Cache_LastUpdates(start, timeout, buf, ende)
|
695
|
+
puts "EIB_Cache_LastUpdates()" if $DEBUG
|
696
|
+
if EIB_Cache_LastUpdates_async(start, timeout, buf, ende) == -1
|
697
|
+
return -1
|
698
|
+
end
|
699
|
+
return EIBComplete()
|
700
|
+
end
|
701
|
+
|
702
|
+
def __EIB_LoadImage_Complete()
|
703
|
+
puts "__EIB_LoadImage_Complete()" if $DEBUG
|
704
|
+
@__complete = nil
|
705
|
+
if __EIB_GetRequest() == -1
|
706
|
+
return -1
|
707
|
+
end
|
708
|
+
if (((@data[0])<<8)|(@data[0+1])) != 99 or @data.length < 4
|
709
|
+
@errno = Errno::ECONNRESET
|
710
|
+
return -1
|
711
|
+
end
|
712
|
+
return (((@data[2])<<8)|(@data[2+1]))
|
713
|
+
end
|
714
|
+
|
715
|
+
|
716
|
+
def EIB_LoadImage_async(image)
|
717
|
+
puts "EIB_LoadImage_async()" if $DEBUG
|
718
|
+
ibuf = [0] * 2;
|
719
|
+
if image.length < 0
|
720
|
+
@errno = Errno::EINVAL
|
721
|
+
return -1
|
722
|
+
end
|
723
|
+
@sendlen = image.length
|
724
|
+
ibuf.concat(image)
|
725
|
+
ibuf[0] = 0
|
726
|
+
ibuf[1] = 99
|
727
|
+
md = caller[0].match(/`(\w*)'/); clr = md and md[1] or caller[0]
|
728
|
+
puts("#{clr} calling __EIB_SendRequest, ibuf=#{ibuf.inspect}") if $DEBUG
|
729
|
+
if __EIB_SendRequest(ibuf) == -1
|
730
|
+
return -1
|
731
|
+
end
|
732
|
+
@__complete = __EIB_LoadImage_Complete()
|
733
|
+
return 0
|
734
|
+
end
|
735
|
+
|
736
|
+
def EIB_LoadImage(image)
|
737
|
+
puts "EIB_LoadImage()" if $DEBUG
|
738
|
+
if EIB_LoadImage_async(image) == -1
|
739
|
+
return -1
|
740
|
+
end
|
741
|
+
return EIBComplete()
|
742
|
+
end
|
743
|
+
|
744
|
+
def __EIB_MC_Authorize_Complete()
|
745
|
+
puts "__EIB_MC_Authorize_Complete()" if $DEBUG
|
746
|
+
@__complete = nil
|
747
|
+
if __EIB_GetRequest() == -1
|
748
|
+
return -1
|
749
|
+
end
|
750
|
+
if (((@data[0])<<8)|(@data[0+1])) != 87 or @data.length < 3
|
751
|
+
@errno = Errno::ECONNRESET
|
752
|
+
return -1
|
753
|
+
end
|
754
|
+
return @data[2]
|
755
|
+
end
|
756
|
+
|
757
|
+
|
758
|
+
def EIB_MC_Authorize_async(key)
|
759
|
+
puts "EIB_MC_Authorize_async()" if $DEBUG
|
760
|
+
ibuf = [0] * 6;
|
761
|
+
if key.length != 4
|
762
|
+
@errno = Errno::EINVAL
|
763
|
+
return -1
|
764
|
+
end
|
765
|
+
ibuf[2..6] = key
|
766
|
+
ibuf[0] = 0
|
767
|
+
ibuf[1] = 87
|
768
|
+
md = caller[0].match(/`(\w*)'/); clr = md and md[1] or caller[0]
|
769
|
+
puts("#{clr} calling __EIB_SendRequest, ibuf=#{ibuf.inspect}") if $DEBUG
|
770
|
+
if __EIB_SendRequest(ibuf) == -1
|
771
|
+
return -1
|
772
|
+
end
|
773
|
+
@__complete = __EIB_MC_Authorize_Complete()
|
774
|
+
return 0
|
775
|
+
end
|
776
|
+
|
777
|
+
def EIB_MC_Authorize(key)
|
778
|
+
puts "EIB_MC_Authorize()" if $DEBUG
|
779
|
+
if EIB_MC_Authorize_async(key) == -1
|
780
|
+
return -1
|
781
|
+
end
|
782
|
+
return EIBComplete()
|
783
|
+
end
|
784
|
+
|
785
|
+
def __EIB_MC_Connect_Complete()
|
786
|
+
puts "__EIB_MC_Connect_Complete()" if $DEBUG
|
787
|
+
@__complete = nil
|
788
|
+
if __EIB_GetRequest() == -1
|
789
|
+
return -1
|
790
|
+
end
|
791
|
+
if (((@data[0])<<8)|(@data[0+1])) != 80 or @data.length < 2
|
792
|
+
@errno = Errno::ECONNRESET
|
793
|
+
return -1
|
794
|
+
end
|
795
|
+
return 0
|
796
|
+
end
|
797
|
+
|
798
|
+
|
799
|
+
def EIB_MC_Connect_async(dest)
|
800
|
+
puts "EIB_MC_Connect_async()" if $DEBUG
|
801
|
+
ibuf = [0] * 4;
|
802
|
+
ibuf[2] = ((dest>>8)&0xff)
|
803
|
+
ibuf[3] = ((dest)&0xff)
|
804
|
+
ibuf[0] = 0
|
805
|
+
ibuf[1] = 80
|
806
|
+
md = caller[0].match(/`(\w*)'/); clr = md and md[1] or caller[0]
|
807
|
+
puts("#{clr} calling __EIB_SendRequest, ibuf=#{ibuf.inspect}") if $DEBUG
|
808
|
+
if __EIB_SendRequest(ibuf) == -1
|
809
|
+
return -1
|
810
|
+
end
|
811
|
+
@__complete = __EIB_MC_Connect_Complete()
|
812
|
+
return 0
|
813
|
+
end
|
814
|
+
|
815
|
+
def EIB_MC_Connect(dest)
|
816
|
+
puts "EIB_MC_Connect()" if $DEBUG
|
817
|
+
if EIB_MC_Connect_async(dest) == -1
|
818
|
+
return -1
|
819
|
+
end
|
820
|
+
return EIBComplete()
|
821
|
+
end
|
822
|
+
|
823
|
+
def __EIB_MC_Individual_Open_Complete()
|
824
|
+
puts "__EIB_MC_Individual_Open_Complete()" if $DEBUG
|
825
|
+
@__complete = nil
|
826
|
+
if __EIB_GetRequest() == -1
|
827
|
+
return -1
|
828
|
+
end
|
829
|
+
if (((@data[0])<<8)|(@data[0+1])) != 73 or @data.length < 2
|
830
|
+
@errno = Errno::ECONNRESET
|
831
|
+
return -1
|
832
|
+
end
|
833
|
+
return 0
|
834
|
+
end
|
835
|
+
|
836
|
+
|
837
|
+
def EIB_MC_Individual_Open_async(dest)
|
838
|
+
puts "EIB_MC_Individual_Open_async()" if $DEBUG
|
839
|
+
ibuf = [0] * 4;
|
840
|
+
ibuf[2] = ((dest>>8)&0xff)
|
841
|
+
ibuf[3] = ((dest)&0xff)
|
842
|
+
ibuf[0] = 0
|
843
|
+
ibuf[1] = 73
|
844
|
+
md = caller[0].match(/`(\w*)'/); clr = md and md[1] or caller[0]
|
845
|
+
puts("#{clr} calling __EIB_SendRequest, ibuf=#{ibuf.inspect}") if $DEBUG
|
846
|
+
if __EIB_SendRequest(ibuf) == -1
|
847
|
+
return -1
|
848
|
+
end
|
849
|
+
@__complete = __EIB_MC_Individual_Open_Complete()
|
850
|
+
return 0
|
851
|
+
end
|
852
|
+
|
853
|
+
def EIB_MC_Individual_Open(dest)
|
854
|
+
puts "EIB_MC_Individual_Open()" if $DEBUG
|
855
|
+
if EIB_MC_Individual_Open_async(dest) == -1
|
856
|
+
return -1
|
857
|
+
end
|
858
|
+
return EIBComplete()
|
859
|
+
end
|
860
|
+
|
861
|
+
def __EIB_MC_GetMaskVersion_Complete()
|
862
|
+
puts "__EIB_MC_GetMaskVersion_Complete()" if $DEBUG
|
863
|
+
@__complete = nil
|
864
|
+
if __EIB_GetRequest() == -1
|
865
|
+
return -1
|
866
|
+
end
|
867
|
+
if (((@data[0])<<8)|(@data[0+1])) != 89 or @data.length < 4
|
868
|
+
@errno = Errno::ECONNRESET
|
869
|
+
return -1
|
870
|
+
end
|
871
|
+
return (((@data[2])<<8)|(@data[2+1]))
|
872
|
+
end
|
873
|
+
|
874
|
+
|
875
|
+
def EIB_MC_GetMaskVersion_async()
|
876
|
+
puts "EIB_MC_GetMaskVersion_async()" if $DEBUG
|
877
|
+
ibuf = [0] * 2;
|
878
|
+
ibuf[0] = 0
|
879
|
+
ibuf[1] = 89
|
880
|
+
md = caller[0].match(/`(\w*)'/); clr = md and md[1] or caller[0]
|
881
|
+
puts("#{clr} calling __EIB_SendRequest, ibuf=#{ibuf.inspect}") if $DEBUG
|
882
|
+
if __EIB_SendRequest(ibuf) == -1
|
883
|
+
return -1
|
884
|
+
end
|
885
|
+
@__complete = __EIB_MC_GetMaskVersion_Complete()
|
886
|
+
return 0
|
887
|
+
end
|
888
|
+
|
889
|
+
def EIB_MC_GetMaskVersion()
|
890
|
+
puts "EIB_MC_GetMaskVersion()" if $DEBUG
|
891
|
+
if EIB_MC_GetMaskVersion_async() == -1
|
892
|
+
return -1
|
893
|
+
end
|
894
|
+
return EIBComplete()
|
895
|
+
end
|
896
|
+
|
897
|
+
def __EIB_MC_GetPEIType_Complete()
|
898
|
+
puts "__EIB_MC_GetPEIType_Complete()" if $DEBUG
|
899
|
+
@__complete = nil
|
900
|
+
if __EIB_GetRequest() == -1
|
901
|
+
return -1
|
902
|
+
end
|
903
|
+
if (((@data[0])<<8)|(@data[0+1])) != 85 or @data.length < 4
|
904
|
+
@errno = Errno::ECONNRESET
|
905
|
+
return -1
|
906
|
+
end
|
907
|
+
return (((@data[2])<<8)|(@data[2+1]))
|
908
|
+
end
|
909
|
+
|
910
|
+
|
911
|
+
def EIB_MC_GetPEIType_async()
|
912
|
+
puts "EIB_MC_GetPEIType_async()" if $DEBUG
|
913
|
+
ibuf = [0] * 2;
|
914
|
+
ibuf[0] = 0
|
915
|
+
ibuf[1] = 85
|
916
|
+
md = caller[0].match(/`(\w*)'/); clr = md and md[1] or caller[0]
|
917
|
+
puts("#{clr} calling __EIB_SendRequest, ibuf=#{ibuf.inspect}") if $DEBUG
|
918
|
+
if __EIB_SendRequest(ibuf) == -1
|
919
|
+
return -1
|
920
|
+
end
|
921
|
+
@__complete = __EIB_MC_GetPEIType_Complete()
|
922
|
+
return 0
|
923
|
+
end
|
924
|
+
|
925
|
+
def EIB_MC_GetPEIType()
|
926
|
+
puts "EIB_MC_GetPEIType()" if $DEBUG
|
927
|
+
if EIB_MC_GetPEIType_async() == -1
|
928
|
+
return -1
|
929
|
+
end
|
930
|
+
return EIBComplete()
|
931
|
+
end
|
932
|
+
|
933
|
+
def __EIB_MC_Progmode_Off_Complete()
|
934
|
+
puts "__EIB_MC_Progmode_Off_Complete()" if $DEBUG
|
935
|
+
@__complete = nil
|
936
|
+
if __EIB_GetRequest() == -1
|
937
|
+
return -1
|
938
|
+
end
|
939
|
+
if (((@data[0])<<8)|(@data[0+1])) != 96 or @data.length < 2
|
940
|
+
@errno = Errno::ECONNRESET
|
941
|
+
return -1
|
942
|
+
end
|
943
|
+
return 0
|
944
|
+
end
|
945
|
+
|
946
|
+
|
947
|
+
def EIB_MC_Progmode_Off_async()
|
948
|
+
puts "EIB_MC_Progmode_Off_async()" if $DEBUG
|
949
|
+
ibuf = [0] * 3;
|
950
|
+
ibuf[2] = ((0)&0xff)
|
951
|
+
ibuf[0] = 0
|
952
|
+
ibuf[1] = 96
|
953
|
+
md = caller[0].match(/`(\w*)'/); clr = md and md[1] or caller[0]
|
954
|
+
puts("#{clr} calling __EIB_SendRequest, ibuf=#{ibuf.inspect}") if $DEBUG
|
955
|
+
if __EIB_SendRequest(ibuf) == -1
|
956
|
+
return -1
|
957
|
+
end
|
958
|
+
@__complete = __EIB_MC_Progmode_Off_Complete()
|
959
|
+
return 0
|
960
|
+
end
|
961
|
+
|
962
|
+
def EIB_MC_Progmode_Off()
|
963
|
+
puts "EIB_MC_Progmode_Off()" if $DEBUG
|
964
|
+
if EIB_MC_Progmode_Off_async() == -1
|
965
|
+
return -1
|
966
|
+
end
|
967
|
+
return EIBComplete()
|
968
|
+
end
|
969
|
+
|
970
|
+
def __EIB_MC_Progmode_On_Complete()
|
971
|
+
puts "__EIB_MC_Progmode_On_Complete()" if $DEBUG
|
972
|
+
@__complete = nil
|
973
|
+
if __EIB_GetRequest() == -1
|
974
|
+
return -1
|
975
|
+
end
|
976
|
+
if (((@data[0])<<8)|(@data[0+1])) != 96 or @data.length < 2
|
977
|
+
@errno = Errno::ECONNRESET
|
978
|
+
return -1
|
979
|
+
end
|
980
|
+
return 0
|
981
|
+
end
|
982
|
+
|
983
|
+
|
984
|
+
def EIB_MC_Progmode_On_async()
|
985
|
+
puts "EIB_MC_Progmode_On_async()" if $DEBUG
|
986
|
+
ibuf = [0] * 3;
|
987
|
+
ibuf[2] = ((1)&0xff)
|
988
|
+
ibuf[0] = 0
|
989
|
+
ibuf[1] = 96
|
990
|
+
md = caller[0].match(/`(\w*)'/); clr = md and md[1] or caller[0]
|
991
|
+
puts("#{clr} calling __EIB_SendRequest, ibuf=#{ibuf.inspect}") if $DEBUG
|
992
|
+
if __EIB_SendRequest(ibuf) == -1
|
993
|
+
return -1
|
994
|
+
end
|
995
|
+
@__complete = __EIB_MC_Progmode_On_Complete()
|
996
|
+
return 0
|
997
|
+
end
|
998
|
+
|
999
|
+
def EIB_MC_Progmode_On()
|
1000
|
+
puts "EIB_MC_Progmode_On()" if $DEBUG
|
1001
|
+
if EIB_MC_Progmode_On_async() == -1
|
1002
|
+
return -1
|
1003
|
+
end
|
1004
|
+
return EIBComplete()
|
1005
|
+
end
|
1006
|
+
|
1007
|
+
def __EIB_MC_Progmode_Status_Complete()
|
1008
|
+
puts "__EIB_MC_Progmode_Status_Complete()" if $DEBUG
|
1009
|
+
@__complete = nil
|
1010
|
+
if __EIB_GetRequest() == -1
|
1011
|
+
return -1
|
1012
|
+
end
|
1013
|
+
if (((@data[0])<<8)|(@data[0+1])) != 96 or @data.length < 3
|
1014
|
+
@errno = Errno::ECONNRESET
|
1015
|
+
return -1
|
1016
|
+
end
|
1017
|
+
return @data[2]
|
1018
|
+
end
|
1019
|
+
|
1020
|
+
|
1021
|
+
def EIB_MC_Progmode_Status_async()
|
1022
|
+
puts "EIB_MC_Progmode_Status_async()" if $DEBUG
|
1023
|
+
ibuf = [0] * 3;
|
1024
|
+
ibuf[2] = ((3)&0xff)
|
1025
|
+
ibuf[0] = 0
|
1026
|
+
ibuf[1] = 96
|
1027
|
+
md = caller[0].match(/`(\w*)'/); clr = md and md[1] or caller[0]
|
1028
|
+
puts("#{clr} calling __EIB_SendRequest, ibuf=#{ibuf.inspect}") if $DEBUG
|
1029
|
+
if __EIB_SendRequest(ibuf) == -1
|
1030
|
+
return -1
|
1031
|
+
end
|
1032
|
+
@__complete = __EIB_MC_Progmode_Status_Complete()
|
1033
|
+
return 0
|
1034
|
+
end
|
1035
|
+
|
1036
|
+
def EIB_MC_Progmode_Status()
|
1037
|
+
puts "EIB_MC_Progmode_Status()" if $DEBUG
|
1038
|
+
if EIB_MC_Progmode_Status_async() == -1
|
1039
|
+
return -1
|
1040
|
+
end
|
1041
|
+
return EIBComplete()
|
1042
|
+
end
|
1043
|
+
|
1044
|
+
def __EIB_MC_Progmode_Toggle_Complete()
|
1045
|
+
puts "__EIB_MC_Progmode_Toggle_Complete()" if $DEBUG
|
1046
|
+
@__complete = nil
|
1047
|
+
if __EIB_GetRequest() == -1
|
1048
|
+
return -1
|
1049
|
+
end
|
1050
|
+
if (((@data[0])<<8)|(@data[0+1])) != 96 or @data.length < 2
|
1051
|
+
@errno = Errno::ECONNRESET
|
1052
|
+
return -1
|
1053
|
+
end
|
1054
|
+
return 0
|
1055
|
+
end
|
1056
|
+
|
1057
|
+
|
1058
|
+
def EIB_MC_Progmode_Toggle_async()
|
1059
|
+
puts "EIB_MC_Progmode_Toggle_async()" if $DEBUG
|
1060
|
+
ibuf = [0] * 3;
|
1061
|
+
ibuf[2] = ((2)&0xff)
|
1062
|
+
ibuf[0] = 0
|
1063
|
+
ibuf[1] = 96
|
1064
|
+
md = caller[0].match(/`(\w*)'/); clr = md and md[1] or caller[0]
|
1065
|
+
puts("#{clr} calling __EIB_SendRequest, ibuf=#{ibuf.inspect}") if $DEBUG
|
1066
|
+
if __EIB_SendRequest(ibuf) == -1
|
1067
|
+
return -1
|
1068
|
+
end
|
1069
|
+
@__complete = __EIB_MC_Progmode_Toggle_Complete()
|
1070
|
+
return 0
|
1071
|
+
end
|
1072
|
+
|
1073
|
+
def EIB_MC_Progmode_Toggle()
|
1074
|
+
puts "EIB_MC_Progmode_Toggle()" if $DEBUG
|
1075
|
+
if EIB_MC_Progmode_Toggle_async() == -1
|
1076
|
+
return -1
|
1077
|
+
end
|
1078
|
+
return EIBComplete()
|
1079
|
+
end
|
1080
|
+
|
1081
|
+
def __EIB_MC_PropertyDesc_Complete()
|
1082
|
+
puts "__EIB_MC_PropertyDesc_Complete()" if $DEBUG
|
1083
|
+
@__complete = nil
|
1084
|
+
if __EIB_GetRequest() == -1
|
1085
|
+
return -1
|
1086
|
+
end
|
1087
|
+
if (((@data[0])<<8)|(@data[0+1])) != 97 or @data.length < 6
|
1088
|
+
@errno = Errno::ECONNRESET
|
1089
|
+
return -1
|
1090
|
+
end
|
1091
|
+
if @ptr2 != nil
|
1092
|
+
@ptr2.data = @data[2]
|
1093
|
+
end
|
1094
|
+
if @ptr4 != nil
|
1095
|
+
@ptr4.data = (((@data[3])<<8)|(@data[3+1]))
|
1096
|
+
end
|
1097
|
+
if @ptr3 != nil
|
1098
|
+
@ptr3.data = @data[5]
|
1099
|
+
end
|
1100
|
+
return 0
|
1101
|
+
end
|
1102
|
+
|
1103
|
+
|
1104
|
+
def EIB_MC_PropertyDesc_async(obj, propertyno, proptype, max_nr_of_elem, access)
|
1105
|
+
puts "EIB_MC_PropertyDesc_async()" if $DEBUG
|
1106
|
+
ibuf = [0] * 4;
|
1107
|
+
@ptr2 = proptype
|
1108
|
+
@ptr4 = max_nr_of_elem
|
1109
|
+
@ptr3 = access
|
1110
|
+
ibuf[2] = ((obj)&0xff)
|
1111
|
+
ibuf[3] = ((propertyno)&0xff)
|
1112
|
+
ibuf[0] = 0
|
1113
|
+
ibuf[1] = 97
|
1114
|
+
md = caller[0].match(/`(\w*)'/); clr = md and md[1] or caller[0]
|
1115
|
+
puts("#{clr} calling __EIB_SendRequest, ibuf=#{ibuf.inspect}") if $DEBUG
|
1116
|
+
if __EIB_SendRequest(ibuf) == -1
|
1117
|
+
return -1
|
1118
|
+
end
|
1119
|
+
@__complete = __EIB_MC_PropertyDesc_Complete()
|
1120
|
+
return 0
|
1121
|
+
end
|
1122
|
+
|
1123
|
+
def EIB_MC_PropertyDesc(obj, propertyno, proptype, max_nr_of_elem, access)
|
1124
|
+
puts "EIB_MC_PropertyDesc()" if $DEBUG
|
1125
|
+
if EIB_MC_PropertyDesc_async(obj, propertyno, proptype, max_nr_of_elem, access) == -1
|
1126
|
+
return -1
|
1127
|
+
end
|
1128
|
+
return EIBComplete()
|
1129
|
+
end
|
1130
|
+
|
1131
|
+
def __EIB_MC_PropertyRead_Complete()
|
1132
|
+
puts "__EIB_MC_PropertyRead_Complete()" if $DEBUG
|
1133
|
+
@__complete = nil
|
1134
|
+
if __EIB_GetRequest() == -1
|
1135
|
+
return -1
|
1136
|
+
end
|
1137
|
+
if (((@data[0])<<8)|(@data[0+1])) != 83 or @data.length < 2
|
1138
|
+
@errno = Errno::ECONNRESET
|
1139
|
+
return -1
|
1140
|
+
end
|
1141
|
+
@buf.buffer = @data[2..-1]
|
1142
|
+
return @buf.buffer.length
|
1143
|
+
end
|
1144
|
+
|
1145
|
+
|
1146
|
+
def EIB_MC_PropertyRead_async(obj, propertyno, start, nr_of_elem, buf)
|
1147
|
+
puts "EIB_MC_PropertyRead_async()" if $DEBUG
|
1148
|
+
ibuf = [0] * 7;
|
1149
|
+
@buf = buf
|
1150
|
+
ibuf[2] = ((obj)&0xff)
|
1151
|
+
ibuf[3] = ((propertyno)&0xff)
|
1152
|
+
ibuf[4] = ((start>>8)&0xff)
|
1153
|
+
ibuf[5] = ((start)&0xff)
|
1154
|
+
ibuf[6] = ((nr_of_elem)&0xff)
|
1155
|
+
ibuf[0] = 0
|
1156
|
+
ibuf[1] = 83
|
1157
|
+
md = caller[0].match(/`(\w*)'/); clr = md and md[1] or caller[0]
|
1158
|
+
puts("#{clr} calling __EIB_SendRequest, ibuf=#{ibuf.inspect}") if $DEBUG
|
1159
|
+
if __EIB_SendRequest(ibuf) == -1
|
1160
|
+
return -1
|
1161
|
+
end
|
1162
|
+
@__complete = __EIB_MC_PropertyRead_Complete()
|
1163
|
+
return 0
|
1164
|
+
end
|
1165
|
+
|
1166
|
+
def EIB_MC_PropertyRead(obj, propertyno, start, nr_of_elem, buf)
|
1167
|
+
puts "EIB_MC_PropertyRead()" if $DEBUG
|
1168
|
+
if EIB_MC_PropertyRead_async(obj, propertyno, start, nr_of_elem, buf) == -1
|
1169
|
+
return -1
|
1170
|
+
end
|
1171
|
+
return EIBComplete()
|
1172
|
+
end
|
1173
|
+
|
1174
|
+
def __EIB_MC_PropertyScan_Complete()
|
1175
|
+
puts "__EIB_MC_PropertyScan_Complete()" if $DEBUG
|
1176
|
+
@__complete = nil
|
1177
|
+
if __EIB_GetRequest() == -1
|
1178
|
+
return -1
|
1179
|
+
end
|
1180
|
+
if (((@data[0])<<8)|(@data[0+1])) != 98 or @data.length < 2
|
1181
|
+
@errno = Errno::ECONNRESET
|
1182
|
+
return -1
|
1183
|
+
end
|
1184
|
+
@buf.buffer = @data[2..-1]
|
1185
|
+
return @buf.buffer.length
|
1186
|
+
end
|
1187
|
+
|
1188
|
+
|
1189
|
+
def EIB_MC_PropertyScan_async(buf)
|
1190
|
+
puts "EIB_MC_PropertyScan_async()" if $DEBUG
|
1191
|
+
ibuf = [0] * 2;
|
1192
|
+
@buf = buf
|
1193
|
+
ibuf[0] = 0
|
1194
|
+
ibuf[1] = 98
|
1195
|
+
md = caller[0].match(/`(\w*)'/); clr = md and md[1] or caller[0]
|
1196
|
+
puts("#{clr} calling __EIB_SendRequest, ibuf=#{ibuf.inspect}") if $DEBUG
|
1197
|
+
if __EIB_SendRequest(ibuf) == -1
|
1198
|
+
return -1
|
1199
|
+
end
|
1200
|
+
@__complete = __EIB_MC_PropertyScan_Complete()
|
1201
|
+
return 0
|
1202
|
+
end
|
1203
|
+
|
1204
|
+
def EIB_MC_PropertyScan(buf)
|
1205
|
+
puts "EIB_MC_PropertyScan()" if $DEBUG
|
1206
|
+
if EIB_MC_PropertyScan_async(buf) == -1
|
1207
|
+
return -1
|
1208
|
+
end
|
1209
|
+
return EIBComplete()
|
1210
|
+
end
|
1211
|
+
|
1212
|
+
def __EIB_MC_PropertyWrite_Complete()
|
1213
|
+
puts "__EIB_MC_PropertyWrite_Complete()" if $DEBUG
|
1214
|
+
@__complete = nil
|
1215
|
+
if __EIB_GetRequest() == -1
|
1216
|
+
return -1
|
1217
|
+
end
|
1218
|
+
if (((@data[0])<<8)|(@data[0+1])) != 84 or @data.length < 2
|
1219
|
+
@errno = Errno::ECONNRESET
|
1220
|
+
return -1
|
1221
|
+
end
|
1222
|
+
@buf.buffer = @data[2..-1]
|
1223
|
+
return @buf.buffer.length
|
1224
|
+
end
|
1225
|
+
|
1226
|
+
|
1227
|
+
def EIB_MC_PropertyWrite_async(obj, propertyno, start, nr_of_elem, buf, res)
|
1228
|
+
puts "EIB_MC_PropertyWrite_async()" if $DEBUG
|
1229
|
+
ibuf = [0] * 7;
|
1230
|
+
ibuf[2] = ((obj)&0xff)
|
1231
|
+
ibuf[3] = ((propertyno)&0xff)
|
1232
|
+
ibuf[4] = ((start>>8)&0xff)
|
1233
|
+
ibuf[5] = ((start)&0xff)
|
1234
|
+
ibuf[6] = ((nr_of_elem)&0xff)
|
1235
|
+
if buf.length < 0
|
1236
|
+
@errno = Errno::EINVAL
|
1237
|
+
return -1
|
1238
|
+
end
|
1239
|
+
@sendlen = buf.length
|
1240
|
+
ibuf.concat(buf)
|
1241
|
+
@buf = res
|
1242
|
+
ibuf[0] = 0
|
1243
|
+
ibuf[1] = 84
|
1244
|
+
md = caller[0].match(/`(\w*)'/); clr = md and md[1] or caller[0]
|
1245
|
+
puts("#{clr} calling __EIB_SendRequest, ibuf=#{ibuf.inspect}") if $DEBUG
|
1246
|
+
if __EIB_SendRequest(ibuf) == -1
|
1247
|
+
return -1
|
1248
|
+
end
|
1249
|
+
@__complete = __EIB_MC_PropertyWrite_Complete()
|
1250
|
+
return 0
|
1251
|
+
end
|
1252
|
+
|
1253
|
+
def EIB_MC_PropertyWrite(obj, propertyno, start, nr_of_elem, buf, res)
|
1254
|
+
puts "EIB_MC_PropertyWrite()" if $DEBUG
|
1255
|
+
if EIB_MC_PropertyWrite_async(obj, propertyno, start, nr_of_elem, buf, res) == -1
|
1256
|
+
return -1
|
1257
|
+
end
|
1258
|
+
return EIBComplete()
|
1259
|
+
end
|
1260
|
+
|
1261
|
+
def __EIB_MC_ReadADC_Complete()
|
1262
|
+
puts "__EIB_MC_ReadADC_Complete()" if $DEBUG
|
1263
|
+
@__complete = nil
|
1264
|
+
if __EIB_GetRequest() == -1
|
1265
|
+
return -1
|
1266
|
+
end
|
1267
|
+
if (((@data[0])<<8)|(@data[0+1])) != 86 or @data.length < 4
|
1268
|
+
@errno = Errno::ECONNRESET
|
1269
|
+
return -1
|
1270
|
+
end
|
1271
|
+
if @ptr1 != nil
|
1272
|
+
@ptr1.data = (((@data[2])<<8)|(@data[2+1]))
|
1273
|
+
end
|
1274
|
+
return 0
|
1275
|
+
end
|
1276
|
+
|
1277
|
+
|
1278
|
+
def EIB_MC_ReadADC_async(channel, count, val)
|
1279
|
+
puts "EIB_MC_ReadADC_async()" if $DEBUG
|
1280
|
+
ibuf = [0] * 4;
|
1281
|
+
@ptr1 = val
|
1282
|
+
ibuf[2] = ((channel)&0xff)
|
1283
|
+
ibuf[3] = ((count)&0xff)
|
1284
|
+
ibuf[0] = 0
|
1285
|
+
ibuf[1] = 86
|
1286
|
+
md = caller[0].match(/`(\w*)'/); clr = md and md[1] or caller[0]
|
1287
|
+
puts("#{clr} calling __EIB_SendRequest, ibuf=#{ibuf.inspect}") if $DEBUG
|
1288
|
+
if __EIB_SendRequest(ibuf) == -1
|
1289
|
+
return -1
|
1290
|
+
end
|
1291
|
+
@__complete = __EIB_MC_ReadADC_Complete()
|
1292
|
+
return 0
|
1293
|
+
end
|
1294
|
+
|
1295
|
+
def EIB_MC_ReadADC(channel, count, val)
|
1296
|
+
puts "EIB_MC_ReadADC()" if $DEBUG
|
1297
|
+
if EIB_MC_ReadADC_async(channel, count, val) == -1
|
1298
|
+
return -1
|
1299
|
+
end
|
1300
|
+
return EIBComplete()
|
1301
|
+
end
|
1302
|
+
|
1303
|
+
def __EIB_MC_Read_Complete()
|
1304
|
+
puts "__EIB_MC_Read_Complete()" if $DEBUG
|
1305
|
+
@__complete = nil
|
1306
|
+
if __EIB_GetRequest() == -1
|
1307
|
+
return -1
|
1308
|
+
end
|
1309
|
+
if (((@data[0])<<8)|(@data[0+1])) != 81 or @data.length < 2
|
1310
|
+
@errno = Errno::ECONNRESET
|
1311
|
+
return -1
|
1312
|
+
end
|
1313
|
+
@buf.buffer = @data[2..-1]
|
1314
|
+
return @buf.buffer.length
|
1315
|
+
end
|
1316
|
+
|
1317
|
+
|
1318
|
+
def EIB_MC_Read_async(addr, buf_len, buf)
|
1319
|
+
puts "EIB_MC_Read_async()" if $DEBUG
|
1320
|
+
ibuf = [0] * 6;
|
1321
|
+
@buf = buf
|
1322
|
+
ibuf[2] = ((addr>>8)&0xff)
|
1323
|
+
ibuf[3] = ((addr)&0xff)
|
1324
|
+
ibuf[4] = ((buf_len>>8)&0xff)
|
1325
|
+
ibuf[5] = ((buf_len)&0xff)
|
1326
|
+
ibuf[0] = 0
|
1327
|
+
ibuf[1] = 81
|
1328
|
+
md = caller[0].match(/`(\w*)'/); clr = md and md[1] or caller[0]
|
1329
|
+
puts("#{clr} calling __EIB_SendRequest, ibuf=#{ibuf.inspect}") if $DEBUG
|
1330
|
+
if __EIB_SendRequest(ibuf) == -1
|
1331
|
+
return -1
|
1332
|
+
end
|
1333
|
+
@__complete = __EIB_MC_Read_Complete()
|
1334
|
+
return 0
|
1335
|
+
end
|
1336
|
+
|
1337
|
+
def EIB_MC_Read(addr, buf_len, buf)
|
1338
|
+
puts "EIB_MC_Read()" if $DEBUG
|
1339
|
+
if EIB_MC_Read_async(addr, buf_len, buf) == -1
|
1340
|
+
return -1
|
1341
|
+
end
|
1342
|
+
return EIBComplete()
|
1343
|
+
end
|
1344
|
+
|
1345
|
+
def __EIB_MC_Restart_Complete()
|
1346
|
+
puts "__EIB_MC_Restart_Complete()" if $DEBUG
|
1347
|
+
@__complete = nil
|
1348
|
+
if __EIB_GetRequest() == -1
|
1349
|
+
return -1
|
1350
|
+
end
|
1351
|
+
if (((@data[0])<<8)|(@data[0+1])) != 90 or @data.length < 2
|
1352
|
+
@errno = Errno::ECONNRESET
|
1353
|
+
return -1
|
1354
|
+
end
|
1355
|
+
return 0
|
1356
|
+
end
|
1357
|
+
|
1358
|
+
|
1359
|
+
def EIB_MC_Restart_async()
|
1360
|
+
puts "EIB_MC_Restart_async()" if $DEBUG
|
1361
|
+
ibuf = [0] * 2;
|
1362
|
+
ibuf[0] = 0
|
1363
|
+
ibuf[1] = 90
|
1364
|
+
md = caller[0].match(/`(\w*)'/); clr = md and md[1] or caller[0]
|
1365
|
+
puts("#{clr} calling __EIB_SendRequest, ibuf=#{ibuf.inspect}") if $DEBUG
|
1366
|
+
if __EIB_SendRequest(ibuf) == -1
|
1367
|
+
return -1
|
1368
|
+
end
|
1369
|
+
@__complete = __EIB_MC_Restart_Complete()
|
1370
|
+
return 0
|
1371
|
+
end
|
1372
|
+
|
1373
|
+
def EIB_MC_Restart()
|
1374
|
+
puts "EIB_MC_Restart()" if $DEBUG
|
1375
|
+
if EIB_MC_Restart_async() == -1
|
1376
|
+
return -1
|
1377
|
+
end
|
1378
|
+
return EIBComplete()
|
1379
|
+
end
|
1380
|
+
|
1381
|
+
def __EIB_MC_SetKey_Complete()
|
1382
|
+
puts "__EIB_MC_SetKey_Complete()" if $DEBUG
|
1383
|
+
@__complete = nil
|
1384
|
+
if __EIB_GetRequest() == -1
|
1385
|
+
return -1
|
1386
|
+
end
|
1387
|
+
if (((@data[0])<<8)|(@data[0+1])) != 2
|
1388
|
+
@errno = Errno::EPERM
|
1389
|
+
return -1
|
1390
|
+
end
|
1391
|
+
if (((@data[0])<<8)|(@data[0+1])) != 88 or @data.length < 2
|
1392
|
+
@errno = Errno::ECONNRESET
|
1393
|
+
return -1
|
1394
|
+
end
|
1395
|
+
return 0
|
1396
|
+
end
|
1397
|
+
|
1398
|
+
|
1399
|
+
def EIB_MC_SetKey_async(key, level)
|
1400
|
+
puts "EIB_MC_SetKey_async()" if $DEBUG
|
1401
|
+
ibuf = [0] * 7;
|
1402
|
+
if key.length != 4
|
1403
|
+
@errno = Errno::EINVAL
|
1404
|
+
return -1
|
1405
|
+
end
|
1406
|
+
ibuf[2..6] = key
|
1407
|
+
ibuf[6] = ((level)&0xff)
|
1408
|
+
ibuf[0] = 0
|
1409
|
+
ibuf[1] = 88
|
1410
|
+
md = caller[0].match(/`(\w*)'/); clr = md and md[1] or caller[0]
|
1411
|
+
puts("#{clr} calling __EIB_SendRequest, ibuf=#{ibuf.inspect}") if $DEBUG
|
1412
|
+
if __EIB_SendRequest(ibuf) == -1
|
1413
|
+
return -1
|
1414
|
+
end
|
1415
|
+
@__complete = __EIB_MC_SetKey_Complete()
|
1416
|
+
return 0
|
1417
|
+
end
|
1418
|
+
|
1419
|
+
def EIB_MC_SetKey(key, level)
|
1420
|
+
puts "EIB_MC_SetKey()" if $DEBUG
|
1421
|
+
if EIB_MC_SetKey_async(key, level) == -1
|
1422
|
+
return -1
|
1423
|
+
end
|
1424
|
+
return EIBComplete()
|
1425
|
+
end
|
1426
|
+
|
1427
|
+
def __EIB_MC_Write_Complete()
|
1428
|
+
puts "__EIB_MC_Write_Complete()" if $DEBUG
|
1429
|
+
@__complete = nil
|
1430
|
+
if __EIB_GetRequest() == -1
|
1431
|
+
return -1
|
1432
|
+
end
|
1433
|
+
if (((@data[0])<<8)|(@data[0+1])) != 68
|
1434
|
+
@errno = Errno::EIO
|
1435
|
+
return -1
|
1436
|
+
end
|
1437
|
+
if (((@data[0])<<8)|(@data[0+1])) != 82 or @data.length < 2
|
1438
|
+
@errno = Errno::ECONNRESET
|
1439
|
+
return -1
|
1440
|
+
end
|
1441
|
+
return @sendlen
|
1442
|
+
end
|
1443
|
+
|
1444
|
+
|
1445
|
+
def EIB_MC_Write_async(addr, buf)
|
1446
|
+
puts "EIB_MC_Write_async()" if $DEBUG
|
1447
|
+
ibuf = [0] * 6;
|
1448
|
+
ibuf[2] = ((addr>>8)&0xff)
|
1449
|
+
ibuf[3] = ((addr)&0xff)
|
1450
|
+
ibuf[4] = (((buf.length)>>8)&0xff)
|
1451
|
+
ibuf[5] = (((buf.length))&0xff)
|
1452
|
+
if buf.length < 0
|
1453
|
+
@errno = Errno::EINVAL
|
1454
|
+
return -1
|
1455
|
+
end
|
1456
|
+
@sendlen = buf.length
|
1457
|
+
ibuf.concat(buf)
|
1458
|
+
ibuf[0] = 0
|
1459
|
+
ibuf[1] = 82
|
1460
|
+
md = caller[0].match(/`(\w*)'/); clr = md and md[1] or caller[0]
|
1461
|
+
puts("#{clr} calling __EIB_SendRequest, ibuf=#{ibuf.inspect}") if $DEBUG
|
1462
|
+
if __EIB_SendRequest(ibuf) == -1
|
1463
|
+
return -1
|
1464
|
+
end
|
1465
|
+
@__complete = __EIB_MC_Write_Complete()
|
1466
|
+
return 0
|
1467
|
+
end
|
1468
|
+
|
1469
|
+
def EIB_MC_Write(addr, buf)
|
1470
|
+
puts "EIB_MC_Write()" if $DEBUG
|
1471
|
+
if EIB_MC_Write_async(addr, buf) == -1
|
1472
|
+
return -1
|
1473
|
+
end
|
1474
|
+
return EIBComplete()
|
1475
|
+
end
|
1476
|
+
|
1477
|
+
def __EIB_MC_Write_Plain_Complete()
|
1478
|
+
puts "__EIB_MC_Write_Plain_Complete()" if $DEBUG
|
1479
|
+
@__complete = nil
|
1480
|
+
if __EIB_GetRequest() == -1
|
1481
|
+
return -1
|
1482
|
+
end
|
1483
|
+
if (((@data[0])<<8)|(@data[0+1])) != 91 or @data.length < 2
|
1484
|
+
@errno = Errno::ECONNRESET
|
1485
|
+
return -1
|
1486
|
+
end
|
1487
|
+
return @sendlen
|
1488
|
+
end
|
1489
|
+
|
1490
|
+
|
1491
|
+
def EIB_MC_Write_Plain_async(addr, buf)
|
1492
|
+
puts "EIB_MC_Write_Plain_async()" if $DEBUG
|
1493
|
+
ibuf = [0] * 6;
|
1494
|
+
ibuf[2] = ((addr>>8)&0xff)
|
1495
|
+
ibuf[3] = ((addr)&0xff)
|
1496
|
+
ibuf[4] = (((buf.length)>>8)&0xff)
|
1497
|
+
ibuf[5] = (((buf.length))&0xff)
|
1498
|
+
if buf.length < 0
|
1499
|
+
@errno = Errno::EINVAL
|
1500
|
+
return -1
|
1501
|
+
end
|
1502
|
+
@sendlen = buf.length
|
1503
|
+
ibuf.concat(buf)
|
1504
|
+
ibuf[0] = 0
|
1505
|
+
ibuf[1] = 91
|
1506
|
+
md = caller[0].match(/`(\w*)'/); clr = md and md[1] or caller[0]
|
1507
|
+
puts("#{clr} calling __EIB_SendRequest, ibuf=#{ibuf.inspect}") if $DEBUG
|
1508
|
+
if __EIB_SendRequest(ibuf) == -1
|
1509
|
+
return -1
|
1510
|
+
end
|
1511
|
+
@__complete = __EIB_MC_Write_Plain_Complete()
|
1512
|
+
return 0
|
1513
|
+
end
|
1514
|
+
|
1515
|
+
def EIB_MC_Write_Plain(addr, buf)
|
1516
|
+
puts "EIB_MC_Write_Plain()" if $DEBUG
|
1517
|
+
if EIB_MC_Write_Plain_async(addr, buf) == -1
|
1518
|
+
return -1
|
1519
|
+
end
|
1520
|
+
return EIBComplete()
|
1521
|
+
end
|
1522
|
+
|
1523
|
+
def __EIB_M_GetMaskVersion_Complete()
|
1524
|
+
puts "__EIB_M_GetMaskVersion_Complete()" if $DEBUG
|
1525
|
+
@__complete = nil
|
1526
|
+
if __EIB_GetRequest() == -1
|
1527
|
+
return -1
|
1528
|
+
end
|
1529
|
+
if (((@data[0])<<8)|(@data[0+1])) != 49 or @data.length < 4
|
1530
|
+
@errno = Errno::ECONNRESET
|
1531
|
+
return -1
|
1532
|
+
end
|
1533
|
+
return (((@data[2])<<8)|(@data[2+1]))
|
1534
|
+
end
|
1535
|
+
|
1536
|
+
|
1537
|
+
def EIB_M_GetMaskVersion_async(dest)
|
1538
|
+
puts "EIB_M_GetMaskVersion_async()" if $DEBUG
|
1539
|
+
ibuf = [0] * 4;
|
1540
|
+
ibuf[2] = ((dest>>8)&0xff)
|
1541
|
+
ibuf[3] = ((dest)&0xff)
|
1542
|
+
ibuf[0] = 0
|
1543
|
+
ibuf[1] = 49
|
1544
|
+
md = caller[0].match(/`(\w*)'/); clr = md and md[1] or caller[0]
|
1545
|
+
puts("#{clr} calling __EIB_SendRequest, ibuf=#{ibuf.inspect}") if $DEBUG
|
1546
|
+
if __EIB_SendRequest(ibuf) == -1
|
1547
|
+
return -1
|
1548
|
+
end
|
1549
|
+
@__complete = __EIB_M_GetMaskVersion_Complete()
|
1550
|
+
return 0
|
1551
|
+
end
|
1552
|
+
|
1553
|
+
def EIB_M_GetMaskVersion(dest)
|
1554
|
+
puts "EIB_M_GetMaskVersion()" if $DEBUG
|
1555
|
+
if EIB_M_GetMaskVersion_async(dest) == -1
|
1556
|
+
return -1
|
1557
|
+
end
|
1558
|
+
return EIBComplete()
|
1559
|
+
end
|
1560
|
+
|
1561
|
+
def __EIB_M_Progmode_Off_Complete()
|
1562
|
+
puts "__EIB_M_Progmode_Off_Complete()" if $DEBUG
|
1563
|
+
@__complete = nil
|
1564
|
+
if __EIB_GetRequest() == -1
|
1565
|
+
return -1
|
1566
|
+
end
|
1567
|
+
if (((@data[0])<<8)|(@data[0+1])) != 48 or @data.length < 2
|
1568
|
+
@errno = Errno::ECONNRESET
|
1569
|
+
return -1
|
1570
|
+
end
|
1571
|
+
return 0
|
1572
|
+
end
|
1573
|
+
|
1574
|
+
|
1575
|
+
def EIB_M_Progmode_Off_async(dest)
|
1576
|
+
puts "EIB_M_Progmode_Off_async()" if $DEBUG
|
1577
|
+
ibuf = [0] * 5;
|
1578
|
+
ibuf[2] = ((dest>>8)&0xff)
|
1579
|
+
ibuf[3] = ((dest)&0xff)
|
1580
|
+
ibuf[4] = ((0)&0xff)
|
1581
|
+
ibuf[0] = 0
|
1582
|
+
ibuf[1] = 48
|
1583
|
+
md = caller[0].match(/`(\w*)'/); clr = md and md[1] or caller[0]
|
1584
|
+
puts("#{clr} calling __EIB_SendRequest, ibuf=#{ibuf.inspect}") if $DEBUG
|
1585
|
+
if __EIB_SendRequest(ibuf) == -1
|
1586
|
+
return -1
|
1587
|
+
end
|
1588
|
+
@__complete = __EIB_M_Progmode_Off_Complete()
|
1589
|
+
return 0
|
1590
|
+
end
|
1591
|
+
|
1592
|
+
def EIB_M_Progmode_Off(dest)
|
1593
|
+
puts "EIB_M_Progmode_Off()" if $DEBUG
|
1594
|
+
if EIB_M_Progmode_Off_async(dest) == -1
|
1595
|
+
return -1
|
1596
|
+
end
|
1597
|
+
return EIBComplete()
|
1598
|
+
end
|
1599
|
+
|
1600
|
+
def __EIB_M_Progmode_On_Complete()
|
1601
|
+
puts "__EIB_M_Progmode_On_Complete()" if $DEBUG
|
1602
|
+
@__complete = nil
|
1603
|
+
if __EIB_GetRequest() == -1
|
1604
|
+
return -1
|
1605
|
+
end
|
1606
|
+
if (((@data[0])<<8)|(@data[0+1])) != 48 or @data.length < 2
|
1607
|
+
@errno = Errno::ECONNRESET
|
1608
|
+
return -1
|
1609
|
+
end
|
1610
|
+
return 0
|
1611
|
+
end
|
1612
|
+
|
1613
|
+
|
1614
|
+
def EIB_M_Progmode_On_async(dest)
|
1615
|
+
puts "EIB_M_Progmode_On_async()" if $DEBUG
|
1616
|
+
ibuf = [0] * 5;
|
1617
|
+
ibuf[2] = ((dest>>8)&0xff)
|
1618
|
+
ibuf[3] = ((dest)&0xff)
|
1619
|
+
ibuf[4] = ((1)&0xff)
|
1620
|
+
ibuf[0] = 0
|
1621
|
+
ibuf[1] = 48
|
1622
|
+
md = caller[0].match(/`(\w*)'/); clr = md and md[1] or caller[0]
|
1623
|
+
puts("#{clr} calling __EIB_SendRequest, ibuf=#{ibuf.inspect}") if $DEBUG
|
1624
|
+
if __EIB_SendRequest(ibuf) == -1
|
1625
|
+
return -1
|
1626
|
+
end
|
1627
|
+
@__complete = __EIB_M_Progmode_On_Complete()
|
1628
|
+
return 0
|
1629
|
+
end
|
1630
|
+
|
1631
|
+
def EIB_M_Progmode_On(dest)
|
1632
|
+
puts "EIB_M_Progmode_On()" if $DEBUG
|
1633
|
+
if EIB_M_Progmode_On_async(dest) == -1
|
1634
|
+
return -1
|
1635
|
+
end
|
1636
|
+
return EIBComplete()
|
1637
|
+
end
|
1638
|
+
|
1639
|
+
def __EIB_M_Progmode_Status_Complete()
|
1640
|
+
puts "__EIB_M_Progmode_Status_Complete()" if $DEBUG
|
1641
|
+
@__complete = nil
|
1642
|
+
if __EIB_GetRequest() == -1
|
1643
|
+
return -1
|
1644
|
+
end
|
1645
|
+
if (((@data[0])<<8)|(@data[0+1])) != 48 or @data.length < 3
|
1646
|
+
@errno = Errno::ECONNRESET
|
1647
|
+
return -1
|
1648
|
+
end
|
1649
|
+
return @data[2]
|
1650
|
+
end
|
1651
|
+
|
1652
|
+
|
1653
|
+
def EIB_M_Progmode_Status_async(dest)
|
1654
|
+
puts "EIB_M_Progmode_Status_async()" if $DEBUG
|
1655
|
+
ibuf = [0] * 5;
|
1656
|
+
ibuf[2] = ((dest>>8)&0xff)
|
1657
|
+
ibuf[3] = ((dest)&0xff)
|
1658
|
+
ibuf[4] = ((3)&0xff)
|
1659
|
+
ibuf[0] = 0
|
1660
|
+
ibuf[1] = 48
|
1661
|
+
md = caller[0].match(/`(\w*)'/); clr = md and md[1] or caller[0]
|
1662
|
+
puts("#{clr} calling __EIB_SendRequest, ibuf=#{ibuf.inspect}") if $DEBUG
|
1663
|
+
if __EIB_SendRequest(ibuf) == -1
|
1664
|
+
return -1
|
1665
|
+
end
|
1666
|
+
@__complete = __EIB_M_Progmode_Status_Complete()
|
1667
|
+
return 0
|
1668
|
+
end
|
1669
|
+
|
1670
|
+
def EIB_M_Progmode_Status(dest)
|
1671
|
+
puts "EIB_M_Progmode_Status()" if $DEBUG
|
1672
|
+
if EIB_M_Progmode_Status_async(dest) == -1
|
1673
|
+
return -1
|
1674
|
+
end
|
1675
|
+
return EIBComplete()
|
1676
|
+
end
|
1677
|
+
|
1678
|
+
def __EIB_M_Progmode_Toggle_Complete()
|
1679
|
+
puts "__EIB_M_Progmode_Toggle_Complete()" if $DEBUG
|
1680
|
+
@__complete = nil
|
1681
|
+
if __EIB_GetRequest() == -1
|
1682
|
+
return -1
|
1683
|
+
end
|
1684
|
+
if (((@data[0])<<8)|(@data[0+1])) != 48 or @data.length < 2
|
1685
|
+
@errno = Errno::ECONNRESET
|
1686
|
+
return -1
|
1687
|
+
end
|
1688
|
+
return 0
|
1689
|
+
end
|
1690
|
+
|
1691
|
+
|
1692
|
+
def EIB_M_Progmode_Toggle_async(dest)
|
1693
|
+
puts "EIB_M_Progmode_Toggle_async()" if $DEBUG
|
1694
|
+
ibuf = [0] * 5;
|
1695
|
+
ibuf[2] = ((dest>>8)&0xff)
|
1696
|
+
ibuf[3] = ((dest)&0xff)
|
1697
|
+
ibuf[4] = ((2)&0xff)
|
1698
|
+
ibuf[0] = 0
|
1699
|
+
ibuf[1] = 48
|
1700
|
+
md = caller[0].match(/`(\w*)'/); clr = md and md[1] or caller[0]
|
1701
|
+
puts("#{clr} calling __EIB_SendRequest, ibuf=#{ibuf.inspect}") if $DEBUG
|
1702
|
+
if __EIB_SendRequest(ibuf) == -1
|
1703
|
+
return -1
|
1704
|
+
end
|
1705
|
+
@__complete = __EIB_M_Progmode_Toggle_Complete()
|
1706
|
+
return 0
|
1707
|
+
end
|
1708
|
+
|
1709
|
+
def EIB_M_Progmode_Toggle(dest)
|
1710
|
+
puts "EIB_M_Progmode_Toggle()" if $DEBUG
|
1711
|
+
if EIB_M_Progmode_Toggle_async(dest) == -1
|
1712
|
+
return -1
|
1713
|
+
end
|
1714
|
+
return EIBComplete()
|
1715
|
+
end
|
1716
|
+
|
1717
|
+
def __EIB_M_ReadIndividualAddresses_Complete()
|
1718
|
+
puts "__EIB_M_ReadIndividualAddresses_Complete()" if $DEBUG
|
1719
|
+
@__complete = nil
|
1720
|
+
if __EIB_GetRequest() == -1
|
1721
|
+
return -1
|
1722
|
+
end
|
1723
|
+
if (((@data[0])<<8)|(@data[0+1])) != 50 or @data.length < 2
|
1724
|
+
@errno = Errno::ECONNRESET
|
1725
|
+
return -1
|
1726
|
+
end
|
1727
|
+
@buf.buffer = @data[2..-1]
|
1728
|
+
return @buf.buffer.length
|
1729
|
+
end
|
1730
|
+
|
1731
|
+
|
1732
|
+
def EIB_M_ReadIndividualAddresses_async(buf)
|
1733
|
+
puts "EIB_M_ReadIndividualAddresses_async()" if $DEBUG
|
1734
|
+
ibuf = [0] * 2;
|
1735
|
+
@buf = buf
|
1736
|
+
ibuf[0] = 0
|
1737
|
+
ibuf[1] = 50
|
1738
|
+
md = caller[0].match(/`(\w*)'/); clr = md and md[1] or caller[0]
|
1739
|
+
puts("#{clr} calling __EIB_SendRequest, ibuf=#{ibuf.inspect}") if $DEBUG
|
1740
|
+
if __EIB_SendRequest(ibuf) == -1
|
1741
|
+
return -1
|
1742
|
+
end
|
1743
|
+
@__complete = __EIB_M_ReadIndividualAddresses_Complete()
|
1744
|
+
return 0
|
1745
|
+
end
|
1746
|
+
|
1747
|
+
def EIB_M_ReadIndividualAddresses(buf)
|
1748
|
+
puts "EIB_M_ReadIndividualAddresses()" if $DEBUG
|
1749
|
+
if EIB_M_ReadIndividualAddresses_async(buf) == -1
|
1750
|
+
return -1
|
1751
|
+
end
|
1752
|
+
return EIBComplete()
|
1753
|
+
end
|
1754
|
+
|
1755
|
+
def __EIB_M_WriteIndividualAddress_Complete()
|
1756
|
+
puts "__EIB_M_WriteIndividualAddress_Complete()" if $DEBUG
|
1757
|
+
@__complete = nil
|
1758
|
+
if __EIB_GetRequest() == -1
|
1759
|
+
return -1
|
1760
|
+
end
|
1761
|
+
if (((@data[0])<<8)|(@data[0+1])) != 65
|
1762
|
+
@errno = Errno::EADDRINUSE
|
1763
|
+
return -1
|
1764
|
+
end
|
1765
|
+
if (((@data[0])<<8)|(@data[0+1])) != 67
|
1766
|
+
@errno = Errno::ETIMEDOUT
|
1767
|
+
return -1
|
1768
|
+
end
|
1769
|
+
if (((@data[0])<<8)|(@data[0+1])) != 66
|
1770
|
+
@errno = Errno::EADDRNOTAVAIL
|
1771
|
+
return -1
|
1772
|
+
end
|
1773
|
+
if (((@data[0])<<8)|(@data[0+1])) != 64 or @data.length < 2
|
1774
|
+
@errno = Errno::ECONNRESET
|
1775
|
+
return -1
|
1776
|
+
end
|
1777
|
+
return 0
|
1778
|
+
end
|
1779
|
+
|
1780
|
+
|
1781
|
+
def EIB_M_WriteIndividualAddress_async(dest)
|
1782
|
+
puts "EIB_M_WriteIndividualAddress_async()" if $DEBUG
|
1783
|
+
ibuf = [0] * 4;
|
1784
|
+
ibuf[2] = ((dest>>8)&0xff)
|
1785
|
+
ibuf[3] = ((dest)&0xff)
|
1786
|
+
ibuf[0] = 0
|
1787
|
+
ibuf[1] = 64
|
1788
|
+
md = caller[0].match(/`(\w*)'/); clr = md and md[1] or caller[0]
|
1789
|
+
puts("#{clr} calling __EIB_SendRequest, ibuf=#{ibuf.inspect}") if $DEBUG
|
1790
|
+
if __EIB_SendRequest(ibuf) == -1
|
1791
|
+
return -1
|
1792
|
+
end
|
1793
|
+
@__complete = __EIB_M_WriteIndividualAddress_Complete()
|
1794
|
+
return 0
|
1795
|
+
end
|
1796
|
+
|
1797
|
+
def EIB_M_WriteIndividualAddress(dest)
|
1798
|
+
puts "EIB_M_WriteIndividualAddress()" if $DEBUG
|
1799
|
+
if EIB_M_WriteIndividualAddress_async(dest) == -1
|
1800
|
+
return -1
|
1801
|
+
end
|
1802
|
+
return EIBComplete()
|
1803
|
+
end
|
1804
|
+
|
1805
|
+
def __EIBOpenBusmonitor_Complete()
|
1806
|
+
puts "__EIBOpenBusmonitor_Complete()" if $DEBUG
|
1807
|
+
@__complete = nil
|
1808
|
+
if __EIB_GetRequest() == -1
|
1809
|
+
return -1
|
1810
|
+
end
|
1811
|
+
if (((@data[0])<<8)|(@data[0+1])) != 1
|
1812
|
+
@errno = Errno::EBUSY
|
1813
|
+
return -1
|
1814
|
+
end
|
1815
|
+
if (((@data[0])<<8)|(@data[0+1])) != 16 or @data.length < 2
|
1816
|
+
@errno = Errno::ECONNRESET
|
1817
|
+
return -1
|
1818
|
+
end
|
1819
|
+
return 0
|
1820
|
+
end
|
1821
|
+
|
1822
|
+
|
1823
|
+
def EIBOpenBusmonitor_async()
|
1824
|
+
puts "EIBOpenBusmonitor_async()" if $DEBUG
|
1825
|
+
ibuf = [0] * 2;
|
1826
|
+
ibuf[0] = 0
|
1827
|
+
ibuf[1] = 16
|
1828
|
+
md = caller[0].match(/`(\w*)'/); clr = md and md[1] or caller[0]
|
1829
|
+
puts("#{clr} calling __EIB_SendRequest, ibuf=#{ibuf.inspect}") if $DEBUG
|
1830
|
+
if __EIB_SendRequest(ibuf) == -1
|
1831
|
+
return -1
|
1832
|
+
end
|
1833
|
+
@__complete = __EIBOpenBusmonitor_Complete()
|
1834
|
+
return 0
|
1835
|
+
end
|
1836
|
+
|
1837
|
+
def EIBOpenBusmonitor()
|
1838
|
+
puts "EIBOpenBusmonitor()" if $DEBUG
|
1839
|
+
if EIBOpenBusmonitor_async() == -1
|
1840
|
+
return -1
|
1841
|
+
end
|
1842
|
+
return EIBComplete()
|
1843
|
+
end
|
1844
|
+
|
1845
|
+
def __EIBOpenBusmonitorText_Complete()
|
1846
|
+
puts "__EIBOpenBusmonitorText_Complete()" if $DEBUG
|
1847
|
+
@__complete = nil
|
1848
|
+
if __EIB_GetRequest() == -1
|
1849
|
+
return -1
|
1850
|
+
end
|
1851
|
+
if (((@data[0])<<8)|(@data[0+1])) != 1
|
1852
|
+
@errno = Errno::EBUSY
|
1853
|
+
return -1
|
1854
|
+
end
|
1855
|
+
if (((@data[0])<<8)|(@data[0+1])) != 17 or @data.length < 2
|
1856
|
+
@errno = Errno::ECONNRESET
|
1857
|
+
return -1
|
1858
|
+
end
|
1859
|
+
return 0
|
1860
|
+
end
|
1861
|
+
|
1862
|
+
|
1863
|
+
def EIBOpenBusmonitorText_async()
|
1864
|
+
puts "EIBOpenBusmonitorText_async()" if $DEBUG
|
1865
|
+
ibuf = [0] * 2;
|
1866
|
+
ibuf[0] = 0
|
1867
|
+
ibuf[1] = 17
|
1868
|
+
md = caller[0].match(/`(\w*)'/); clr = md and md[1] or caller[0]
|
1869
|
+
puts("#{clr} calling __EIB_SendRequest, ibuf=#{ibuf.inspect}") if $DEBUG
|
1870
|
+
if __EIB_SendRequest(ibuf) == -1
|
1871
|
+
return -1
|
1872
|
+
end
|
1873
|
+
@__complete = __EIBOpenBusmonitorText_Complete()
|
1874
|
+
return 0
|
1875
|
+
end
|
1876
|
+
|
1877
|
+
def EIBOpenBusmonitorText()
|
1878
|
+
puts "EIBOpenBusmonitorText()" if $DEBUG
|
1879
|
+
if EIBOpenBusmonitorText_async() == -1
|
1880
|
+
return -1
|
1881
|
+
end
|
1882
|
+
return EIBComplete()
|
1883
|
+
end
|
1884
|
+
|
1885
|
+
def __EIBOpen_GroupSocket_Complete()
|
1886
|
+
puts "__EIBOpen_GroupSocket_Complete()" if $DEBUG
|
1887
|
+
@__complete = nil
|
1888
|
+
if __EIB_GetRequest() == -1
|
1889
|
+
return -1
|
1890
|
+
end
|
1891
|
+
if (((@data[0])<<8)|(@data[0+1])) != 38 or @data.length < 2
|
1892
|
+
@errno = Errno::ECONNRESET
|
1893
|
+
return -1
|
1894
|
+
end
|
1895
|
+
return 0
|
1896
|
+
end
|
1897
|
+
|
1898
|
+
|
1899
|
+
def EIBOpen_GroupSocket_async(write_only)
|
1900
|
+
puts "EIBOpen_GroupSocket_async()" if $DEBUG
|
1901
|
+
ibuf = [0] * 5;
|
1902
|
+
if write_only != 0
|
1903
|
+
ibuf[4] = 0xff
|
1904
|
+
else
|
1905
|
+
ibuf[4] = 0x00
|
1906
|
+
end
|
1907
|
+
ibuf[0] = 0
|
1908
|
+
ibuf[1] = 38
|
1909
|
+
md = caller[0].match(/`(\w*)'/); clr = md and md[1] or caller[0]
|
1910
|
+
puts("#{clr} calling __EIB_SendRequest, ibuf=#{ibuf.inspect}") if $DEBUG
|
1911
|
+
if __EIB_SendRequest(ibuf) == -1
|
1912
|
+
return -1
|
1913
|
+
end
|
1914
|
+
@__complete = __EIBOpen_GroupSocket_Complete()
|
1915
|
+
return 0
|
1916
|
+
end
|
1917
|
+
|
1918
|
+
def EIBOpen_GroupSocket(write_only)
|
1919
|
+
puts "EIBOpen_GroupSocket()" if $DEBUG
|
1920
|
+
if EIBOpen_GroupSocket_async(write_only) == -1
|
1921
|
+
return -1
|
1922
|
+
end
|
1923
|
+
return EIBComplete()
|
1924
|
+
end
|
1925
|
+
|
1926
|
+
def __EIBOpenT_Broadcast_Complete()
|
1927
|
+
puts "__EIBOpenT_Broadcast_Complete()" if $DEBUG
|
1928
|
+
@__complete = nil
|
1929
|
+
if __EIB_GetRequest() == -1
|
1930
|
+
return -1
|
1931
|
+
end
|
1932
|
+
if (((@data[0])<<8)|(@data[0+1])) != 35 or @data.length < 2
|
1933
|
+
@errno = Errno::ECONNRESET
|
1934
|
+
return -1
|
1935
|
+
end
|
1936
|
+
return 0
|
1937
|
+
end
|
1938
|
+
|
1939
|
+
|
1940
|
+
def EIBOpenT_Broadcast_async(write_only)
|
1941
|
+
puts "EIBOpenT_Broadcast_async()" if $DEBUG
|
1942
|
+
ibuf = [0] * 5;
|
1943
|
+
if write_only != 0
|
1944
|
+
ibuf[4] = 0xff
|
1945
|
+
else
|
1946
|
+
ibuf[4] = 0x00
|
1947
|
+
end
|
1948
|
+
ibuf[0] = 0
|
1949
|
+
ibuf[1] = 35
|
1950
|
+
md = caller[0].match(/`(\w*)'/); clr = md and md[1] or caller[0]
|
1951
|
+
puts("#{clr} calling __EIB_SendRequest, ibuf=#{ibuf.inspect}") if $DEBUG
|
1952
|
+
if __EIB_SendRequest(ibuf) == -1
|
1953
|
+
return -1
|
1954
|
+
end
|
1955
|
+
@__complete = __EIBOpenT_Broadcast_Complete()
|
1956
|
+
return 0
|
1957
|
+
end
|
1958
|
+
|
1959
|
+
def EIBOpenT_Broadcast(write_only)
|
1960
|
+
puts "EIBOpenT_Broadcast()" if $DEBUG
|
1961
|
+
if EIBOpenT_Broadcast_async(write_only) == -1
|
1962
|
+
return -1
|
1963
|
+
end
|
1964
|
+
return EIBComplete()
|
1965
|
+
end
|
1966
|
+
|
1967
|
+
def __EIBOpenT_Connection_Complete()
|
1968
|
+
puts "__EIBOpenT_Connection_Complete()" if $DEBUG
|
1969
|
+
@__complete = nil
|
1970
|
+
if __EIB_GetRequest() == -1
|
1971
|
+
return -1
|
1972
|
+
end
|
1973
|
+
if (((@data[0])<<8)|(@data[0+1])) != 32 or @data.length < 2
|
1974
|
+
@errno = Errno::ECONNRESET
|
1975
|
+
return -1
|
1976
|
+
end
|
1977
|
+
return 0
|
1978
|
+
end
|
1979
|
+
|
1980
|
+
|
1981
|
+
def EIBOpenT_Connection_async(dest)
|
1982
|
+
puts "EIBOpenT_Connection_async()" if $DEBUG
|
1983
|
+
ibuf = [0] * 5;
|
1984
|
+
ibuf[2] = ((dest>>8)&0xff)
|
1985
|
+
ibuf[3] = ((dest)&0xff)
|
1986
|
+
ibuf[0] = 0
|
1987
|
+
ibuf[1] = 32
|
1988
|
+
md = caller[0].match(/`(\w*)'/); clr = md and md[1] or caller[0]
|
1989
|
+
puts("#{clr} calling __EIB_SendRequest, ibuf=#{ibuf.inspect}") if $DEBUG
|
1990
|
+
if __EIB_SendRequest(ibuf) == -1
|
1991
|
+
return -1
|
1992
|
+
end
|
1993
|
+
@__complete = __EIBOpenT_Connection_Complete()
|
1994
|
+
return 0
|
1995
|
+
end
|
1996
|
+
|
1997
|
+
def EIBOpenT_Connection(dest)
|
1998
|
+
puts "EIBOpenT_Connection()" if $DEBUG
|
1999
|
+
if EIBOpenT_Connection_async(dest) == -1
|
2000
|
+
return -1
|
2001
|
+
end
|
2002
|
+
return EIBComplete()
|
2003
|
+
end
|
2004
|
+
|
2005
|
+
def __EIBOpenT_Group_Complete()
|
2006
|
+
puts "__EIBOpenT_Group_Complete()" if $DEBUG
|
2007
|
+
@__complete = nil
|
2008
|
+
if __EIB_GetRequest() == -1
|
2009
|
+
return -1
|
2010
|
+
end
|
2011
|
+
if (((@data[0])<<8)|(@data[0+1])) != 34 or @data.length < 2
|
2012
|
+
@errno = Errno::ECONNRESET
|
2013
|
+
return -1
|
2014
|
+
end
|
2015
|
+
return 0
|
2016
|
+
end
|
2017
|
+
|
2018
|
+
|
2019
|
+
def EIBOpenT_Group_async(dest, write_only)
|
2020
|
+
puts "EIBOpenT_Group_async()" if $DEBUG
|
2021
|
+
ibuf = [0] * 5;
|
2022
|
+
ibuf[2] = ((dest>>8)&0xff)
|
2023
|
+
ibuf[3] = ((dest)&0xff)
|
2024
|
+
if write_only != 0
|
2025
|
+
ibuf[4] = 0xff
|
2026
|
+
else
|
2027
|
+
ibuf[4] = 0x00
|
2028
|
+
end
|
2029
|
+
ibuf[0] = 0
|
2030
|
+
ibuf[1] = 34
|
2031
|
+
md = caller[0].match(/`(\w*)'/); clr = md and md[1] or caller[0]
|
2032
|
+
puts("#{clr} calling __EIB_SendRequest, ibuf=#{ibuf.inspect}") if $DEBUG
|
2033
|
+
if __EIB_SendRequest(ibuf) == -1
|
2034
|
+
return -1
|
2035
|
+
end
|
2036
|
+
@__complete = __EIBOpenT_Group_Complete()
|
2037
|
+
return 0
|
2038
|
+
end
|
2039
|
+
|
2040
|
+
def EIBOpenT_Group(dest, write_only)
|
2041
|
+
puts "EIBOpenT_Group()" if $DEBUG
|
2042
|
+
if EIBOpenT_Group_async(dest, write_only) == -1
|
2043
|
+
return -1
|
2044
|
+
end
|
2045
|
+
return EIBComplete()
|
2046
|
+
end
|
2047
|
+
|
2048
|
+
def __EIBOpenT_Individual_Complete()
|
2049
|
+
puts "__EIBOpenT_Individual_Complete()" if $DEBUG
|
2050
|
+
@__complete = nil
|
2051
|
+
if __EIB_GetRequest() == -1
|
2052
|
+
return -1
|
2053
|
+
end
|
2054
|
+
if (((@data[0])<<8)|(@data[0+1])) != 33 or @data.length < 2
|
2055
|
+
@errno = Errno::ECONNRESET
|
2056
|
+
return -1
|
2057
|
+
end
|
2058
|
+
return 0
|
2059
|
+
end
|
2060
|
+
|
2061
|
+
|
2062
|
+
def EIBOpenT_Individual_async(dest, write_only)
|
2063
|
+
puts "EIBOpenT_Individual_async()" if $DEBUG
|
2064
|
+
ibuf = [0] * 5;
|
2065
|
+
ibuf[2] = ((dest>>8)&0xff)
|
2066
|
+
ibuf[3] = ((dest)&0xff)
|
2067
|
+
if write_only != 0
|
2068
|
+
ibuf[4] = 0xff
|
2069
|
+
else
|
2070
|
+
ibuf[4] = 0x00
|
2071
|
+
end
|
2072
|
+
ibuf[0] = 0
|
2073
|
+
ibuf[1] = 33
|
2074
|
+
md = caller[0].match(/`(\w*)'/); clr = md and md[1] or caller[0]
|
2075
|
+
puts("#{clr} calling __EIB_SendRequest, ibuf=#{ibuf.inspect}") if $DEBUG
|
2076
|
+
if __EIB_SendRequest(ibuf) == -1
|
2077
|
+
return -1
|
2078
|
+
end
|
2079
|
+
@__complete = __EIBOpenT_Individual_Complete()
|
2080
|
+
return 0
|
2081
|
+
end
|
2082
|
+
|
2083
|
+
def EIBOpenT_Individual(dest, write_only)
|
2084
|
+
puts "EIBOpenT_Individual()" if $DEBUG
|
2085
|
+
if EIBOpenT_Individual_async(dest, write_only) == -1
|
2086
|
+
return -1
|
2087
|
+
end
|
2088
|
+
return EIBComplete()
|
2089
|
+
end
|
2090
|
+
|
2091
|
+
def __EIBOpenT_TPDU_Complete()
|
2092
|
+
puts "__EIBOpenT_TPDU_Complete()" if $DEBUG
|
2093
|
+
@__complete = nil
|
2094
|
+
if __EIB_GetRequest() == -1
|
2095
|
+
return -1
|
2096
|
+
end
|
2097
|
+
if (((@data[0])<<8)|(@data[0+1])) != 36 or @data.length < 2
|
2098
|
+
@errno = Errno::ECONNRESET
|
2099
|
+
return -1
|
2100
|
+
end
|
2101
|
+
return 0
|
2102
|
+
end
|
2103
|
+
|
2104
|
+
|
2105
|
+
def EIBOpenT_TPDU_async(src)
|
2106
|
+
puts "EIBOpenT_TPDU_async()" if $DEBUG
|
2107
|
+
ibuf = [0] * 5;
|
2108
|
+
ibuf[2] = ((src>>8)&0xff)
|
2109
|
+
ibuf[3] = ((src)&0xff)
|
2110
|
+
ibuf[0] = 0
|
2111
|
+
ibuf[1] = 36
|
2112
|
+
md = caller[0].match(/`(\w*)'/); clr = md and md[1] or caller[0]
|
2113
|
+
puts("#{clr} calling __EIB_SendRequest, ibuf=#{ibuf.inspect}") if $DEBUG
|
2114
|
+
if __EIB_SendRequest(ibuf) == -1
|
2115
|
+
return -1
|
2116
|
+
end
|
2117
|
+
@__complete = __EIBOpenT_TPDU_Complete()
|
2118
|
+
return 0
|
2119
|
+
end
|
2120
|
+
|
2121
|
+
def EIBOpenT_TPDU(src)
|
2122
|
+
puts "EIBOpenT_TPDU()" if $DEBUG
|
2123
|
+
if EIBOpenT_TPDU_async(src) == -1
|
2124
|
+
return -1
|
2125
|
+
end
|
2126
|
+
return EIBComplete()
|
2127
|
+
end
|
2128
|
+
|
2129
|
+
def __EIBOpenVBusmonitor_Complete()
|
2130
|
+
puts "__EIBOpenVBusmonitor_Complete()" if $DEBUG
|
2131
|
+
@__complete = nil
|
2132
|
+
if __EIB_GetRequest() == -1
|
2133
|
+
return -1
|
2134
|
+
end
|
2135
|
+
if (((@data[0])<<8)|(@data[0+1])) != 1
|
2136
|
+
@errno = Errno::EBUSY
|
2137
|
+
return -1
|
2138
|
+
end
|
2139
|
+
if (((@data[0])<<8)|(@data[0+1])) != 18 or @data.length < 2
|
2140
|
+
@errno = Errno::ECONNRESET
|
2141
|
+
return -1
|
2142
|
+
end
|
2143
|
+
return 0
|
2144
|
+
end
|
2145
|
+
|
2146
|
+
|
2147
|
+
def EIBOpenVBusmonitor_async()
|
2148
|
+
puts "EIBOpenVBusmonitor_async()" if $DEBUG
|
2149
|
+
ibuf = [0] * 2;
|
2150
|
+
ibuf[0] = 0
|
2151
|
+
ibuf[1] = 18
|
2152
|
+
md = caller[0].match(/`(\w*)'/); clr = md and md[1] or caller[0]
|
2153
|
+
puts("#{clr} calling __EIB_SendRequest, ibuf=#{ibuf.inspect}") if $DEBUG
|
2154
|
+
if __EIB_SendRequest(ibuf) == -1
|
2155
|
+
return -1
|
2156
|
+
end
|
2157
|
+
@__complete = __EIBOpenVBusmonitor_Complete()
|
2158
|
+
return 0
|
2159
|
+
end
|
2160
|
+
|
2161
|
+
def EIBOpenVBusmonitor()
|
2162
|
+
puts "EIBOpenVBusmonitor()" if $DEBUG
|
2163
|
+
if EIBOpenVBusmonitor_async() == -1
|
2164
|
+
return -1
|
2165
|
+
end
|
2166
|
+
return EIBComplete()
|
2167
|
+
end
|
2168
|
+
|
2169
|
+
def __EIBOpenVBusmonitorText_Complete()
|
2170
|
+
puts "__EIBOpenVBusmonitorText_Complete()" if $DEBUG
|
2171
|
+
@__complete = nil
|
2172
|
+
if __EIB_GetRequest() == -1
|
2173
|
+
return -1
|
2174
|
+
end
|
2175
|
+
if (((@data[0])<<8)|(@data[0+1])) != 1
|
2176
|
+
@errno = Errno::EBUSY
|
2177
|
+
return -1
|
2178
|
+
end
|
2179
|
+
if (((@data[0])<<8)|(@data[0+1])) != 19 or @data.length < 2
|
2180
|
+
@errno = Errno::ECONNRESET
|
2181
|
+
return -1
|
2182
|
+
end
|
2183
|
+
return 0
|
2184
|
+
end
|
2185
|
+
|
2186
|
+
|
2187
|
+
def EIBOpenVBusmonitorText_async()
|
2188
|
+
puts "EIBOpenVBusmonitorText_async()" if $DEBUG
|
2189
|
+
ibuf = [0] * 2;
|
2190
|
+
ibuf[0] = 0
|
2191
|
+
ibuf[1] = 19
|
2192
|
+
md = caller[0].match(/`(\w*)'/); clr = md and md[1] or caller[0]
|
2193
|
+
puts("#{clr} calling __EIB_SendRequest, ibuf=#{ibuf.inspect}") if $DEBUG
|
2194
|
+
if __EIB_SendRequest(ibuf) == -1
|
2195
|
+
return -1
|
2196
|
+
end
|
2197
|
+
@__complete = __EIBOpenVBusmonitorText_Complete()
|
2198
|
+
return 0
|
2199
|
+
end
|
2200
|
+
|
2201
|
+
def EIBOpenVBusmonitorText()
|
2202
|
+
puts "EIBOpenVBusmonitorText()" if $DEBUG
|
2203
|
+
if EIBOpenVBusmonitorText_async() == -1
|
2204
|
+
return -1
|
2205
|
+
end
|
2206
|
+
return EIBComplete()
|
2207
|
+
end
|
2208
|
+
|
2209
|
+
def __EIBReset_Complete()
|
2210
|
+
puts "__EIBReset_Complete()" if $DEBUG
|
2211
|
+
@__complete = nil
|
2212
|
+
if __EIB_GetRequest() == -1
|
2213
|
+
return -1
|
2214
|
+
end
|
2215
|
+
if (((@data[0])<<8)|(@data[0+1])) != 4 or @data.length < 2
|
2216
|
+
@errno = Errno::ECONNRESET
|
2217
|
+
return -1
|
2218
|
+
end
|
2219
|
+
return 0
|
2220
|
+
end
|
2221
|
+
|
2222
|
+
|
2223
|
+
def EIBReset_async()
|
2224
|
+
puts "EIBReset_async()" if $DEBUG
|
2225
|
+
ibuf = [0] * 2;
|
2226
|
+
ibuf[0] = 0
|
2227
|
+
ibuf[1] = 4
|
2228
|
+
md = caller[0].match(/`(\w*)'/); clr = md and md[1] or caller[0]
|
2229
|
+
puts("#{clr} calling __EIB_SendRequest, ibuf=#{ibuf.inspect}") if $DEBUG
|
2230
|
+
if __EIB_SendRequest(ibuf) == -1
|
2231
|
+
return -1
|
2232
|
+
end
|
2233
|
+
@__complete = __EIBReset_Complete()
|
2234
|
+
return 0
|
2235
|
+
end
|
2236
|
+
|
2237
|
+
def EIBReset()
|
2238
|
+
puts "EIBReset()" if $DEBUG
|
2239
|
+
if EIBReset_async() == -1
|
2240
|
+
return -1
|
2241
|
+
end
|
2242
|
+
return EIBComplete()
|
2243
|
+
end
|
2244
|
+
|
2245
|
+
def EIBSendAPDU(data)
|
2246
|
+
puts "EIBSendAPDU()" if $DEBUG
|
2247
|
+
ibuf = [0] * 2;
|
2248
|
+
if data.length < 2
|
2249
|
+
@errno = Errno::EINVAL
|
2250
|
+
return -1
|
2251
|
+
end
|
2252
|
+
@sendlen = data.length
|
2253
|
+
ibuf.concat(data)
|
2254
|
+
ibuf[0] = 0
|
2255
|
+
ibuf[1] = 37
|
2256
|
+
md = caller[0].match(/`(\w*)'/); clr = md and md[1] or caller[0]
|
2257
|
+
puts("#{clr} calling __EIB_SendRequest, ibuf=#{ibuf.inspect}") if $DEBUG
|
2258
|
+
if __EIB_SendRequest(ibuf) == -1
|
2259
|
+
return -1
|
2260
|
+
end
|
2261
|
+
return @sendlen
|
2262
|
+
|
2263
|
+
end
|
2264
|
+
|
2265
|
+
def EIBSendGroup(dest, data)
|
2266
|
+
puts "EIBSendGroup()" if $DEBUG
|
2267
|
+
ibuf = [0] * 4;
|
2268
|
+
ibuf[2] = ((dest>>8)&0xff)
|
2269
|
+
ibuf[3] = ((dest)&0xff)
|
2270
|
+
if data.length < 2
|
2271
|
+
@errno = Errno::EINVAL
|
2272
|
+
return -1
|
2273
|
+
end
|
2274
|
+
@sendlen = data.length
|
2275
|
+
ibuf.concat(data)
|
2276
|
+
ibuf[0] = 0
|
2277
|
+
ibuf[1] = 39
|
2278
|
+
md = caller[0].match(/`(\w*)'/); clr = md and md[1] or caller[0]
|
2279
|
+
puts("#{clr} calling __EIB_SendRequest, ibuf=#{ibuf.inspect}") if $DEBUG
|
2280
|
+
if __EIB_SendRequest(ibuf) == -1
|
2281
|
+
return -1
|
2282
|
+
end
|
2283
|
+
return @sendlen
|
2284
|
+
|
2285
|
+
end
|
2286
|
+
|
2287
|
+
def EIBSendTPDU(dest, data)
|
2288
|
+
puts "EIBSendTPDU()" if $DEBUG
|
2289
|
+
ibuf = [0] * 4;
|
2290
|
+
ibuf[2] = ((dest>>8)&0xff)
|
2291
|
+
ibuf[3] = ((dest)&0xff)
|
2292
|
+
if data.length < 2
|
2293
|
+
@errno = Errno::EINVAL
|
2294
|
+
return -1
|
2295
|
+
end
|
2296
|
+
@sendlen = data.length
|
2297
|
+
ibuf.concat(data)
|
2298
|
+
ibuf[0] = 0
|
2299
|
+
ibuf[1] = 37
|
2300
|
+
md = caller[0].match(/`(\w*)'/); clr = md and md[1] or caller[0]
|
2301
|
+
puts("#{clr} calling __EIB_SendRequest, ibuf=#{ibuf.inspect}") if $DEBUG
|
2302
|
+
if __EIB_SendRequest(ibuf) == -1
|
2303
|
+
return -1
|
2304
|
+
end
|
2305
|
+
return @sendlen
|
2306
|
+
|
2307
|
+
end
|
2308
|
+
|
2309
|
+
IMG_UNKNOWN_ERROR = 0
|
2310
|
+
IMG_UNRECOG_FORMAT = 1
|
2311
|
+
IMG_INVALID_FORMAT = 2
|
2312
|
+
IMG_NO_BCUTYPE = 3
|
2313
|
+
IMG_UNKNOWN_BCUTYPE = 4
|
2314
|
+
IMG_NO_CODE = 5
|
2315
|
+
IMG_NO_SIZE = 6
|
2316
|
+
IMG_LODATA_OVERFLOW = 7
|
2317
|
+
IMG_HIDATA_OVERFLOW = 8
|
2318
|
+
IMG_TEXT_OVERFLOW = 9
|
2319
|
+
IMG_NO_ADDRESS = 10
|
2320
|
+
IMG_WRONG_SIZE = 11
|
2321
|
+
IMG_IMAGE_LOADABLE = 12
|
2322
|
+
IMG_NO_DEVICE_CONNECTION = 13
|
2323
|
+
IMG_MASK_READ_FAILED = 14
|
2324
|
+
IMG_WRONG_MASK_VERSION = 15
|
2325
|
+
IMG_CLEAR_ERROR = 16
|
2326
|
+
IMG_RESET_ADDR_TAB = 17
|
2327
|
+
IMG_LOAD_HEADER = 18
|
2328
|
+
IMG_LOAD_MAIN = 19
|
2329
|
+
IMG_ZERO_RAM = 20
|
2330
|
+
IMG_FINALIZE_ADDR_TAB = 21
|
2331
|
+
IMG_PREPARE_RUN = 22
|
2332
|
+
IMG_RESTART = 23
|
2333
|
+
IMG_LOADED = 24
|
2334
|
+
IMG_NO_START = 25
|
2335
|
+
IMG_WRONG_ADDRTAB = 26
|
2336
|
+
IMG_ADDRTAB_OVERFLOW = 27
|
2337
|
+
IMG_OVERLAP_ASSOCTAB = 28
|
2338
|
+
IMG_OVERLAP_TEXT = 29
|
2339
|
+
IMG_NEGATIV_TEXT_SIZE = 30
|
2340
|
+
IMG_OVERLAP_PARAM = 31
|
2341
|
+
IMG_OVERLAP_EEPROM = 32
|
2342
|
+
IMG_OBJTAB_OVERFLOW = 33
|
2343
|
+
IMG_WRONG_LOADCTL = 34
|
2344
|
+
IMG_UNLOAD_ADDR = 35
|
2345
|
+
IMG_UNLOAD_ASSOC = 36
|
2346
|
+
IMG_UNLOAD_PROG = 37
|
2347
|
+
IMG_LOAD_ADDR = 38
|
2348
|
+
IMG_WRITE_ADDR = 39
|
2349
|
+
IMG_SET_ADDR = 40
|
2350
|
+
IMG_FINISH_ADDR = 41
|
2351
|
+
IMG_LOAD_ASSOC = 42
|
2352
|
+
IMG_WRITE_ASSOC = 43
|
2353
|
+
IMG_SET_ASSOC = 44
|
2354
|
+
IMG_FINISH_ASSOC = 45
|
2355
|
+
IMG_LOAD_PROG = 46
|
2356
|
+
IMG_ALLOC_LORAM = 47
|
2357
|
+
IMG_ALLOC_HIRAM = 48
|
2358
|
+
IMG_ALLOC_INIT = 49
|
2359
|
+
IMG_ALLOC_RO = 50
|
2360
|
+
IMG_ALLOC_EEPROM = 51
|
2361
|
+
IMG_ALLOC_PARAM = 52
|
2362
|
+
IMG_SET_PROG = 53
|
2363
|
+
IMG_SET_TASK_PTR = 54
|
2364
|
+
IMG_SET_OBJ = 55
|
2365
|
+
IMG_SET_TASK2 = 56
|
2366
|
+
IMG_FINISH_PROC = 57
|
2367
|
+
IMG_WRONG_CHECKLIM = 58
|
2368
|
+
IMG_INVALID_KEY = 59
|
2369
|
+
IMG_AUTHORIZATION_FAILED = 60
|
2370
|
+
IMG_KEY_WRITE = 61
|
2371
|
+
end #class EIBConnection
|