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

Function write_transaction

rigs/dummy/flrig.c:539–573  ·  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

537* Assumes rig!=NULL, xml!=NULL, xml_len=total size of xml for response
538*/
539static int write_transaction(RIG *rig, char *xml, int xml_len)
540{
541
542 int try = rig->caps->retry;
543
544 int retval = -RIG_EPROTO;
545
546 hamlib_port_t *rp = RIGPORT(rig);
547
548 ENTERFUNC;
549
550 // This shouldn't ever happen...but just in case
551 // We need to avoid an empty write as rigctld replies with blank line
552 if (xml_len == 0)
553 {
554 rig_debug(RIG_DEBUG_ERR, "%s: len==0??\n", __func__);
555 RETURNFUNC(retval);
556 }
557
558 // appears we can lose sync if we don't clear things out
559 // shouldn't be anything for us now anyways
560 rig_flush(rp);
561
562 while (try-- >= 0 && retval != RIG_OK)
563 {
564 retval = write_block(rp, (unsigned char *) xml, strlen(xml));
565
566 if (retval < 0)
567 {
568 RETURNFUNC(-RIG_EIO);
569 }
570 }
571
572 RETURNFUNC(retval);
573}
574
575static int flrig_transaction(RIG *rig, char *cmd, char *cmd_arg, char *value,
576 int value_len)

Callers 1

flrig_transactionFunction · 0.70

Calls 3

rig_debugFunction · 0.85
rig_flushFunction · 0.85
write_blockFunction · 0.85

Tested by

no test coverage detected