/*
 *========================================================================
 *
 *   시스템명 : AZN_PLAZA_LANE APP
 *   파 일 명 : hi_packet_format.h
 *   작 성 자 : JBY (baarong@neighbor21.co.kr)
 *   작 성 일 : 2018.07.13
 *   수 정 일 :
 *   설    명 :
 *
 *========================================================================
*/

#ifndef    _H_HPKT
#define    _H_HPKT

#include <sys/types.h>

/* tlda->tbl_typ */
#define    TB_BAS               1    /* BASIC TABLE */
#define    TB_WRKR              2    /* WORKER TABLE */
#define    TB_HOLI              3    /* HOLI TABLE */
#define    TB_ISS_COMP          4    /* ISSUE TABLE */
#define    TB_IMM_CARNO         5    /* 차량번호 면제 */
#define    TB_IMM_CRDNO         6    /* RFID 면제 */
#define    TB_ADV_PAY           7    /* 사전결제등록 */
#define    TB_PL_CRD            8    /* 교통카드PL */
#define    TB_BL_CRD            9    /* 교통카드BL */
#define    TB_RED_CARNO        10    /* 차량번호 감면 */
#define    TB_IMSIBL_CRD       11    /* 교통카드BL */
#define    TB_FORC_OCC_ERR      0xff /*   ERROR(INTERNAL)  */

#define    TB_LAST             10    /* 마지막 테이블데이터 */

/* tlda->frame_no */
#define    FRAME_FIRST          0x00          /* 1st FRAME         */
#define    FRAME_LAST           0xff          /*  FRAME      */

#define    FRAME_FIRST_I        0x00000000    /* 1st FRAME         */
#define    FRAME_LAST_I         0xffffffff    /*  FRAME      */

struct hi_packet_format { /* COMMON FRAME DATA  */
    unsigned char    seq_no[8];   /*   전송연번         */
    unsigned char    kind[2];     /*   DATA종별         */
    unsigned char    data[2];     /*   차로타입         */
};

/* 1.1 전송연번요구 */
struct hi_rq_seq_no {
    unsigned char    seq_no[8];
    unsigned char    kind[2];
    unsigned char    io_div;
};

/* 1.2 전송연번데이터 */
struct hi_seq_no_data {
    unsigned char   seq_no[8];
    unsigned char   kind[2];
    unsigned char   rq_seq_no[8];
    unsigned char   wrk_no[4];
    unsigned char   start_year[4];
    unsigned char   start_month[2];
    unsigned char   start_day[2];
    unsigned char   lane_no[2];
};

/* 2.1 교신재개요구 */
struct hi_comm_continue_rq {
    unsigned char    seq_no[8];
    unsigned char    kind[2];
    unsigned char    lane_no[2];
    unsigned char    plz_id[2];
    unsigned char    io_div;
};

/* 2.2 축적데이터전송요구 */
struct hi_rq_accuml_data {
    unsigned char    seq_no[8];
    unsigned char    kind[2];
    unsigned char    rq_seq_no[8];
    unsigned char    year[4];
    unsigned char    month[2];
    unsigned char    day[2];
    unsigned char    lane_no[2];
};

/* 2.3 축적데이터전송완료  */
struct hi_accuml_data_ok {
    unsigned char    seq_no[8];
    unsigned char    kind[2];
};

/* 3 확인응답 */
struct hi_confrm_reply {
    unsigned char    seq_no[8];
    unsigned char    kind[2];
    unsigned char    reply_typ;
    unsigned char    warr_seq_no[8];
};

/* 4.1 시각요구 */
struct hi_tm_rq {
    unsigned char    seq_no[8];
    unsigned char    kind[2];
};

/* 4.2 시각데이터  */
struct hi_tm_data {
    unsigned char    seq_no[8];
    unsigned char    kind[2];
    unsigned char    year[4];
    unsigned char    month[2];
    unsigned char    day[2];
    unsigned char    hour[2];
    unsigned char    min[2];
    unsigned char    sec[2];
};

/* 5.1 테이블지령 */
struct hi_tbl_cmd {
    unsigned char    seq_no[8];
    unsigned char    kind[2];
    unsigned char    dump_tbl_div[2];

    struct {
        unsigned char    rvs_no[2];
    } rvs_no_tbl[20];

    unsigned char    bl_seq_no[8];
    unsigned char    bef_seq_no[8];
    unsigned char    imm_carno_seq_no[8];
    unsigned char    rfid_seq_no[8];
    unsigned char    red_carno_seq_no[8];
};

/* 5.2 테이블지령응답 */
struct hi_cmd_reply {
    unsigned char    seq_no[8];
    unsigned char    kind[2];
    unsigned char    reply_typ;
};

/* 6 테이블요구 */
struct hi_tbl_order {
    unsigned char    seq_no[8];
    unsigned char    kind[2];
    unsigned char    tbl_typ[2];
    unsigned char    data_div[2];
    unsigned char    frame_no[8];
    unsigned char    req_seq_no[8];
};

/* 7.0 TABLE DATA */
struct hi_tbl_data {
    unsigned char    seq_no[8];
    unsigned char    kind[2];
    unsigned char    tbl_typ[2];
    unsigned char    frame_no[8];
    unsigned char    data;
};

/* 7.1 기초(정수) Header */
struct hi_bas_tbl {
    unsigned char    seq_no[8];
    unsigned char    kind[2];
    unsigned char    tbl_typ[2];
    unsigned char    frame_no[8];
    unsigned char    frame_cnt[8];
    unsigned char    rvs_no[2];
    unsigned char    plz_id[2];
    unsigned char    plz_name[14];
    
    unsigned char    lane_no[2];
    unsigned char    io_div[2];
/* 징수유형 건수 추가 */
    unsigned char    fare_cnt[2];
    struct {
        unsigned char    fare_div[2];
        unsigned char    dc_typ;
        unsigned char    fare[6];
        unsigned char    start_dt[8];
        unsigned char    end_dt[8];
        unsigned char    fare_dc[6];
        unsigned char    penalty[6];
    } fare_info[48];
    unsigned char    plz_tel1[15];
    unsigned char    plz_tel2[15];
    
    unsigned char    bas_aply_year[4];
    unsigned char    bas_aply_month[2];
    unsigned char    bas_aply_day[2];
    unsigned char    bas_aply_hour[2];
    unsigned char    bas_aply_min[2];

    unsigned char    bas_modf_year[4];
    unsigned char    bas_modf_month[2];
    unsigned char    bas_modf_day[2];
    unsigned char    bas_modf_hour[2];
    unsigned char    bas_modf_min[2];
/* 2019.06.03 징수 시작시간/종료시간 추가 */
    unsigned char    rcv_str_dt[4];
    unsigned char    rcv_end_dt[4];
};

/* 7.2.1 근무자 Header */
struct hi_wrkr_tbl_h {
    unsigned char    seq_no[8];
    unsigned char    kind[2];
    unsigned char    tbl_typ[2];
    unsigned char    frame_no[8];
    unsigned char    frame_cnt[8];
    unsigned char    rvs_no[2];

    unsigned char    tbl_aply_year[4];
    unsigned char    tbl_aply_mon[2];
    unsigned char    tbl_aply_day[2];
    unsigned char    tbl_aply_hour[2];
    unsigned char    tbl_aply_min[2];

    unsigned char    tbl_modf_year[4];
    unsigned char    tbl_modf_mon[2];
    unsigned char    tbl_modf_day[2];
    unsigned char    tbl_modf_hour[2];
    unsigned char    tbl_modf_min[2];

    unsigned char    wrkr_crd_cnt[4];
};

/* 7.2.2 근무자 Frame */
struct hi_wrkr_tbl_f {
    unsigned char    seq_no[8];
    unsigned char    kind[2];
    unsigned char    tbl_typ[2];
    unsigned char    frame_no[8];
    struct{
        unsigned char    wrkr_no[4];
        unsigned char    wrkr_nm[10];
    }wrkr_crd_no[83];
};

/* 7.3.1 요금 Header */
struct hi_fare_tbl_h    {
    unsigned char    seq_no[8];
    unsigned char    kind[2];
    unsigned char    tbl_typ[2];
    unsigned char    frame_no[8];
    unsigned char    frame_cnt[8];
    unsigned char    rvs_no[2];

    unsigned char    new_fare_rvs_year[4];
    unsigned char    new_fare_rvs_month[2];
    unsigned char    new_fare_rvs_day[2];
    unsigned char    new_fare_rvs_hour[2];
    unsigned char    new_fare_rvs_min[2];

    unsigned char    old_fare_close_year[4];
    unsigned char    old_fare_close_month[2];
    unsigned char    old_fare_close_day[2];
    unsigned char    old_fare_close_hour[2];
    unsigned char    old_fare_close_min[2];

    unsigned char    fare_modf_year[4];
    unsigned char    fare_modf_month[2];
    unsigned char    fare_modf_day[2];
    unsigned char    fare_modf_hour[2];
    unsigned char    fare_modf_min[2];

    unsigned char    rgst_plz_cnt[4];
};

/* 7.3.2 요금 Frame */
struct hi_fare_tbl_f {
    unsigned char    seq_no[8];
    unsigned char    kind[2];
    unsigned char    tbl_typ[2];
    unsigned char    frame_no[8];
    
    struct {
        unsigned char    fare_div[2];
        unsigned char    dc_typ;
        unsigned char    fare[6];
        unsigned char    start_dt[8];
        unsigned char    end_dt[8];
        unsigned char    fare_dc[6];
        unsigned char    penalty[6];
    } fare_info[52];
};

/* 7.3.1 휴일정보 Header */
struct hi_holi_tbl_h    {
    unsigned char    seq_no[8];
    unsigned char    kind[2];
    unsigned char    tbl_typ[2];
    unsigned char    frame_no[8];
    unsigned char    frame_cnt[8];
    unsigned char    rvs_no[2];

    unsigned char    new_holi_rvs_year[4];
    unsigned char    new_holi_rvs_month[2];
    unsigned char    new_holi_rvs_day[2];
    unsigned char    new_holi_rvs_hour[2];
    unsigned char    new_holi_rvs_min[2];

    unsigned char    holi_modf_year[4];
    unsigned char    holi_modf_month[2];
    unsigned char    holi_modf_day[2];
    unsigned char    holi_modf_hour[2];
    unsigned char    holi_modf_min[2];
};

/* 7.3.2 휴일정보 Frame */
struct hi_holi_tbl_f {
    unsigned char    seq_no[8];
    unsigned char    kind[2];
    unsigned char    tbl_typ[2];
    unsigned char    frame_no[8];
    
    struct {
        unsigned char    year[4];
        unsigned char    mon[2];
        unsigned char    day[2];
    } holi[250];
};

/* 7.4.1 발행사 Header */
struct hi_iss_comp_info_h {
    unsigned char    seq_no[8];
    unsigned char    kind[2];
    unsigned char    tbl_typ[2];
    unsigned char    frame_no[8];
    unsigned char    frame_cnt[8];
    unsigned char    rvs_no[2];
    unsigned char    rgst_iss_cnt[8];

    unsigned char    iss_aply_year[4];
    unsigned char    iss_aply_month[2];
    unsigned char    iss_aply_day[2];
    unsigned char    iss_aply_hour[2];
    unsigned char    iss_aply_min[2];

    unsigned char    iss_modf_year[4];
    unsigned char    iss_modf_month[2];
    unsigned char    iss_modf_day[2];
    unsigned char    iss_modf_hour[2];
    unsigned char    iss_modf_min[2];
};

/* 7.4.2 발행사 Frame */
struct hi_iss_comp_info_f {
    unsigned char    seq_no[8];
    unsigned char    kind[2];
    unsigned char    tbl_typ[2];
    unsigned char    frame_no[8];
    struct {
        unsigned char    crd_co[2];
        unsigned char    bin_code[8];
    } comp[200];
};

/* 7.5.1 차량번호면제 Header */
struct hi_imm_carno_tbl_h {
    unsigned char    seq_no[8];
    unsigned char    kind[2];
    unsigned char    tbl_typ[2];
    unsigned char    frame_no[8];
    unsigned char    frame_cnt[8];
    unsigned char    rvs_no[2];
    unsigned char    div[2];

    unsigned char    imm_aply_year[4];
    unsigned char    imm_aply_month[2];
    unsigned char    imm_aply_day[2];
    unsigned char    imm_aply_hour[2];
    unsigned char    imm_aply_min[2];

    unsigned char    imm_modf_year[4];
    unsigned char    imm_modf_month[2];
    unsigned char    imm_modf_day[2];
    unsigned char    imm_modf_hour[2];
    unsigned char    imm_modf_min[2];
};

/* 7.5.2 차량번호면제 Frame */
struct hi_imm_carno_tbl_f {
    unsigned char    seq_no[8];
    unsigned char    kind[2];
    unsigned char    tbl_typ[2];
    unsigned char    frame_no[8];

    unsigned char    last_data_seq_no[8];
    unsigned char    item_cnt[2];
    struct {
        unsigned char    rgst_div[2];
        unsigned char    imm_div[2];
        unsigned char    car_no[10];
    } imm_info[142];
};

/* 7.6.1 RFID저공해/요일제 Header */
struct hi_imm_crdno_tbl_h {
    unsigned char    seq_no[8];
    unsigned char    kind[2];
    unsigned char    tbl_typ[2];
    unsigned char    frame_no[8];
    unsigned char    frame_cnt[8];
    unsigned char    rvs_no[2];
    unsigned char    div[2];

    unsigned char    imm_aply_year[4];
    unsigned char    imm_aply_month[2];
    unsigned char    imm_aply_day[2];
    unsigned char    imm_aply_hour[2];
    unsigned char    imm_aply_min[2];

    unsigned char    imm_modf_year[4];
    unsigned char    imm_modf_month[2];
    unsigned char    imm_modf_day[2];
    unsigned char    imm_modf_hour[2];
    unsigned char    imm_modf_min[2];
};

/* 7.6.2 RFID저공해/요일제 Frame */
struct hi_imm_crdno_tbl_f {
    unsigned char    seq_no[8];
    unsigned char    kind[2];
    unsigned char    tbl_typ[2];
    unsigned char    frame_no[8];

    unsigned char    last_data_seq_no[8];
    unsigned char    item_cnt[2];
    struct {
        unsigned char    rgst_div[2];
        unsigned char    car_div;
        unsigned char    crd_no[24];
        unsigned char    car_no[10];
        unsigned char    unap_div;
        unsigned char    vio_div;
    }imm_info[49];
};

/* 7.7.1 사전결제등록 Header */
struct hi_adv_payment_tbl_h {
    unsigned char    seq_no[8];
    unsigned char    kind[2];
    unsigned char    tbl_typ[2];
    unsigned char    frame_no[8];
    unsigned char    frame_cnt[8];
    unsigned char    rvs_no[2];
    unsigned char    div[2];

    unsigned char    adv_aply_year[4];
    unsigned char    adv_aply_month[2];
    unsigned char    adv_aply_day[2];
    unsigned char    adv_aply_hour[2];
    unsigned char    adv_aply_min[2];

    unsigned char    adv_modf_year[4];
    unsigned char    adv_modf_month[2];
    unsigned char    adv_modf_day[2];
    unsigned char    adv_modf_hour[2];
    unsigned char    adv_modf_min[2];
};

/* 7.7.2 사전결제등록 Frame */
struct hi_adv_payment_tbl_f {
    unsigned char    seq_no[8];
    unsigned char    kind[2];
    unsigned char    tbl_typ[2];
    unsigned char    frame_no[8];
    unsigned char    last_data_seq_no[8];
    unsigned char    item_cnt[2];
    struct {
        unsigned char    rgst_div[2];
        unsigned char    div[2];
        unsigned char    car_no[10];
    } adv_info[142];
};

/* 7.8.1 교통카드P/L Header */
struct hi_pl_tbl_h {
    unsigned char    seq_no[8];
    unsigned char    kind[2];
    unsigned char    tbl_typ[2];
    unsigned char    frame_no[8];
    unsigned char    frame_cnt[8];
    unsigned char    rvs_no[2];
    unsigned char    div[2];

    unsigned char    pl_aply_year[4];
    unsigned char    pl_aply_month[2];
    unsigned char    pl_aply_day[2];
    unsigned char    pl_aply_hour[2];
    unsigned char    pl_aply_min[2];

    unsigned char    pl_modf_year[4];
    unsigned char    pl_modf_month[2];
    unsigned char    pl_modf_day[2];
    unsigned char    pl_modf_hour[2];
    unsigned char    pl_modf_min[2];
    struct {
        unsigned char block_st_no[8]; /* 블록 시작 Alias_no */
        unsigned char block_cnt[8];   /* 블록 총건수        */
    } pl_block[17];
};

/* 7.8.2 교통카드P/L Frame */
struct hi_pl_tbl_f {
    unsigned char    seq_no[8];
    unsigned char    kind[2];
    unsigned char    tbl_typ[2];
    unsigned char    frame_no[8];
    unsigned char    item_cnt[4];
    unsigned char    div[1003];
};

/* 7.9.1 교통카드B/L Header */
struct hi_bl_tbl_h {
    unsigned char    seq_no[8];
    unsigned char    kind[2];
    unsigned char    tbl_typ[2];
    unsigned char    frame_no[8];
    unsigned char    frame_cnt[8];
    unsigned char    rvs_no[2];
    unsigned char    div[2];

    unsigned char    bl_aply_year[4];
    unsigned char    bl_aply_month[2];
    unsigned char    bl_aply_day[2];
    unsigned char    bl_aply_hour[2];
    unsigned char    bl_aply_min[2];

    unsigned char    bl_modf_year[4];
    unsigned char    bl_modf_month[2];
    unsigned char    bl_modf_day[2];
    unsigned char    bl_modf_hour[2];
    unsigned char    bl_modf_min[2];
};

/* 7.9.2 교통카드B/L Frame */
struct hi_bl_tbl_f {
    unsigned char    seq_no[8];
    unsigned char    kind[2];
    unsigned char    tbl_typ[2];
    unsigned char    frame_no[8];
    unsigned char    last_data_seq_no[8];
    unsigned char    item_cnt[2];
    struct{
        unsigned char    div[2];
        unsigned char    crd_no[16];
    }bl_data[111];
};

/* 7.10.1 차량번호감면 Header */
struct hi_reduce_tbl_h {
    unsigned char    seq_no[8];
    unsigned char    kind[2];
    unsigned char    tbl_typ[2];
    unsigned char    frame_no[8];
    unsigned char    frame_cnt[8];
    unsigned char    rvs_no[2];
    unsigned char    div[2];

    unsigned char    red_aply_year[4];
    unsigned char    red_aply_month[2];
    unsigned char    red_aply_day[2];
    unsigned char    red_aply_hour[2];
    unsigned char    red_aply_min[2];

    unsigned char    red_modf_year[4];
    unsigned char    red_modf_month[2];
    unsigned char    red_modf_day[2];
    unsigned char    red_modf_hour[2];
    unsigned char    red_modf_min[2];
};

/* 7.10.2 차량번호감면 Frame */
struct hi_reduce_tbl_f {
    unsigned char    seq_no[8];
    unsigned char    kind[2];
    unsigned char    tbl_typ[2];
    unsigned char    frame_no[8];
    unsigned char    last_data_seq_no[8];
    unsigned char    item_cnt[2];
    struct {
        unsigned char    rgst_div[2];
        unsigned char    div[2];
        unsigned char    car_no[10];
    }red_data[142];
};
#if 0
/* 7.11.1 IMSI 교통카드B/L Header */
struct hi_imbl_tbl_h {
    unsigned char    seq_no[8];
    unsigned char    kind[2];
    unsigned char    tbl_typ[2];
    unsigned char    frame_no[8];
    unsigned char    frame_cnt[8];
    unsigned char    rvs_no[2];
    unsigned char    div[2];

    unsigned char    bl_aply_year[4];
    unsigned char    bl_aply_month[2];
    unsigned char    bl_aply_day[2];
    unsigned char    bl_aply_hour[2];
    unsigned char    bl_aply_min[2];

    unsigned char    bl_modf_year[4];
    unsigned char    bl_modf_month[2];
    unsigned char    bl_modf_day[2];
    unsigned char    bl_modf_hour[2];
    unsigned char    bl_modf_min[2];
};

/* 7.11.2 IMSI 교통카드B/L Frame */
struct hi_imbl_tbl_f {
    unsigned char    seq_no[8];
    unsigned char    kind[2];
    unsigned char    tbl_typ[2];
    unsigned char    frame_no[8];
    unsigned char    last_data_seq_no[8];
    unsigned char    item_cnt[2];
    struct{
        unsigned char    div[2];
        unsigned char    crd_no[16];
    }bl_data[111];
};
#endif
/* 8.1 차로상태정보 */
struct hi_lane_stat {
    unsigned char    seq_no[8];
    unsigned char    kind[2];
    unsigned char    mchi_stat[8]; //  (BIT)
    unsigned char    dummy;

    struct {
        unsigned char    stat;
        unsigned char    rvs_no[2];
    }tbl_stat[20];

    unsigned char    bl_seq_no[8];
    unsigned char    bef_seq_no[8];
    unsigned char    imm_carno_seq_no[8];
    unsigned char    rfid_seq_no[8];
    unsigned char    red_carno_seq_no[8];
    unsigned char    anpr_cam;
    unsigned char    anpr_tempa[4];
    unsigned char    anpr_door;
    unsigned char    anpr_sd;
};

/* 9.1 보수데이터 */
struct hi_rpr_data {
    unsigned char    seq_no[8];
    unsigned char    kind[2];
    unsigned char    wrk_no[4];
    unsigned char    year[4];
    unsigned char    month[2];
    unsigned char    day[2];
    unsigned char    hour[2];
    unsigned char    min[2];
    unsigned char    sec[2];
    unsigned char    lane_no[2];
    unsigned char    terminal_no[10];
    unsigned char    wrk_stat;
    unsigned char    mchi_kind[2];
    unsigned char    occ_rest;
    unsigned char    err_code[2];
    
    unsigned char    anpr_cam;
    unsigned char    anpr_tempa[4];
    unsigned char    anpr_door;
    unsigned char    anpr_sd;
};

/* 10.1 야간계수 */
struct hi_close_pass {
    unsigned char    seq_no[8];
    unsigned char    kind[2];
    unsigned char    wrk_date[8];
    unsigned char    lane_no[2];
    unsigned char    serial_no[6];

    unsigned char    year[4];
    unsigned char    month[2];
    unsigned char    day[2];
    unsigned char    hour[2];
    unsigned char    min[2];
    unsigned char    sec[2];

    unsigned char    io_div;
    unsigned char    plz_id[2];
    unsigned char    car_kind;
    unsigned char    image_yn;
    unsigned char    car_no[16];
    unsigned char    x_point[4];
    unsigned char    y_point[4];
    unsigned char    img_width[4];
    unsigned char    img_heigh[4];
};

/* 11.1 근무개시보고 */
struct hi_wrk_start {
    unsigned char    seq_no[8];
    unsigned char    kind[2];

    unsigned char    wrk_year[4];
    unsigned char    wrk_month[2];
    unsigned char    wrk_day[2];

    unsigned char    wrk_no[4];

    unsigned char    wrk_start_year[4];
    unsigned char    wrk_start_month[2];
    unsigned char    wrk_start_day[2];
    unsigned char    wrk_start_hour[2];
    unsigned char    wrk_start_min[2];
    unsigned char    wrk_start_sec[2];

    unsigned char    io_div;
    unsigned char    wrk_div;
    unsigned char    week_no;
    unsigned char    holi_yn;
    unsigned char    wrkr_no[4];
    unsigned char    plz_id[2];
};

/* 12.1 처리 */
struct hi_hnd_data {
    unsigned char    seq_no[8];
    unsigned char    kind[2];
    unsigned char    wrk_date[8];
    unsigned char    wrk_no[4];
    unsigned char    wrkr_no[4];
    unsigned char    serial_no[6];
    unsigned char    io_div;
    unsigned char    plz_id[2];
    unsigned char    lane_no[2];
    unsigned char    car_kind;
    unsigned char    sence_seq_no[6];
#if 1
/* 2019.07.26 감지시간 추가 */
    unsigned char    sence_time[6];
#endif
    struct {
        unsigned char    hnd_year[4];
        unsigned char    hnd_month[2];
        unsigned char    hnd_day[2];
        unsigned char    hnd_hour[2];
        unsigned char    hnd_min[2];
        unsigned char    hnd_sec[2];
        unsigned char    org_pass_fare[6];
        unsigned char    pass_fare[6];
        unsigned char    rcpt_money[6];
        unsigned char    refund_yn;
        unsigned char    key_yn;
        unsigned char    rcpt_hnd[2];
        unsigned char    red_div;
        unsigned char    issue_code[7];
        unsigned char    crd_no[20];
        unsigned char    rcpt_div[2];
    } hnd_info;
    unsigned char    pre_yn;
    unsigned char    img_yn;
    unsigned char    car_no1[16];
    unsigned char    car_no2[16];
    unsigned char    x_point[4];
    unsigned char    y_point[4];
    unsigned char    img_width[4];
    unsigned char    img_heigh[4];
    unsigned char    dc_typ[2];
    unsigned char    tag_id1[24];
    unsigned char    tag_id2[24];
};

/* 13.1 카드처리 */
struct hi_crd_hnd_data {
    unsigned char    seq_no[8];
    unsigned char    kind[2];
    unsigned char    wrk_date[8];
    unsigned char    wrk_no[4];
    unsigned char    wrkr_no[4];
    unsigned char    serial_no[6];
    unsigned char    io_div;
    unsigned char    plz_id[2];

    unsigned char    hnd_year[4];
    unsigned char    hnd_month[2];
    unsigned char    hnd_day[2];
    unsigned char    hnd_hour[2];
    unsigned char    hnd_min[2];
    unsigned char    hnd_sec[2];
    unsigned char    pass_fare[6];
    unsigned char    rcpt_money[6];
    unsigned char    bef_rcpt_balc[8];
    unsigned char    aft_rcpt_balc[8];
    unsigned char    rcpt_div[2];
    unsigned char    crd_kind[2];
    unsigned char    pre_div;
    unsigned char    car_kind;
    unsigned char    crd_no[20];
    unsigned char    pay_div[2];

    unsigned char    terminal_no[10];
    unsigned char    terminal_cnt[10];
    unsigned char    alg_id[2];
    unsigned char    psam_id[16];
    unsigned char    purch_dt[8];
    unsigned char    deal_div[2];
    unsigned char    elec_iss_id[6];
    unsigned char    elec_id[10];
    unsigned char    elec_ser_no[8];
    unsigned char    deal_ser_no[8];
    unsigned char    crd_ser_no[10];
    unsigned char    deal_tot[8];

    unsigned char    ind_iss_cnt[4];
    unsigned char    rcpt_deal_ser[8];
    unsigned char    ind_sign1[2];
    unsigned char    psam_sign1[8];
    unsigned char    ind_sign2[2];
    unsigned char    psam_sign2[8];
    unsigned char    id_center[2];
    unsigned char    iss_code[7];
    unsigned char    another[2];
    unsigned char    alias_no[10];
    unsigned char    car_no1[16];
    unsigned char    car_no2[16];
    unsigned char    tot_id[12];
};

/* 14.1 근무종료 */
struct hi_wrk_end {
    unsigned char    seq_no[8];
    unsigned char    kind[2];
    unsigned char    wrkr_no[4];
    unsigned char    wrk_date[8];
    unsigned char    wrk_no[4];

    unsigned char    wrk_start_year[4];
    unsigned char    wrk_start_month[2];
    unsigned char    wrk_start_day[2];
    unsigned char    wrk_start_hour[2];
    unsigned char    wrk_start_min[2];
    unsigned char    wrk_start_sec[2];

    unsigned char    wrk_end_year[4];
    unsigned char    wrk_end_month[2];
    unsigned char    wrk_end_day[2];
    unsigned char    wrk_end_hour[2];
    unsigned char    wrk_end_min[2];
    unsigned char    wrk_end_sec[2];

    unsigned char    io_div;
    unsigned char    week_div;
    unsigned char    holi_yn;
    unsigned char    input_fare[8];
    unsigned char    output_fare[8];
    unsigned char    over_input[8];
    unsigned char    over_output[8];
    struct {
        unsigned char div[2];
        unsigned char cnt[4];
        unsigned char fare[8];
    } hnd_cnt[50];
//2019.05.22 추가
    unsigned char    repay_cnt[4];
    unsigned char    repay_fare[8];

    unsigned char    tot_fare[8];
};

/* 15.1 보증전송연번 */
struct hi_warr_snd_no {
    unsigned char    seq_no[8];
    unsigned char    kind[2];
    unsigned char    warr_seq_no[8];
};

/* 16.1 테이블덤프 */
struct hi_dump_tbl {
    unsigned char    seq_no[8];
    unsigned char    kind[2];
    unsigned char    tbl_type[2];
    unsigned char    frame_no[8];
    unsigned char    dummy[2010];
};

/* 17.1 차로측기동회선테스트 */
struct hi_lane_line_test {
    unsigned char    seq_no[8];
    unsigned char    kind[2];
    unsigned char    test_data[1010];
};

/* 17.2 차로측기동회선테스트-응답 */
struct hi_lane_line_test_reply {
    unsigned char    seq_no[8];
    unsigned char    kind[2];
    unsigned char    test_data[1010];
};

/* 18.1 요금소측기동회선테스트 */
struct hi_plz_line_test {
    unsigned char    seq_no[8];
    unsigned char    kind[2];
    unsigned char    test_data[1010];
};

/* 18.2 요금소측기동회선테스트-응답 */
struct hi_plz_line_test_reply {
    unsigned char    seq_no[8];
    unsigned char    kind[2];
    unsigned char    test_data[1010];
};

/* 19.1 원격차로상태요청 */
struct hi_remote_lane_stat {
    unsigned char    seq_no[8];
    unsigned char    kind[2];
};

/* 19.2 원격차로상태응답 */
struct hi_remote_lane_stat_reply {
    unsigned char    seq_no[8];
    unsigned char    kind[2];
    unsigned char    lane_stat[8];
    unsigned char    dummy[10];
    unsigned char    tick_stat[4];
    unsigned char    rcpt_stat[4];
    unsigned char    car_div_stat[8];
    unsigned char    crd_terminal[56];
    unsigned char    crd_reader[2];
    unsigned char    toll_system[2];
    unsigned char    reserve1[2];
    unsigned char    reserve2[2];
    unsigned char    reserve3[2];
    unsigned char    reserve4[2];
};

/* 19.3 원격차로제어 */
struct hi_remote_lane {
    unsigned char    seq_no[8];
    unsigned char    kind[2];
    unsigned char    div[2];
};

/* 20.1 미납조회요청 */
struct hi_non_pay_srch {
    unsigned char    seq_no[8];
    unsigned char    kind[2];
    unsigned char    car_no[16];
    unsigned char    car_code[10];
};

/* 20.2 미납조회결과 */
struct hi_non_pay_rlt {
    unsigned char    seq_no[8];
    unsigned char    kind[2];
    unsigned char    tot_cnt[4];
    unsigned char    tot_fare[8];
    unsigned char    car_no[10];
    struct {
        unsigned char wrk_dt[14];
        unsigned char lane_no[2];
        unsigned char plz_id[2];
        unsigned char toll_amt[8];
        unsigned char notice_cnt[2];
        unsigned char end_date[8];
    } rlt_info[5];
};

/* 21.1 카드번호조회 */
struct hi_crd_srch {
    unsigned char    seq_no[8];
    unsigned char    kind[2];
    unsigned char    div;
    unsigned char    srch_number[16];
};

/* 21.2 카드번호조회결과 */
struct hi_crd_rlt {
    unsigned char    seq_no[8];
    unsigned char    kind[2];
    unsigned char    rlt[2];
};

/* 22.1 면제감면정보조회 */
struct hi_immred_srch {
    unsigned char    seq_no[8];
    unsigned char    kind[2];
    unsigned char    car_no[16];
    unsigned char    car_no_cd[10];
};

/* 22.2 면제감면정보결과 */
struct hi_immred_rlt {
    unsigned char    seq_no[8];
    unsigned char    kind[2];
    unsigned char    rlt[2];
    unsigned char    dtl;
    unsigned char    unap_div;
    unsigned char    vio_div;
};

/* 23.1 환불처리데이터 */
struct hi_refund_data {
#if 0
    unsigned char    seq_no[8];
    unsigned char    kind[2];
    unsigned char    wrk_date[8];
    unsigned char    wrk_no[4];
    unsigned char    wrkr_no[4];
	unsigned char    serial_no[6];
	unsigned char    plz_id[2];
	unsigned char    lane_no[2];

	unsigned char    hnd_year[4];
	unsigned char    hnd_month[2];
	unsigned char    hnd_day[2];
	unsigned char    hnd_hour[2];
	unsigned char    hnd_min[2];
	unsigned char    hnd_sec[2];

	unsigned char    org_pass_fare[6];
	unsigned char    pass_fare[6];
	unsigned char    toll_amt[6];

	unsigned char    refund_year[4];
	unsigned char    refund_month[2];
	unsigned char    refund_day[2];
	unsigned char    refund_hour[2];
	unsigned char    refund_min[2];
	unsigned char    refund_sec[2];

	unsigned char    refund_key;
#else
    unsigned char    seq_no[8];
    unsigned char    kind[2];
    unsigned char    wrk_date[8];
    unsigned char    wrk_no[4];
    unsigned char    wrkr_no[4];
    unsigned char    serial_no[6];
    unsigned char    io_div;
    unsigned char    plz_id[2];
    unsigned char    lane_no[2];
    unsigned char    car_kind;
    unsigned char    sence_seq_no[6];
    unsigned char    sence_time[6];
    struct {
        unsigned char    hnd_year[4];
        unsigned char    hnd_month[2];
        unsigned char    hnd_day[2];
        unsigned char    hnd_hour[2];
        unsigned char    hnd_min[2];
        unsigned char    hnd_sec[2];
        unsigned char    org_pass_fare[6];
        unsigned char    pass_fare[6];
        unsigned char    rcpt_money[6];
        unsigned char    refund_yn;
        unsigned char    key_yn;
        unsigned char    rcpt_hnd[2];
        unsigned char    red_div;
        unsigned char    issue_code[7];
        unsigned char    crd_no[20];
        unsigned char    rcpt_div[2];
    } hnd_info;
    unsigned char    pre_yn;
    unsigned char    img_yn;
    unsigned char    car_no1[16];
    unsigned char    car_no2[16];
    unsigned char    x_point[4];
    unsigned char    y_point[4];
    unsigned char    img_width[4];
    unsigned char    img_heigh[4];
    unsigned char    dc_typ[2];
    unsigned char    tag_id1[24];
    unsigned char    tag_id2[24];
#endif
};
#endif