Exemple #1
0
        private bool performRSMSetStoreAttribute(Scanner.RSMAttribute rsmAttribute, bool isStore)
        {
            if (IsScannerConnected())
            {
                string inXml = "<inArgs>" +
                               GetOnlyScannerIDXml() +
                               "<cmdArgs>" +
                               "<arg-xml>" +
                               "<attrib_list>" +
                               "<attribute>" +
                               "<id>" + rsmAttribute.ID + "</id>" +
                               "<datatype>" + rsmAttribute.Type + "</datatype>" +
                               "<value>" + rsmAttribute.value + "</value>" +
                               "</attribute>" +
                               "</attrib_list>" +
                               "</arg-xml>" +
                               "</cmdArgs>" +
                               "</inArgs>";


                string outXml = "";
                int    status = STATUS_FALSE;
                int    opCode = isStore ? RSM_ATTR_STORE : RSM_ATTR_SET;
                ExecCmd(opCode, ref inXml, out outXml, out status);
                UpdateOutXml(outXml);
                string strOpCode = "RSM_ATTR_SET";
                if (RSM_ATTR_STORE == opCode)
                {
                    strOpCode = "RSM_ATTR_STORE";
                }
                DisplayResult(status, strOpCode);
            }
            return(false);
        }
Exemple #2
0
        private bool PerformRSMGetAttribute(int attributeNo, out Scanner.RSMAttribute attribute)
        {
            value     = null;
            attribute = null;
            if (IsScannerConnected())
            {
                string inXml = "<inArgs>" +
                               GetOnlyScannerIDXml() +
                               "<cmdArgs>" +
                               "<arg-xml>" +
                               "<attrib_list>" +
                               attributeNo +
                               "</attrib_list>" +
                               "</arg-xml>" +
                               "</cmdArgs>" +
                               "</inArgs>";

                int    opCode = RSM_ATTR_GET;
                string outXml = "";
                int    status = STATUS_FALSE;
                ExecCmd(opCode, ref inXml, out outXml, out status);
                UpdateOutXml(outXml);

                if (!chkAsync.Checked)
                {
                    Scanner scanr      = null;
                    int     nIndex     = -1;
                    int     nAttrCount = 0;
                    int     nOpCode    = -1;

                    m_xml.ReadXmlString_RsmAttrGet(outXml, m_arScanners, out scanr, out nIndex, out nAttrCount, out nOpCode);
                    if (scanr == null)
                    {
                        DisplayResult(STATUS_FALSE, "RSM_ATTR_GET");
                        return(false);
                    }
                    DisplayResult(STATUS_SUCCESS, "RSM_ATTR_GET");

                    attribute = scanr.m_rsmAttribute;
                    return(true);
                }
            }

            return(false);
        }