+ * do_triggerResourceControl:
+ */
+static int do_triggerResourceControl (void *obj, Tcl_Interp *interp,
+ int argc, char **argv)
+{
+ IrTcl_Obj *p = obj;
+ Z_APDU *apdu;
+ Z_TriggerResourceControlRequest *req;
+ int r;
+
+ if (argc <= 0)
+ return TCL_OK;
+ if (!p->cs_link)
+ {
+ interp->result = "not connected";
+ return TCL_ERROR;
+ }
+ apdu = zget_APDU (p->odr_out, Z_APDU_triggerResourceControlRequest);
+ req = apdu->u.triggerResourceControlRequest;
+
+ if (!z_APDU (p->odr_out, &apdu, 0))
+ {
+ Tcl_AppendResult (interp, odr_errlist [odr_geterror (p->odr_out)],
+ NULL);
+ odr_reset (p->odr_out);
+ return TCL_ERROR;
+ }
+ p->sbuf = odr_getbuf (p->odr_out, &p->slen, NULL);
+ if ((r=cs_put (p->cs_link, p->sbuf, p->slen)) < 0)
+ {
+ interp->result = "cs_put failed in triggerResourceControl";
+ do_disconnect (p, NULL, 2, NULL);
+ return TCL_ERROR;
+ }
+ else if (r == 1)
+ {
+ ir_select_add_write (cs_fileno(p->cs_link), p);
+ logf (LOG_DEBUG, "Sent part of triggerResourceControl (%d bytes)",
+ p->slen);
+ }
+ else
+ logf (LOG_DEBUG, "Sent whole of triggerResourceControl (%d bytes)",
+ p->slen);
+ return TCL_OK;
+}
+
+/*