MCPcopy Create free account
hub / github.com/cjcliffe/CubicSDR / setErrorStateFromHamlibCode

Method setErrorStateFromHamlibCode

src/rig/RigThread.cpp:47–104  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

45}
46
47void RigThread::setErrorStateFromHamlibCode(int errcode) {
48 errorState.store(true);
49 switch (abs(errcode)) {
50 case RIG_EINVAL:
51 errorMessage = "Invalid parameter specified.";
52 break; /*!< invalid parameter */
53 case RIG_ECONF:
54 errorMessage = "Invalid configuration i.e. serial, etc.";
55 break; /*!< invalid configuration (serial,..) */
56 case RIG_ENOMEM:
57 errorMessage = "Out of memory.";
58 break; /*!< memory shortage */
59 case RIG_ENIMPL:
60 errorMessage = "Function Not Yet Implemented.";
61 break; /*!< function not implemented, but will be */
62 case RIG_ETIMEOUT:
63 errorMessage = "Communication timed out.";
64 break; /*!< communication timed out */
65 case RIG_EIO:
66 errorMessage = "I/O error (Open failed?)";
67 break; /*!< IO error, including open failed */
68 case RIG_EINTERNAL:
69 errorMessage = "Internal hamlib error :(";
70 break; /*!< Internal Hamlib error, huh! */
71 case RIG_EPROTO:
72 errorMessage = "Protocol Error.";
73 break; /*!< Protocol error */
74 case RIG_ERJCTED:
75 errorMessage = "Command rejected by rig.";
76 break; /*!< Command rejected by the rig */
77 case RIG_ETRUNC:
78 errorMessage = "Argument truncated.";
79 break; /*!< Command performed, but arg truncated */
80 case RIG_ENAVAIL:
81 errorMessage = "Function not available.";
82 break; /*!< function not available */
83 case RIG_ENTARGET:
84 errorMessage = "VFO not targetable.";
85 break; /*!< VFO not targetable */
86 case RIG_BUSERROR:
87 errorMessage = "Error talking on the bus.";
88 break; /*!< Error talking on the bus */
89 case RIG_BUSBUSY:
90 errorMessage = "Collision on the bus.";
91 break; /*!< Collision on the bus */
92 case RIG_EARG:
93 errorMessage = "Invalid rig handle.";
94 break; /*!< NULL RIG handle or any invalid pointer parameter in get arg */
95 case RIG_EVFO:
96 errorMessage = "Invalid VFO.";
97 break; /*!< Invalid VFO */
98 case RIG_EDOM:
99 errorMessage = "Argument out of domain of function.";
100 break; /*!< Argument out of domain of func */
101 }
102
103 std::cout << "Rig error: " << errorMessage << std::endl;
104}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected