Guest User

Untitled

a guest
Nov 19th, 2018
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.12 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <hamlib/rig.h>
  3.  
  4. int main() {
  5. RIG * my_rig;
  6. int retcode;
  7. vfo_t vfo;
  8.  
  9. rig_set_debug(RIG_DEBUG_NONE);
  10.  
  11. my_rig = rig_init(RIG_MODEL_NETRIGCTL);
  12.  
  13. retcode = rig_open(my_rig);
  14.  
  15. if (retcode == RIG_OK) {
  16. printf("connected\n");
  17. retcode = rig_get_vfo(my_rig, &vfo);
  18. if (retcode == RIG_OK) {
  19. retcode = rig_set_vfo(my_rig, vfo);
  20. if (retcode == RIG_OK) {
  21. printf("set vfo success\n");
  22. printf("current vfo: %d\n", (int)vfo);
  23. retcode = rig_send_morse(my_rig, vfo, "TEST HA2OS HA2OS TEST");
  24. if (retcode == RIG_OK) {
  25. printf("send success\n");
  26. }
  27. else {
  28. printf("send morse failed, retcode: %d", retcode);
  29. }
  30. }
  31. else {
  32. printf("set vfo failed, retcode: %d\n", retcode);
  33. }
  34. }
  35. else {
  36. printf("can't read current vfo, retcode: %d", retcode);
  37. }
  38. }
  39. else {
  40. printf("cat't connect to rig, retcode: %d\n", retcode);
  41. }
  42. }
Add Comment
Please, Sign In to add comment