* \brief Get a lock on the Parallel Port * \param port * \return RIG_OK or < 0 */
| 547 | * \return RIG_OK or < 0 |
| 548 | */ |
| 549 | int HAMLIB_API par_lock(hamlib_port_t *port) |
| 550 | { |
| 551 | rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); |
| 552 | |
| 553 | #ifdef HAVE_LINUX_PPDEV_H |
| 554 | |
| 555 | if (ioctl(port->fd, PPCLAIM) < 0) |
| 556 | { |
| 557 | rig_debug(RIG_DEBUG_ERR, |
| 558 | "%s: claiming device \"%s\": %s\n", |
| 559 | __func__, |
| 560 | port->pathname, |
| 561 | strerror(errno)); |
| 562 | return -RIG_EIO; |
| 563 | } |
| 564 | |
| 565 | return RIG_OK; |
| 566 | #elif defined(HAVE_DEV_PPBUS_PPI_H) |
| 567 | return RIG_OK; |
| 568 | #elif defined(__WIN64__) || defined(__WIN32__) |
| 569 | return RIG_OK; |
| 570 | #else |
| 571 | return -RIG_ENIMPL; |
| 572 | #endif |
| 573 | } |
| 574 | |
| 575 | |
| 576 | /** |
no test coverage detected