Class: Phidgets::Hub

Inherits:
Common show all
Defined in:
ext/phidgets/phidgets_hub.c

Instance Method Summary collapse

Methods inherited from Common

#close, #getAttached, #getChannel, #getChannelClass, #getChannelClassName, #getChannelName, #getChannelSubclass, #getDataInterval, #getDeviceChannelCount, #getDeviceClass, #getDeviceClassName, #getDeviceID, #getDeviceLabel, #getDeviceName, #getDeviceSKU, #getDeviceSerialNumber, #getDeviceVersion, #getHubPort, #getHubPortCount, #getIsChannel, #getIsHubPortDevice, #getIsLocal, #getIsRemote, #getServerHostname, #getServerName, #getServerPeerName, #getServerUniqueName, #open, #openWaitForAttachment, #setChannel, #setDataInterval, #setDeviceLabel, #setDeviceSerialNumber, #setHubPort, #setIsHubPortDevice, #setIsLocal, #setIsRemote, #setOnAttachHandler, #setOnDetachHandler, #setOnErrorHandler, #setOnPropertyChangeHandler, #setServerName, #writeDeviceLabel

Constructor Details

#newObject

Creates a Phidget Hub object.



5
6
7
8
9
# File 'ext/phidgets/phidgets_hub.c', line 5

VALUE ph_hub_init(VALUE self) {
  ph_data_t *ph = get_ph_data(self);
  ph_raise(PhidgetHub_create((PhidgetHubHandle *)(&(ph->handle))));
  return self;
}

Instance Method Details

#setPortPower(port, state) ⇒ Object Also known as: set_port_power

Controls power to the VINT Hub Ports.



12
13
14
15
# File 'ext/phidgets/phidgets_hub.c', line 12

VALUE ph_hub_set_port_power(VALUE self, VALUE port, VALUE state) {
  ph_raise(PhidgetHub_setPortPower((PhidgetHubHandle)get_ph_handle(self), NUM2INT(port), TYPE(state) == T_TRUE ? PTRUE : PFALSE));
  return Qnil;
}