Logo Search packages:      
Sourcecode: libgphoto2 version File versions  Download package

int gp_port_set_pin ( GPPort port,
GPPin  pin,
GPLevel  level 

Set specified serial PIN to value.

port a GPPort
pin the serial pin to be retrieved
level the setting of the pin
Pulls the specified pin of a serial port to the specified level.

a gphoto2 error code

Definition at line 680 of file gphoto2-port.c.

References CHECK_NULL, CHECK_RESULT, gp_log(), GP_LOG_DEBUG, GP_OK, _GPPortPrivateCore::ops, _GPPort::pc, and _GPPortOperations::set_pin.

      unsigned int i, j;

      for (i = 0; PinTable[i].description_short; i++)
            if (PinTable[i].pin == pin)
      for (j = 0; LevelTable[j].description; j++)
            if (LevelTable[j].level == level)
      gp_log (GP_LOG_DEBUG, "gphoto2-port", _("Setting pin %i "
            "(%s: '%s') to '%s'..."), 
            PinTable[i].number, PinTable[i].description_short,
            PinTable[i].description_long, _(LevelTable[j].description));

      CHECK_NULL (port);
      CHECK_INIT (port);

      CHECK_SUPP (port, "set_pin", port->pc->ops->set_pin);
      CHECK_RESULT (port->pc->ops->set_pin (port, pin, level));

      return (GP_OK);

Generated by  Doxygen 1.6.0   Back to index