MCPcopy Create free account
hub / github.com/Hamlib/Hamlib / write_transaction

Function write_transaction

rigs/dummy/aclog.c:216–249  ·  view source on GitHub ↗

* write_transaction * Assumes rig!=NULL, xml!=NULL, xml_len=total size of xml for response */

Source from the content-addressed store, hash-verified

214* Assumes rig!=NULL, xml!=NULL, xml_len=total size of xml for response
215*/
216static int write_transaction(RIG *rig, char *xml, int xml_len)
217{
218
219 int try = rig->caps->retry;
220
221 int retval = -RIG_EPROTO;
222 hamlib_port_t *rp = RIGPORT(rig);
223
224 ENTERFUNC;
225
226 // This shouldn't ever happen...but just in case
227 // We need to avoid an empty write as rigctld replies with blank line
228 if (xml_len == 0)
229 {
230 rig_debug(RIG_DEBUG_ERR, "%s: len==0??\n", __func__);
231 RETURNFUNC(retval);
232 }
233
234 // appears we can lose sync if we don't clear things out
235 // shouldn't be anything for us now anyways
236 rig_flush(rp);
237
238 while (try-- >= 0 && retval != RIG_OK)
239 {
240 retval = write_block(rp, (unsigned char *) xml, strlen(xml));
241
242 if (retval < 0)
243 {
244 RETURNFUNC(-RIG_EIO);
245 }
246 }
247
248 RETURNFUNC(retval);
249}
250
251static int aclog_transaction(RIG *rig, char *cmd, char *value,
252 int value_len)

Callers 1

aclog_transactionFunction · 0.70

Calls 3

rig_debugFunction · 0.85
rig_flushFunction · 0.85
write_blockFunction · 0.85

Tested by

no test coverage detected