#import "EposStringHelper.h"

int EPOS2_ERR_INIT = -1;

@implementation EposStringHelper: NSObject

+ (NSDictionary *)convertStatusInfoToDictionary:(Epos2PrinterStatusInfo *)info
{
   return @{
      @"connection": [@(info.connection) stringValue],
      @"online": [@(info.online) stringValue],
      @"coverOpen": [@(info.coverOpen) stringValue],
      @"paper": [@(info.paper) stringValue],
      @"paperFeed": [@(info.paperFeed) stringValue],
      @"panelSwitch": [@(info.panelSwitch) stringValue],
      @"drawer": [@(info.drawer) stringValue],
      @"errorStatus": [@(info.errorStatus) stringValue],
      @"autoRecoverError": [@(info.autoRecoverError) stringValue],
      @"buzzer": [@(info.buzzer) stringValue],
      @"adapter": [@(info.adapter) stringValue],
      @"batteryLevel": [@(info.batteryLevel) stringValue],
      @"removalWaiting": [@(info.removalWaiting) stringValue],
      @"paperTakenSensor": [@(info.paperTakenSensor) stringValue],
      @"unrecoverError": [@(info.unrecoverError) stringValue],
    };
}

+ (NSDictionary *) getDiscoveryConstants
{
  return @{
           // filter options
          @"PORTTYPE_ALL": @(EPOS2_PORTTYPE_ALL),
          @"PORTTYPE_TCP": @(EPOS2_PORTTYPE_TCP),
          @"PORTTYPE_BLUETOOTH": @(EPOS2_PORTTYPE_BLUETOOTH),
          @"PORTTYPE_USB": @(EPOS2_PORTTYPE_USB),
          @"PORTTYPE_BLUETOOTH_LE": @(EPOS2_PORTTYPE_BLUETOOTH_LE),
          @"MODEL_ALL": @(EPOS2_MODEL_ALL),
          @"TYPE_ALL": @(EPOS2_TYPE_ALL),
          @"TYPE_PRINTER": @(EPOS2_TYPE_PRINTER),
          @"TYPE_HYBRID_PRINTER": @(EPOS2_TYPE_HYBRID_PRINTER),
          @"TYPE_DISPLAY": @(EPOS2_TYPE_DISPLAY),
          @"TYPE_KEYBOARD": @(EPOS2_TYPE_KEYBOARD),
          @"TYPE_SCANNER": @(EPOS2_TYPE_SCANNER),
          @"TYPE_SERIAL": @(EPOS2_TYPE_SERIAL),
          @"TYPE_POS_KEYBOARD": @(EPOS2_TYPE_POS_KEYBOARD),
          @"TYPE_MSR": @(EPOS2_TYPE_MSR),
          @"TYPE_GFE": @(EPOS2_TYPE_GFE),
          @"TYPE_OTHER_PERIPHERAL": @(EPOS2_TYPE_OTHER_PERIPHERAL),
          // return value
          @"ERR_PARAM": @(EPOS2_ERR_PARAM),
          @"ERR_ILLEGAL": @(EPOS2_ERR_ILLEGAL),
          @"ERR_MEMORY": @(EPOS2_ERR_MEMORY),
          @"ERR_FAILURE": @(EPOS2_ERR_FAILURE),
          @"ERR_PROCESSING": @(EPOS2_ERR_PROCESSING),
              // pair bluetooth device error
          @"BT_ERR_PARAM": @(EPOS2_BT_ERR_PARAM),
          @"BT_ERR_UNSUPPORTED": @(EPOS2_BT_ERR_UNSUPPORTED),
          @"BT_ERR_CANCEL": @(EPOS2_BT_ERR_CANCEL),
          @"BT_ERR_ILLEGAL_DEVICE": @(EPOS2_BT_ERR_ILLEGAL_DEVICE),
    };
}

+ (int) getInitErrorResultCode
{
  return EPOS2_ERR_INIT;
}

+ (NSDictionary *) getPrinterConstants
{
  return @{
    // init models lang
    @"MODEL_ANK": @(EPOS2_MODEL_ANK),
    @"MODEL_CHINESE": @(EPOS2_MODEL_CHINESE),
    @"MODEL_TAIWAN": @(EPOS2_MODEL_TAIWAN),
    @"MODEL_KOREAN": @(EPOS2_MODEL_KOREAN),
    @"MODEL_THAI": @(EPOS2_MODEL_THAI),
    @"MODEL_SOUTHASIA": @(EPOS2_MODEL_SOUTHASIA),


    // cut types
    @"CUT_FEED": @(EPOS2_CUT_FEED),
    @"CUT_NO_FEED": @(EPOS2_CUT_NO_FEED),
    @"CUT_RESERVE": @(EPOS2_CUT_RESERVE),
    @"FULL_CUT_FEED": @(EPOS2_FULL_CUT_FEED),
    @"FULL_CUT_NO_FEED": @(EPOS2_FULL_CUT_NO_FEED),
    @"FULL_CUT_RESERVE": @(EPOS2_FULL_CUT_RESERVE),
    @"PARAM_DEFAULT": @(EPOS2_PARAM_DEFAULT),
    @"PARAM_UNSPECIFIED": @(EPOS2_PARAM_UNSPECIFIED),

    // errors
    @"ERR_PARAM": @(EPOS2_ERR_PARAM),
    @"ERR_MEMORY": @(EPOS2_ERR_MEMORY),
    @"ERR_UNSUPPORTED": @(EPOS2_ERR_UNSUPPORTED),
    @"ERR_FAILURE": @(EPOS2_ERR_FAILURE),
    @"ERR_PROCESSING": @(EPOS2_ERR_PROCESSING),
    @"ERR_CONNECT": @(EPOS2_ERR_CONNECT),
    @"ERR_TIMEOUT": @(EPOS2_ERR_TIMEOUT),
    @"ERR_ILLEGAL": @(EPOS2_ERR_ILLEGAL),
    @"ERR_NOT_FOUND": @(EPOS2_ERR_NOT_FOUND),
    @"ERR_IN_USE": @(EPOS2_ERR_IN_USE),
    @"ERR_TYPE_INVALID": @(EPOS2_ERR_TYPE_INVALID),
    @"ERR_RECOVERY_FAILURE": @(EPOS2_ERR_RECOVERY_FAILURE),
    @"ERR_DISCONNECT": @(EPOS2_ERR_DISCONNECT),
    @"ERR_INIT": @(EPOS2_ERR_INIT),

    // code errors
    @"CODE_ERR_AUTORECOVER": @(EPOS2_CODE_ERR_AUTORECOVER),
    @"CODE_ERR_COVER_OPEN": @(EPOS2_CODE_ERR_COVER_OPEN),
    @"CODE_ERR_CUTTER": @(EPOS2_CODE_ERR_CUTTER),
    @"CODE_ERR_MECHANICAL": @(EPOS2_CODE_ERR_MECHANICAL),
    @"CODE_ERR_EMPTY": @(EPOS2_CODE_ERR_EMPTY),
    @"CODE_ERR_UNRECOVERABLE": @(EPOS2_CODE_ERR_UNRECOVERABLE),
    @"CODE_ERR_FAILURE": @(EPOS2_CODE_ERR_FAILURE),
    @"CODE_ERR_NOT_FOUND": @(EPOS2_CODE_ERR_NOT_FOUND),
    @"CODE_ERR_SYSTEM": @(EPOS2_CODE_ERR_SYSTEM),
    @"CODE_ERR_PORT": @(EPOS2_CODE_ERR_PORT),
    @"CODE_ERR_TIMEOUT": @(EPOS2_CODE_ERR_TIMEOUT),
    @"CODE_ERR_JOB_NOT_FOUND": @(EPOS2_CODE_ERR_JOB_NOT_FOUND),
    @"CODE_ERR_SPOOLER": @(EPOS2_CODE_ERR_SPOOLER),
    @"CODE_ERR_BATTERY_LOW": @(EPOS2_CODE_ERR_BATTERY_LOW),
    @"CODE_ERR_TOO_MANY_REQUESTS": @(EPOS2_CODE_ERR_TOO_MANY_REQUESTS),
    @"CODE_ERR_REQUEST_ENTITY_TOO_LARGE": @(EPOS2_CODE_ERR_REQUEST_ENTITY_TOO_LARGE),
    @"CODE_ERR_WAIT_REMOVAL": @(EPOS2_CODE_ERR_WAIT_REMOVAL),
    @"CODE_PRINTING": @(EPOS2_CODE_PRINTING),
    @"CODE_ERR_PARAM": @(EPOS2_CODE_ERR_PARAM),
    @"CODE_ERR_MEMORY": @(EPOS2_CODE_ERR_MEMORY),
    @"CODE_ERR_PROCESSING": @(EPOS2_CODE_ERR_PROCESSING),
    @"CODE_ERR_ILLEGAL": @(EPOS2_CODE_ERR_ILLEGAL),
    @"CODE_ERR_DEVICE_BUSY": @(EPOS2_CODE_ERR_DEVICE_BUSY),

    // get printer settings
    @"PRINTER_SETTING_PAPERWIDTH": @(EPOS2_PRINTER_SETTING_PAPERWIDTH),
    @"PRINTER_SETTING_PRINTDENSITY": @(EPOS2_PRINTER_SETTING_PRINTDENSITY),
    @"PRINTER_SETTING_PRINTSPEED": @(EPOS2_PRINTER_SETTING_PRINTSPEED),

    @"PRINTER_SETTING_PAPERWIDTH58_0": @(EPOS2_PRINTER_SETTING_PAPERWIDTH_58_0),
    @"PRINTER_SETTING_PAPERWIDTH60_0": @(EPOS2_PRINTER_SETTING_PAPERWIDTH_60_0),
    @"PRINTER_SETTING_PAPERWIDTH70_0": @(EPOS2_PRINTER_SETTING_PAPERWIDTH_70_0),
    @"PRINTER_SETTING_PAPERWIDTH76_0": @(EPOS2_PRINTER_SETTING_PAPERWIDTH_76_0),
    @"PRINTER_SETTING_PAPERWIDTH80_0": @(EPOS2_PRINTER_SETTING_PAPERWIDTH_80_0),
    @"PRINTER_SETTING_PRINTDENSITYDIP": @(EPOS2_PRINTER_SETTING_PRINTDENSITY_DIP),
    @"PRINTER_SETTING_PRINTDENSITY70": @(EPOS2_PRINTER_SETTING_PRINTDENSITY_70),
    @"PRINTER_SETTING_PRINTDENSITY75": @(EPOS2_PRINTER_SETTING_PRINTDENSITY_75),
    @"PRINTER_SETTING_PRINTDENSITY80": @(EPOS2_PRINTER_SETTING_PRINTDENSITY_80),
    @"PRINTER_SETTING_PRINTDENSITY85": @(EPOS2_PRINTER_SETTING_PRINTDENSITY_85),
    @"PRINTER_SETTING_PRINTDENSITY90": @(EPOS2_PRINTER_SETTING_PRINTDENSITY_90),
    @"PRINTER_SETTING_PRINTDENSITY95": @(EPOS2_PRINTER_SETTING_PRINTDENSITY_95),
    @"PRINTER_SETTING_PRINTDENSITY100": @(EPOS2_PRINTER_SETTING_PRINTDENSITY_100),
    @"PRINTER_SETTING_PRINTDENSITY105": @(EPOS2_PRINTER_SETTING_PRINTDENSITY_105),
    @"PRINTER_SETTING_PRINTDENSITY110": @(EPOS2_PRINTER_SETTING_PRINTDENSITY_110),
    @"PRINTER_SETTING_PRINTDENSITY115": @(EPOS2_PRINTER_SETTING_PRINTDENSITY_115),
    @"PRINTER_SETTING_PRINTDENSITY120": @(EPOS2_PRINTER_SETTING_PRINTDENSITY_120),
    @"PRINTER_SETTING_PRINTDENSITY125": @(EPOS2_PRINTER_SETTING_PRINTDENSITY_125),
    @"PRINTER_SETTING_PRINTDENSITY130": @(EPOS2_PRINTER_SETTING_PRINTDENSITY_130),
    @"PRINTER_SETTING_PRINTSPEED1": @(EPOS2_PRINTER_SETTING_PRINTSPEED_1),
    @"PRINTER_SETTING_PRINTSPEED2": @(EPOS2_PRINTER_SETTING_PRINTSPEED_2),
    @"PRINTER_SETTING_PRINTSPEED3": @(EPOS2_PRINTER_SETTING_PRINTSPEED_3),
    @"PRINTER_SETTING_PRINTSPEED4": @(EPOS2_PRINTER_SETTING_PRINTSPEED_4),
    @"PRINTER_SETTING_PRINTSPEED5": @(EPOS2_PRINTER_SETTING_PRINTSPEED_5),
    @"PRINTER_SETTING_PRINTSPEED6": @(EPOS2_PRINTER_SETTING_PRINTSPEED_6),
    @"PRINTER_SETTING_PRINTSPEED7": @(EPOS2_PRINTER_SETTING_PRINTSPEED_7),
    @"PRINTER_SETTING_PRINTSPEED8": @(EPOS2_PRINTER_SETTING_PRINTSPEED_8),
    @"PRINTER_SETTING_PRINTSPEED9": @(EPOS2_PRINTER_SETTING_PRINTSPEED_9),
    @"PRINTER_SETTING_PRINTSPEED10": @(EPOS2_PRINTER_SETTING_PRINTSPEED_10),
    @"PRINTER_SETTING_PRINTSPEED11": @(EPOS2_PRINTER_SETTING_PRINTSPEED_11),
    @"PRINTER_SETTING_PRINTSPEED12": @(EPOS2_PRINTER_SETTING_PRINTSPEED_12),
    @"PRINTER_SETTING_PRINTSPEED13": @(EPOS2_PRINTER_SETTING_PRINTSPEED_13),
    @"PRINTER_SETTING_PRINTSPEED14": @(EPOS2_PRINTER_SETTING_PRINTSPEED_14),
    @"PRINTER_SETTING_PRINTSPEED15": @(EPOS2_PRINTER_SETTING_PRINTSPEED_15),
    @"PRINTER_SETTING_PRINTSPEED16": @(EPOS2_PRINTER_SETTING_PRINTSPEED_16),
    @"PRINTER_SETTING_PRINTSPEED17": @(EPOS2_PRINTER_SETTING_PRINTSPEED_17),

    // printer status
    @"PRINTER_TRUE": @(EPOS2_TRUE),
    @"PRINTER_FALSE": @(EPOS2_FALSE),
    @"UNKNOWN": @(EPOS2_UNKNOWN),
    @"PAPER_OK": @(EPOS2_PAPER_OK),
    @"PAPER_NEAR_END": @(EPOS2_PAPER_NEAR_END),
    @"PAPER_EMPTY": @(EPOS2_PAPER_EMPTY),
    @"SWITCH_ON": @(EPOS2_SWITCH_ON),
    @"SWITCH_OFF": @(EPOS2_SWITCH_OFF),
    @"DRAWER_HIGH": @(EPOS2_DRAWER_HIGH),
    @"DRAWER_LOW": @(EPOS2_DRAWER_LOW),
    @"NO_ERR": @(EPOS2_NO_ERR),
    @"MECHANICAL_ERR": @(EPOS2_MECHANICAL_ERR),
    @"AUTOCUTTER_ERR": @(EPOS2_AUTOCUTTER_ERR),
    @"UNRECOVER_ERR": @(EPOS2_UNRECOVER_ERR),
    @"AUTORECOVER_ERR": @(EPOS2_AUTORECOVER_ERR),
    @"HEAD_OVERHEAT": @(EPOS2_HEAD_OVERHEAT),
    @"MOTOR_OVERHEAT": @(EPOS2_MOTOR_OVERHEAT),
    @"BATTERY_OVERHEAT": @(EPOS2_BATTERY_OVERHEAT),
    @"WRONG_PAPER": @(EPOS2_WRONG_PAPER),
    @"COVER_OPEN": @(EPOS2_COVER_OPEN),
    @"EPOS2_BATTERY_LEVEL_6": @(EPOS2_BATTERY_LEVEL_6),
    @"EPOS2_BATTERY_LEVEL_5": @(EPOS2_BATTERY_LEVEL_5),
    @"EPOS2_BATTERY_LEVEL_4": @(EPOS2_BATTERY_LEVEL_4),
    @"EPOS2_BATTERY_LEVEL_3": @(EPOS2_BATTERY_LEVEL_3),
    @"EPOS2_BATTERY_LEVEL_2": @(EPOS2_BATTERY_LEVEL_2),
    @"EPOS2_BATTERY_LEVEL_1": @(EPOS2_BATTERY_LEVEL_1),
    @"EPOS2_BATTERY_LEVEL_0": @(EPOS2_BATTERY_LEVEL_0),
    @"REMOVAL_WAIT_PAPER": @(EPOS2_REMOVAL_WAIT_PAPER),
    @"REMOVAL_WAIT_NONE": @(EPOS2_REMOVAL_WAIT_NONE),
    @"REMOVAL_DETECT_PAPER": @(EPOS2_REMOVAL_DETECT_PAPER),
    @"REMOVAL_DETECT_PAPER_NONE": @(EPOS2_REMOVAL_DETECT_PAPER_NONE),
    @"REMOVAL_DETECT_UNKNOWN": @(EPOS2_REMOVAL_DETECT_UNKNOWN),
    @"HIGH_VOLTAGE_ERR": @(EPOS2_HIGH_VOLTAGE_ERR),
    @"LOW_VOLTAGE_ERR": @(EPOS2_LOW_VOLTAGE_ERR),

    // image
    @"COLOR_NONE": @(EPOS2_COLOR_NONE),
    @"COLOR_1": @(EPOS2_COLOR_1),
    @"COLOR_2": @(EPOS2_COLOR_2),
    @"COLOR_3": @(EPOS2_COLOR_3),
    @"COLOR_4": @(EPOS2_COLOR_4),
    @"MODE_MONO": @(EPOS2_MODE_MONO),
    @"MODE_GRAY16": @(EPOS2_MODE_GRAY16),
    @"MODE_MONO_HIGH_DENSITY": @(EPOS2_MODE_MONO_HIGH_DENSITY),
    @"HALFTONE_DITHER": @(EPOS2_HALFTONE_DITHER),
    @"HALFTONE_ERROR_DIFFUSION": @(EPOS2_HALFTONE_ERROR_DIFFUSION),
    @"HALFTONE_THRESHOLD": @(EPOS2_HALFTONE_THRESHOLD),
    @"COMPRESS_DEFLATE": @(EPOS2_COMPRESS_DEFLATE),
    @"COMPRESS_NONE": @(EPOS2_COMPRESS_NONE),
    @"COMPRESS_AUTO": @(EPOS2_COMPRESS_AUTO),

    // barcode
    @"BARCODE_UPC_A": @(EPOS2_BARCODE_UPC_A),
    @"BARCODE_UPC_E": @(EPOS2_BARCODE_UPC_E),
    @"BARCODE_EAN13": @(EPOS2_BARCODE_EAN13),
    @"BARCODE_JAN13": @(EPOS2_BARCODE_JAN13),
    @"BARCODE_EAN8": @(EPOS2_BARCODE_EAN8),
    @"BARCODE_JAN8": @(EPOS2_BARCODE_JAN8),
    @"BARCODE_CODE39": @(EPOS2_BARCODE_CODE39),
    @"BARCODE_ITF": @(EPOS2_BARCODE_ITF),
    @"BARCODE_CODABAR": @(EPOS2_BARCODE_CODABAR),
    @"BARCODE_CODE93": @(EPOS2_BARCODE_CODE93),
    @"BARCODE_CODE128": @(EPOS2_BARCODE_CODE128),
    @"BARCODE_CODE128_AUTO": @(EPOS2_BARCODE_CODE128_AUTO),
    @"BARCODE_GS1_128": @(EPOS2_BARCODE_GS1_128),
    @"BARCODE_GS1_DATABAR_OMNIDIRECTIONAL": @(EPOS2_BARCODE_GS1_DATABAR_OMNIDIRECTIONAL),
    @"BARCODE_GS1_DATABAR_TRUNCATED": @(EPOS2_BARCODE_GS1_DATABAR_TRUNCATED),
    @"BARCODE_GS1_DATABAR_LIMITED": @(EPOS2_BARCODE_GS1_DATABAR_LIMITED),
    @"BARCODE_GS1_DATABAR_EXPANDED": @(EPOS2_BARCODE_GS1_DATABAR_EXPANDED),
    @"HRI_NONE": @(EPOS2_HRI_NONE),
    @"HRI_ABOVE": @(EPOS2_HRI_ABOVE),
    @"HRI_BELOW": @(EPOS2_HRI_BELOW),
    @"HRI_BOTH": @(EPOS2_HRI_BOTH),

    // font
    @"FONT_A": @(EPOS2_FONT_A),
    @"FONT_B": @(EPOS2_FONT_B),
    @"FONT_C": @(EPOS2_FONT_C),
    @"FONT_D": @(EPOS2_FONT_D),
    @"FONT_E": @(EPOS2_FONT_E),

    // symbol

    @"SYMBOL_PDF417_STANDARD": @(EPOS2_SYMBOL_PDF417_STANDARD),
    @"SYMBOL_PDF417_TRUNCATED": @(EPOS2_SYMBOL_PDF417_TRUNCATED),
    @"SYMBOL_QRCODE_MODEL_1": @(EPOS2_SYMBOL_QRCODE_MODEL_1),
    @"SYMBOL_QRCODE_MODEL_2": @(EPOS2_SYMBOL_QRCODE_MODEL_2),
    @"SYMBOL_QRCODE_MICRO": @(EPOS2_SYMBOL_QRCODE_MICRO),
    @"SYMBOL_MAXICODE_MODE_2": @(EPOS2_SYMBOL_MAXICODE_MODE_2),
    @"SYMBOL_MAXICODE_MODE_3": @(EPOS2_SYMBOL_MAXICODE_MODE_3),
    @"SYMBOL_MAXICODE_MODE_4": @(EPOS2_SYMBOL_MAXICODE_MODE_4),
    @"SYMBOL_MAXICODE_MODE_5": @(EPOS2_SYMBOL_MAXICODE_MODE_5),
    @"SYMBOL_MAXICODE_MODE_6": @(EPOS2_SYMBOL_MAXICODE_MODE_6),
    @"SYMBOL_GS1_DATABAR_STACKED": @(EPOS2_SYMBOL_GS1_DATABAR_STACKED),
    @"SYMBOL_GS1_DATABAR_STACKED_OMNIDIRECTIONAL": @(EPOS2_SYMBOL_GS1_DATABAR_STACKED_OMNIDIRECTIONAL),
    @"SYMBOL_GS1_DATABAR_EXPANDED_STACKED": @(EPOS2_SYMBOL_GS1_DATABAR_EXPANDED_STACKED),
    @"SYMBOL_AZTECCODE_FULLRANGE": @(EPOS2_SYMBOL_AZTECCODE_FULLRANGE),
    @"SYMBOL_AZTECCODE_COMPACT": @(EPOS2_SYMBOL_AZTECCODE_COMPACT),
    @"SYMBOL_DATAMATRIX_SQUARE": @(EPOS2_SYMBOL_DATAMATRIX_SQUARE),
    @"SYMBOL_DATAMATRIX_RECTANGLE_8": @(EPOS2_SYMBOL_DATAMATRIX_RECTANGLE_8),
    @"SYMBOL_DATAMATRIX_RECTANGLE_12": @(EPOS2_SYMBOL_DATAMATRIX_RECTANGLE_12),
    @"SYMBOL_DATAMATRIX_RECTANGLE_16": @(EPOS2_SYMBOL_DATAMATRIX_RECTANGLE_16),
    @"LEVEL_0": @(EPOS2_LEVEL_0),
    @"LEVEL_1": @(EPOS2_LEVEL_1),
    @"LEVEL_2": @(EPOS2_LEVEL_2),
    @"LEVEL_3": @(EPOS2_LEVEL_3),
    @"LEVEL_4": @(EPOS2_LEVEL_4),
    @"LEVEL_5": @(EPOS2_LEVEL_5),
    @"LEVEL_6": @(EPOS2_LEVEL_6),
    @"LEVEL_7": @(EPOS2_LEVEL_7),
    @"LEVEL_8": @(EPOS2_LEVEL_8),
    @"LEVEL_L": @(EPOS2_LEVEL_L),
    @"LEVEL_M": @(EPOS2_LEVEL_M),
    @"LEVEL_Q": @(EPOS2_LEVEL_Q),
    @"LEVEL_H": @(EPOS2_LEVEL_H),


    // add pulse

    @"DRAWER_2PIN": @(EPOS2_DRAWER_2PIN),
    @"DRAWER_5PIN": @(EPOS2_DRAWER_5PIN),
    @"PULSE_100": @(EPOS2_PULSE_100),
    @"PULSE_200": @(EPOS2_PULSE_200),
    @"PULSE_300": @(EPOS2_PULSE_300),
    @"PULSE_400": @(EPOS2_PULSE_400),
    @"PULSE_500": @(EPOS2_PULSE_500),

    // text align

    @"ALIGN_LEFT": @(EPOS2_ALIGN_LEFT),
    @"ALIGN_CENTER": @(EPOS2_ALIGN_CENTER),
    @"ALIGN_RIGHT": @(EPOS2_ALIGN_RIGHT),

    // text lang

    @"LANG_EN": @(EPOS2_LANG_EN),
    @"LANG_JA": @(EPOS2_LANG_JA),
    @"LANG_ZH_CN": @(EPOS2_LANG_ZH_CN),
    @"LANG_ZH_TW": @(EPOS2_LANG_ZH_TW),
    @"LANG_KO": @(EPOS2_LANG_KO),
    @"LANG_TH": @(EPOS2_LANG_TH),
    @"LANG_VI": @(EPOS2_LANG_VI),
    @"LANG_MULTI": @(EPOS2_LANG_MULTI),
   };
}

+ (int)getPrinterSeries:(NSString*)name
{
    if (name == nil || [name isEqualToString:@""]) return EPOS2_TM_T88;

    if ([name hasPrefix:@"TM-m10"]) return EPOS2_TM_M10;
    if ([name hasPrefix:@"TM-m30"]) return EPOS2_TM_M30;
    if ([name hasPrefix:@"TM-m30III"]) return EPOS2_TM_M30III;
    if ([name hasPrefix:@"TM-m30II"]) return EPOS2_TM_M30II;
    if ([name hasPrefix:@"TM-m50II"]) return EPOS2_TM_M50II;
    if ([name hasPrefix:@"TM-m50"]) return EPOS2_TM_M50;
    if ([name hasPrefix:@"TM-P20II"]) return EPOS2_TM_P20II;
    if ([name hasPrefix:@"TM-P20"]) return EPOS2_TM_P20;
    if ([name hasPrefix:@"TM-P60II"]) return EPOS2_TM_P60II;
    if ([name hasPrefix:@"TM-P60"]) return EPOS2_TM_P60;
    if ([name hasPrefix:@"TM-P80II"]) return EPOS2_TM_P80II;
    if ([name hasPrefix:@"TM-P80"]) return EPOS2_TM_P80;
    if ([name hasPrefix:@"TM-T20"]) return EPOS2_TM_T20;
    if ([name hasPrefix:@"TM-T60"]) return EPOS2_TM_T60;
    if ([name hasPrefix:@"TM-T70"]) return EPOS2_TM_T70;
    if ([name hasPrefix:@"TM-T81"]) return EPOS2_TM_T81;
    if ([name hasPrefix:@"TM-T82"]) return EPOS2_TM_T82;
    if ([name hasPrefix:@"TM-T83III"]) return EPOS2_TM_T83III;
    if ([name hasPrefix:@"TM-T83"]) return EPOS2_TM_T83;
    if ([name hasPrefix:@"TM-T88VII"]) return EPOS2_TM_T88VII;
    if ([name hasPrefix:@"TM-T88"]) return EPOS2_TM_T88;
    if ([name hasPrefix:@"TM-T90"]) return EPOS2_TM_T90;
    if ([name hasPrefix:@"TM-T100"]) return EPOS2_TM_T100;
    if ([name hasPrefix:@"TM-U220"]) return EPOS2_TM_U220;
    if ([name hasPrefix:@"TM-U330"]) return EPOS2_TM_U330;
    if ([name hasPrefix:@"TM-L90LFC"]) return EPOS2_TM_L90LFC;
    if ([name hasPrefix:@"TM-L90"]) return EPOS2_TM_L90;
    if ([name hasPrefix:@"TM-L100"]) return EPOS2_TM_L100;
    if ([name hasPrefix:@"TM-H6000"]) return EPOS2_TM_H6000;

    return EPOS2_TM_T88;
}

+ (NSString *)convertDictionatyToJsonString:(NSDictionary *)dict
{
   NSData *nsData = [NSJSONSerialization dataWithJSONObject:dict options:NSJSONWritingPrettyPrinted error:nil];
   NSString *jsonString = [[NSString alloc] initWithData:nsData encoding:NSUTF8StringEncoding];

   return jsonString;
}


@end
