Class: Shutter3Sps
- Inherits:
-
Shutter3
- Object
- Shutter3
- Shutter3Sps
- Defined in:
- lib/shutter3_sps.rb
Instance Method Summary collapse
-
#initialize(bdid, topic: 'shutter3', sps_address: nil, sps_port: 59000) ⇒ Shutter3Sps
constructor
A new instance of Shutter3Sps.
- #on_android_keydown ⇒ Object
- #on_android_keypress ⇒ Object
- #on_android_keyup ⇒ Object
- #on_connect ⇒ Object
- #on_disconnect ⇒ Object
- #on_ios_keydown ⇒ Object
- #on_ios_keypress ⇒ Object
- #on_ios_keyup ⇒ Object
Constructor Details
#initialize(bdid, topic: 'shutter3', sps_address: nil, sps_port: 59000) ⇒ Shutter3Sps
Returns a new instance of Shutter3Sps.
11 12 13 14 15 16 17 |
# File 'lib/shutter3_sps.rb', line 11 def initialize(bdid, topic: 'shutter3', sps_address: nil, sps_port: 59000) raise 'Shutter3Sps: Please provide a SPS addres' unless sps_address super(bdid) @sps = SPSPub.new host: sps_address @topic = topic end |
Instance Method Details
#on_android_keydown ⇒ Object
23 24 25 |
# File 'lib/shutter3_sps.rb', line 23 def on_android_keydown() end |
#on_android_keypress ⇒ Object
19 20 21 |
# File 'lib/shutter3_sps.rb', line 19 def on_android_keypress() @sps.notice @topic + ': button2 pressed' end |
#on_android_keyup ⇒ Object
27 28 29 |
# File 'lib/shutter3_sps.rb', line 27 def on_android_keyup() end |
#on_connect ⇒ Object
31 32 33 |
# File 'lib/shutter3_sps.rb', line 31 def on_connect() @sps.notice @topic + ': connected' end |
#on_disconnect ⇒ Object
35 36 37 38 |
# File 'lib/shutter3_sps.rb', line 35 def on_disconnect() @sps.notice @topic + ': dicconnected' end |
#on_ios_keydown ⇒ Object
44 45 46 |
# File 'lib/shutter3_sps.rb', line 44 def on_ios_keydown() end |
#on_ios_keypress ⇒ Object
40 41 42 |
# File 'lib/shutter3_sps.rb', line 40 def on_ios_keypress() @sps.notice @topic + ': button1 pressed' end |
#on_ios_keyup ⇒ Object
48 49 50 |
# File 'lib/shutter3_sps.rb', line 48 def on_ios_keyup() end |