Example #1
0
        public ERROR_ID UpdateDevice(string formFilePath)
        {
            string filename = Path.GetFileName(formFilePath);

            RBA_API.SetParam(PARAMETER_ID.P62_REQ_RECORD_TYPE, "0");
            RBA_API.SetParam(PARAMETER_ID.P62_REQ_ENCODING_FORMAT, "8");

            //this will be a tgz file for all forms - application files are set to 1
            if (formFilePath.ToLower().Contains("ogz"))
            {
                RBA_API.SetParam(PARAMETER_ID.P62_REQ_UNPACK_FLAG, "0");
            }
            else
            {
                RBA_API.SetParam(PARAMETER_ID.P62_REQ_UNPACK_FLAG, "1");
            }

            RBA_API.SetParam(PARAMETER_ID.P62_REQ_FAST_DOWNLOAD, "1");
            RBA_API.SetParam(PARAMETER_ID.P62_REQ_OS_FILE_NAME, formFilePath);
            RBA_API.SetParam(PARAMETER_ID.P62_REQ_FILE_NAME, filename);

            ERROR_ID result = RBA_API.ProcessMessage(MESSAGE_ID.FILE_WRITE);

            return(result);
        }
Example #2
0
        public ERROR_ID SoftReset()
        {
            RBA_API.SetParam(PARAMETER_ID.P15_REQ_RESET_TYPE, "9");
            ERROR_ID result = RBA_API.ProcessMessage(MESSAGE_ID.M15_SOFT_RESET);

            return(result);
        }
Example #3
0
        public ERROR_ID WriteConfiguration(string group, string index, string data)
        {
            RBA_API.SetParam(PARAMETER_ID.P60_REQ_GROUP_NUM, group);
            RBA_API.SetParam(PARAMETER_ID.P60_REQ_INDEX_NUM, index);
            RBA_API.SetParam(PARAMETER_ID.P60_REQ_DATA_CONFIG_PARAM, data);
            ERROR_ID result = RBA_API.ProcessMessage(MESSAGE_ID.M60_CONFIGURATION_WRITE);

            return(result);
        }
Example #4
0
        public string Get24RebootTime()
        {
            RBA_API.SetParam(PARAMETER_ID.P61_REQ_GROUP_NUM, "0007");
            RBA_API.SetParam(PARAMETER_ID.P61_REQ_INDEX_NUM, "0046");
            RBA_API.ProcessMessage(MESSAGE_ID.M61_CONFIGURATION_READ);

            string status = RBA_API.GetParam(PARAMETER_ID.P61_RES_DATA_CONFIG_PARAMETER);

            return(status);
        }
Example #5
0
        public string GetVariable_29(string varId)
        {
            RBA_API.SetParam(PARAMETER_ID.P29_REQ_VARIABLE_ID, varId);
            RBA_API.ProcessMessage(MESSAGE_ID.M29_GET_VARIABLE);

            string status   = RBA_API.GetParam(PARAMETER_ID.P29_RES_STATUS);
            string variable = RBA_API.GetParam(PARAMETER_ID.P29_RES_VARIABLE_ID);
            string value    = RBA_API.GetParam(PARAMETER_ID.P29_RES_VARIABLE_DATA);

            return(value);
        }
Example #6
0
        public string RetrieveFile(string filename)
        {
            RBA_API.SetParam(PARAMETER_ID.P65_REQ_RECORD_TYPE, "1");
            //dataformat - 0 = plain text and 1 = BASE64 Format - all should be plain text 0
            RBA_API.SetParam(PARAMETER_ID.P65_REQ_DATA_TYPE, "0");
            RBA_API.SetParam(PARAMETER_ID.P65_REQ_FILE_NAME, filename);
            ERROR_ID result = RBA_API.ProcessMessage(MESSAGE_ID.M65_RETRIVE_FILE);

            //get value that will determine is the file was actually found and retreived
            string resultMessage = RBA_API.GetParam(PARAMETER_ID.P65_RES_RESULT);
            string fileData      = RBA_API.GetParam(PARAMETER_ID.P65_RES_DATA);

            return(fileData);
        }
Example #7
0
        public ERROR_ID ShowMessage(DeviceForms form, string message)
        {
            ERROR_ID Result;

            Result = RBA_API.SetParam(PARAMETER_ID.P24_REQ_FORM_NUMBER, StringEnum.GetStringValue(form));

            Result = RBA_API.SetParam(PARAMETER_ID.P24_REQ_TYPE_OF_ELEMENT, StringEnum.GetStringValue(DeviceFormTypeOf.Text));
            Result = RBA_API.SetParam(PARAMETER_ID.P24_REQ_TEXT_ELEMENTID, StringEnum.GetStringValue(DeviceFormElementID.PromptLine1));
            Result = RBA_API.SetParam(PARAMETER_ID.P24_REQ_PROMPT_IDX, message);

            Result = RBA_API.ProcessMessage(MESSAGE_ID.M24_FORM_ENTRY);

            //Make sure the form shows on the device long enough for the user to see it
            Thread.Sleep(2000);

            return(Result);
        }
Example #8
0
        public ERROR_ID UpdateDeviceCustom(string form_file_path)
        {
            ERROR_ID Result = ERROR_ID.RESULT_SUCCESS;

            try
            {
                string filename = Path.GetFileName(form_file_path);
                Result = RBA_API.SetParam(PARAMETER_ID.P62_REQ_UNPACK_FLAG, "0");
                Result = RBA_API.SetParam(PARAMETER_ID.P62_REQ_ENCODING_FORMAT, "8");

                //this will be a tgz file for all forms - application files are set to 1
                if (form_file_path.ToLower().Contains("ogz"))
                {
                    Result = RBA_API.SetParam(PARAMETER_ID.P62_REQ_UNPACK_FLAG, "0");
                }
                else
                {
                    Result = RBA_API.SetParam(PARAMETER_ID.P62_REQ_UNPACK_FLAG, "1");
                }

                Result = RBA_API.SetParam(PARAMETER_ID.P62_REQ_FAST_DOWNLOAD, "1");
                Result = RBA_API.SetParam(PARAMETER_ID.P62_REQ_OS_FILE_NAME, form_file_path);
                Result = RBA_API.SetParam(PARAMETER_ID.P62_REQ_FILE_NAME, filename);

                Result = RBA_API.SetParam(PARAMETER_ID.P60_REQ_GROUP_NUM, "13");
                Result = RBA_API.SetParam(PARAMETER_ID.P60_REQ_INDEX_NUM, "11");
                Result = RBA_API.SetParam(PARAMETER_ID.P60_REQ_DATA_CONFIG_PARAM, "1");
                Result = RBA_API.ProcessMessage(MESSAGE_ID.M60_CONFIGURATION_WRITE);

                Result = RBA_API.SetParam(PARAMETER_ID.P62_REQ_LAST_MESSAGE_TIMEOUT_SEC, "360");

                ShowMessage("Device Form Loading ...");

                Result = RBA_API.ProcessMessage(MESSAGE_ID.FILE_WRITE);
                Debug.WriteLine("DEVICE UPDATER: SetParam() FILE_WRITE RESULT-----------={0}", Result);
            }
            catch (Exception e)
            {
                Debug.WriteLine("DeviceConfig: EXCEPTION={0}", (object)e.Message);
            }

            return(Result);
        }
Example #9
0
        public ERROR_ID LoadForm(string formName, string message)
        {
            ERROR_ID Result = RBA_API.ProcessMessage(MESSAGE_ID.M01_ONLINE);;

            Debug.WriteLine("device online : {0} --------------------------------------------------", (object)result);

            Result = RBA_API.SetParam(PARAMETER_ID.P24_REQ_FORM_NUMBER, formName);

            Result = RBA_API.SetParam(PARAMETER_ID.P24_REQ_TYPE_OF_ELEMENT, StringEnum.GetStringValue(DeviceFormTypeOf.Text));
            Result = RBA_API.SetParam(PARAMETER_ID.P24_REQ_TEXT_ELEMENTID, StringEnum.GetStringValue(DeviceFormElementID.PromptLine1));
            Result = RBA_API.SetParam(PARAMETER_ID.P24_REQ_PROMPT_IDX, message);

            Result = RBA_API.ProcessMessage(MESSAGE_ID.M24_FORM_ENTRY);

            //Make sure the form shows on the device long enough for the user to see it
            //System.Threading.Thread.Sleep(4000);

            return(Result);
        }
Example #10
0
        private void SetDeviceToOnDemand()
        {
            //check to see if the device is already in OnDemand
            RBA_API.SetParam(PARAMETER_ID.P61_REQ_GROUP_NUM, "7");
            RBA_API.SetParam(PARAMETER_ID.P61_REQ_INDEX_NUM, "15");
            RBA_API.ProcessMessage(MESSAGE_ID.M61_CONFIGURATION_READ);

            string dataValue = RBA_API.GetParam(PARAMETER_ID.P61_RES_DATA_CONFIG_PARAMETER);

            //Not Set - so set it
            if (!OnDemandSet || dataValue != "1")
            {
                RBA_API.SetParam(PARAMETER_ID.P60_REQ_GROUP_NUM, "7");
                RBA_API.SetParam(PARAMETER_ID.P60_REQ_INDEX_NUM, "15");
                RBA_API.SetParam(PARAMETER_ID.P60_REQ_DATA_CONFIG_PARAM, "1");
                RBA_API.ProcessMessage(MESSAGE_ID.M60_CONFIGURATION_WRITE);

                OnDemandSet = true;
            }
        }