| 596 | } |
| 597 | |
| 598 | extern "C" int indi_wrapper_open(ROT *rot) |
| 599 | { |
| 600 | hamlib_port_t *rotp = ROTPORT(rot); |
| 601 | char host[256]; |
| 602 | char port[6]; |
| 603 | |
| 604 | rig_debug(RIG_DEBUG_TRACE, "%s called\n", __func__); |
| 605 | |
| 606 | if (parse_hoststr(rotp->pathname, strlen(rotp->pathname), host, port) == RIG_OK) |
| 607 | { |
| 608 | indi_wrapper_client->setServer(host, atoi(port)); |
| 609 | } |
| 610 | else |
| 611 | { |
| 612 | indi_wrapper_client->setServer("localhost", 7624); |
| 613 | } |
| 614 | |
| 615 | if (!indi_wrapper_client->connectServer()) |
| 616 | { |
| 617 | rig_debug(RIG_DEBUG_ERR, "indi: server refused connection\n"); |
| 618 | return -RIG_EPROTO; |
| 619 | } |
| 620 | |
| 621 | return RIG_OK; |
| 622 | } |
| 623 | |
| 624 | extern "C" int indi_wrapper_close(ROT *rot) |
| 625 | { |
nothing calls this directly
no test coverage detected