lg-lcd 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/LICENSE +22 -0
- data/README.md +33 -0
- data/bin/lglcd +26 -0
- data/ext/LgLcdDll.dll +0 -0
- data/features/lglcd.feature +7 -0
- data/features/support/env.rb +4 -0
- data/lib/lg-lcd.rb +5 -0
- data/lib/lg-lcd/connection.rb +39 -0
- data/lib/lg-lcd/lglcd.rb +20 -0
- data/lib/lg-lcd/lib.rb +273 -0
- data/lib/lg-lcd/open.rb +24 -0
- data/lib/lg-lcd/version.rb +3 -0
- data/test/test.rb +24 -0
- metadata +128 -0
data/LICENSE
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2012 theldoria
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,33 @@
|
|
1
|
+
# LgLcd
|
2
|
+
|
3
|
+
Ruby binding to the 'Logitech LCD SDK Package'
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
gem 'lg-lcd'
|
10
|
+
|
11
|
+
And then execute:
|
12
|
+
|
13
|
+
$ bundle
|
14
|
+
|
15
|
+
Or install it yourself as:
|
16
|
+
|
17
|
+
$ gem install lg-lcd
|
18
|
+
|
19
|
+
## Usage
|
20
|
+
|
21
|
+
|
22
|
+
|
23
|
+
## Contributing
|
24
|
+
|
25
|
+
1. Fork it
|
26
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
27
|
+
3. Commit your changes (`git commit -am 'Added some feature'`)
|
28
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
29
|
+
5. Create new Pull Request
|
30
|
+
|
31
|
+
## Copyright
|
32
|
+
|
33
|
+
Copyright (c) 2012 theldoria. See LICENSE for further details.
|
data/bin/lglcd
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'lg-lcd/lglcd'
|
4
|
+
|
5
|
+
LgLcd::LgLcd.new do |lg_lcd|
|
6
|
+
puts "-" * 80
|
7
|
+
|
8
|
+
lg_lcd.connect("Ruby") do |ctx|
|
9
|
+
puts "Connection: #{ctx.connection}"
|
10
|
+
puts "-" * 40
|
11
|
+
|
12
|
+
dd = LgLcd::Lib::DeviceDesc.new
|
13
|
+
index = 0
|
14
|
+
while 0 == ret = LgLcd::Lib.enumerate(ctx.connection, index, dd)
|
15
|
+
puts "Index: #{index}"
|
16
|
+
puts "Family id: #{dd[:family_id]}"
|
17
|
+
puts "Display name: #{dd[:display_name]}"
|
18
|
+
puts "Width: #{dd[:width]}"
|
19
|
+
puts "Height: #{dd[:height]}"
|
20
|
+
puts "Bpp: #{dd[:bpp]}"
|
21
|
+
puts "Buttons: #{dd[:num_soft_buttons]}"
|
22
|
+
index = index + 1
|
23
|
+
end
|
24
|
+
STDOUT.flush
|
25
|
+
end
|
26
|
+
end
|
data/ext/LgLcdDll.dll
ADDED
Binary file
|
data/lib/lg-lcd.rb
ADDED
@@ -0,0 +1,39 @@
|
|
1
|
+
require 'ffi'
|
2
|
+
require_relative 'lib'
|
3
|
+
require_relative 'open'
|
4
|
+
|
5
|
+
module LgLcd
|
6
|
+
class Connection
|
7
|
+
def initialize name
|
8
|
+
@ctx = Lib::ConnectionContext.new
|
9
|
+
@ctx[:app_friendly_name] = string_pointer(name)
|
10
|
+
@ctx[:is_persistent] = false
|
11
|
+
@ctx[:is_autostartable] = false
|
12
|
+
@ctx[:connection] = Lib::LGLCD_INVALID_CONNECTION
|
13
|
+
|
14
|
+
raise "Connecting failed" unless Lib::LGLCD_RET_OK == Lib.connect(@ctx)
|
15
|
+
|
16
|
+
begin
|
17
|
+
yield(self)
|
18
|
+
ensure
|
19
|
+
Lib.disconnect(connection)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
def connection
|
24
|
+
return @ctx[:connection]
|
25
|
+
end
|
26
|
+
|
27
|
+
def open &block
|
28
|
+
return Open.new(connection, &block)
|
29
|
+
end
|
30
|
+
|
31
|
+
private
|
32
|
+
|
33
|
+
def string_pointer string
|
34
|
+
mem_buf = FFI::MemoryPointer.new(:char, string.size)
|
35
|
+
mem_buf.put_bytes(0, string)
|
36
|
+
return mem_buf
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
data/lib/lg-lcd/lglcd.rb
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
require_relative 'lib'
|
2
|
+
require_relative 'connection'
|
3
|
+
|
4
|
+
module LgLcd
|
5
|
+
class LgLcd
|
6
|
+
def initialize
|
7
|
+
raise "Initialization failed" unless Lib::LGLCD_RET_OK == Lib.init()
|
8
|
+
|
9
|
+
begin
|
10
|
+
yield(self)
|
11
|
+
ensure
|
12
|
+
Lib.deinit()
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
def connect name, &block
|
17
|
+
return Connection.new(name, &block)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
data/lib/lg-lcd/lib.rb
ADDED
@@ -0,0 +1,273 @@
|
|
1
|
+
require 'ffi'
|
2
|
+
|
3
|
+
module LgLcd
|
4
|
+
module Lib
|
5
|
+
extend FFI::Library
|
6
|
+
|
7
|
+
LGLCD_RET_OK = 0
|
8
|
+
|
9
|
+
# Invalid handle definitions
|
10
|
+
LGLCD_INVALID_CONNECTION = -1
|
11
|
+
LGLCD_INVALID_DEVICE = -1
|
12
|
+
|
13
|
+
# Common Soft-Buttons available through the SDK
|
14
|
+
LGLCDBUTTON_LEFT = 0x00000100
|
15
|
+
LGLCDBUTTON_RIGHT = 0x00000200
|
16
|
+
LGLCDBUTTON_OK = 0x00000400
|
17
|
+
LGLCDBUTTON_CANCEL = 0x00000800
|
18
|
+
LGLCDBUTTON_UP = 0x00001000
|
19
|
+
LGLCDBUTTON_DOWN = 0x00002000
|
20
|
+
LGLCDBUTTON_MENU = 0x00004000
|
21
|
+
|
22
|
+
# Soft-Button masks. Kept for backwards compatibility
|
23
|
+
LGLCDBUTTON_BUTTON0 = 0x00000001
|
24
|
+
LGLCDBUTTON_BUTTON1 = 0x00000002
|
25
|
+
LGLCDBUTTON_BUTTON2 = 0x00000004
|
26
|
+
LGLCDBUTTON_BUTTON3 = 0x00000008
|
27
|
+
LGLCDBUTTON_BUTTON4 = 0x00000010
|
28
|
+
LGLCDBUTTON_BUTTON5 = 0x00000020
|
29
|
+
LGLCDBUTTON_BUTTON6 = 0x00000040
|
30
|
+
LGLCDBUTTON_BUTTON7 = 0x00000080
|
31
|
+
|
32
|
+
# Bitmap
|
33
|
+
LGLCD_BMP_FORMAT_160x43x1 = 0x00000001
|
34
|
+
LGLCD_BMP_FORMAT_QVGAx32 = 0x00000003
|
35
|
+
LGLCD_BW_BMP_WIDTH = 160
|
36
|
+
LGLCD_BW_BMP_HEIGHT = 43
|
37
|
+
LGLCD_BW_BMP_BPP = 1
|
38
|
+
LGLCD_QVGA_BMP_WIDTH = 320
|
39
|
+
LGLCD_QVGA_BMP_HEIGHT = 240
|
40
|
+
LGLCD_QVGA_BMP_BPP = 4
|
41
|
+
|
42
|
+
# Priorities
|
43
|
+
LGLCD_PRIORITY_IDLE_NO_SHOW = 0
|
44
|
+
LGLCD_PRIORITY_BACKGROUND = 64
|
45
|
+
LGLCD_PRIORITY_NORMAL = 128
|
46
|
+
LGLCD_PRIORITY_ALERT = 255
|
47
|
+
LGLCD_SYNC_UPDATE = 0x80000000
|
48
|
+
LGLCD_SYNC_COMPLETE_WITHIN_FRAME = 0xC0000000
|
49
|
+
LGLCD_ASYNC_UPDATE = 0
|
50
|
+
|
51
|
+
# Foreground mode for client applications
|
52
|
+
LGLCD_LCD_FOREGROUND_APP_NO = 0
|
53
|
+
LGLCD_LCD_FOREGROUND_APP_YES = 1
|
54
|
+
|
55
|
+
# Device family definitions
|
56
|
+
LGLCD_DEVICE_FAMILY_BW_160x43_GAMING = 0x00000001
|
57
|
+
LGLCD_DEVICE_FAMILY_KEYBOARD_G15 = 0x00000001
|
58
|
+
LGLCD_DEVICE_FAMILY_BW_160x43_AUDIO = 0x00000002
|
59
|
+
LGLCD_DEVICE_FAMILY_SPEAKERS_Z10 = 0x00000002
|
60
|
+
LGLCD_DEVICE_FAMILY_JACKBOX = 0x00000004
|
61
|
+
LGLCD_DEVICE_FAMILY_BW_160x43_BASIC = 0x00000008
|
62
|
+
LGLCD_DEVICE_FAMILY_LCDEMULATOR_G15 = 0x00000008
|
63
|
+
LGLCD_DEVICE_FAMILY_RAINBOW = 0x00000010
|
64
|
+
LGLCD_DEVICE_FAMILY_QVGA_BASIC = 0x00000020
|
65
|
+
LGLCD_DEVICE_FAMILY_QVGA_GAMING = 0x00000040
|
66
|
+
LGLCD_DEVICE_FAMILY_GAMEBOARD_G13 = 0x00000080
|
67
|
+
LGLCD_DEVICE_FAMILY_KEYBOARD_G510 = 0x00000100
|
68
|
+
LGLCD_DEVICE_FAMILY_OTHER = 0x80000000
|
69
|
+
|
70
|
+
# Combinations of device families (device clans?)
|
71
|
+
LGLCD_DEVICE_FAMILY_ALL_BW_160x43 = (LGLCD_DEVICE_FAMILY_BW_160x43_GAMING |
|
72
|
+
LGLCD_DEVICE_FAMILY_BW_160x43_AUDIO |
|
73
|
+
LGLCD_DEVICE_FAMILY_JACKBOX |
|
74
|
+
LGLCD_DEVICE_FAMILY_BW_160x43_BASIC |
|
75
|
+
LGLCD_DEVICE_FAMILY_RAINBOW |
|
76
|
+
LGLCD_DEVICE_FAMILY_GAMEBOARD_G13 |
|
77
|
+
LGLCD_DEVICE_FAMILY_KEYBOARD_G510)
|
78
|
+
|
79
|
+
LGLCD_DEVICE_FAMILY_ALL_QVGA = (LGLCD_DEVICE_FAMILY_QVGA_BASIC |
|
80
|
+
LGLCD_DEVICE_FAMILY_QVGA_GAMING)
|
81
|
+
|
82
|
+
LGLCD_DEVICE_FAMILY_ALL = (LGLCD_DEVICE_FAMILY_ALL_BW_160x43 |
|
83
|
+
LGLCD_DEVICE_FAMILY_ALL_QVGA)
|
84
|
+
|
85
|
+
# Capabilities of applets connecting to LCD Manager.
|
86
|
+
LGLCD_APPLET_CAP_BASIC = 0x00000000
|
87
|
+
LGLCD_APPLET_CAP_BW = 0x00000001
|
88
|
+
LGLCD_APPLET_CAP_QVGA = 0x00000002
|
89
|
+
|
90
|
+
# Notifications sent by LCD Manager to applets connected to it.
|
91
|
+
LGLCD_NOTIFICATION_DEVICE_ARRIVAL = 0x00000001
|
92
|
+
LGLCD_NOTIFICATION_DEVICE_REMOVAL = 0x00000002
|
93
|
+
LGLCD_NOTIFICATION_CLOSE_CONNECTION = 0x00000003
|
94
|
+
LGLCD_NOTIFICATION_APPLET_DISABLED = 0x00000004
|
95
|
+
LGLCD_NOTIFICATION_APPLET_ENABLED = 0x00000005
|
96
|
+
LGLCD_NOTIFICATION_TERMINATE_APPLET = 0x00000006
|
97
|
+
|
98
|
+
# Device types used in notifications
|
99
|
+
LGLCD_DEVICE_BW = 0x00000001
|
100
|
+
LGLCD_DEVICE_QVGA = 0x00000002
|
101
|
+
|
102
|
+
# From WinDef.h
|
103
|
+
MAX_PATH = 260
|
104
|
+
|
105
|
+
# struct lgLcdConfigureContext
|
106
|
+
class ConfigureContext < FFI::Struct
|
107
|
+
layout config_callback: :pointer,
|
108
|
+
config_context: :pointer
|
109
|
+
end
|
110
|
+
|
111
|
+
# struct lgLcdNotificationContext
|
112
|
+
class NotificationContext < FFI::Struct
|
113
|
+
layout notification_callback: :pointer,
|
114
|
+
notification_context: :pointer
|
115
|
+
end
|
116
|
+
|
117
|
+
# struct lgLcdConnectContextExA
|
118
|
+
class ConnectionContext < FFI::Struct
|
119
|
+
# "Friendly name" display in the listing
|
120
|
+
# LPCSTR
|
121
|
+
layout app_friendly_name: :pointer,
|
122
|
+
# isPersistent determines whether this connection persists in the list
|
123
|
+
is_persistent: :bool,
|
124
|
+
# isAutostartable determines whether the client can be started by
|
125
|
+
# LCDMon
|
126
|
+
is_autostartable: :bool,
|
127
|
+
on_configure: ConfigureContext,
|
128
|
+
# Need this x, otherwise connection is not filled.
|
129
|
+
# Possibly a padding problem...
|
130
|
+
x: :int,
|
131
|
+
# --> Connection handle
|
132
|
+
connection: :int,
|
133
|
+
# Or'd combination of LGLCD_APPLET_CAP_... defines
|
134
|
+
applet_capabilities_supported: :long,
|
135
|
+
reserved: :long,
|
136
|
+
on_notify: NotificationContext
|
137
|
+
end
|
138
|
+
|
139
|
+
# struct lgLcdDeviceDescExA
|
140
|
+
class DeviceDesc < FFI::Struct
|
141
|
+
layout family_id: :long,
|
142
|
+
display_name: [:uint8, MAX_PATH],
|
143
|
+
width: :long,
|
144
|
+
height: :long,
|
145
|
+
bpp: :long,
|
146
|
+
num_soft_buttons: :long,
|
147
|
+
reserved1: :long,
|
148
|
+
reserved2: :long
|
149
|
+
end
|
150
|
+
|
151
|
+
class SoftbuttonsChangedContext < FFI::Struct
|
152
|
+
# Set to NULL if no softbutton notifications are needed
|
153
|
+
layout softbuttons_changed_callback: :pointer,
|
154
|
+
softbuttons_changed_context: :pointer
|
155
|
+
end
|
156
|
+
|
157
|
+
class OpenContext < FFI::Struct
|
158
|
+
layout connection: :int,
|
159
|
+
# Device type to open (either LGLCD_DEVICE_BW or LGLCD_DEVICE_QVGA)
|
160
|
+
index: :int,
|
161
|
+
on_softbuttons_changed: SoftbuttonsChangedContext,
|
162
|
+
# --> Device handle
|
163
|
+
device: :int
|
164
|
+
end
|
165
|
+
|
166
|
+
class OpenByTypeContext < FFI::Struct
|
167
|
+
layout connection: :int,
|
168
|
+
# Device type to open (either LGLCD_DEVICE_BW or LGLCD_DEVICE_QVGA)
|
169
|
+
device_type: :int,
|
170
|
+
on_softbuttons_changed: SoftbuttonsChangedContext,
|
171
|
+
# --> Device handle
|
172
|
+
device: :int
|
173
|
+
end
|
174
|
+
|
175
|
+
class BitmapHeader < FFI::Struct
|
176
|
+
layout format: :long
|
177
|
+
end
|
178
|
+
|
179
|
+
class Bitmap160x43x1 < FFI::Struct
|
180
|
+
layout hdr: BitmapHeader, # LGLCD_BMP_FORMAT_160x43x1
|
181
|
+
pixels: [:uint8, LGLCD_BW_BMP_WIDTH * LGLCD_BW_BMP_HEIGHT * LGLCD_BW_BMP_BPP]
|
182
|
+
end
|
183
|
+
|
184
|
+
ffi_lib File.join(File.dirname(__FILE__), '..\..\ext\LgLcdDll')
|
185
|
+
ffi_convention :stdcall
|
186
|
+
|
187
|
+
attach_function :init, :lgLcdInit, [], :long
|
188
|
+
attach_function :deinit, :lgLcdDeInit, [], :long
|
189
|
+
|
190
|
+
attach_function :connect, :lgLcdConnectExA, [:pointer], :long
|
191
|
+
attach_function :disconnect, :lgLcdDisconnect, [:int], :long
|
192
|
+
|
193
|
+
attach_function :open_by_type, :lgLcdOpenByType, [:pointer], :long
|
194
|
+
attach_function :close, :lgLcdClose, [:int], :long
|
195
|
+
|
196
|
+
attach_function :set_as_lcd_foreground_app, :lgLcdSetAsLCDForegroundApp, [:int, :int], :long
|
197
|
+
attach_function :update_bitmap, :lgLcdUpdateBitmap, [:int, :pointer, :long], :long
|
198
|
+
|
199
|
+
# Deprecated
|
200
|
+
attach_function :enumerate, :lgLcdEnumerateExA, [:int, :int, :pointer], :long
|
201
|
+
end
|
202
|
+
|
203
|
+
class Open
|
204
|
+
def initialize connection
|
205
|
+
@ctx = Lib::OpenByTypeContext.new
|
206
|
+
@ctx[:connection] = connection
|
207
|
+
@ctx[:device_type] = Lib::LGLCD_DEVICE_BW
|
208
|
+
@ctx[:device] = Lib::LGLCD_INVALID_DEVICE
|
209
|
+
raise "Open by type failes" unless Lib::LGLCD_RET_OK == Lib.open_by_type(@ctx)
|
210
|
+
|
211
|
+
begin
|
212
|
+
yield(self)
|
213
|
+
ensure
|
214
|
+
puts "Close"
|
215
|
+
Lib.close(@ctx[:device])
|
216
|
+
end
|
217
|
+
end
|
218
|
+
|
219
|
+
def device
|
220
|
+
return @ctx[:device]
|
221
|
+
end
|
222
|
+
end
|
223
|
+
|
224
|
+
class Connection
|
225
|
+
def initialize name
|
226
|
+
@ctx = Lib::ConnectionContext.new
|
227
|
+
@ctx[:app_friendly_name] = string_pointer(name)
|
228
|
+
@ctx[:is_persistent] = false
|
229
|
+
@ctx[:is_autostartable] = false
|
230
|
+
@ctx[:connection] = Lib::LGLCD_INVALID_CONNECTION
|
231
|
+
|
232
|
+
raise "Connecting failed" unless Lib::LGLCD_RET_OK == Lib.connect(@ctx)
|
233
|
+
|
234
|
+
begin
|
235
|
+
yield(self)
|
236
|
+
ensure
|
237
|
+
Lib.disconnect(connection)
|
238
|
+
end
|
239
|
+
end
|
240
|
+
|
241
|
+
def connection
|
242
|
+
return @ctx[:connection]
|
243
|
+
end
|
244
|
+
|
245
|
+
def open &block
|
246
|
+
return Open.new(connection, &block)
|
247
|
+
end
|
248
|
+
|
249
|
+
private
|
250
|
+
|
251
|
+
def string_pointer string
|
252
|
+
mem_buf = FFI::MemoryPointer.new(:char, string.size)
|
253
|
+
mem_buf.put_bytes(0, string)
|
254
|
+
return mem_buf
|
255
|
+
end
|
256
|
+
end
|
257
|
+
|
258
|
+
class LgLcd
|
259
|
+
def initialize
|
260
|
+
raise "Initialization failed" unless Lib::LGLCD_RET_OK == Lib.init()
|
261
|
+
|
262
|
+
begin
|
263
|
+
yield(self)
|
264
|
+
ensure
|
265
|
+
Lib.deinit()
|
266
|
+
end
|
267
|
+
end
|
268
|
+
|
269
|
+
def connect name, &block
|
270
|
+
return Connection.new(name, &block)
|
271
|
+
end
|
272
|
+
end
|
273
|
+
end
|
data/lib/lg-lcd/open.rb
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
require_relative 'lib'
|
2
|
+
|
3
|
+
module LgLcd
|
4
|
+
class Open
|
5
|
+
def initialize connection
|
6
|
+
@ctx = Lib::OpenByTypeContext.new
|
7
|
+
@ctx[:connection] = connection
|
8
|
+
@ctx[:device_type] = Lib::LGLCD_DEVICE_BW
|
9
|
+
@ctx[:device] = Lib::LGLCD_INVALID_DEVICE
|
10
|
+
raise "Open by type failes" unless Lib::LGLCD_RET_OK == Lib.open_by_type(@ctx)
|
11
|
+
|
12
|
+
begin
|
13
|
+
yield(self)
|
14
|
+
ensure
|
15
|
+
puts "Close"
|
16
|
+
Lib.close(@ctx[:device])
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
def device
|
21
|
+
return @ctx[:device]
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
data/test/test.rb
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
require_relative '../lib/lg-lcd/lib'
|
2
|
+
|
3
|
+
LgLcd::LgLcd.new do |lg_lcd|
|
4
|
+
puts "-" * 80
|
5
|
+
|
6
|
+
lg_lcd.connect("Ruby") do |ctx|
|
7
|
+
puts "Connection: #{ctx.connection}"
|
8
|
+
puts "-" * 40
|
9
|
+
|
10
|
+
dd = LgLcd::Lib::DeviceDesc.new
|
11
|
+
index = 0
|
12
|
+
while 0 == ret = LgLcd::Lib.enumerate(ctx.connection, index, dd)
|
13
|
+
puts "Index: #{index}"
|
14
|
+
puts "Family id: #{dd[:family_id]}"
|
15
|
+
puts "Display name: #{dd[:display_name]}"
|
16
|
+
puts "Width: #{dd[:width]}"
|
17
|
+
puts "Height: #{dd[:height]}"
|
18
|
+
puts "Bpp: #{dd[:bpp]}"
|
19
|
+
puts "Buttons: #{dd[:num_soft_buttons]}"
|
20
|
+
index = index + 1
|
21
|
+
end
|
22
|
+
STDOUT.flush
|
23
|
+
end
|
24
|
+
end
|
metadata
ADDED
@@ -0,0 +1,128 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: lg-lcd
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- theldoria
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2012-08-12 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: ffi
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: 1.1.5
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: 1.1.5
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: methadone
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
34
|
+
requirements:
|
35
|
+
- - ~>
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: 1.2.1
|
38
|
+
type: :runtime
|
39
|
+
prerelease: false
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ~>
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: 1.2.1
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
name: cucumber
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
50
|
+
requirements:
|
51
|
+
- - ! '>='
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '0'
|
54
|
+
type: :development
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
- !ruby/object:Gem::Dependency
|
63
|
+
name: aruba
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
65
|
+
none: false
|
66
|
+
requirements:
|
67
|
+
- - ! '>='
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '0'
|
70
|
+
type: :development
|
71
|
+
prerelease: false
|
72
|
+
version_requirements: !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
74
|
+
requirements:
|
75
|
+
- - ! '>='
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: '0'
|
78
|
+
description: Ruby binding to the 'Logitech LCD SDK Package'
|
79
|
+
email:
|
80
|
+
- theldoria@hotmail.com
|
81
|
+
executables:
|
82
|
+
- lglcd
|
83
|
+
extensions: []
|
84
|
+
extra_rdoc_files: []
|
85
|
+
files:
|
86
|
+
- lib/lg-lcd/connection.rb
|
87
|
+
- lib/lg-lcd/lglcd.rb
|
88
|
+
- lib/lg-lcd/lib.rb
|
89
|
+
- lib/lg-lcd/open.rb
|
90
|
+
- lib/lg-lcd/version.rb
|
91
|
+
- lib/lg-lcd.rb
|
92
|
+
- ext/LgLcdDll.dll
|
93
|
+
- bin/lglcd
|
94
|
+
- README.md
|
95
|
+
- LICENSE
|
96
|
+
- test/test.rb
|
97
|
+
- features/lglcd.feature
|
98
|
+
- features/support/env.rb
|
99
|
+
homepage: ''
|
100
|
+
licenses: []
|
101
|
+
post_install_message:
|
102
|
+
rdoc_options: []
|
103
|
+
require_paths:
|
104
|
+
- lib
|
105
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
106
|
+
none: false
|
107
|
+
requirements:
|
108
|
+
- - ! '>='
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: 1.9.2
|
111
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
112
|
+
none: false
|
113
|
+
requirements:
|
114
|
+
- - ! '>='
|
115
|
+
- !ruby/object:Gem::Version
|
116
|
+
version: 1.3.6
|
117
|
+
requirements: []
|
118
|
+
rubyforge_project:
|
119
|
+
rubygems_version: 1.8.24
|
120
|
+
signing_key:
|
121
|
+
specification_version: 3
|
122
|
+
summary: This binding provides low level access to the LCD of some Logitech products
|
123
|
+
like the G19, G15 or G510
|
124
|
+
test_files:
|
125
|
+
- test/test.rb
|
126
|
+
- features/lglcd.feature
|
127
|
+
- features/support/env.rb
|
128
|
+
has_rdoc:
|