Class: NewRemote::Transmitter
- Inherits:
-
Object
- Object
- NewRemote::Transmitter
- Defined in:
- lib/new_remote.rb,
ext/new_remote/new_remote.cpp
Instance Method Summary collapse
- #group ⇒ Object
- #initialize(*args) ⇒ Object constructor
- #send_group(state) ⇒ Object
- #send_group_dim(dimLevel) ⇒ Object
- #send_unit(device, state) ⇒ Object
- #send_unit_dim(device, dimLevel) ⇒ Object
- #unit(device) ⇒ Object
Constructor Details
#initialize(*args) ⇒ Object
96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 |
# File 'ext/new_remote/new_remote.cpp', line 96
static VALUE wrap_transmitter_initialize(int argc, VALUE *argv, VALUE self) {
NewRemoteTransmitter *transmitter = getNewRemoteTransmitter(self);
VALUE address, pin, periodusec, repeats;
rb_scan_args(argc, argv, "22", &address, &pin, &periodusec, &repeats);
if (NIL_P(periodusec)) {
periodusec = INT2NUM(260);
}
if (NIL_P(repeats)) {
repeats = INT2NUM(4);
}
new(transmitter) NewRemoteTransmitter(NUM2INT(address), NUM2INT(pin), NUM2INT(periodusec), NUM2INT(repeats));
return Qnil;
}
|
Instance Method Details
#group ⇒ Object
49 50 51 |
# File 'lib/new_remote.rb', line 49 def group GroupCommand.new(self) end |
#send_group(state) ⇒ Object
115 116 117 118 119 120 121 |
# File 'ext/new_remote/new_remote.cpp', line 115
static VALUE wrap_transmitter_send_group(VALUE self, VALUE state) {
NewRemoteTransmitter *transmitter = getNewRemoteTransmitter(self);
transmitter->sendGroup(RTEST(state));
return self;
}
|
#send_group_dim(dimLevel) ⇒ Object
131 132 133 134 135 136 137 |
# File 'ext/new_remote/new_remote.cpp', line 131
static VALUE wrap_transmitter_send_group_dim(VALUE self, VALUE dimLevel) {
NewRemoteTransmitter *transmitter = getNewRemoteTransmitter(self);
transmitter->sendGroupDim(NUM2INT(dimLevel));
return self;
}
|
#send_unit(device, state) ⇒ Object
123 124 125 126 127 128 129 |
# File 'ext/new_remote/new_remote.cpp', line 123
static VALUE wrap_transmitter_send_unit(VALUE self, VALUE device, VALUE state) {
NewRemoteTransmitter *transmitter = getNewRemoteTransmitter(self);
transmitter->sendUnit(NUM2INT(device), RTEST(state));
return self;
}
|
#send_unit_dim(device, dimLevel) ⇒ Object
139 140 141 142 143 144 145 |
# File 'ext/new_remote/new_remote.cpp', line 139
static VALUE wrap_transmitter_send_unit_dim(VALUE self, VALUE device, VALUE dimLevel) {
NewRemoteTransmitter *transmitter = getNewRemoteTransmitter(self);
transmitter->sendDim(NUM2INT(device), NUM2INT(dimLevel));
return self;
}
|
#unit(device) ⇒ Object
45 46 47 |
# File 'lib/new_remote.rb', line 45 def unit(device) UnitCommand.new(self, device) end |