Beispiel #1
0
            public void enumerateSupportedControlLanguages(IMethodResult oResult)
            {
                Logger.Write("enumerateSupportedControlLanguages call");

                if (m_printer != null)
                {
                    IReadOnlyDictionary <string, string> controlLanguage = new IReadOnlyDictionary <string, string>();

                    switch (m_printer.GetPrinterControlLanguage())
                    {
                    case PrinterLanguage.CPCL:
                        controlLanguage.Add(ZebraConstants.PRINTER_LANGUAGE_CPCL, "");
                        break;

                    case PrinterLanguage.ZPL:
                        controlLanguage.Add(ZebraConstants.PRINTER_LANGUAGE_ZPL, "");
                        controlLanguage.Add(ZebraConstants.PRINTER_LANGUAGE_CPCL, "");
                        break;
                    }

                    oResult.set(controlLanguage);
                    return;
                }

                oResult.set(ZebraConstants.PRINTER_STATUS_ERR_NOT_CONNECTED);
            }
Beispiel #2
0
        protected void InitDefaultValue()
        {
            _data = new Dictionary <int, T>();

            var dv = new T();

            _data.Add(dv.GetHashCode(), dv);
        }
Beispiel #3
0
            public void printRawString(string command, IReadOnlyDictionary <string, string> options, IMethodResult oResult)
            {
                Logger.Write("printRawString call: " + command);
                Logger.Write("command: " + command);
                Logger.Write("options:", options);

                if (m_connection != null && m_printer != null)
                {
                    try
                    {
                        byte[] commandStr = Encoding.UTF8.GetBytes(command);
                        m_connection.Write(commandStr);

                        Thread.Sleep(500);

                        byte[] printerResponse    = m_connection.Read();
                        string printerResponseStr = Encoding.UTF8.GetString(printerResponse, 0, printerResponse.Length);

                        IReadOnlyDictionary <string, string> response = new IReadOnlyDictionary <string, string>();

                        response.Add(ZebraConstants.HK_STATUS, ZebraConstants.PRINTER_STATUS_SUCCESS);
                        response.Add(ZebraConstants.HK_STRING_RESPONCE, printerResponseStr);

                        oResult.set(response);
                    }
                    catch (Exception ex)
                    {
                        IReadOnlyDictionary <string, string> errResponse = new IReadOnlyDictionary <string, string>();

                        errResponse.Add(ZebraConstants.HK_STATUS, ZebraConstants.PRINTER_STATUS_ERROR);
                        errResponse.Add(ZebraConstants.HK_MESSAGE, ex.Message.ToString());

                        oResult.set(errResponse);
                    }
                }
                else
                {
                    oResult.set(ZebraConstants.PRINTER_STATUS_ERR_NOT_CONNECTED);
                }
            }
Beispiel #4
0
            public void retrieveFileNames(IMethodResult oResult)
            {
                Logger.Write("call retrieveFileNames ");

                IReadOnlyDictionary <string, object> resultHash = new IReadOnlyDictionary <string, object>();

                if (m_connection != null && m_connection.IsConnected())
                {
                    RetriveParser parser = new RetriveParser(m_connection);

                    List <string> resultNames = parser.getAllFileNames();

                    resultHash.Add(ZebraConstants.HK_STATUS, ZebraConstants.PRINTER_STATUS_SUCCESS);
                    resultHash.Add(ZebraConstants.HK_FILE_NAMES, resultNames);
                    oResult.set(resultHash);

                    return;
                }

                resultHash.Add(ZebraConstants.HK_STATUS, ZebraConstants.PRINTER_STATUS_ERROR);
                resultHash.Add(ZebraConstants.HK_FILE_NAMES, new List <string>());
                oResult.set(resultHash);
            }
Beispiel #5
0
            public void retrieveFileNamesWithExtensions(IReadOnlyList <string> extensions, IMethodResult oResult)
            {
                Logger.Write("retrieveFileNamesWithExtensions call");
                Logger.Write("extensions:", extensions);

                IReadOnlyDictionary <string, object> resultHash = new IReadOnlyDictionary <string, object>();

                if (m_printer != null)
                {
                    RetriveParser parser = new RetriveParser(m_connection);

                    List <string> resultNames = parser.getAllFileNames(extensions);

                    resultHash.Add(ZebraConstants.HK_STATUS, ZebraConstants.PRINTER_STATUS_SUCCESS);
                    resultHash.Add(ZebraConstants.HK_FILE_NAMES, resultNames);
                    oResult.set(resultHash);

                    return;
                }

                resultHash.Add(ZebraConstants.HK_STATUS, ZebraConstants.PRINTER_STATUS_ERROR);
                resultHash.Add(ZebraConstants.HK_FILE_NAMES, new List <string>());
                oResult.set(resultHash);
            }
        static DebugApplicationEngine()
        {
            var debugServices = new Dictionary <uint, ServiceMethod>();

            Register("System.Runtime.CheckWitness", Debug_CheckWitness);
            Register("System.Blockchain.GetBlock", Debug_GetBlock);
            Register("System.Blockchain.GetTransactionFromBlock", Debug_GetTransactionFromBlock);

            DebugApplicationEngine.debugServices = debugServices;

            void Register(string name, ServiceMethod method)
            {
                var hash = BitConverter.ToUInt32(Encoding.ASCII.GetBytes(name).Sha256(), 0);

                debugServices.Add(hash, method);
            }
        }
        public EnumAsStringFormatter()
        {
            this.isFlags = typeof(T).GetCustomAttribute <FlagsAttribute>() is object;

            var fields           = typeof(T).GetFields(BindingFlags.DeclaredOnly | BindingFlags.Public | BindingFlags.Static);
            var nameValueMapping = new Dictionary <string, T>(fields.Length);
            var valueNameMapping = new Dictionary <T, string>();
            Dictionary <string, string> clrToSerializationName = null;
            Dictionary <string, string> serializationToClrName = null;

            foreach (FieldInfo enumValueMember in fields)
            {
                string name  = enumValueMember.Name;
                T      value = (T)enumValueMember.GetValue(null);

                // Consider the case where the serialized form of the enum value is overridden via an attribute.
                var attribute = enumValueMember.GetCustomAttribute <EnumMemberAttribute>();
                if (attribute?.IsValueSetExplicitly ?? false)
                {
                    clrToSerializationName = clrToSerializationName ?? new Dictionary <string, string>();
                    serializationToClrName = serializationToClrName ?? new Dictionary <string, string>();

                    clrToSerializationName.Add(name, attribute.Value);
                    serializationToClrName.Add(attribute.Value, name);

                    name = attribute.Value;
                    this.enumMemberOverridesPresent = true;
                }

                nameValueMapping[name]  = value;
                valueNameMapping[value] = name;
            }

            this.nameValueMapping       = nameValueMapping;
            this.valueNameMapping       = valueNameMapping;
            this.clrToSerializationName = clrToSerializationName;
            this.serializationToClrName = serializationToClrName;
        }
Beispiel #8
0
        public void requestState(IReadOnlyList<string> listOfParameters, IMethodResult oResult)
        {
            Logger.Write("requestState call");
            Logger.Write("listOfParameters:", listOfParameters);

            IReadOnlyDictionary<string, object> resultHash = new IReadOnlyDictionary<string, object>();

            if (m_connection != null && m_connection.IsConnected() && m_printer != null)
            {
                PrinterStatus currStatus = getStatus();
                
                if (currStatus != null)
                {
                    resultHash.Add(ZebraConstants.HK_STATUS, ZebraConstants.PRINTER_STATUS_SUCCESS);
                    resultHash.Add(ZebraConstants.HK_MESSAGE, "");

                    foreach (string parameter in listOfParameters)
                    {
                        switch(parameter)
                        {
                        case ZebraConstants.PRINTER_STATE_IS_HEAD_COLD:
                            resultHash.Add(ZebraConstants.PRINTER_STATE_IS_HEAD_COLD, currStatus.IsHeadCold);
                            break;
                        case ZebraConstants.PRINTER_STATE_IS_HEAD_OPEN:
                            resultHash.Add(ZebraConstants.PRINTER_STATE_IS_HEAD_OPEN, currStatus.IsHeadOpen);
                            break;
                        case ZebraConstants.PRINTER_STATE_IS_HEAD_TOO_HOT:
                            resultHash.Add(ZebraConstants.PRINTER_STATE_IS_HEAD_TOO_HOT, currStatus.IsHeadTooHot);
                            break;
                        case ZebraConstants.PRINTER_STATE_IS_PAPER_OUT:
                            resultHash.Add(ZebraConstants.PRINTER_STATE_IS_PAPER_OUT, currStatus.IsPaperOut);
                            break;
                        case ZebraConstants.PRINTER_STATE_IS_PARTIAL_FORMAT_IN_PROGRESS:
                            resultHash.Add(ZebraConstants.PRINTER_STATE_IS_PARTIAL_FORMAT_IN_PROGRESS, currStatus.IsPartialFormatInProgress);
                            break;
                        case ZebraConstants.PRINTER_STATE_IS_PAUSED:
                            resultHash.Add(ZebraConstants.PRINTER_STATE_IS_BATTERY_LOW, currStatus.IsPaused);
                            break;
                        case ZebraConstants.PRINTER_STATE_IS_READY_TO_PRINT:
                            resultHash.Add(ZebraConstants.PRINTER_STATE_IS_READY_TO_PRINT, currStatus.IsReadyToPrint);
                            break;
                        case ZebraConstants.PRINTER_STATE_IS_RECEIVE_BUFFER_FULL:
                            resultHash.Add(ZebraConstants.PRINTER_STATE_IS_RECEIVE_BUFFER_FULL, currStatus.IsReceiveBufferFull);
                            break;
                        case ZebraConstants.PRINTER_STATE_IS_RIBBON_OUT:
                            resultHash.Add(ZebraConstants.PRINTER_STATE_IS_RIBBON_OUT, currStatus.IsRibbonOut);
                            break;
                        case ZebraConstants.PRINTER_STATE_LABELS_REMAINING_IN_BATCH:
                            resultHash.Add(ZebraConstants.PRINTER_STATE_LABELS_REMAINING_IN_BATCH, currStatus.LabelsRemainingInBatch);
                            break;
                        case ZebraConstants.PRINTER_STATE_LABEL_LENGTH_IN_DOTS:
                            resultHash.Add(ZebraConstants.PRINTER_STATE_LABEL_LENGTH_IN_DOTS, currStatus.LabelLengthInDots);
                            break;
                        case ZebraConstants.PRINTER_STATE_NUMBER_OF_FORMATS_IN_RECEIVE_BUFFER:
                            resultHash.Add(ZebraConstants.PRINTER_STATE_NUMBER_OF_FORMATS_IN_RECEIVE_BUFFER, currStatus.NumberOfFormatsInReceiveBuffer);
                            break;
                        case ZebraConstants.PRINTER_STATE_PRINT_MODE:
                            switch (currStatus.PrintMode)
                            {
                                case ZplPrintMode.REWIND:
                                    resultHash.Add(ZebraConstants.PRINTER_STATE_PRINT_MODE, ZebraConstants.PRINT_MODE_REWIND);
                                    break;
                                case ZplPrintMode.PEEL_OFF:
                                    resultHash.Add(ZebraConstants.PRINTER_STATE_PRINT_MODE, ZebraConstants.PRINT_MODE_PEEL_OFF);
                                    break;
                                case ZplPrintMode.TEAR_OFF:
                                    resultHash.Add(ZebraConstants.PRINTER_STATE_PRINT_MODE, ZebraConstants.PRINT_MODE_TEAR_OFF);
                                    break;
                                case ZplPrintMode.CUTTER:
                                    resultHash.Add(ZebraConstants.PRINTER_STATE_PRINT_MODE, ZebraConstants.PRINT_MODE_CUTTER);
                                    break;
                                case ZplPrintMode.APPLICATOR:
                                    resultHash.Add(ZebraConstants.PRINTER_STATE_PRINT_MODE, ZebraConstants.PRINT_MODE_APPLICATOR);
                                    break;
                                case ZplPrintMode.DELAYED_CUT:
                                    resultHash.Add(ZebraConstants.PRINTER_STATE_PRINT_MODE, ZebraConstants.PRINT_MODE_DELAYED_CUT);
                                    break;
                                case ZplPrintMode.LINERLESS_PEEL:
                                    resultHash.Add(ZebraConstants.PRINTER_STATE_PRINT_MODE, ZebraConstants.PRINT_MODE_LINERLESS_PEEL);
                                    break;
                                case ZplPrintMode.LINERLESS_REWIND:
                                    resultHash.Add(ZebraConstants.PRINTER_STATE_PRINT_MODE, ZebraConstants.PRINT_MODE_REWIND);
                                    break;
                                case ZplPrintMode.PARTIAL_CUTTER:
                                    resultHash.Add(ZebraConstants.PRINTER_STATE_PRINT_MODE, ZebraConstants.PRINT_MODE_PARTIAL_CUTTER);
                                    break;
                                case ZplPrintMode.RFID:
                                    resultHash.Add(ZebraConstants.PRINTER_STATE_PRINT_MODE, ZebraConstants.PRINT_MODE_RFID);
                                    break;
                                case ZplPrintMode.KIOSK:
                                    resultHash.Add(ZebraConstants.PRINTER_STATE_PRINT_MODE, ZebraConstants.PRINT_MODE_KIOSK);
                                    break;
                                case ZplPrintMode.UNKNOWN:
                                    resultHash.Add(ZebraConstants.PRINTER_STATE_PRINT_MODE, ZebraConstants.PRINT_MODE_UNKNOWN);
                                    break;
                            }
                            break;
                        }
                    }
                }
                else
                {
                    resultHash.Add(ZebraConstants.HK_STATUS, ZebraConstants.PRINTER_STATUS_ERROR);
                    resultHash.Add(ZebraConstants.HK_MESSAGE, "");
                }
            }
            else
            {
                resultHash.Add(ZebraConstants.HK_STATUS, ZebraConstants.PRINTER_STATUS_ERR_NOT_CONNECTED);
                resultHash.Add(ZebraConstants.HK_MESSAGE, "");
            }

            oResult.set(resultHash);
        }
Beispiel #9
0
        public void retrieveFileNamesWithExtensions(IReadOnlyList<string> extensions, IMethodResult oResult)
        {
            Logger.Write("retrieveFileNamesWithExtensions call");
            Logger.Write("extensions:", extensions);

            IReadOnlyDictionary<string, object> resultHash = new IReadOnlyDictionary<string, object>();

            if (m_printer != null)
            {
                RetriveParser parser = new RetriveParser(m_connection);

                List<string> resultNames = parser.getAllFileNames(extensions);

                resultHash.Add(ZebraConstants.HK_STATUS, ZebraConstants.PRINTER_STATUS_SUCCESS);
                resultHash.Add(ZebraConstants.HK_FILE_NAMES, resultNames);
                oResult.set(resultHash);

                return;
            }

            resultHash.Add(ZebraConstants.HK_STATUS, ZebraConstants.PRINTER_STATUS_ERROR);
            resultHash.Add(ZebraConstants.HK_FILE_NAMES, new List<string>());
            oResult.set(resultHash);
        }
Beispiel #10
0
        public void retrieveFileNames(IMethodResult oResult)
        {
            Logger.Write("call retrieveFileNames ");

            IReadOnlyDictionary<string, object> resultHash = new IReadOnlyDictionary<string, object>();

            if (m_connection != null && m_connection.IsConnected())
            {
                RetriveParser parser = new RetriveParser(m_connection);

                List<string> resultNames = parser.getAllFileNames();
                
                resultHash.Add(ZebraConstants.HK_STATUS, ZebraConstants.PRINTER_STATUS_SUCCESS);
                resultHash.Add(ZebraConstants.HK_FILE_NAMES, resultNames);
                oResult.set(resultHash);

                return;
            }

            resultHash.Add(ZebraConstants.HK_STATUS, ZebraConstants.PRINTER_STATUS_ERROR);
            resultHash.Add(ZebraConstants.HK_FILE_NAMES, new List<string>());
            oResult.set(resultHash);
        }
Beispiel #11
0
        public void enumerateSupportedControlLanguages(IMethodResult oResult)
        {
            Logger.Write("enumerateSupportedControlLanguages call");

            if (m_printer != null)
            {
                IReadOnlyDictionary<string, string> controlLanguage = new IReadOnlyDictionary<string, string>();

                switch (m_printer.GetPrinterControlLanguage())
                {
                    case PrinterLanguage.CPCL:
                        controlLanguage.Add(ZebraConstants.PRINTER_LANGUAGE_CPCL, "");
                        break;
                    case PrinterLanguage.ZPL:
                        controlLanguage.Add(ZebraConstants.PRINTER_LANGUAGE_ZPL, "");
                        controlLanguage.Add(ZebraConstants.PRINTER_LANGUAGE_CPCL, "");
                        break;
                }

                oResult.set(controlLanguage);
                return;
            }

            oResult.set(ZebraConstants.PRINTER_STATUS_ERR_NOT_CONNECTED);
        }
Beispiel #12
0
        public void printRawString(string command, IReadOnlyDictionary<string, string> options, IMethodResult oResult)
        {
            Logger.Write("printRawString call: " + command);
            Logger.Write("command: " + command);
            Logger.Write("options:", options);

            if (m_connection != null && m_printer != null)
            {
                try
                {                    
                    byte[] commandStr = Encoding.UTF8.GetBytes(command);
                    m_connection.Write(commandStr);
                    
                    Thread.Sleep(500);
                                        
                    byte[] printerResponse = m_connection.Read();
                    string printerResponseStr = Encoding.UTF8.GetString(printerResponse, 0, printerResponse.Length);

                    IReadOnlyDictionary<string, string> response = new IReadOnlyDictionary<string, string>();

                    response.Add(ZebraConstants.HK_STATUS, ZebraConstants.PRINTER_STATUS_SUCCESS);
                    response.Add(ZebraConstants.HK_STRING_RESPONCE, printerResponseStr);

                    oResult.set(response);
                }
                catch (Exception ex)
                {
                    IReadOnlyDictionary<string, string> errResponse = new IReadOnlyDictionary<string, string>();

                    errResponse.Add(ZebraConstants.HK_STATUS, ZebraConstants.PRINTER_STATUS_ERROR);
                    errResponse.Add(ZebraConstants.HK_MESSAGE, ex.Message.ToString());

                    oResult.set(errResponse);
                }
            }
            else
            {
                oResult.set(ZebraConstants.PRINTER_STATUS_ERR_NOT_CONNECTED);
            }
        }
Beispiel #13
0
            public void requestState(IReadOnlyList <string> listOfParameters, IMethodResult oResult)
            {
                Logger.Write("requestState call");
                Logger.Write("listOfParameters:", listOfParameters);

                IReadOnlyDictionary <string, object> resultHash = new IReadOnlyDictionary <string, object>();

                if (m_connection != null && m_connection.IsConnected() && m_printer != null)
                {
                    PrinterStatus currStatus = getStatus();

                    if (currStatus != null)
                    {
                        resultHash.Add(ZebraConstants.HK_STATUS, ZebraConstants.PRINTER_STATUS_SUCCESS);
                        resultHash.Add(ZebraConstants.HK_MESSAGE, "");

                        foreach (string parameter in listOfParameters)
                        {
                            switch (parameter)
                            {
                            case ZebraConstants.PRINTER_STATE_IS_HEAD_COLD:
                                resultHash.Add(ZebraConstants.PRINTER_STATE_IS_HEAD_COLD, currStatus.IsHeadCold);
                                break;

                            case ZebraConstants.PRINTER_STATE_IS_HEAD_OPEN:
                                resultHash.Add(ZebraConstants.PRINTER_STATE_IS_HEAD_OPEN, currStatus.IsHeadOpen);
                                break;

                            case ZebraConstants.PRINTER_STATE_IS_HEAD_TOO_HOT:
                                resultHash.Add(ZebraConstants.PRINTER_STATE_IS_HEAD_TOO_HOT, currStatus.IsHeadTooHot);
                                break;

                            case ZebraConstants.PRINTER_STATE_IS_PAPER_OUT:
                                resultHash.Add(ZebraConstants.PRINTER_STATE_IS_PAPER_OUT, currStatus.IsPaperOut);
                                break;

                            case ZebraConstants.PRINTER_STATE_IS_PARTIAL_FORMAT_IN_PROGRESS:
                                resultHash.Add(ZebraConstants.PRINTER_STATE_IS_PARTIAL_FORMAT_IN_PROGRESS, currStatus.IsPartialFormatInProgress);
                                break;

                            case ZebraConstants.PRINTER_STATE_IS_PAUSED:
                                resultHash.Add(ZebraConstants.PRINTER_STATE_IS_BATTERY_LOW, currStatus.IsPaused);
                                break;

                            case ZebraConstants.PRINTER_STATE_IS_READY_TO_PRINT:
                                resultHash.Add(ZebraConstants.PRINTER_STATE_IS_READY_TO_PRINT, currStatus.IsReadyToPrint);
                                break;

                            case ZebraConstants.PRINTER_STATE_IS_RECEIVE_BUFFER_FULL:
                                resultHash.Add(ZebraConstants.PRINTER_STATE_IS_RECEIVE_BUFFER_FULL, currStatus.IsReceiveBufferFull);
                                break;

                            case ZebraConstants.PRINTER_STATE_IS_RIBBON_OUT:
                                resultHash.Add(ZebraConstants.PRINTER_STATE_IS_RIBBON_OUT, currStatus.IsRibbonOut);
                                break;

                            case ZebraConstants.PRINTER_STATE_LABELS_REMAINING_IN_BATCH:
                                resultHash.Add(ZebraConstants.PRINTER_STATE_LABELS_REMAINING_IN_BATCH, currStatus.LabelsRemainingInBatch);
                                break;

                            case ZebraConstants.PRINTER_STATE_LABEL_LENGTH_IN_DOTS:
                                resultHash.Add(ZebraConstants.PRINTER_STATE_LABEL_LENGTH_IN_DOTS, currStatus.LabelLengthInDots);
                                break;

                            case ZebraConstants.PRINTER_STATE_NUMBER_OF_FORMATS_IN_RECEIVE_BUFFER:
                                resultHash.Add(ZebraConstants.PRINTER_STATE_NUMBER_OF_FORMATS_IN_RECEIVE_BUFFER, currStatus.NumberOfFormatsInReceiveBuffer);
                                break;

                            case ZebraConstants.PRINTER_STATE_PRINT_MODE:
                                switch (currStatus.PrintMode)
                                {
                                case ZplPrintMode.REWIND:
                                    resultHash.Add(ZebraConstants.PRINTER_STATE_PRINT_MODE, ZebraConstants.PRINT_MODE_REWIND);
                                    break;

                                case ZplPrintMode.PEEL_OFF:
                                    resultHash.Add(ZebraConstants.PRINTER_STATE_PRINT_MODE, ZebraConstants.PRINT_MODE_PEEL_OFF);
                                    break;

                                case ZplPrintMode.TEAR_OFF:
                                    resultHash.Add(ZebraConstants.PRINTER_STATE_PRINT_MODE, ZebraConstants.PRINT_MODE_TEAR_OFF);
                                    break;

                                case ZplPrintMode.CUTTER:
                                    resultHash.Add(ZebraConstants.PRINTER_STATE_PRINT_MODE, ZebraConstants.PRINT_MODE_CUTTER);
                                    break;

                                case ZplPrintMode.APPLICATOR:
                                    resultHash.Add(ZebraConstants.PRINTER_STATE_PRINT_MODE, ZebraConstants.PRINT_MODE_APPLICATOR);
                                    break;

                                case ZplPrintMode.DELAYED_CUT:
                                    resultHash.Add(ZebraConstants.PRINTER_STATE_PRINT_MODE, ZebraConstants.PRINT_MODE_DELAYED_CUT);
                                    break;

                                case ZplPrintMode.LINERLESS_PEEL:
                                    resultHash.Add(ZebraConstants.PRINTER_STATE_PRINT_MODE, ZebraConstants.PRINT_MODE_LINERLESS_PEEL);
                                    break;

                                case ZplPrintMode.LINERLESS_REWIND:
                                    resultHash.Add(ZebraConstants.PRINTER_STATE_PRINT_MODE, ZebraConstants.PRINT_MODE_REWIND);
                                    break;

                                case ZplPrintMode.PARTIAL_CUTTER:
                                    resultHash.Add(ZebraConstants.PRINTER_STATE_PRINT_MODE, ZebraConstants.PRINT_MODE_PARTIAL_CUTTER);
                                    break;

                                case ZplPrintMode.RFID:
                                    resultHash.Add(ZebraConstants.PRINTER_STATE_PRINT_MODE, ZebraConstants.PRINT_MODE_RFID);
                                    break;

                                case ZplPrintMode.KIOSK:
                                    resultHash.Add(ZebraConstants.PRINTER_STATE_PRINT_MODE, ZebraConstants.PRINT_MODE_KIOSK);
                                    break;

                                case ZplPrintMode.UNKNOWN:
                                    resultHash.Add(ZebraConstants.PRINTER_STATE_PRINT_MODE, ZebraConstants.PRINT_MODE_UNKNOWN);
                                    break;
                                }
                                break;
                            }
                        }
                    }
                    else
                    {
                        resultHash.Add(ZebraConstants.HK_STATUS, ZebraConstants.PRINTER_STATUS_ERROR);
                        resultHash.Add(ZebraConstants.HK_MESSAGE, "");
                    }
                }
                else
                {
                    resultHash.Add(ZebraConstants.HK_STATUS, ZebraConstants.PRINTER_STATUS_ERR_NOT_CONNECTED);
                    resultHash.Add(ZebraConstants.HK_MESSAGE, "");
                }

                oResult.set(resultHash);
            }