/*
 *========================================================================
 *
 *    : AZN_PLAZA_LANE APP
 *      : taglnk_frame.h
 *      : JBY (baarong@neighbor21.co.kr)
 *      : 2018.07.13
 *      : 
 *        :    
 *
 *========================================================================
*/

#ifndef    _TAGLNK_HEADER
#define    _TAGLNK_HEADER

#include "file_ctrl.h"
#include "tag_chrg.h"
#include "tag_rfnd.h"

struct lnk_header {
    unsigned char    rcv_code[6];
    unsigned char    occr;
    unsigned char    job[4];
    unsigned char    wrk[4];
    unsigned char    snd_no[8];
    unsigned char    tm[14];
    unsigned char    reply[4];
};

struct rq_seq_no_tbl {
    unsigned char    kind[2];              /*         */
    unsigned char    rq_seq_no[8];         /*         */
    unsigned char    wrk_no[4];         /*         */
    unsigned char    wrk_date[8];       /*         */
    unsigned char    lane_no[2];        /* ещ        */
    unsigned char    day_chng_hour[2];  /*         */
    unsigned char    day_chng_min[2];   /*         */
    unsigned char    day_end_hour[2];   /*         */
    unsigned char    day_end_min[2];    /*         */
};

struct rq_iss_info_tbl {
    unsigned char    kind[2];
    unsigned char    rslt[2];
    unsigned char    rs_cnt[4];
    unsigned char    snd_cnt[4];
    struct {
        unsigned char    tag_balc[8];
        unsigned char    tag_id[24];
        unsigned char    tag_iss[2];
        unsigned char    tag_vhcl_clss;
        unsigned char    tag_atrb;
        unsigned char    tag_dtl_code[2];
        unsigned char    tag_vhcl_no[12];
        unsigned char    tag_vald_term[10];
        unsigned char    tag_crc[2];
    } iss_info[25];
};

struct rq_lnk_rslt {
    unsigned char    kind[2];
    unsigned char    rslt[4];
};

struct rq_betran_rslt_tbl {
    unsigned char    kind[2];
    unsigned char    rs_cnt[4];
    unsigned char    snd_cnt[4];
    struct {
        unsigned char    betran_div[2];
        unsigned char    tag_vhcl_no[12];
        unsigned char    tag_id[24];
        unsigned char    betran_datetm[14];
        unsigned char    betran_mny[8];
    } betran_info[50];
};

struct rq_tag_info_tbl {
    unsigned char    kind[2];
    unsigned char    rslt[2];
    unsigned char    tag_blnc[8];
    unsigned char    tag_id[24];
    unsigned char    iss_comp[2];
    unsigned char    tag_vhcl_clss;
    unsigned char    tag_atrb;
    unsigned char    tag_dtl_code[2];
    unsigned char    tag_vhcl_no[12];
    unsigned char    vald_term[10];
    unsigned char    tag_crc[2];
    unsigned char    in_way_plz_id[2];
    unsigned char    in_way_wrk_date[8];
    unsigned char    in_way_wrk_no[4];
    unsigned char    in_way_proc_no[8];
    unsigned char    in_way_sense_vhcl_clss;
    unsigned char    in_way_hnd_vhcl_clss;
    unsigned char    in_way_entry_datetm[14];
};

struct rcv_lane_data {
	unsigned char    kind[2];
    unsigned char    plz_id[2];
    unsigned char    wrk_datetm[14];
    unsigned char    io_div;
    unsigned char    lane_no[2];
    unsigned char    wrk_no[4];
    unsigned char    wrkr_no[4];
    unsigned char    con_stat;
    unsigned char    rcv_snd_no[10];
    unsigned char    st_snd_no[10];
    unsigned char    ed_snd_no[10];
    unsigned char    buf[2048];
};

#endif
