/*
 *========================================================================
 *
 *   시스템명 : 남산 1/3호 터널
 *   파 일 명 : packet_chng.c
 *   작 성 자 : 조보용 (baarong@neighbor21.co.kr)
 *   작 성 일 : 2019.05.02
 *   수 정 일 :
 *   설    명 :
 *
 *========================================================================
*/

#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <termio.h>
#include <strings.h>
#include <sys/msg.h>
#include <sys/ipc.h>
#include "hi_ctrl.h"
#include "lo_ctrl.h"
#include "snd_rcv_knd.h"
#include "hi_packet_format.h"
#include "lo_packet_format.h"
#include "file_lb.h"
#include "func_list.h"
#include "lo_typ_chg_def.h"
#include "def_set.h"
#include "lb_func_list.h"
#define  _VERIFY_  1

static int    ns_rq_seq_no(), ns_seq_no_data(), ns_comm_continue_rq();
static int    ns_rq_accuml_data(), ns_accuml_data_ok(), ns_confrm_reply();
static int    ns_tm_rq(), ns_tm_data(), ns_tbl_cmd(), ns_cmd_reply();
static int    ns_tbl_order(), ns_tbl_data(), ns_warr_snd_no();
static int    ns_lane_stat(), ns_rpr_data(), ns_close_pass();
static int    ns_wrk_start(), ns_hnd_data(), ns_crd_hnd_data();
static int    ns_wrk_end(), ns_lane_line_test(), ns_lane_line_test_reply();
static int    ns_plz_line_test(), ns_plz_line_test_reply();
static int    ns_remote_lane_stat(), ns_remote_lane_stat_reply();
static int    ns_remote_lane(), ns_non_pay_srch(), ns_non_pay_rlt();
static int    ns_crd_srch(), ns_crd_rlt(), ns_refund_data();

struct    ns_pkt_chng {           /* PACKET 변환 TABLE    */
    int    cmd;                 /* command              */
    int    (*func)();            /* low->high function  */
    int    hi_size;                /* high packet size     */
    int    lo_size;                /* low packet size      */
} ns_pkt_chng[] = {
 /* cmd */                 /*(*func)()*/             /* hi_size */                   /* lo_size */
 { NS_RQ_SEQ_NO              , ns_rq_seq_no              , SZ(hi_rq_seq_no             ) , SZ(rq_seq_no              )      },  /* 0x01 전송연번요구 */
 { NS_SEQ_NO_DATA            , ns_seq_no_data            , SZ(hi_seq_no_data           ) , SZ(seq_no_data            )      },  /* 0xA1 전송연번 데이터 */
 { NS_COMM_CONTINUE_RQ       , ns_comm_continue_rq       , SZ(hi_comm_continue_rq      ) , SZ(comm_continue_rq       )      },  /* 0x02 교신재개요구 */
 { NS_RQ_ACCUML_DATA         , ns_rq_accuml_data         , SZ(hi_rq_accuml_data        ) , SZ(rq_accuml_data         )      },  /* 0xA2 축적데이터 전송요구 */
 { NS_ACCUML_DATA_OK         , ns_accuml_data_ok         , SZ(hi_accuml_data_ok        ) , SZ(accuml_data_ok         )      },  /* 0x03 축적데이터 전송 완료 */
 { NS_CONFRM_REPLY           , ns_confrm_reply           , SZ(hi_confrm_reply          ) , SZ(confrm_reply           )      },  /* 0xA3 확인응답 */
 { NS_TM_RQ                  , ns_tm_rq                  , SZ(hi_tm_rq                 ) , SZ(tm_rq                  )      },  /* 0x04 시각요구 */
 { NS_TM_DATA                , ns_tm_data                , SZ(hi_tm_data               ) , SZ(tm_data                )      },  /* 0xA4 시각 데이터 */
 { NS_TBL_CMD                , ns_tbl_cmd                , SZ(hi_tbl_cmd               ) , SZ(tbl_cmd                )      },  /* 0xB6 테이블 지령 */
 { NS_CMD_REPLY              , ns_cmd_reply              , SZ(hi_cmd_reply             ) , SZ(cmd_reply              )      },  /* 0xD1 지령응답 */
 { NS_TBL_ORDER              , ns_tbl_order              , SZ(hi_tbl_order             ) , SZ(tbl_order              )      },  /* 0x24 테이블 요구 */
 { NS_TBL_DATA               , ns_tbl_data               , SZ(hi_tbl_data              ) , SZ(tbl_data               )      },  /* 0xC2 테이블 데이터 */
 { NS_LANE_STAT              , ns_lane_stat              , SZ(hi_lane_stat             ) , SZ(lane_stat              )      },  /* 0x75 차로상태(STATUS */
 { NS_RPR_DATA               , ns_rpr_data               , SZ(hi_rpr_data              ) , SZ(rpr_data               )      },  /* 0x76 보수데이터 */
 { NS_CLOSE_PASS             , ns_close_pass             , SZ(hi_close_pass            ) , SZ(close_pass             )      },  /* 0x73 야간계수 데이터 */
 { NS_WRK_START              , ns_wrk_start              , SZ(hi_wrk_start             ) , SZ(wrk_start              )      },  /* 0x61 근무개시보고 */
 { NS_HND_DATA               , ns_hnd_data               , SZ(hi_hnd_data              ) , SZ(hnd_data               )      },  /* 0x17 처리 데이터 */
 { NS_CRD_HND_DATA           , ns_crd_hnd_data           , SZ(hi_crd_hnd_data          ) , SZ(crd_hnd_data           )      },  /* 0x50 카드처리 데이터 */
 { NS_WRK_END                , ns_wrk_end                , SZ(hi_wrk_end               ) , SZ(wrk_end                )      },  /* 0x28 근무종료데이터 */
 { NS_WARR_SND_NO            , ns_warr_snd_no            , SZ(hi_warr_snd_no           ) , SZ(warr_snd_no            )      },  /* 0xB3 보증전송연번 */
 { NS_DUMP_TBL               , ns_tbl_data               , SZ(hi_dump_tbl              ) , SZ(dump_tbl               )      },  /* 0x26 테이블 덤프 */
 { NS_LANE_LINE_TEST         , ns_lane_line_test         , SZ(hi_lane_line_test        ) , SZ(lane_line_test         )      },  /* 0x2F 차로측기동회선테스트 테이터 */
 { NS_LANE_LINE_TEST_REPLY   , ns_lane_line_test_reply   , SZ(hi_lane_line_test_reply  ) , SZ(lane_line_test_reply   )      },  /* 0xCF 차로측기동회선테스트 테이터 응답 */
 { NS_PLZ_LINE_TEST          , ns_plz_line_test          , SZ(hi_plz_line_test         ) , SZ(plz_line_test          )      },  /* 0xB2 영업소측 기동회선테스트 테이터 */
 { NS_PLZ_LINE_TEST_REPLY    , ns_plz_line_test_reply    , SZ(hi_plz_line_test_reply   ) , SZ(plz_line_test_reply    )      },  /* 0xD2 영업소측 기동회선테스트 테이터 응답 */
 { NS_REMOTE_LANE_STAT       , ns_remote_lane_stat       , SZ(hi_remote_lane_stat      ) , SZ(remote_lane_stat       )      },  /* 0xB9 원격차로상태조회 */
 { NS_REMOTE_LANE_STAT_REPLY , ns_remote_lane_stat_reply , SZ(hi_remote_lane_stat_reply) , SZ(remote_lane_stat_reply )      },  /* 0xD4 원격차로상태응답 */
 { NS_REMOTE_LANE            , ns_remote_lane            , SZ(hi_remote_lane           ) , SZ(remote_lane            )      },  /* 0xBA 원격차로제어 */
 { NS_NON_PAY_SRCH           , ns_non_pay_srch           , SZ(hi_non_pay_srch          ) , SZ(non_pay_srch           )      },  /* 0x21 미납정보조회 */
 { NS_NON_PAY_RLT            , ns_non_pay_rlt            , SZ(hi_non_pay_rlt           ) , SZ(non_pay_rlt            )      },  /* 0x22 미납정보결과 */
 { NS_CRD_SRCH               , ns_crd_srch               , SZ(hi_crd_srch              ) , SZ(crd_srch               )      },  /* 0x21 카드번호조회 */
 { NS_CRD_RLT                , ns_crd_rlt                , SZ(hi_crd_rlt               ) , SZ(crd_rlt                )      },  /* 0xA5 카드번호결과 */
 { NS_REFUND_DATA            , ns_refund_data            , SZ(hi_refund_data           ) , SZ(refund_data            )      },  /* 0x40 환불처리데이터 */
 { -1                        , NULL                      , 0                             , 0                                }
};

/*************************** PROCEDURE LIST **********************************/
/* ns_packet_h2l()  상위레벨의 FRAME FORMAT을 차로측 송신 FORMAT으로 변경   */
/* ns_packet_l2h()  차로측 수신 FRAME을 상위 LEVEL FORMAT으로 변경          */
/*****************************************************************************/

/*
 *========================================================================
 *
 *   Function : ns_packet_h2l()
 *   Progrmer : JBY (baarong@neighbor21.co.kr)
 *   Date     : 2018.08.24
 *   Modified :
 *   Remark   : 차로로 전송할 DATA를 LOW-LEVEL PACKET BUFFER로 전송
 *
 *========================================================================
*/
int ns_packet_h2l(unsigned char *buf, int len)
{
    int     result;
    char    knd[2+1];
    register int i;

    if (lo_comm_ctrl.pkt.flg != LP_FREE)
        lane_log(" (ns_packet_chng.c) PACKET BUSY.........\n");
    if (lo_comm_ctrl.pkt.flg != LP_FREE)        /* packet busy    */
        return (-1);
//lane_log("buf[%s]\n", buf);
    sprintf(knd, "%.2s%c", buf+8, '\0');
    hi_comm_ctrl.snd.cmd = strtoul(knd, NULL, 16);
//lane_log("H_TO_L KIND [%.2s] [%x] [%x] \n", knd, hi_comm_ctrl.snd.cmd, NS_TBL_DATA);

    for (i=0; ns_pkt_chng[i].cmd != -1; i++)
    {
        if (ns_pkt_chng[i].cmd == (int)hi_comm_ctrl.snd.cmd)
            break;
    }
//lane_log("HtoL 1[%x][%d]\n", ns_pkt_chng[i].cmd, len);
    if (ns_pkt_chng[i].cmd == -1 || ns_pkt_chng[i].func == NULL)
        lane_log(" (ns_packet_chng.c) 차로종별 [%02X] 송신 FORMAT 변경오류\n", hi_comm_ctrl.snd.cmd);
    if (len < ns_pkt_chng[i].hi_size)
        lane_log(" (ns_packet_chng.c) 종별 %02X 송신 FORMAT LEN ERR \n", hi_comm_ctrl.snd.cmd);
    if (ns_pkt_chng[i].cmd == -1 || ns_pkt_chng[i].func == NULL) return (-1);
//lane_log("HtoL 2[%d][%d][%d]\n", len, i, ns_pkt_chng[i].hi_size);
    if (len < ns_pkt_chng[i].hi_size)
        return (-1);
//lane_log("HtoL 3\n");
    memset(lo_comm_ctrl.pkt.buf, 0, ns_pkt_chng[i].lo_size);
    result = (*ns_pkt_chng[i].func)(buf, lo_comm_ctrl.pkt.buf);
//lane_log("HtoL 4\n");
    lo_comm_ctrl.pkt.len = ns_pkt_chng[i].lo_size;
    lo_comm_ctrl.pkt.buf[lo_comm_ctrl.pkt.len++] = ETX;
    lo_comm_ctrl.pkt.flg = LP_SEND;
    lane_log( " [LC2SV] (ns_packet_chng.c) 종별 [%02X] 송신변경 ret=%d len %d\n", hi_comm_ctrl.snd.cmd, result, lo_comm_ctrl.pkt.len);
#ifdef _TRACE_
    trace_high('S', lo_comm_ctrl.pkt.buf, lo_comm_ctrl.pkt.len);
#endif
    return (lo_comm_ctrl.pkt.len);
}

/*
 *========================================================================
 *
 *   Function : ns_packet_l2h()
 *   Progrmer : JBY (baarong@neighbor21.co.kr)
 *   Date     : 2018.08.24
 *   Modified :
 *   Remark   : 차로로 부터 수신한 DATA를 HIGH-LEVEL로 전송
 *
 *========================================================================
*/
int ns_packet_l2h(unsigned char *buf, int len)
{
    int     result;
    char    tmp_sndNo[4+1];
    register int i;

    if (hi_comm_ctrl.rcv_ctrl.len > 0)            /* packet busy    */
    {
        lane_log( " [SV2LC] (ns_packet_chng.c) RCV DATA : High Packet busy!!!!\n");
        return (-1);
    }

    if (buf[len-1] != ETX)
        lane_log( " [SV2LC] (ns_packet_chng.c) No ETX on FRAME DATA....\n");

    if (buf[len-1] != ETX) return (-1);
#ifdef _TRACE_
    trace_high(buf, len);
#endif
    len--;

    sprintf(tmp_sndNo, "%02x%02x%02x%02x", buf[0], buf[1], buf[2], buf[3]);
//lane_log("=======수신 전송연번[%.8s][%08x]\n", tmp_sndNo, strtoul(tmp_sndNo, NULL, 16));
//    btoi((char *)&hi_comm_ctrl.rcv_ctrl.snd_no, (char *)buf, 4);    /* 전송연번    */
    hi_comm_ctrl.rcv_ctrl.snd_no = strtoul(tmp_sndNo, NULL, 16);
    hi_comm_ctrl.rcv_ctrl.cmd = buf[4];            /* COMMAND    */
    for (i=0; ns_pkt_chng[i].cmd != -1; i++)
    {
        if (ns_pkt_chng[i].cmd == (int)hi_comm_ctrl.rcv_ctrl.cmd)
            break;
    }
//lane_log("LtoH 1\n");
    if (ns_pkt_chng[i].cmd == -1 || ns_pkt_chng[i].func == NULL)
        lane_log(" [SV2LC] (ns_packet_chng.c) 수신변환 [%02X} TABLE 없음.\n", hi_comm_ctrl.rcv_ctrl.cmd);
    else if (ns_pkt_chng[i].lo_size > len)
        lane_log(" [SV2LC] (ns_packet_chng.c) 수신변환 [%02X] LEN ERROR.\n", hi_comm_ctrl.rcv_ctrl.cmd);
//lane_log("LtoH 2\n");
    if (ns_pkt_chng[i].cmd == -1 || ns_pkt_chng[i].func == NULL)
        return (-1);
//lane_log("LtoH 3\n");
    memset(hi_comm_ctrl.rcv_ctrl.buf, 0x0, ns_pkt_chng[i].hi_size);
//lane_log("LtoH 4\n");
    result = (*ns_pkt_chng[i].func)(hi_comm_ctrl.rcv_ctrl.buf, buf);
//lane_log("LtoH 5\n");
    if(result != 0)
        lane_log( " (ns_packet_chng.c) 수신변환 [%02X] ERROR.\n", hi_comm_ctrl.rcv_ctrl.cmd);
//lane_log("LtoH 6\n");
    hi_comm_ctrl.rcv_ctrl.len = ns_pkt_chng[i].hi_size;
    lo_comm_ctrl.rcv.len = 0;  /* 차로쪽 수신길이 초기화 */
//lane_log("LtoH 7\n");
    return (hi_comm_ctrl.rcv_ctrl.len);
}

 /*
 *========================================================================
 *
 *   함 수 명 : ns_rq_seq_no()
 *   작 성 자 : JBY(baarong@neighbor21.co.kr)
 *   작 성 일 : 2018.08.24
 *   수 정 일 :
 *   설    명 : 전송연번요구(영업소 <- 차로)
 *
 *========================================================================
*/
static int ns_rq_seq_no(uchar *h_buf, uchar *l_buf)
{
    struct    hi_rq_seq_no    *hrsn;
    struct    rq_seq_no       *lrsn;

    hrsn = (struct hi_rq_seq_no *)h_buf;
    lrsn = (struct rq_seq_no    *)l_buf;
//lane_log("1\n");
    smemcpy(D_TO_A, L_TO_H, (char *)&hrsn->seq_no,   (char *)&lrsn->seq_no, 8, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hrsn->kind,     (char *)&lrsn->kind, 2, 0);
#if 1
    smemcpy(D_TO_A, L_TO_H, (char *)&hrsn->io_div, (char *)&lrsn->io_div, 2, 1);
#else
    sprintf((char *)hrsn->io_div, "%02x", lrsn->io_div);
#endif

#ifdef _VERIFY_
    lane_log("===========================================\n");
    lane_log("전송연번요구 seq_no[%.8s][%02X%02X%02X%02X]\n", hrsn->seq_no,
            lrsn->seq_no[0], lrsn->seq_no[1], lrsn->seq_no[2], lrsn->seq_no[3]);
    lane_log("전송연번요구 kind[%.2s][%02x]\n", hrsn->kind, lrsn->kind);
    lane_log("전송연번요구 io_div[%c][%x]\n", hrsn->io_div, lrsn->io_div);
#endif
    return (0);
}

 /*
 *========================================================================
 *
 *   함 수 명 : ns_seq_no_data()
 *   작 성 자 : JBY(baarong@neighbor21.co.kr)
 *   작 성 일 : 2018.08.24
 *   수 정 일 :
 *   설    명 : 전송연번(LC2SV)
 *
 *========================================================================
*/
static int ns_seq_no_data(uchar *h_buf, uchar *l_buf)
{
    struct    hi_seq_no_data    *hsnd;
    struct    seq_no_data       *lsnd;
    hsnd = (struct hi_seq_no_data *)h_buf;
    lsnd = (struct seq_no_data    *)l_buf;

    smemcpy(D_TO_A, H_TO_L, (char *)&hsnd->seq_no,        (char *)&lsnd->seq_no, 8, 0);
#if 0
    smemcpy(B_TO_B, H_TO_L, (char *)&hsnd->kind,          (char *)&lsnd->kind, 1, 0);
    smemcpy(D_TO_A, H_TO_L, (char *)&hsnd->rq_seq_no,     (char *)&lsnd->rq_seq_no, 8, 0);
#else
    sscanf((const char *)hsnd->kind, "%2hhx", &lsnd->kind);

    sscanf((const char *)hsnd->rq_seq_no  , "%2hhx", &lsnd->rq_seq_no[0]);
    sscanf((const char *)hsnd->rq_seq_no+2, "%2hhx", &lsnd->rq_seq_no[1]);
    sscanf((const char *)hsnd->rq_seq_no+4, "%2hhx", &lsnd->rq_seq_no[2]);
    sscanf((const char *)hsnd->rq_seq_no+6, "%2hhx", &lsnd->rq_seq_no[3]);
#endif
    
    smemcpy(D_TO_A, H_TO_L, (char *)&hsnd->wrk_no,        (char *)&lsnd->wrk_no, 4, 0);
    smemcpy(D_TO_A, H_TO_L, (char *)&hsnd->start_year,    (char *)&lsnd->start_year, 4, 0);
    smemcpy(D_TO_A, H_TO_L, (char *)&hsnd->start_month,   (char *)&lsnd->start_month, 2, 0);
    smemcpy(D_TO_A, H_TO_L, (char *)&hsnd->start_day,     (char *)&lsnd->start_day, 2, 0);
    smemcpy(D_TO_A, H_TO_L, (char *)&hsnd->lane_no,       (char *)&lsnd->lane_no, 2, 0);
#ifdef _VERIFY_
    lane_log("===========================================\n");
    lane_log("전송연번 seq_no[%.8s][%02x%02x%02x%02x]\n", hsnd->seq_no,
            lsnd->seq_no[0], lsnd->seq_no[1], lsnd->seq_no[2], lsnd->seq_no[3]);
    lane_log("전송연번 kind[%.2s][%02x]\n", hsnd->kind, lsnd->kind);
    lane_log("전송연번 rq_seq_no[%.8s][%02x%02x%02x%02x]\n", hsnd->rq_seq_no,
            lsnd->rq_seq_no[0], lsnd->rq_seq_no[1], lsnd->rq_seq_no[2], lsnd->rq_seq_no[3]);
    lane_log("전송연번 wrk_no[%.4s][%02x%02x]\n", hsnd->wrk_no,
            lsnd->wrk_no[0], lsnd->wrk_no[1]);
    lane_log("전송연번 start_year[%.4s][%02x%02x]\n", hsnd->start_year,
            lsnd->start_year[0], lsnd->start_year[1]);
    lane_log("전송연번 start_month[%.2s][%02x]\n", hsnd->start_month, lsnd->start_month);
    lane_log("전송연번 start_day[%.2s][%02x]\n", hsnd->start_day, lsnd->start_day);
    lane_log("전송연번 lane_no[%.2s][%02x]\n", hsnd->lane_no, lsnd->lane_no);
#endif
    return (0);
}

 /*
 *========================================================================
 *
 *   함 수 명 : ns_comm_continue_rq()
 *   작 성 자 : JBY(baarong@neighbor21.co.kr)
 *   작 성 일 : 2018.08.24
 *   수 정 일 :
 *   설    명 : 교신재개요구(영업소<-차로)
 *
 *========================================================================
*/
static int ns_comm_continue_rq(uchar *h_buf, uchar *l_buf)
{
    struct    hi_comm_continue_rq *hccr;
    struct    comm_continue_rq    *lccr;
    hccr = (struct hi_comm_continue_rq *)h_buf;
    lccr = (struct comm_continue_rq    *)l_buf;

    smemcpy(D_TO_A, L_TO_H, (char *)&hccr->seq_no,   (char *)&lccr->seq_no, 8, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hccr->kind,     (char *)&lccr->kind, 2, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hccr->lane_no,  (char *)&lccr->lane_no, 2, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hccr->plz_id,   (char *)&lccr->plz_id, 2, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hccr->io_div,   (char *)&lccr->io_div, 2, 1);
#ifdef _VERIFY_
    lane_log("===========================================\n");
    lane_log("교신재개요구 seq_no[%.8s][%02x%02x%02x%02x]\n", hccr->seq_no,
            lccr->seq_no[0], lccr->seq_no[1], lccr->seq_no[2], lccr->seq_no[3]);
    lane_log("교신재개요구 kind[%.2s][%02x]\n", hccr->kind, lccr->kind);
    lane_log("교신재개요구 lane_no[%.2s][%02x]\n", hccr->lane_no, lccr->lane_no);
    lane_log("교신재개요구 plz_id[%.2s][%02x]\n", hccr->plz_id, lccr->plz_id);
    lane_log("교신재개요구 io_div[%c][%02x]\n", hccr->io_div, lccr->io_div);
#endif
    return (0);
}

 /*
 *========================================================================
 *
 *   함 수 명 : ns_rq_accuml_data()
 *   작 성 자 : JBY(baarong@neighbor21.co.kr)
 *   작 성 일 : 2018.08.24
 *   수 정 일 :
 *   설    명 : 축적 DATA 전송요구(영업소 -> 차로)
 *
 *========================================================================
*/
static int ns_rq_accuml_data(uchar *h_buf, uchar *l_buf)
{
    struct    hi_rq_accuml_data    *hrad;
    struct    rq_accuml_data       *lrad;
    hrad = (struct hi_rq_accuml_data *)h_buf;
    lrad = (struct rq_accuml_data    *)l_buf;

    smemcpy(D_TO_A, H_TO_L, (char *)&hrad->seq_no,     (char *)&lrad->seq_no, 8, 0);
#if 0
    smemcpy(B_TO_B, H_TO_L, (char *)&hrad->kind,       (char *)&lrad->kind, 1, 0);
    smemcpy(D_TO_A, H_TO_L, (char *)&hrad->rq_seq_no, (char *)&lrad->rq_seq_no, 8, 0);
#else
    sscanf((const char *)hrad->kind, "%2hhx", &lrad->kind);

    sscanf((const char *)hrad->rq_seq_no  , "%2hhx", &lrad->rq_seq_no[0]);
    sscanf((const char *)hrad->rq_seq_no+2, "%2hhx", &lrad->rq_seq_no[1]);
    sscanf((const char *)hrad->rq_seq_no+4, "%2hhx", &lrad->rq_seq_no[2]);
    sscanf((const char *)hrad->rq_seq_no+6, "%2hhx", &lrad->rq_seq_no[3]);
#endif
    smemcpy(D_TO_A, H_TO_L, (char *)&hrad->year,       (char *)&lrad->year, 4, 0);
    smemcpy(D_TO_A, H_TO_L, (char *)&hrad->month,      (char *)&lrad->month, 2, 0);
    smemcpy(D_TO_A, H_TO_L, (char *)&hrad->day,        (char *)&lrad->day, 2, 0);
    smemcpy(D_TO_A, H_TO_L, (char *)&hrad->lane_no,    (char *)&lrad->lane_no, 2, 0);
#ifdef _VERIFY_
    lane_log("===========================================\n");
    lane_log("축적DATA전송요구 seq_no[%.8s][%02X%02X%02X%02X]\n", hrad->seq_no,
            lrad->seq_no[0], lrad->seq_no[1], lrad->seq_no[2], lrad->seq_no[3]);
    lane_log("축적DATA전송요구 kind[%.2s][%02x]\n", hrad->kind, lrad->kind);
    lane_log("축적DATA전송요구 rq_seq_no[%.8s][%02X%02X%02X%02X]\n", hrad->rq_seq_no,
            lrad->rq_seq_no[0], lrad->rq_seq_no[1], lrad->rq_seq_no[2], lrad->rq_seq_no[3]);
    lane_log("축적DATA전송요구 year[%.4s][%02X%02X]\n", hrad->year,
            lrad->year[0], lrad->year[1]);
    lane_log("축적DATA전송요구 month[%.2s][%02x]\n", hrad->month, lrad->month);
    lane_log("축적DATA전송요구 day[%.2s][%02x]\n", hrad->day, lrad->day);
    lane_log("축적DATA전송요구 lane_no[%.2s][%02x]\n", hrad->lane_no, lrad->lane_no);
#endif
    return (0);
}

 /*
 *========================================================================
 *
 *   함 수 명 : ns_accuml_data_ok()
 *   작 성 자 : JBY(baarong@neighbor21.co.kr)
 *   작 성 일 : 2018.08.24
 *   수 정 일 :
 *   설    명 : 축적 DATA 전송완료(영업소 <- 차로)
 *
 *========================================================================
*/
static int ns_accuml_data_ok(uchar *h_buf, uchar *l_buf)
{
    struct    hi_accuml_data_ok *hado;
    struct    accuml_data_ok    *lado;
    hado = (struct hi_accuml_data_ok *)h_buf;
    lado = (struct accuml_data_ok *)l_buf;

    smemcpy(D_TO_A, L_TO_H, (char *)&hado->seq_no, (char *)&lado->seq_no, 8, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hado->kind,   (char *)&lado->kind, 2, 0);
#ifdef _VERIFY_
    lane_log("===========================================\n");
    lane_log("축적DATA전송완료 seq_no[%.8s][%02X%02X%02X%02X]\n", hado->seq_no,
            lado->seq_no[0], lado->seq_no[1], lado->seq_no[2], lado->seq_no[3]);
    lane_log("축적DATA전송완료 kind[%.2s][%02x]\n", hado->kind, lado->kind);
#endif
    return (0);
}

 /*
 *========================================================================
 *
 *   함 수 명 : ns_confrm_reply()
 *   작 성 자 : JBY(baarong@neighbor21.co.kr)
 *   작 성 일 : 2018.08.24
 *   수 정 일 :
 *   설    명 : 확인응답 (영업소 -> 차로)
 *
 *========================================================================
*/
static int ns_confrm_reply(uchar *h_buf, uchar *l_buf)
{
    struct    hi_confrm_reply    *hcr;
    struct    confrm_reply    *lcr;

    hcr = (struct hi_confrm_reply *)h_buf;
    lcr = (struct confrm_reply *)l_buf;

#if 0
    smemcpy(D_TO_A, H_TO_L, (char *)&hcr->seq_no,      (char *)&lcr->seq_no, 8, 0);
    smemcpy(B_TO_B, H_TO_L, (char *)&hcr->kind,        (char *)&lcr->kind, 1, 0);
#else
    sscanf((const char *)hcr->seq_no  , "%2hhx", &lcr->seq_no[0]);
    sscanf((const char *)hcr->seq_no+2, "%2hhx", &lcr->seq_no[1]);
    sscanf((const char *)hcr->seq_no+4, "%2hhx", &lcr->seq_no[2]);
    sscanf((const char *)hcr->seq_no+6, "%2hhx", &lcr->seq_no[3]);

    sscanf((const char *)hcr->kind, "%2hhx", &lcr->kind);
#endif
    smemcpy(B_TO_B, H_TO_L, (char *)&hcr->reply_typ,   (char *)&lcr->reply_typ, 1, 0);
#if 0
    smemcpy(D_TO_A, H_TO_L, (char *)&hcr->warr_seq_no, (char *)&lcr->warr_seq_no, 8, 0);
#else
    sscanf((const char *)hcr->warr_seq_no, "%2hhx", &lcr->warr_seq_no[0]);
    sscanf((const char *)hcr->warr_seq_no+2, "%2hhx", &lcr->warr_seq_no[1]);
    sscanf((const char *)hcr->warr_seq_no+4, "%2hhx", &lcr->warr_seq_no[2]);
    sscanf((const char *)hcr->warr_seq_no+6, "%2hhx", &lcr->warr_seq_no[3]);
#endif
    lane_log("===========================================\n");
    lane_log("확인응답 seq_no[%.2s][%02X%02X%02X%02X]\n", hcr->seq_no,
            lcr->seq_no[0], lcr->seq_no[1], lcr->seq_no[2], lcr->seq_no[3]);
    lane_log("확인응답 kind[%.2s][%02x]\n", hcr->kind, lcr->kind);
    lane_log("확인응답 reply_typ[%x][%x]\n", hcr->reply_typ, lcr->reply_typ);
    lane_log("확인응답 warr_seq_no[%.8s][%02X%02X%02X%02X]\n", hcr->warr_seq_no,
            lcr->warr_seq_no[0], lcr->warr_seq_no[1], lcr->warr_seq_no[2], lcr->warr_seq_no[3]);

    return (0);
}

 /*
 *========================================================================
 *
 *   함 수 명 : ns_tm_rq()
 *   작 성 자 : JBY(baarong@neighbor21.co.kr)
 *   작 성 일 : 2018.08.24
 *   수 정 일 :
 *   설    명 : 시각요구(영업소 <- 차로)
 *
 *========================================================================
*/
static int ns_tm_rq(uchar *h_buf, uchar *l_buf)
{
    struct    hi_tm_rq    *htr;
    struct    tm_rq       *ltr;
    htr = (struct hi_tm_rq *)h_buf;
    ltr = (struct tm_rq    *)l_buf;

    smemcpy(D_TO_A, L_TO_H, (char *)&htr->seq_no, (char *)&ltr->seq_no, 8, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&htr->kind,   (char *)&ltr->kind, 2, 0);
#ifdef _VERIFY_
    lane_log("===========================================\n");
    lane_log("시각요구 seq_no[%.8s][%02X%02X%02X%02X]\n", htr->seq_no,
            ltr->seq_no[0], ltr->seq_no[1], ltr->seq_no[2], ltr->seq_no[3]);
    lane_log("시각요구 kind[%.2s][%02x]\n", htr->kind, ltr->kind);
#endif
    return (0);
}

 /*
 *========================================================================
 *
 *   함 수 명 : ns_tm_data()
 *   작 성 자 : JBY(baarong@neighbor21.co.kr)
 *   작 성 일 : 2018.08.24
 *   수 정 일 :
 *   설    명 : 시각DATA (영업소 -> 차로)
 *
 *========================================================================
*/
static int ns_tm_data(uchar *h_buf, uchar *l_buf)
{
    struct    hi_tm_data *htd;
    struct    tm_data    *ltd;
    htd = (struct hi_tm_data *)h_buf;
    ltd = (struct tm_data    *)l_buf;

    smemcpy(D_TO_A, H_TO_L, (char *)&htd->seq_no, (char *)&ltd->seq_no, 8, 0);
#if 0
    smemcpy(B_TO_B, H_TO_L, (char *)&htd->kind,   (char *)&ltd->kind, 1, 0);
#else
    sscanf((const char *)htd->kind, "%2hhx", &ltd->kind);
#endif
    smemcpy(D_TO_A, H_TO_L, (char *)&htd->year,   (char *)&ltd->year, 4, 0);
    smemcpy(D_TO_A, H_TO_L, (char *)&htd->month,  (char *)&ltd->month, 2, 0);
    smemcpy(D_TO_A, H_TO_L, (char *)&htd->day,    (char *)&ltd->day, 2, 0);
    smemcpy(D_TO_A, H_TO_L, (char *)&htd->hour,   (char *)&ltd->hour, 2, 0);
    smemcpy(D_TO_A, H_TO_L, (char *)&htd->min,    (char *)&ltd->min, 2, 0);
    smemcpy(D_TO_A, H_TO_L, (char *)&htd->sec,    (char *)&ltd->sec, 2, 0);
#ifdef _VERIFY_
    lane_log("===========================================\n");
    lane_log("시각데이터 seq_no[%.8s][%02X%02X%02X%02X]\n", htd->seq_no,
            ltd->seq_no[0], ltd->seq_no[1], ltd->seq_no[2], ltd->seq_no[3]);
    lane_log("시각데이터 kind[%.2s][%02x]\n", htd->kind, ltd->kind);
    lane_log("시각데이터 TIME[%.4s.%.2s.%.2s %.2s:%.2s:%.2s][%02x%02x.%02x.%02x %02x:%02x:%02x]\n",
             htd->year, htd->month, htd->day, htd->hour, htd->min, htd->sec,
             ltd->year[0], ltd->year[1], ltd->month, ltd->day, ltd->hour, ltd->min, ltd->sec);
#endif
    return (0);
}

/*
 *========================================================================
 *
 *   함 수 명 : ns_tbl_cmd()
 *   작 성 자 : JBY(baarong@neighbor21.co.kr)
 *   작 성 일 : 2018.08.24
 *   수 정 일 :
 *   설    명 : TBL 지령 (영업소 -> 차로)
 *
 *========================================================================
*/
static int ns_tbl_cmd(uchar *h_buf, uchar *l_buf)
{
    struct    hi_tbl_cmd *htc;
    struct    tbl_cmd    *ltc;
	int i;
    htc = (struct hi_tbl_cmd *)h_buf;
    ltc = (struct tbl_cmd    *)l_buf;

    smemcpy(D_TO_A, H_TO_L, (char *)&htc->seq_no,               (char *)&ltc->seq_no, 8, 0);
#if 0
    smemcpy(B_TO_B, H_TO_L, (char *)&htc->kind,                 (char *)&ltc->kind, 1, 0);
#else
    sscanf((const char *)htc->kind, "%2hhx", &ltc->kind);
#endif
    smemcpy(D_TO_A, H_TO_L, (char *)&htc->dump_tbl_div,         (char *)&ltc->dump_tbl_div, 2, 0);
	
	for(i - 0; i < 20; i++)
	{
		smemcpy(D_TO_A, H_TO_L, (char *)&htc->rvs_no_tbl[i].rvs_no, (char *)&ltc->rvs_no_tbl[i].rvs_no, 2, 0);
	}

#if 0
    smemcpy(D_TO_A, H_TO_L, (char *)&htc->bl_seq_no,  (char *)&ltc->bl_seq_no, 8, 0);
    smemcpy(D_TO_A, H_TO_L, (char *)&htc->pl_seq_no,  (char *)&ltc->pl_seq_no, 8, 0);
    smemcpy(D_TO_A, H_TO_L, (char *)&htc->bef_seq_no, (char *)&ltc->bef_seq_no, 8, 0);
#else
    sscanf((const char *)htc->bl_seq_no  , "%2hhx", &ltc->bl_seq_no[0]);
    sscanf((const char *)htc->bl_seq_no+2, "%2hhx", &ltc->bl_seq_no[1]);
    sscanf((const char *)htc->bl_seq_no+4, "%2hhx", &ltc->bl_seq_no[2]);
    sscanf((const char *)htc->bl_seq_no+6, "%2hhx", &ltc->bl_seq_no[3]);

    sscanf((const char *)htc->bef_seq_no  , "%2hhx", &ltc->bef_seq_no[0]);
    sscanf((const char *)htc->bef_seq_no+2, "%2hhx", &ltc->bef_seq_no[1]);
    sscanf((const char *)htc->bef_seq_no+4, "%2hhx", &ltc->bef_seq_no[2]);
    sscanf((const char *)htc->bef_seq_no+6, "%2hhx", &ltc->bef_seq_no[3]);
/* 2019.06.15 추가 */	
    sscanf((const char *)htc->imm_carno_seq_no  , "%2hhx", &ltc->imm_carno_seq_no[0]);
    sscanf((const char *)htc->imm_carno_seq_no+2, "%2hhx", &ltc->imm_carno_seq_no[1]);
    sscanf((const char *)htc->imm_carno_seq_no+4, "%2hhx", &ltc->imm_carno_seq_no[2]);
    sscanf((const char *)htc->imm_carno_seq_no+6, "%2hhx", &ltc->imm_carno_seq_no[3]);
	
    sscanf((const char *)htc->rfid_seq_no  , "%2hhx", &ltc->rfid_seq_no[0]);
    sscanf((const char *)htc->rfid_seq_no+2, "%2hhx", &ltc->rfid_seq_no[1]);
    sscanf((const char *)htc->rfid_seq_no+4, "%2hhx", &ltc->rfid_seq_no[2]);
    sscanf((const char *)htc->rfid_seq_no+6, "%2hhx", &ltc->rfid_seq_no[3]);
	
    sscanf((const char *)htc->red_carno_seq_no  , "%2hhx", &ltc->red_carno_seq_no[0]);
    sscanf((const char *)htc->red_carno_seq_no+2, "%2hhx", &ltc->red_carno_seq_no[1]);
    sscanf((const char *)htc->red_carno_seq_no+4, "%2hhx", &ltc->red_carno_seq_no[2]);
    sscanf((const char *)htc->red_carno_seq_no+6, "%2hhx", &ltc->red_carno_seq_no[3]);
#endif

#ifdef _VERIFY_
    lane_log("===========================================\n");
    lane_log("테이블지령 seq_no[%.8s][%02X%02X%02X%02X]\n", htc->seq_no,
            ltc->seq_no[0], ltc->seq_no[1], ltc->seq_no[2], ltc->seq_no[3]);
    lane_log("테이블지령 kind[%.2s][%02x]\n", htc->kind, ltc->kind);
    lane_log("테이블지령 dump_tbl_div[%.2s][%02x]\n", htc->dump_tbl_div, ltc->dump_tbl_div);
    lane_log("테이블지령 rvs_no1[%.2s][%02x]\n", htc->rvs_no_tbl[0].rvs_no, ltc->rvs_no_tbl[0].rvs_no);
    lane_log("테이블지령 rvs_no2[%.2s][%02x]\n", htc->rvs_no_tbl[1].rvs_no, ltc->rvs_no_tbl[1].rvs_no);
    lane_log("테이블지령 rvs_no3[%.2s][%02x]\n", htc->rvs_no_tbl[2].rvs_no, ltc->rvs_no_tbl[2].rvs_no);
    lane_log("테이블지령 rvs_no4[%.2s][%02x]\n", htc->rvs_no_tbl[3].rvs_no, ltc->rvs_no_tbl[3].rvs_no);
    lane_log("테이블지령 rvs_no5[%.2s][%02x]\n", htc->rvs_no_tbl[4].rvs_no, ltc->rvs_no_tbl[4].rvs_no);
    lane_log("테이블지령 rvs_no6[%.2s][%02x]\n", htc->rvs_no_tbl[5].rvs_no, ltc->rvs_no_tbl[5].rvs_no);
    lane_log("테이블지령 rvs_no7[%.2s][%02x]\n", htc->rvs_no_tbl[6].rvs_no, ltc->rvs_no_tbl[6].rvs_no);
    lane_log("테이블지령 rvs_no8[%.2s][%02x]\n", htc->rvs_no_tbl[7].rvs_no, ltc->rvs_no_tbl[7].rvs_no);
    lane_log("테이블지령 rvs_no9[%.2s][%02x]\n", htc->rvs_no_tbl[8].rvs_no, ltc->rvs_no_tbl[8].rvs_no);
    lane_log("테이블지령 rvs_no10[%.2s][%02x]\n", htc->rvs_no_tbl[9].rvs_no, ltc->rvs_no_tbl[9].rvs_no);

    lane_log("테이블지령 BL[%.8s][%02X%02X%02X%02X]\n", htc->bl_seq_no,
            ltc->bl_seq_no[0], ltc->bl_seq_no[1], ltc->bl_seq_no[2], ltc->bl_seq_no[3]);
    lane_log("테이블지령 BEF[%.8s][%02X%02X%02X%02X]\n", htc->bef_seq_no,
            ltc->bef_seq_no[0], ltc->bef_seq_no[1], ltc->bef_seq_no[2], ltc->bef_seq_no[3]);
/* 2019.06.15 추가 */
    lane_log("NEW 테이블지령 IMM_CARNO[%.8s][%02X%02X%02X%02X]\n", htc->imm_carno_seq_no,
            ltc->imm_carno_seq_no[0], ltc->imm_carno_seq_no[1], ltc->imm_carno_seq_no[2], ltc->imm_carno_seq_no[3]);
    lane_log("NEW 테이블지령 RFID[%.8s][%02X%02X%02X%02X]\n", htc->rfid_seq_no,
            ltc->rfid_seq_no[0], ltc->rfid_seq_no[1], ltc->rfid_seq_no[2], ltc->rfid_seq_no[3]);
    lane_log("NEW 테이블지령 RED_CARNO[%.8s][%02X%02X%02X%02X]\n", htc->red_carno_seq_no,
            ltc->red_carno_seq_no[0], ltc->red_carno_seq_no[1], ltc->red_carno_seq_no[2], ltc->red_carno_seq_no[3]);
#endif
    return (0);
}

 /*
 *========================================================================
 *
 *   함 수 명 : ns_cmd_reply()
 *   작 성 자 : JBY(baarong@neighbor21.co.kr)
 *   작 성 일 : 2018.08.24
 *   수 정 일 :
 *   설    명 : 지령응답 (영업소 <- 차로)
 *
 *========================================================================
*/
static int ns_cmd_reply(uchar *h_buf, uchar *l_buf)
{
    struct    hi_cmd_reply *hcr;
    struct    cmd_reply    *lcr;
    hcr = (struct hi_cmd_reply *)h_buf;
    lcr = (struct cmd_reply    *)l_buf;
//lane_log("지령응답 1\n");
    smemcpy(D_TO_A, L_TO_H, (char *)&hcr->seq_no,    (char *)&lcr->seq_no, 8, 0);
//lane_log("지령응답 2\n");
    smemcpy(D_TO_A, L_TO_H, (char *)&hcr->kind,      (char *)&lcr->kind, 2, 0);
#if 0
    smemcpy(D_TO_A, L_TO_H, (char *)&hcr->reply_typ, (char *)&lcr->reply_typ, 2, 0);
#else
    hcr->reply_typ = lcr->reply_typ + '0';
//lane_log("지령응답 3\n");
#endif

#ifdef _VERIFY_
    lane_log("===========================================\n");
    lane_log("지령응답 seq_no[%.8s][%02X%02X%02X%02X]\n", hcr->seq_no,
            lcr->seq_no[0], lcr->seq_no[1], lcr->seq_no[2], lcr->seq_no[3]);
    lane_log("지령응답 kind[%.2s][%02x]\n", hcr->kind, lcr->kind);
    lane_log("지령응답 reply_typ[%c][%02x]\n", hcr->reply_typ, lcr->reply_typ);
#endif
    return (0);
}

 /*
 *========================================================================
 *
 *   함 수 명 : ns_tbl_order()
 *   작 성 자 : JBY(baarong@neighbor21.co.kr)
 *   작 성 일 : 2018.08.24
 *   수 정 일 :
 *   설    명 : TABLE 요구(영업소 <- 차로)
 *
 *========================================================================
*/
static int ns_tbl_order(uchar *h_buf, uchar *l_buf)
{
    struct    tbl_order    *lto;
    struct    hi_tbl_order *hto;
    char tmp[10]; memset(tmp, 0x00, sizeof(tmp));

    hto = (struct hi_tbl_order *)h_buf;
    lto = (struct tbl_order    *)l_buf;

    smemcpy(D_TO_A, L_TO_H, (char *)&hto->seq_no,   (char *)&lto->seq_no, 8, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hto->kind,     (char *)&lto->kind, 2, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hto->tbl_typ,  (char *)&lto->tbl_typ, 2, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hto->data_div, (char *)&lto->data_div, 2, 0);

    smemcpy(D_TO_A, L_TO_H, (char *)&hto->frame_no,        (char *)&lto->frame_no, 8, 0);

    smemcpy(D_TO_A, L_TO_H, (char *)&hto->req_seq_no, (char *)&lto->req_seq_no, 8, 0);
    lane_log("===========================================\n");
    lane_log("테이블요구 seq_no[%.8s][%02X%02X%02X%02X]\n", hto->seq_no,
              lto->seq_no[0], lto->seq_no[1], lto->seq_no[2], lto->seq_no[3]);
    lane_log("테이블요구 kind[%.2s][%02x]\n", hto->kind, lto->kind);

    switch(lto->tbl_typ)
    {
        case 1 :
            lane_log("    TABLE TYPE : %.2s (Basic Table)\n", hto->tbl_typ);
            break;
        case 2 :
            lane_log("    TABLE TYPE : %.2s (Worker Table)\n", hto->tbl_typ);
            break;
        case 3 :
            lane_log("    TABLE TYPE : %.2s (Holiday Table)\n", hto->tbl_typ);
            break;
        case 4 :
            lane_log("    TABLE TYPE : %.2s (Issue Company Table)\n", hto->tbl_typ);
            break;
        case 5 :
            lane_log("    TABLE TYPE : %.2s (Car No Exem Table)\n", hto->tbl_typ);
            break;
        case 6 :
            lane_log("    TABLE TYPE : %.2s (RFID Exem Table)\n", hto->tbl_typ);
            break;
        case 7 :
            lane_log("    TABLE TYPE : %.2s (Before Fare Regist)\n", hto->tbl_typ);
            break;
        case 8 :
            lane_log("    TABLE TYPE : %.2s (Card P/L)\n", hto->tbl_typ);
            break;
        case 9 :
            lane_log("    TABLE TYPE : %.2s (Card B/L)\n", hto->tbl_typ);
            break;
        case 10 :
            lane_log("    TABLE TYPE : %.2s (Car No Reduce)\n", hto->tbl_typ);
            break;
        default :
            break;
    }
    
    lane_log("    요구데이터 구분      : %.2s\n", hto->data_div);
    lane_log("Frame No[%.8s]\n", hto->frame_no);
    if(lb_data2atoi(hto->frame_no, 8) == 0)
    {
        lane_log("FRAME NO. : %.8s(Table Header) %02X%02X%02X%02X\n", hto->frame_no,
                lto->frame_no[0], lto->frame_no[1], lto->frame_no[2], lto->frame_no[3]);
    }else{
        lane_log("FRAME NO. : %.8s(Table Frame) %02X%02X%02X%02X\n", hto->frame_no,
                lto->frame_no[0], lto->frame_no[1], lto->frame_no[2], lto->frame_no[3]);
    }
    lane_log("Sequence : [%.8s][%02X%02X%02X%02X]\n", hto->req_seq_no,
                  lto->req_seq_no[0], lto->req_seq_no[1], lto->req_seq_no[2], lto->req_seq_no[3]);
    lane_log("--------------------------------------------------------------------------------------\n");

    return (0);
}

 /*
 *========================================================================
 *
 *   함 수 명 : ns_tbl_data()
 *   작 성 자 : JBY(baarong@neighbor21.co.kr)
 *   작 성 일 : 2018.08.24
 *   수 정 일 :
 *   설    명 : TABLE DATA(영업소 -> 차로)
 *
 *========================================================================
*/
static int ns_tbl_data(uchar *h_buf, uchar *l_buf)
{
    struct hi_tbl_data *htd;        /* TABLE DATA    */
    struct tbl_data    *ltd;

    struct hi_bas_tbl *hbt;        /* Basic-H    */
    struct bas_tbl    *lbt;

    struct hi_wrkr_tbl_h *hwth;        /* Worker-H    */
    struct wrkr_tbl_h    *lwth;
    struct hi_wrkr_tbl_f *hwtf;        /* Worker-F    */
    struct wrkr_tbl_f    *lwtf;

    struct hi_holi_tbl_h *hhth;        /* Holi-H */
    struct holi_tbl_h    *lhth;
    struct hi_holi_tbl_f *hhtf;        /* Holi-F */
    struct holi_tbl_f    *lhtf;

    struct hi_iss_comp_info_h *hicih;        /* Issue Company-H */
    struct iss_comp_info_h    *licih;
    struct hi_iss_comp_info_f *hicif;        /* Issue Company-F */
    struct iss_comp_info_f    *licif;

    struct hi_imm_carno_tbl_h *hicth;        /* 차량번호 면제정보 Exem-H */
    struct imm_carno_tbl_h    *licth;
    struct hi_imm_carno_tbl_f *hictf;        /* 차량번호 면제정보 Exem-F */
    struct imm_carno_tbl_f    *lictf;

    struct hi_imm_crdno_tbl_h *hicdh;        /* 면제카드-H */
    struct imm_crdno_tbl_h    *licdh;
    struct hi_imm_crdno_tbl_f *hicdf;        /* 면제카드-F */
    struct imm_crdno_tbl_f    *licdf;

    struct hi_adv_payment_tbl_h *hapth;        /* 사전등록정보-H */
    struct adv_payment_tbl_h    *lapth;
    struct hi_adv_payment_tbl_f *haptf;        /* 사전등록정보-F */
    struct adv_payment_tbl_f    *laptf;

    struct hi_pl_tbl_h *hpth;        /* 교통카드PL-H */
    struct pl_tbl_h    *lpth;
    struct hi_pl_tbl_f *hptf;        /* 교통카드PL-F */
    struct pl_tbl_f    *lptf;

    struct hi_bl_tbl_h *hbth;        /* 교통카드BL-H */
    struct bl_tbl_h    *lbth;
    struct hi_bl_tbl_f *hbtf;        /* 교통카드BL-F */
    struct bl_tbl_f    *lbtf;

    struct hi_reduce_tbl_h *hrth;        /* 차량번호 감면-H */
    struct reduce_tbl_h    *lrth;
    struct hi_reduce_tbl_f *hrtf;        /* 차량번호 감면-F */
    struct reduce_tbl_f    *lrtf;

    int tbl_typ, i=0, j;        /* TABLE TYPE   */
    char tmp[10]; memset(tmp, 0x00, sizeof(tmp));

    htd = (struct hi_tbl_data *)h_buf;
    ltd = (struct tbl_data    *)l_buf;

    smemcpy(D_TO_A, H_TO_L, (char *)&htd->seq_no,   (char *)&ltd->seq_no, 8, 0);
#if 0
    smemcpy(B_TO_B, H_TO_L, (char *)&htd->kind,     (char *)&ltd->kind, 1, 0);
#else
    sscanf((const char *)htd->kind, "%2hhx", &ltd->kind);
#endif
    smemcpy(D_TO_A, H_TO_L, (char *)&htd->tbl_typ,  (char *)&ltd->tbl_typ, 2, 0);
#if 0
    smemcpy(D_TO_A, H_TO_L, (char *)&htd->frame_no, (char *)&ltd->frame_no, 8, 0);
#else
    sscanf((const char *)htd->frame_no  , "%2hhx", &ltd->frame_no[0]);
    sscanf((const char *)htd->frame_no+2, "%2hhx", &ltd->frame_no[1]);
    sscanf((const char *)htd->frame_no+4, "%2hhx", &ltd->frame_no[2]);
    sscanf((const char *)htd->frame_no+6, "%2hhx", &ltd->frame_no[3]);
#endif
#ifdef _VERIFY_
    lane_log("===========================================\n");
    lane_log("테이블데이터 seq_no[%.8s][%02X%02X%02X%02X]\n", htd->seq_no,
              ltd->seq_no[0], ltd->seq_no[1], ltd->seq_no[2], ltd->seq_no[3]);
    lane_log("테이블데이터 kind[%.2s][%02x]\n", htd->kind, ltd->kind);
    lane_log("테이블데이터 tbl_typ[%.2s][%02x]\n", htd->tbl_typ, ltd->tbl_typ);
    lane_log("테이블데이터 frame_no[%.8s][%02X%02X%02X%02X]\n", htd->frame_no,
              ltd->frame_no[0], ltd->frame_no[1], ltd->frame_no[2], ltd->frame_no[3]);
#endif

#if 0 //쉬프트 사용시 Digit의 경우 9까지만 가능
    tbl_typ = ((ltd->tbl_typ << 4) & 0xf0);
#else
    tbl_typ = lb_data2atoi(htd->tbl_typ, 2) * 10;
#endif

    if (memcmp(htd->frame_no, "00000000", 8) != 0)
        tbl_typ += 1;

    //lane_log("KIND[%.2s][%02x] TBL_TYPE[%d][%02x]\n", htd->tbl_typ, ltd->tbl_typ, tbl_typ, ltd->tbl_typ);
    switch (tbl_typ)
    {
    case 10: /* Basic TABLE HEADER */
    case 11: /* Basic TABLE FRAME    */
        hbt = (struct hi_bas_tbl *)htd;
        lbt = (struct bas_tbl *)ltd;

        /* int -> 4B Byte (Hex) */
#if 0
        smemcpy(D_TO_A, H_TO_L, (char *)&hbt->frame_cnt, (char *)&lbt->frame_cnt, 8, 0);
#else
        sscanf((const char *)hbt->frame_cnt, "%2hhx", &lbt->frame_cnt[0]);
        sscanf((const char *)hbt->frame_cnt+2, "%2hhx", &lbt->frame_cnt[1]);
        sscanf((const char *)hbt->frame_cnt+4, "%2hhx", &lbt->frame_cnt[2]);
        sscanf((const char *)hbt->frame_cnt+6, "%2hhx", &lbt->frame_cnt[3]);
#endif
#ifdef _VERIFY_
        lane_log("테이블데이터 Basic 1[%.8s][%02X%02X%02X%02X]\n", hbt->frame_cnt
                , lbt->frame_cnt[0], lbt->frame_cnt[1], lbt->frame_cnt[2], lbt->frame_cnt[3]);
#endif
        smemcpy(D_TO_A, H_TO_L, (char *)&hbt->rvs_no,   (char *)&lbt->rvs_no, 2, 0);
        smemcpy(D_TO_A, H_TO_L, (char *)&hbt->plz_id,   (char *)&lbt->plz_id, 2, 0);
        smemcpy(S_TO_S, H_TO_L, (char *)&hbt->plz_name, (char *)&lbt->plz_name, sizeof(lbt->plz_name), 0);
        smemcpy(D_TO_A, H_TO_L, (char *)&hbt->lane_no,  (char *)&lbt->lane_no, 2, 0);
        smemcpy(D_TO_A, H_TO_L, (char *)&hbt->io_div, (char *)&lbt->io_div, 2, 0);
#ifdef _VERIFY_
        lane_log("테이블데이터 Basic rvs_no[%.2s][%02x]\n", hbt->rvs_no, lbt->rvs_no);
        lane_log("테이블데이터 Basic plz_id[%.2s][%02x]\n", hbt->plz_id, lbt->plz_id);
        lane_log("테이블데이터 Basic plz_name[%.30s][%.30s]\n", hbt->plz_name, lbt->plz_name);
        lane_log("테이블데이터 Basic lane_no[%.2s][%02x]\n", hbt->lane_no, lbt->lane_no);
        lane_log("테이블데이터 Basic io_div[%.2s][%02x]\n", hbt->io_div, lbt->io_div);
#endif

/* 요금정보 통합 */
        smemcpy(D_TO_A, H_TO_L, (char *)&hbt->fare_cnt,  (char *)&lbt->fare_cnt, 2, 0);
#ifdef _VERIFY_
        lane_log("테이블데이터 Basic fare_cnt[%.2s][%02x]\n", hbt->fare_cnt, lbt->fare_cnt);
#endif
        for(j = 0; j < 48; j++)
        {
            smemcpy(D_TO_A, H_TO_L, (char *)&hbt->fare_info[j].fare_div, 
                                    (char *)&lbt->fare_info[j].fare_div, 2, 0);
            smemcpy(D_TO_A, H_TO_L, (char *)&hbt->fare_info[j].dc_typ, 
                                    (char *)&lbt->fare_info[j].dc_typ, 2, 1);
            smemcpy(D_TO_A, H_TO_L, (char *)&hbt->fare_info[j].fare, 
                                    (char *)&lbt->fare_info[j].fare, 6, 0);
            smemcpy(D_TO_A, H_TO_L, (char *)&hbt->fare_info[j].start_dt, 
                                    (char *)&lbt->fare_info[j].start_dt, 8, 0);
            smemcpy(D_TO_A, H_TO_L, (char *)&hbt->fare_info[j].end_dt, 
                                    (char *)&lbt->fare_info[j].end_dt, 8, 0);
            smemcpy(D_TO_A, H_TO_L, (char *)&hbt->fare_info[j].fare_dc, 
                                    (char *)&lbt->fare_info[j].fare_dc, 6, 0);
            smemcpy(D_TO_A, H_TO_L, (char *)&hbt->fare_info[j].penalty, 
                                    (char *)&lbt->fare_info[j].penalty, 6, 0);
#ifdef _VERIFY_
            lane_log("테이블데이터 Basic fare_div(%d)[%.2s][%02x]\n", i,
                     hbt->fare_info[i].fare_div, lbt->fare_info[i].fare_div);
            lane_log("테이블데이터 Basic dc_typ(%d)[%c][%x]\n", i,
                     hbt->fare_info[i].dc_typ, lbt->fare_info[i].dc_typ);
            lane_log("테이블데이터 Basic fare(%d)[%.6s][%02x%02x%02x]\n", i, hbt->fare_info[i].fare,
                     lbt->fare_info[i].fare[0], lbt->fare_info[i].fare[1], lbt->fare_info[i].fare[2]);
            lane_log("테이블데이터 Basic start_dt(%d)[%.8s][%02x%02x%02x%02x]\n", i, hbt->fare_info[i].start_dt,
                     lbt->fare_info[i].start_dt[0], lbt->fare_info[i].start_dt[1],
                     lbt->fare_info[i].start_dt[2], lbt->fare_info[i].start_dt[3]);
            lane_log("테이블데이터 Basic end_dt(%d)[%.8s][%02x%02x%02x%02x]\n", i, hbt->fare_info[i].end_dt,
                     lbt->fare_info[i].end_dt[0], lbt->fare_info[i].end_dt[1],
                     lbt->fare_info[i].end_dt[2], lbt->fare_info[i].end_dt[3]);
            lane_log("테이블데이터 Basic fare_dc(%d)[%.6s][%02x%02x%02x]\n", i, hbt->fare_info[i].fare_dc,
                     lbt->fare_info[i].fare_dc[0], lbt->fare_info[i].fare_dc[1], lbt->fare_info[i].fare_dc[2]);
            lane_log("테이블데이터 Basic penalty(%d)[%.6s][%02x%02x%02x]\n", i, hbt->fare_info[i].penalty,
                     lbt->fare_info[i].penalty[0], lbt->fare_info[i].penalty[1], lbt->fare_info[i].penalty[2]);
#endif
        }

        smemcpy(S_TO_S, H_TO_L, (char *)&hbt->plz_tel1, (char *)&lbt->plz_tel1, sizeof(lbt->plz_tel1), 0);
        smemcpy(S_TO_S, H_TO_L, (char *)&hbt->plz_tel2, (char *)&lbt->plz_tel2, sizeof(lbt->plz_tel2), 0);
        smemcpy(D_TO_A, H_TO_L, (char *)&hbt->bas_aply_year,  (char *)&lbt->bas_aply_year, 4, 0);
        smemcpy(D_TO_A, H_TO_L, (char *)&hbt->bas_aply_month, (char *)&lbt->bas_aply_month, 2, 0);
        smemcpy(D_TO_A, H_TO_L, (char *)&hbt->bas_aply_day,   (char *)&lbt->bas_aply_day, 2, 0);
        smemcpy(D_TO_A, H_TO_L, (char *)&hbt->bas_aply_hour,  (char *)&lbt->bas_aply_hour, 2, 0);
        smemcpy(D_TO_A, H_TO_L, (char *)&hbt->bas_aply_min,   (char *)&lbt->bas_aply_min, 2, 0);
#ifdef _VERIFY_
        lane_log("테이블데이터 Basic bas_aply_year[%.4s][%02x%02x]\n", hbt->bas_aply_year
                , lbt->bas_aply_year[0], lbt->bas_aply_year[1]);
        lane_log("테이블데이터 Basic bas_aply_month[%.2s][%02x]\n", hbt->bas_aply_month, lbt->bas_aply_month);
        lane_log("테이블데이터 Basic bas_aply_day[%.2s][%02x]\n", hbt->bas_aply_day, lbt->bas_aply_day);
        lane_log("테이블데이터 Basic bas_aply_hour[%.2s][%02x]\n", hbt->bas_aply_hour, lbt->bas_aply_hour);
        lane_log("테이블데이터 Basic bas_aply_min[%.2s][%02x]\n", hbt->bas_aply_min, lbt->bas_aply_min);
#endif
        smemcpy(D_TO_A, H_TO_L, (char *)&hbt->bas_modf_year,  (char *)&lbt->bas_modf_year, 4, 0);
        smemcpy(D_TO_A, H_TO_L, (char *)&hbt->bas_modf_month, (char *)&lbt->bas_modf_month, 2, 0);
        smemcpy(D_TO_A, H_TO_L, (char *)&hbt->bas_modf_day,   (char *)&lbt->bas_modf_day, 2, 0);
        smemcpy(D_TO_A, H_TO_L, (char *)&hbt->bas_modf_hour,  (char *)&lbt->bas_modf_hour, 2, 0);
        smemcpy(D_TO_A, H_TO_L, (char *)&hbt->bas_modf_min,   (char *)&lbt->bas_modf_min, 2, 0);
#ifdef _VERIFY_
        lane_log("테이블데이터 Basic bas_modf_year[%.4s][%02x%02x]\n", hbt->bas_modf_year
                , lbt->bas_modf_year[0], lbt->bas_modf_year[1]);
        lane_log("테이블데이터 Basic bas_modf_month[%.2s][%02x]\n", hbt->bas_modf_month, lbt->bas_modf_month);
        lane_log("테이블데이터 Basic bas_modf_day[%.2s][%02x]\n", hbt->bas_modf_day, lbt->bas_modf_day);
        lane_log("테이블데이터 Basic bas_modf_hour[%.2s][%02x]\n", hbt->bas_modf_hour, lbt->bas_modf_hour);
        lane_log("테이블데이터 Basic bas_modf_min[%.2s][%02x]\n", hbt->bas_modf_min, lbt->bas_modf_min);
#endif
/* 2019.06.13 추가 */
        smemcpy(D_TO_A, H_TO_L, (char *)&hbt->rcv_str_dt,  (char *)&lbt->rcv_str_dt, 4, 0);
		smemcpy(D_TO_A, H_TO_L, (char *)&hbt->rcv_end_dt,  (char *)&lbt->rcv_end_dt, 4, 0);
#ifdef _VERIFY_
		lane_log("테이블데이터 Basic rcv_str_dt[%.4s][%02x%02x]\n", hbt->rcv_str_dt
                , lbt->rcv_str_dt[0], lbt->rcv_str_dt[1]);
		lane_log("테이블데이터 Basic rcv_end_dt[%.4s][%02x%02x]\n", hbt->rcv_end_dt
                , lbt->rcv_end_dt[0], lbt->rcv_end_dt[1]);
#endif
        break;

    case 20: /* Worker TABLE HEADER */
        hwth = (struct hi_wrkr_tbl_h *)htd;
        lwth = (struct wrkr_tbl_h    *)ltd;
#if 0
        smemcpy(D_TO_A, H_TO_L, (char *)&hwth->frame_cnt,     (char *)&lwth->frame_cnt, 8, 0);
#else
        sscanf((const char *)hwth->frame_cnt, "%2hhx", &lwth->frame_cnt[0]);
        sscanf((const char *)hwth->frame_cnt+2, "%2hhx", &lwth->frame_cnt[1]);
        sscanf((const char *)hwth->frame_cnt+4, "%2hhx", &lwth->frame_cnt[2]);
        sscanf((const char *)hwth->frame_cnt+6, "%2hhx", &lwth->frame_cnt[3]);
#endif
        smemcpy(D_TO_A, H_TO_L, (char *)&hwth->rvs_no,        (char *)&lwth->rvs_no, 2, 0);

        smemcpy(D_TO_A, H_TO_L, (char *)&hwth->tbl_aply_year, (char *)&lwth->tbl_aply_year, 4, 0);
        smemcpy(D_TO_A, H_TO_L, (char *)&hwth->tbl_aply_mon,  (char *)&lwth->tbl_aply_mon, 2, 0);
        smemcpy(D_TO_A, H_TO_L, (char *)&hwth->tbl_aply_day,  (char *)&lwth->tbl_aply_day, 2, 0);
        smemcpy(D_TO_A, H_TO_L, (char *)&hwth->tbl_aply_hour, (char *)&lwth->tbl_aply_hour, 2, 0);
        smemcpy(D_TO_A, H_TO_L, (char *)&hwth->tbl_aply_min,  (char *)&lwth->tbl_aply_min, 2, 0);

        smemcpy(D_TO_A, H_TO_L, (char *)&hwth->tbl_modf_year, (char *)&lwth->tbl_modf_year, 4, 0);
        smemcpy(D_TO_A, H_TO_L, (char *)&hwth->tbl_modf_mon,  (char *)&lwth->tbl_modf_mon, 2, 0);
        smemcpy(D_TO_A, H_TO_L, (char *)&hwth->tbl_modf_day,  (char *)&lwth->tbl_modf_day, 2, 0);
        smemcpy(D_TO_A, H_TO_L, (char *)&hwth->tbl_modf_hour, (char *)&lwth->tbl_modf_hour, 2, 0);
        smemcpy(D_TO_A, H_TO_L, (char *)&hwth->tbl_modf_min,  (char *)&lwth->tbl_modf_min, 2, 0);

        smemcpy(D_TO_A, H_TO_L, (char *)&hwth->wrkr_crd_cnt,  (char *)&lwth->wrkr_crd_cnt, 4, 0);
#ifdef _VERIFY_
        lane_log("테이블데이터 Worker frame_cnt[%.8s][%02x%02x%02x%02x]\n", hwth->frame_cnt
                , lwth->frame_cnt[0], lwth->frame_cnt[1], lwth->frame_cnt[2], lwth->frame_cnt[3]);
        lane_log("테이블데이터 Worker rvs_no[%.2s][%02x]\n", hwth->rvs_no, lwth->rvs_no);
        lane_log("테이블데이터 Worker TIME1[%.4s%.2s%.2s%.2s%.2s][%02x%02x%02x%02x%02x%02x]\n"
                , hwth->tbl_aply_year, hwth->tbl_aply_mon, hwth->tbl_aply_day
                , hwth->tbl_aply_hour, hwth->tbl_aply_min
                , lwth->tbl_aply_year[0], lwth->tbl_aply_year[1], lwth->tbl_aply_mon
                , lwth->tbl_aply_day, lwth->tbl_aply_hour, lwth->tbl_aply_min);
        lane_log("테이블데이터 Worker TIME2[%.4s%.2s%.2s%.2s%.2s][%02x%02x%02x%02x%02x%02x]\n"
                , hwth->tbl_modf_year, hwth->tbl_modf_mon, hwth->tbl_modf_day
                , hwth->tbl_modf_hour, hwth->tbl_modf_min
                , lwth->tbl_modf_year[0], lwth->tbl_modf_year[1], lwth->tbl_modf_mon
                , lwth->tbl_modf_day, lwth->tbl_modf_hour, lwth->tbl_modf_min);
        lane_log("테이블데이터 Worker wrkr_crd_cnt[%.4s][%02x%02x]\n", hwth->wrkr_crd_cnt
                , lwth->wrkr_crd_cnt[0], lwth->wrkr_crd_cnt[1]);
#endif
        break;
    case 21: /* Worker TABLE FRAME */
        hwtf = (struct hi_wrkr_tbl_f *)htd;
        lwtf = (struct wrkr_tbl_f    *)ltd;

        for(i=0; i<83; i++)
        {
            smemcpy(D_TO_A, H_TO_L, (char *)&hwtf->wrkr_crd_no[i].wrkr_no, (char *)&lwtf->wrkr_crd_no[i].wrkr_no, 4, 0);
			smemcpy(S_TO_S, H_TO_L, (char *)&hwtf->wrkr_crd_no[i].wrkr_nm, (char *)&lwtf->wrkr_crd_no[i].wrkr_nm, sizeof(lwtf->wrkr_crd_no[i].wrkr_nm), 0);
#ifdef _VERIFY_
            lane_log("테이블데이터 Worker wrkr_no[%.4s][%02x%02x]\n", hwtf->wrkr_crd_no[i].wrkr_no
                    , lwtf->wrkr_crd_no[i].wrkr_no[0], lwtf->wrkr_crd_no[i].wrkr_no[1]);
            lane_log("테이블데이터 Worker wrkr_nm[%.10s][%.10s]\n", hwtf->wrkr_crd_no[i].wrkr_nm, lwtf->wrkr_crd_no[i].wrkr_nm);
#endif
        }

        break;

    case 30:/* Holi TABLE HEADER */
        hhth = (struct hi_holi_tbl_h *)htd;
        lhth = (struct holi_tbl_h *)ltd;
#if 0
        smemcpy(D_TO_A, H_TO_L, (char *)&hhth->frame_cnt , (char *)&lhth->frame_cnt , 8, 0);
#else
        sscanf((const char *)hhth->frame_cnt, "%2hhx", &lhth->frame_cnt[0]);
        sscanf((const char *)hhth->frame_cnt+2, "%2hhx", &lhth->frame_cnt[1]);
        sscanf((const char *)hhth->frame_cnt+4, "%2hhx", &lhth->frame_cnt[2]);
        sscanf((const char *)hhth->frame_cnt+6, "%2hhx", &lhth->frame_cnt[3]);
#endif
        smemcpy(D_TO_A, H_TO_L, (char *)&hhth->rvs_no ,    (char *)&lhth->rvs_no , 2, 0);
#ifdef _VERIFY_
        lane_log("테이블데이터 Fare frame_cnt[%.8s][%02x%02x%02x%02x]\n", hhth->frame_cnt,
                  lhth->frame_cnt[0], lhth->frame_cnt[1], lhth->frame_cnt[2], lhth->frame_cnt[3]);
        lane_log("테이블데이터 Fare rvs_no[%.2s][%02x]\n", hhth->rvs_no, lhth->rvs_no);
#endif
        smemcpy(D_TO_A, H_TO_L, (char *)&hhth->new_holi_rvs_year,  (char *)&lhth->new_holi_rvs_year, 4, 0);
        smemcpy(D_TO_A, H_TO_L, (char *)&hhth->new_holi_rvs_month, (char *)&lhth->new_holi_rvs_month, 2, 0);
        smemcpy(D_TO_A, H_TO_L, (char *)&hhth->new_holi_rvs_day,   (char *)&lhth->new_holi_rvs_day, 2, 0);
        smemcpy(D_TO_A, H_TO_L, (char *)&hhth->new_holi_rvs_hour,  (char *)&lhth->new_holi_rvs_hour, 2, 0);
        smemcpy(D_TO_A, H_TO_L, (char *)&hhth->new_holi_rvs_min,   (char *)&lhth->new_holi_rvs_min, 2, 0);
#ifdef _VERIFY_
        lane_log("테이블데이터 Fare new_holi_rvs_year[%.4s][%02x%02x]\n", hhth->new_holi_rvs_year,
                  lhth->new_holi_rvs_year[0], lhth->new_holi_rvs_year[1]);
        lane_log("테이블데이터 Fare new_holi_rvs_month[%.2s][%02x]\n", hhth->new_holi_rvs_month, lhth->new_holi_rvs_month);
        lane_log("테이블데이터 Fare new_holi_rvs_day[%.2s][%02x]\n", hhth->new_holi_rvs_day, lhth->new_holi_rvs_day);
        lane_log("테이블데이터 Fare new_holi_rvs_hour[%.2s][%02x]\n", hhth->new_holi_rvs_hour, lhth->new_holi_rvs_hour);
        lane_log("테이블데이터 Fare new_holi_rvs_min[%.2s][%02x]\n", hhth->new_holi_rvs_min, lhth->new_holi_rvs_min);
#endif
        smemcpy(D_TO_A, H_TO_L, (char *)&hhth->holi_modf_year,  (char *)&lhth->holi_modf_year, 4, 0);
        smemcpy(D_TO_A, H_TO_L, (char *)&hhth->holi_modf_month, (char *)&lhth->holi_modf_month, 2, 0);
        smemcpy(D_TO_A, H_TO_L, (char *)&hhth->holi_modf_day,   (char *)&lhth->holi_modf_day, 2, 0);
        smemcpy(D_TO_A, H_TO_L, (char *)&hhth->holi_modf_hour,  (char *)&lhth->holi_modf_hour, 2, 0);
        smemcpy(D_TO_A, H_TO_L, (char *)&hhth->holi_modf_min,   (char *)&lhth->holi_modf_min, 2, 0);
#ifdef _VERIFY_
        lane_log("테이블데이터 Fare holi_modf_year[%.4s][%02x%02x]\n", hhth->holi_modf_year,
                lhth->holi_modf_year[0], lhth->holi_modf_year[1]);
        lane_log("테이블데이터 Fare holi_modf_month[%.2s][%02x]\n", hhth->holi_modf_month, lhth->holi_modf_month);
        lane_log("테이블데이터 Fare holi_modf_day[%.2s][%02x]\n", hhth->holi_modf_day, lhth->holi_modf_day);
        lane_log("테이블데이터 Fare holi_modf_hour[%.2s][%02x]\n", hhth->holi_modf_hour, lhth->holi_modf_hour);
        lane_log("테이블데이터 Fare holi_modf_min[%.2s][%02x]\n", hhth->holi_modf_min, lhth->holi_modf_min);
#endif

        break;

    case 31:/* Holi TABLE FRAME */
        hhtf = (struct hi_holi_tbl_f *)htd;
        lhtf = (struct holi_tbl_f *)ltd;

        for(i=0; i<250; i++)
        {
            smemcpy(D_TO_A, H_TO_L, (char *)&hhtf->holi[i].year, (char *)&lhtf->holi[i].year, 4, 0);
			smemcpy(D_TO_A, H_TO_L, (char *)&hhtf->holi[i].mon, (char *)&lhtf->holi[i].mon, 2, 0);
			smemcpy(D_TO_A, H_TO_L, (char *)&hhtf->holi[i].day, (char *)&lhtf->holi[i].day, 2, 0);
#ifdef _VERIFY_
            lane_log("테이블데이터 Holi DATE[%.4s%.2s%.2s][%02x%02x%02x%02x]\n", hhtf->holi[i].year, hhtf->holi[i].mon, hhtf->holi[i].day,
                    lhtf->holi[i].year[0], lhtf->holi[i].year[1], lhtf->holi[i].mon, lhtf->holi[i].day);
#endif
        }
        
        break;

    case 40: /* Issue Company Header */
        hicih = (struct hi_iss_comp_info_h *)htd;
        licih = (struct iss_comp_info_h *)ltd;
#if 0
        smemcpy(D_TO_A, H_TO_L, (char *)&hicih->frame_cnt , (char *)&licih->frame_cnt , 8, 0);
#else
        sscanf((const char *)hicih->frame_cnt, "%2hhx", &licih->frame_cnt[0]);
        sscanf((const char *)hicih->frame_cnt+2, "%2hhx", &licih->frame_cnt[1]);
        sscanf((const char *)hicih->frame_cnt+4, "%2hhx", &licih->frame_cnt[2]);
        sscanf((const char *)hicih->frame_cnt+6, "%2hhx", &licih->frame_cnt[3]);
#endif
        smemcpy(D_TO_A, H_TO_L, (char *)&hicih->rvs_no ,      (char *)&licih->rvs_no , 2, 0);
        smemcpy(D_TO_A, H_TO_L, (char *)&hicih->rgst_iss_cnt, (char *)&licih->rgst_iss_cnt, 8, 0);
#ifdef _VERIFY_
        lane_log("테이블데이터 Issue frame_cnt[%.8s][%02x%02x%02x%02x]\n", hicih->frame_cnt,
                licih->frame_cnt[0], licih->frame_cnt[1], licih->frame_cnt[2], licih->frame_cnt[3]);
        lane_log("테이블데이터 Issue rvs_no[%.2s][%02x]\n", hicih->rvs_no, licih->rvs_no);
        lane_log("테이블데이터 Issue rgst_iss_cnt[%.8s][%02x%02x%02x%02x]\n", hicih->rgst_iss_cnt,
                licih->rgst_iss_cnt[0], licih->rgst_iss_cnt[1], licih->rgst_iss_cnt[2], licih->rgst_iss_cnt[3]);
#endif
	    smemcpy(D_TO_A, H_TO_L, (char *)&hicih->iss_aply_year,  (char *)&licih->iss_aply_year, 4, 0);
        smemcpy(D_TO_A, H_TO_L, (char *)&hicih->iss_aply_month, (char *)&licih->iss_aply_month, 2, 0);
        smemcpy(D_TO_A, H_TO_L, (char *)&hicih->iss_aply_day,   (char *)&licih->iss_aply_day, 2, 0);
        smemcpy(D_TO_A, H_TO_L, (char *)&hicih->iss_aply_hour,  (char *)&licih->iss_aply_hour, 2, 0);
        smemcpy(D_TO_A, H_TO_L, (char *)&hicih->iss_aply_min,   (char *)&licih->iss_aply_min, 2, 0);
#ifdef _VERIFY_
        lane_log("테이블데이터 Issue iss_aply_year[%.4s][%02x%02x]\n", hicih->iss_aply_year,
                  licih->iss_aply_year[0], licih->iss_aply_year[1]);
        lane_log("테이블데이터 Issue iss_aply_month[%.2s][%02x]\n", hicih->iss_aply_month, licih->iss_aply_month);
        lane_log("테이블데이터 Issue iss_aply_day[%.2s][%02x]\n", hicih->iss_aply_day, licih->iss_aply_day);
        lane_log("테이블데이터 Issue iss_aply_hour[%.2s][%02x]\n", hicih->iss_aply_hour, licih->iss_aply_hour);
        lane_log("테이블데이터 Issue iss_aply_min[%.2s][%02x]\n", hicih->iss_aply_min, licih->iss_aply_min);
#endif
        smemcpy(D_TO_A, H_TO_L, (char *)&hicih->iss_modf_year,  (char *)&licih->iss_modf_year, 4, 0);
        smemcpy(D_TO_A, H_TO_L, (char *)&hicih->iss_modf_month, (char *)&licih->iss_modf_month, 2, 0);
        smemcpy(D_TO_A, H_TO_L, (char *)&hicih->iss_modf_day,   (char *)&licih->iss_modf_day, 2, 0);
        smemcpy(D_TO_A, H_TO_L, (char *)&hicih->iss_modf_hour,  (char *)&licih->iss_modf_hour, 2, 0);
        smemcpy(D_TO_A, H_TO_L, (char *)&hicih->iss_modf_min,   (char *)&licih->iss_modf_min, 2, 0);
#ifdef _VERIFY_
        lane_log("테이블데이터 Issue iss_modf_year[%.4s][%02x%02x]\n", hicih->iss_modf_year,
                licih->iss_modf_year[0], licih->iss_modf_year[1]);
        lane_log("테이블데이터 Issue iss_modf_month[%.2s][%02x]\n", hicih->iss_modf_month, licih->iss_modf_month);
        lane_log("테이블데이터 Issue iss_modf_day[%.2s][%02x]\n", hicih->iss_modf_day, licih->iss_modf_day);
        lane_log("테이블데이터 Issue iss_modf_hour[%.2s][%02x]\n", hicih->iss_modf_hour, licih->iss_modf_hour);
        lane_log("테이블데이터 Issue iss_modf_min[%.2s][%02x]\n", hicih->iss_modf_min, licih->iss_modf_min);
#endif
        break;

    case 41: /* Issue Company Frame */
        hicif = (struct hi_iss_comp_info_f *)htd;
        licif = (struct iss_comp_info_f *)ltd;

        for (i=0; i<200; i++)
        {
			//smemcpy(D_TO_A, H_TO_L, (char *)&hicif->comp[i].crd_co , (char *)&licif->comp[i].crd_co , 2, 0);
			sscanf((const char *)hicif->comp[i].crd_co, "%2hhx", &licif->comp[i].crd_co);
            smemcpy(D_TO_A, H_TO_L, (char *)&hicif->comp[i].bin_code , (char *)&licif->comp[i].bin_code , 8, 0);
#ifdef _VERIFY_
            lane_log("테이블데이터 Issue iss_code[%.2s][%02x]\n", hicif->comp[i].crd_co , licif->comp[i].crd_co);
            lane_log("테이블데이터 Issue bin_code[%.8s][%02x%02x%02x%02x]\n", hicif->comp[i].bin_code,
                    licif->comp[i].bin_code[0], licif->comp[i].bin_code[1], licif->comp[i].bin_code[2], licif->comp[i].bin_code[3]);
#endif
        }

        break;

    case 50: /* 차량번호 면제정보 -H */
        hicth = (struct hi_imm_carno_tbl_h *)htd;
        licth = (struct imm_carno_tbl_h *)ltd;

#if 0
        smemcpy(D_TO_A, H_TO_L, (char *)&hicth->frame_cnt , (char *)&licth->frame_cnt , 8, 0);
#else
        sscanf((const char *)hicth->frame_cnt  , "%2hhx", &licth->frame_cnt[0]);
        sscanf((const char *)hicth->frame_cnt+2, "%2hhx", &licth->frame_cnt[1]);
        sscanf((const char *)hicth->frame_cnt+4, "%2hhx", &licth->frame_cnt[2]);
        sscanf((const char *)hicth->frame_cnt+6, "%2hhx", &licth->frame_cnt[3]);
#endif
        smemcpy(D_TO_A, H_TO_L, (char *)&hicth->rvs_no, (char *)&licth->rvs_no, 2, 0);
		smemcpy(D_TO_A, H_TO_L, (char *)&hicth->div   , (char *)&licth->div, 2, 0);
#ifdef _VERIFY_
        lane_log("테이블데이터 차량면제 frame_cnt[%.8s][%02x%02x%02x%02x]\n", hicth->frame_cnt,
                licth->frame_cnt[0], licth->frame_cnt[1], licth->frame_cnt[2], licth->frame_cnt[3]);
        lane_log("테이블데이터 차량면제 rvs_no[%.2s][%02x]\n", hicth->rvs_no, licth->rvs_no);
		lane_log("테이블데이터 차량면제 div[%.2s][%02x]\n", hicth->div, licth->div);
#endif
	    smemcpy(D_TO_A, H_TO_L, (char *)&hicth->imm_aply_year,  (char *)&licth->imm_aply_year, 4, 0);
        smemcpy(D_TO_A, H_TO_L, (char *)&hicth->imm_aply_month, (char *)&licth->imm_aply_month, 2, 0);
        smemcpy(D_TO_A, H_TO_L, (char *)&hicth->imm_aply_day,   (char *)&licth->imm_aply_day, 2, 0);
        smemcpy(D_TO_A, H_TO_L, (char *)&hicth->imm_aply_hour,  (char *)&licth->imm_aply_hour, 2, 0);
        smemcpy(D_TO_A, H_TO_L, (char *)&hicth->imm_aply_min,   (char *)&licth->imm_aply_min, 2, 0);
#ifdef _VERIFY_
        lane_log("테이블데이터 차량면제 imm_aply_year[%.4s][%02x%02x]\n", hicth->imm_aply_year,
                  licth->imm_aply_year[0], licth->imm_aply_year[1]);
        lane_log("테이블데이터 차량면제 imm_aply_month[%.2s][%02x]\n", hicth->imm_aply_month, licth->imm_aply_month);
        lane_log("테이블데이터 차량면제 imm_aply_day[%.2s][%02x]\n", hicth->imm_aply_day, licth->imm_aply_day);
        lane_log("테이블데이터 차량면제 imm_aply_hour[%.2s][%02x]\n", hicth->imm_aply_hour, licth->imm_aply_hour);
        lane_log("테이블데이터 차량면제 imm_aply_min[%.2s][%02x]\n", hicth->imm_aply_min, licth->imm_aply_min);
#endif
        smemcpy(D_TO_A, H_TO_L, (char *)&hicth->imm_modf_year,  (char *)&licth->imm_modf_year, 4, 0);
        smemcpy(D_TO_A, H_TO_L, (char *)&hicth->imm_modf_month, (char *)&licth->imm_modf_month, 2, 0);
        smemcpy(D_TO_A, H_TO_L, (char *)&hicth->imm_modf_day,   (char *)&licth->imm_modf_day, 2, 0);
        smemcpy(D_TO_A, H_TO_L, (char *)&hicth->imm_modf_hour,  (char *)&licth->imm_modf_hour, 2, 0);
        smemcpy(D_TO_A, H_TO_L, (char *)&hicth->imm_modf_min,   (char *)&licth->imm_modf_min, 2, 0);
#ifdef _VERIFY_
        lane_log("테이블데이터 차량면제 imm_modf_year[%.4s][%02x%02x]\n", hicth->imm_modf_year,
                licth->imm_modf_year[0], licth->imm_modf_year[1]);
        lane_log("테이블데이터 차량면제 imm_modf_month[%.2s][%02x]\n", hicth->imm_modf_month, licth->imm_modf_month);
        lane_log("테이블데이터 차량면제 imm_modf_day[%.2s][%02x]\n", hicth->imm_modf_day, licth->imm_modf_day);
        lane_log("테이블데이터 차량면제 imm_modf_hour[%.2s][%02x]\n", hicth->imm_modf_hour, licth->imm_modf_hour);
        lane_log("테이블데이터 차량면제 imm_modf_min[%.2s][%02x]\n", hicth->imm_modf_min, licth->imm_modf_min);
#endif
        break;

    case 51: /* 차량번호 면제정보 -F */
        hictf = (struct hi_imm_carno_tbl_f *)htd;
        lictf = (struct imm_carno_tbl_f *)ltd;

        sscanf((const char *)hictf->last_data_seq_no  , "%2hhx", &lictf->last_data_seq_no[0]);
        sscanf((const char *)hictf->last_data_seq_no+2, "%2hhx", &lictf->last_data_seq_no[1]);
        sscanf((const char *)hictf->last_data_seq_no+4, "%2hhx", &lictf->last_data_seq_no[2]);
        sscanf((const char *)hictf->last_data_seq_no+6, "%2hhx", &lictf->last_data_seq_no[3]);

        sscanf((const char *)hictf->item_cnt, "%2hhx", &lictf->item_cnt);
        for (i=0; i<142; i++)
        {
            smemcpy(D_TO_A, H_TO_L, (char *)&hictf->imm_info[i].rgst_div, (char *)&lictf->imm_info[i].rgst_div, 2, 0);
			smemcpy(D_TO_A, H_TO_L, (char *)&hictf->imm_info[i].imm_div, (char *)&lictf->imm_info[i].imm_div, 2, 0);

            sscanf((const char *)hictf->imm_info[i].car_no  , "%2hhx", &lictf->imm_info[i].car_no[0]);
            sscanf((const char *)hictf->imm_info[i].car_no+2, "%2hhx", &lictf->imm_info[i].car_no[1]);
            sscanf((const char *)hictf->imm_info[i].car_no+4, "%2hhx", &lictf->imm_info[i].car_no[2]);
            sscanf((const char *)hictf->imm_info[i].car_no+6, "%2hhx", &lictf->imm_info[i].car_no[3]);
			sscanf((const char *)hictf->imm_info[i].car_no+8, "%2hhx", &lictf->imm_info[i].car_no[4]);

#ifdef _VERIFY_
            lane_log("테이블데이터 Issue[%.10s][%02x%02x%02x%02x%02x]\n", hictf->imm_info[i].car_no,
   		              lictf->imm_info[i].car_no[0], lictf->imm_info[i].car_no[1], lictf->imm_info[i].car_no[2],
					  lictf->imm_info[i].car_no[3], lictf->imm_info[i].car_no[4]);
#endif
        }

        break;

    case 60: /* 면제카드 Header */
        hicdh = (struct hi_imm_crdno_tbl_h *)htd;
        licdh = (struct imm_crdno_tbl_h *)ltd;
#if 0
        smemcpy(D_TO_A, H_TO_L, (char *)&hicdh->frame_cnt, (char *)&licdh->frame_cnt, 8, 0);
#else
        sscanf((const char *)hicdh->frame_cnt  , "%2hhx", &licdh->frame_cnt[0]);
        sscanf((const char *)hicdh->frame_cnt+2, "%2hhx", &licdh->frame_cnt[1]);
        sscanf((const char *)hicdh->frame_cnt+4, "%2hhx", &licdh->frame_cnt[2]);
        sscanf((const char *)hicdh->frame_cnt+6, "%2hhx", &licdh->frame_cnt[3]);
#endif
        smemcpy(D_TO_A, H_TO_L, (char *)&hicdh->rvs_no, (char *)&licdh->rvs_no, 2, 0);
        smemcpy(D_TO_A, H_TO_L, (char *)&hicdh->div   , (char *)&licdh->div, 2, 0);
#ifdef _VERIFY_
        lane_log("테이블데이터 면제카드 frame_cnt[%.8s][%02x%02x%02x%02x]\n", hicdh->frame_cnt,
                licdh->frame_cnt[0], licdh->frame_cnt[1], licdh->frame_cnt[2], licdh->frame_cnt[3]);
        lane_log("테이블데이터 면제카드 rvs_no[%.2s][%02x]\n", hicdh->rvs_no, licdh->rvs_no);
        lane_log("테이블데이터 면제카드 div[%.2s][%02x]\n", hicdh->div, licdh->div);
#endif
	    smemcpy(D_TO_A, H_TO_L, (char *)&hicdh->imm_aply_year,  (char *)&licdh->imm_aply_year, 4, 0);
        smemcpy(D_TO_A, H_TO_L, (char *)&hicdh->imm_aply_month, (char *)&licdh->imm_aply_month, 2, 0);
        smemcpy(D_TO_A, H_TO_L, (char *)&hicdh->imm_aply_day,   (char *)&licdh->imm_aply_day, 2, 0);
        smemcpy(D_TO_A, H_TO_L, (char *)&hicdh->imm_aply_hour,  (char *)&licdh->imm_aply_hour, 2, 0);
        smemcpy(D_TO_A, H_TO_L, (char *)&hicdh->imm_aply_min,   (char *)&licdh->imm_aply_min, 2, 0);
#ifdef _VERIFY_
        lane_log("테이블데이터 면제카드 imm_aply_year[%.4s][%02x%02x]\n", hicdh->imm_aply_year,
                  licdh->imm_aply_year[0], licdh->imm_aply_year[1]);
        lane_log("테이블데이터 면제카드 imm_aply_month[%.2s][%02x]\n", hicdh->imm_aply_month, licdh->imm_aply_month);
        lane_log("테이블데이터 면제카드 imm_aply_day[%.2s][%02x]\n", hicdh->imm_aply_day, licdh->imm_aply_day);
        lane_log("테이블데이터 면제카드 imm_aply_hour[%.2s][%02x]\n", hicdh->imm_aply_hour, licdh->imm_aply_hour);
        lane_log("테이블데이터 면제카드 imm_aply_min[%.2s][%02x]\n", hicdh->imm_aply_min, licdh->imm_aply_min);
#endif
        smemcpy(D_TO_A, H_TO_L, (char *)&hicdh->imm_modf_year,  (char *)&licdh->imm_modf_year, 4, 0);
        smemcpy(D_TO_A, H_TO_L, (char *)&hicdh->imm_modf_month, (char *)&licdh->imm_modf_month, 2, 0);
        smemcpy(D_TO_A, H_TO_L, (char *)&hicdh->imm_modf_day,   (char *)&licdh->imm_modf_day, 2, 0);
        smemcpy(D_TO_A, H_TO_L, (char *)&hicdh->imm_modf_hour,  (char *)&licdh->imm_modf_hour, 2, 0);
        smemcpy(D_TO_A, H_TO_L, (char *)&hicdh->imm_modf_min,   (char *)&licdh->imm_modf_min, 2, 0);
#ifdef _VERIFY_
        lane_log("테이블데이터 면제카드 imm_modf_year[%.4s][%02x%02x]\n", hicdh->imm_modf_year,
                licdh->imm_modf_year[0], licdh->imm_modf_year[1]);
        lane_log("테이블데이터 면제카드 imm_modf_month[%.2s][%02x]\n", hicdh->imm_modf_month, licdh->imm_modf_month);
        lane_log("테이블데이터 면제카드 imm_modf_day[%.2s][%02x]\n", hicdh->imm_modf_day, licdh->imm_modf_day);
        lane_log("테이블데이터 면제카드 imm_modf_hour[%.2s][%02x]\n", hicdh->imm_modf_hour, licdh->imm_modf_hour);
        lane_log("테이블데이터 면제카드 imm_modf_min[%.2s][%02x]\n", hicdh->imm_modf_min, licdh->imm_modf_min);
#endif
        break;

    case 61: /* 면제카드 Frame */
        hicdf = (struct hi_imm_crdno_tbl_f *)htd;
        licdf = (struct imm_crdno_tbl_f *)ltd;

        sscanf((const char *)hicdf->last_data_seq_no  , "%2hhx", &licdf->last_data_seq_no[0]);
        sscanf((const char *)hicdf->last_data_seq_no+2, "%2hhx", &licdf->last_data_seq_no[1]);
        sscanf((const char *)hicdf->last_data_seq_no+4, "%2hhx", &licdf->last_data_seq_no[2]);
        sscanf((const char *)hicdf->last_data_seq_no+6, "%2hhx", &licdf->last_data_seq_no[3]);

        sscanf((const char *)hicdf->item_cnt, "%2hhx", &licdf->item_cnt);
        for (i=0; i<49; i++)
        {
			smemcpy(D_TO_A, H_TO_L, (char *)&hicdf->imm_info[i].rgst_div, (char *)&licdf->imm_info[i].rgst_div, 2, 0);
            smemcpy(D_TO_A, H_TO_L, (char *)&hicdf->imm_info[i].car_div , (char *)&licdf->imm_info[i].car_div , 2, 1);

            sscanf((const char *)hicdf->imm_info[i].crd_no   , "%2hhx", &licdf->imm_info[i].crd_no[0]);
            sscanf((const char *)hicdf->imm_info[i].crd_no+2 , "%2hhx", &licdf->imm_info[i].crd_no[1]);
            sscanf((const char *)hicdf->imm_info[i].crd_no+4 , "%2hhx", &licdf->imm_info[i].crd_no[2]);
            sscanf((const char *)hicdf->imm_info[i].crd_no+6 , "%2hhx", &licdf->imm_info[i].crd_no[3]);
            sscanf((const char *)hicdf->imm_info[i].crd_no+8 , "%2hhx", &licdf->imm_info[i].crd_no[4]);
            sscanf((const char *)hicdf->imm_info[i].crd_no+10, "%2hhx", &licdf->imm_info[i].crd_no[5]);
            sscanf((const char *)hicdf->imm_info[i].crd_no+12, "%2hhx", &licdf->imm_info[i].crd_no[6]);
            sscanf((const char *)hicdf->imm_info[i].crd_no+14, "%2hhx", &licdf->imm_info[i].crd_no[7]);
            sscanf((const char *)hicdf->imm_info[i].crd_no+16, "%2hhx", &licdf->imm_info[i].crd_no[8]);
            sscanf((const char *)hicdf->imm_info[i].crd_no+18, "%2hhx", &licdf->imm_info[i].crd_no[9]);
            sscanf((const char *)hicdf->imm_info[i].crd_no+20, "%2hhx", &licdf->imm_info[i].crd_no[10]);
            sscanf((const char *)hicdf->imm_info[i].crd_no+22, "%2hhx", &licdf->imm_info[i].crd_no[11]);

            sscanf((const char *)hicdf->imm_info[i].car_no   , "%2hhx", &licdf->imm_info[i].car_no[0]);
            sscanf((const char *)hicdf->imm_info[i].car_no+2 , "%2hhx", &licdf->imm_info[i].car_no[1]);
            sscanf((const char *)hicdf->imm_info[i].car_no+4 , "%2hhx", &licdf->imm_info[i].car_no[2]);
            sscanf((const char *)hicdf->imm_info[i].car_no+6 , "%2hhx", &licdf->imm_info[i].car_no[3]);
            sscanf((const char *)hicdf->imm_info[i].car_no+8 , "%2hhx", &licdf->imm_info[i].car_no[4]);

            memset(tmp, 0x00, sizeof(tmp));
            sprintf(tmp, "%c%c\0", hicdf->imm_info[i].unap_div, hicdf->imm_info[i].vio_div);

            smemcpy(D_TO_A, H_TO_L, (char *)&tmp , (char *)&licdf->imm_info[i].unap_vio_div , 2, 0);

#ifdef _VERIFY_
            lane_log("테이블데이터 면제카드 car_div[%c][%02x]\n", hicdf->imm_info[i].car_div , licdf->imm_info[i].car_div);
            lane_log("테이블데이터 면제카드 crd_no[%.24s][%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x]\n",
                    hicdf->imm_info[i].crd_no,
                    licdf->imm_info[i].crd_no[0], licdf->imm_info[i].crd_no[1], licdf->imm_info[i].crd_no[2],
                    licdf->imm_info[i].crd_no[3], licdf->imm_info[i].crd_no[4], licdf->imm_info[i].crd_no[5],
                    licdf->imm_info[i].crd_no[6], licdf->imm_info[i].crd_no[7], licdf->imm_info[i].crd_no[8],
                    licdf->imm_info[i].crd_no[9], licdf->imm_info[i].crd_no[10], licdf->imm_info[i].crd_no[11]);
            lane_log("테이블데이터 면제카드 car_no[%10][%02x%02x%02x%02x%02x]\n", hicdf->imm_info[i].car_no,
                    licdf->imm_info[i].car_no[0], licdf->imm_info[i].car_no[1], licdf->imm_info[i].car_no[2],
                    licdf->imm_info[i].car_no[3], licdf->imm_info[i].car_no[4]);
            lane_log("테이블데이터 면제카드 unap_vio_div[%c][%c][%02x]\n",
                    hicdf->imm_info[i].unap_div, hicdf->imm_info[i].vio_div,
                    licdf->imm_info[i].unap_vio_div);
#endif
        }

    case 70: /* 사전결제등록정보 Header */
        hapth = (struct hi_adv_payment_tbl_h *)htd;
        lapth = (struct adv_payment_tbl_h *)ltd;
#if 0
        smemcpy(D_TO_A, H_TO_L, (char *)&hapth->frame_cnt, (char *)&lapth->frame_cnt, 8, 0);
#else
        sscanf((const char *)hapth->frame_cnt  , "%2hhx", &lapth->frame_cnt[0]);
        sscanf((const char *)hapth->frame_cnt+2, "%2hhx", &lapth->frame_cnt[1]);
        sscanf((const char *)hapth->frame_cnt+4, "%2hhx", &lapth->frame_cnt[2]);
        sscanf((const char *)hapth->frame_cnt+6, "%2hhx", &lapth->frame_cnt[3]);
#endif
        smemcpy(D_TO_A, H_TO_L, (char *)&hapth->rvs_no,    (char *)&lapth->rvs_no, 2, 0);
        smemcpy(D_TO_A, H_TO_L, (char *)&hapth->div,       (char *)&lapth->div, 2, 0);
#ifdef _VERIFY_
        lane_log("테이블데이터 사전결제등록정보 frame_cnt[%.8s][%02x%02x%02x%02x]\n", hapth->frame_cnt,
                lapth->frame_cnt[0], lapth->frame_cnt[1], lapth->frame_cnt[2], lapth->frame_cnt[3]);
        lane_log("테이블데이터 사전결제등록정보 rvs_no[%.2s][%02x]\n", hapth->rvs_no, lapth->rvs_no);
        lane_log("테이블데이터 사전결제등록정보 div[%.2s][%02x]\n", hapth->div, lapth->div);
#endif
        smemcpy(D_TO_A, H_TO_L, (char *)&hapth->adv_aply_year,  (char *)&lapth->adv_aply_year, 4, 0);
        smemcpy(D_TO_A, H_TO_L, (char *)&hapth->adv_aply_month, (char *)&lapth->adv_aply_month, 2, 0);
        smemcpy(D_TO_A, H_TO_L, (char *)&hapth->adv_aply_day,   (char *)&lapth->adv_aply_day, 2, 0);
        smemcpy(D_TO_A, H_TO_L, (char *)&hapth->adv_aply_hour,  (char *)&lapth->adv_aply_hour, 2, 0);
        smemcpy(D_TO_A, H_TO_L, (char *)&hapth->adv_aply_min,   (char *)&lapth->adv_aply_min, 2, 0);
#ifdef _VERIFY_
        lane_log("테이블데이터 사전결제등록정보 adv_aply_year[%.4s][%02x%02x]\n", hapth->adv_aply_year,
                  lapth->adv_aply_year[0], lapth->adv_aply_year[1]);
        lane_log("테이블데이터 사전결제등록정보 adv_aply_month[%.2s][%02x]\n", hapth->adv_aply_month, lapth->adv_aply_month);
        lane_log("테이블데이터 사전결제등록정보 adv_aply_day[%.2s][%02x]\n", hapth->adv_aply_day, lapth->adv_aply_day);
        lane_log("테이블데이터 사전결제등록정보 adv_aply_hour[%.2s][%02x]\n", hapth->adv_aply_hour, lapth->adv_aply_hour);
        lane_log("테이블데이터 사전결제등록정보 adv_aply_min[%.2s][%02x]\n", hapth->adv_aply_min, lapth->adv_aply_min);
#endif
        smemcpy(D_TO_A, H_TO_L, (char *)&hapth->adv_modf_year,  (char *)&lapth->adv_modf_year, 4, 0);
        smemcpy(D_TO_A, H_TO_L, (char *)&hapth->adv_modf_month, (char *)&lapth->adv_modf_month, 2, 0);
        smemcpy(D_TO_A, H_TO_L, (char *)&hapth->adv_modf_day,   (char *)&lapth->adv_modf_day, 2, 0);
        smemcpy(D_TO_A, H_TO_L, (char *)&hapth->adv_modf_hour,  (char *)&lapth->adv_modf_hour, 2, 0);
        smemcpy(D_TO_A, H_TO_L, (char *)&hapth->adv_modf_min,   (char *)&lapth->adv_modf_min, 2, 0);
#ifdef _VERIFY_
        lane_log("테이블데이터 사전결제등록정보 adv_modf_year[%.4s][%02x%02x]\n", hapth->adv_modf_year,
                lapth->adv_modf_year[0], lapth->adv_modf_year[1]);
        lane_log("테이블데이터 사전결제등록정보 adv_modf_month[%.2s][%02x]\n", hapth->adv_modf_month, lapth->adv_modf_month);
        lane_log("테이블데이터 사전결제등록정보 adv_modf_day[%.2s][%02x]\n", hapth->adv_modf_day, lapth->adv_modf_day);
        lane_log("테이블데이터 사전결제등록정보 adv_modf_hour[%.2s][%02x]\n", hapth->adv_modf_hour, lapth->adv_modf_hour);
        lane_log("테이블데이터 사전결제등록정보 adv_modf_min[%.2s][%02x]\n", hapth->adv_modf_min, lapth->adv_modf_min);
#endif
        break;

    case 71: /* 사전결제등록정보 Frame */
        haptf = (struct hi_adv_payment_tbl_f *)htd;
        laptf = (struct adv_payment_tbl_f *)ltd;
#if 0
        smemcpy(D_TO_A, H_TO_L, (char *)&haptf->last_data_seq_no ,  (char *)&laptf->last_data_seq_no , 8, 0);
#else
        sscanf((const char *)haptf->last_data_seq_no  , "%2hhx", &laptf->last_data_seq_no[0]);
        sscanf((const char *)haptf->last_data_seq_no+2, "%2hhx", &laptf->last_data_seq_no[1]);
        sscanf((const char *)haptf->last_data_seq_no+4, "%2hhx", &laptf->last_data_seq_no[2]);
        sscanf((const char *)haptf->last_data_seq_no+6, "%2hhx", &laptf->last_data_seq_no[3]);
#endif
        //smemcpy(D_TO_A, H_TO_L, (char *)&haptf->item_cnt ,  (char *)&laptf->item_cnt , 4, 0);
		sscanf((const char *)haptf->item_cnt, "%2hhx", &laptf->item_cnt);
        for (i=0; i<142; i++)
        {
            smemcpy(D_TO_A, H_TO_L, (char *)&haptf->adv_info[i].rgst_div ,  (char *)&laptf->adv_info[i].rgst_div , 2, 0);
			smemcpy(D_TO_A, H_TO_L, (char *)&haptf->adv_info[i].div      ,  (char *)&laptf->adv_info[i].div , 2, 0);
#if 0
            smemcpy(D_TO_A, H_TO_L, (char *)&haptf->adv_info[i].car_no ,   (char *)&laptf->adv_info[i].car_no , 10, 0);
#else
            sscanf((const char *)haptf->adv_info[i].car_no   , "%2hhx", &laptf->adv_info[i].car_no[0]);
            sscanf((const char *)haptf->adv_info[i].car_no+2 , "%2hhx", &laptf->adv_info[i].car_no[1]);
            sscanf((const char *)haptf->adv_info[i].car_no+4 , "%2hhx", &laptf->adv_info[i].car_no[2]);
            sscanf((const char *)haptf->adv_info[i].car_no+6 , "%2hhx", &laptf->adv_info[i].car_no[3]);
            sscanf((const char *)haptf->adv_info[i].car_no+8 , "%2hhx", &laptf->adv_info[i].car_no[4]);
#endif

#ifdef _VERIFY_
            lane_log("테이블데이터 사전결제등록정보 rgst_div[%.2s][%02x]\n", haptf->adv_info[i].rgst_div , laptf->adv_info[i].rgst_div);
			lane_log("테이블데이터 사전결제등록정보 div[%.2s][%02x]\n", haptf->adv_info[i].div , laptf->adv_info[i].div);
            lane_log("테이블데이터 사전결제등록정보 car_no[%.10s][%02x%02x%02x%02x%02x]\n", haptf->adv_info[i].car_no,
                    laptf->adv_info[i].car_no[0], laptf->adv_info[i].car_no[1], laptf->adv_info[i].car_no[2],
                    laptf->adv_info[i].car_no[3], laptf->adv_info[i].car_no[4]);
#endif
        }

        break;

    case 80: /* PL Header */
        hpth = (struct hi_pl_tbl_h *)htd;
        lpth = (struct pl_tbl_h *)ltd;
#if 0
        smemcpy(D_TO_A, H_TO_L, (char *)&hpth->frame_cnt, (char *)&lpth->frame_cnt, 8, 0);
#else
        sscanf((const char *)hpth->frame_cnt  , "%2hhx", &lpth->frame_cnt[0]);
        sscanf((const char *)hpth->frame_cnt+2, "%2hhx", &lpth->frame_cnt[1]);
        sscanf((const char *)hpth->frame_cnt+4, "%2hhx", &lpth->frame_cnt[2]);
        sscanf((const char *)hpth->frame_cnt+6, "%2hhx", &lpth->frame_cnt[3]);
#endif
        smemcpy(D_TO_A, H_TO_L, (char *)&hpth->rvs_no,    (char *)&lpth->rvs_no, 2, 0);
        smemcpy(D_TO_A, H_TO_L, (char *)&hpth->div,       (char *)&lpth->div, 2, 0);
#ifdef _VERIFY_
        lane_log("테이블데이터 PL frame_cnt[%.8s][%02x%02x%02x%02x]\n", hpth->frame_cnt,
                lpth->frame_cnt[0], lpth->frame_cnt[1], lpth->frame_cnt[2], lpth->frame_cnt[3]);
        lane_log("테이블데이터 PL rvs_no[%.2s][%02x]\n", hpth->rvs_no, lpth->rvs_no);
        lane_log("테이블데이터 PL rgst_imm_cnt[%.2s][%02x]\n", hpth->div, lpth->div);
#endif
        smemcpy(D_TO_A, H_TO_L, (char *)&hpth->pl_aply_year,  (char *)&lpth->pl_aply_year, 4, 0);
        smemcpy(D_TO_A, H_TO_L, (char *)&hpth->pl_aply_month, (char *)&lpth->pl_aply_month, 2, 0);
        smemcpy(D_TO_A, H_TO_L, (char *)&hpth->pl_aply_day,   (char *)&lpth->pl_aply_day, 2, 0);
        smemcpy(D_TO_A, H_TO_L, (char *)&hpth->pl_aply_hour,  (char *)&lpth->pl_aply_hour, 2, 0);
        smemcpy(D_TO_A, H_TO_L, (char *)&hpth->pl_aply_min,   (char *)&lpth->pl_aply_min, 2, 0);
#ifdef _VERIFY_
        lane_log("테이블데이터 PL pl_aply_year[%.4s][%02x%02x]\n", hpth->pl_aply_year,
                  lpth->pl_aply_year[0], lpth->pl_aply_year[1]);
        lane_log("테이블데이터 PL pl_aply_month[%.2s][%02x]\n", hpth->pl_aply_month, lpth->pl_aply_month);
        lane_log("테이블데이터 PL pl_aply_day[%.2s][%02x]\n", hpth->pl_aply_day, lpth->pl_aply_day);
        lane_log("테이블데이터 PL pl_aply_hour[%.2s][%02x]\n", hpth->pl_aply_hour, lpth->pl_aply_hour);
        lane_log("테이블데이터 PL pl_aply_min[%.2s][%02x]\n", hpth->pl_aply_min, lpth->pl_aply_min);
#endif
        smemcpy(D_TO_A, H_TO_L, (char *)&hpth->pl_modf_year,  (char *)&lpth->pl_modf_year, 4, 0);
        smemcpy(D_TO_A, H_TO_L, (char *)&hpth->pl_modf_month, (char *)&lpth->pl_modf_month, 2, 0);
        smemcpy(D_TO_A, H_TO_L, (char *)&hpth->pl_modf_day,   (char *)&lpth->pl_modf_day, 2, 0);
        smemcpy(D_TO_A, H_TO_L, (char *)&hpth->pl_modf_hour,  (char *)&lpth->pl_modf_hour, 2, 0);
        smemcpy(D_TO_A, H_TO_L, (char *)&hpth->pl_modf_min,   (char *)&lpth->pl_modf_min, 2, 0);
#ifdef _VERIFY_
        lane_log("테이블데이터 PL pl_modf_year[%.4s][%02x%02x]\n", hpth->pl_modf_year,
                lpth->pl_modf_year[0], lpth->pl_modf_year[1]);
        lane_log("테이블데이터 PL pl_modf_month[%.2s][%02x]\n", hpth->pl_modf_month, lpth->pl_modf_month);
        lane_log("테이블데이터 PL pl_modf_day[%.2s][%02x]\n", hpth->pl_modf_day, lpth->pl_modf_day);
        lane_log("테이블데이터 PL pl_modf_hour[%.2s][%02x]\n", hpth->pl_modf_hour, lpth->pl_modf_hour);
        lane_log("테이블데이터 PL pl_modf_min[%.2s][%02x]\n", hpth->pl_modf_min, lpth->pl_modf_min);
#endif
#if 0
        smemcpy(D_TO_A, H_TO_L, (char *)&hpth->ft_alias_no, (char *)&lpth->ft_alias_no, 8, 0);
        smemcpy(D_TO_A, H_TO_L, (char *)&hpth->ft_frame_cnt, (char *)&lpth->ft_frame_cnt, 8, 0);
        smemcpy(D_TO_A, H_TO_L, (char *)&hpth->sc_alias_no, (char *)&lpth->sc_alias_no, 8, 0);
        smemcpy(D_TO_A, H_TO_L, (char *)&hpth->sc_frame_cnt, (char *)&lpth->sc_frame_cnt, 8, 0);
        smemcpy(D_TO_A, H_TO_L, (char *)&hpth->th_alias_no, (char *)&lpth->th_alias_no, 8, 0);
        smemcpy(D_TO_A, H_TO_L, (char *)&hpth->th_frame_cnt, (char *)&lpth->th_frame_cnt, 8, 0);
#else
        for(i = 0; i < 17; i++)
		{
			sscanf((const char *)hpth->pl_block[i].block_st_no  , "%2hhx", &lpth->pl_block[i].block_st_no[0]);
            sscanf((const char *)hpth->pl_block[i].block_st_no+2, "%2hhx", &lpth->pl_block[i].block_st_no[1]);
            sscanf((const char *)hpth->pl_block[i].block_st_no+4, "%2hhx", &lpth->pl_block[i].block_st_no[2]);
            sscanf((const char *)hpth->pl_block[i].block_st_no+6, "%2hhx", &lpth->pl_block[i].block_st_no[3]);

			sscanf((const char *)hpth->pl_block[i].block_cnt  , "%2hhx", &lpth->pl_block[i].block_cnt[0]);
            sscanf((const char *)hpth->pl_block[i].block_cnt+2, "%2hhx", &lpth->pl_block[i].block_cnt[1]);
            sscanf((const char *)hpth->pl_block[i].block_cnt+4, "%2hhx", &lpth->pl_block[i].block_cnt[2]);
            sscanf((const char *)hpth->pl_block[i].block_cnt+6, "%2hhx", &lpth->pl_block[i].block_cnt[3]);
#ifdef _VERIFY_
        lane_log("테이블데이터 PL alias_no[%.8s][%02x%02x%02x%02x]\n", hpth->pl_block[i].block_st_no,
                lpth->pl_block[i].block_st_no[0], lpth->pl_block[i].block_st_no[1],
				lpth->pl_block[i].block_st_no[2], lpth->pl_block[i].block_st_no[3]);
#endif
		}

#endif
        break;

    case 81: /* PL Frame */
        hptf = (struct hi_pl_tbl_f *)htd;
        lptf = (struct pl_tbl_f *)ltd;

        //smemcpy(D_TO_A, H_TO_L, (char *)&hptf->item_cnt, (char *)&lptf->item_cnt, 4, 0);
#if 0
    sscanf((const char *)hptf->item_cnt+2, "%2hhx", &lptf->item_cnt[0]);
    sscanf((const char *)hptf->item_cnt  , "%2hhx", &lptf->item_cnt[1]);
#else
	sprintf((char *)tmp, "%c%c%c", hptf->item_cnt[2], lptf->item_cnt[3], '\0');
    lptf->item_cnt[0] = strtoul(tmp, NULL, 16);
	sprintf((char *)tmp, "%c%c%c", hptf->item_cnt[0], hptf->item_cnt[1], '\0');
	lptf->item_cnt[1] = strtoul(tmp, NULL, 16);
#endif
#ifdef _VERIFY_
        lane_log("테이블데이터 PL item_cnt[%.2s][%02x]\n", hptf->item_cnt, lptf->item_cnt);
#endif
        for (i=0; i<1004; i++)
        {
            smemcpy(B_TO_B, H_TO_L, (char *)&hptf->div[i],  (char *)&lptf->div[i], 1, 0);
			//lptf->div[i] = hptf->div[i];
#ifdef _VERIFY_
            //lane_log("테이블데이터 PL div[%02x][%02x]\n", hptf->div[i] , lptf->div[i]);
#endif
        }
        
        break;

    case 90: /* BL Header */
        hbth = (struct hi_bl_tbl_h *)htd;
        lbth = (struct bl_tbl_h *)ltd;
#if 0
        smemcpy(D_TO_A, H_TO_L, (char *)&hbth->frame_cnt, (char *)&lbth->frame_cnt, 8, 0);
#else
        sscanf((const char *)hbth->frame_cnt  , "%2hhx", &lbth->frame_cnt[0]);
        sscanf((const char *)hbth->frame_cnt+2, "%2hhx", &lbth->frame_cnt[1]);
        sscanf((const char *)hbth->frame_cnt+4, "%2hhx", &lbth->frame_cnt[2]);
        sscanf((const char *)hbth->frame_cnt+6, "%2hhx", &lbth->frame_cnt[3]);
#endif
        smemcpy(D_TO_A, H_TO_L, (char *)&hbth->rvs_no,    (char *)&lbth->rvs_no, 2, 0);
        smemcpy(D_TO_A, H_TO_L, (char *)&hbth->div,       (char *)&lbth->div, 2, 0);
#ifdef _VERIFY_
        lane_log("테이블데이터 BL frame_cnt[%.8s][%02x%02x%02x%02x]\n", hbth->frame_cnt,
                lbth->frame_cnt[0], lbth->frame_cnt[1], lbth->frame_cnt[2], lbth->frame_cnt[3]);
        lane_log("테이블데이터 BL rvs_no[%.2s][%02x]\n", hbth->rvs_no, lbth->rvs_no);
        lane_log("테이블데이터 BL rgst_imm_cnt[%.2s][%02x]\n", hbth->div, lbth->div);
#endif
        smemcpy(D_TO_A, H_TO_L, (char *)&hbth->bl_aply_year,  (char *)&lbth->bl_aply_year, 4, 0);
        smemcpy(D_TO_A, H_TO_L, (char *)&hbth->bl_aply_month, (char *)&lbth->bl_aply_month, 2, 0);
        smemcpy(D_TO_A, H_TO_L, (char *)&hbth->bl_aply_day,   (char *)&lbth->bl_aply_day, 2, 0);
        smemcpy(D_TO_A, H_TO_L, (char *)&hbth->bl_aply_hour,  (char *)&lbth->bl_aply_hour, 2, 0);
        smemcpy(D_TO_A, H_TO_L, (char *)&hbth->bl_aply_min,   (char *)&lbth->bl_aply_min, 2, 0);
#ifdef _VERIFY_
        lane_log("테이블데이터 BL bl_aply_year[%.4s][%02x%02x]\n", hbth->bl_aply_year,
                  lbth->bl_aply_year[0], lbth->bl_aply_year[1]);
        lane_log("테이블데이터 BL bl_aply_month[%.2s][%02x]\n", hbth->bl_aply_month, lbth->bl_aply_month);
        lane_log("테이블데이터 BL bl_aply_day[%.2s][%02x]\n", hbth->bl_aply_day, lbth->bl_aply_day);
        lane_log("테이블데이터 BL bl_aply_hour[%.2s][%02x]\n", hbth->bl_aply_hour, lbth->bl_aply_hour);
        lane_log("테이블데이터 BL bl_aply_min[%.2s][%02x]\n", hbth->bl_aply_min, lbth->bl_aply_min);
#endif
        smemcpy(D_TO_A, H_TO_L, (char *)&hbth->bl_modf_year,  (char *)&lbth->bl_modf_year, 4, 0);
        smemcpy(D_TO_A, H_TO_L, (char *)&hbth->bl_modf_month, (char *)&lbth->bl_modf_month, 2, 0);
        smemcpy(D_TO_A, H_TO_L, (char *)&hbth->bl_modf_day,   (char *)&lbth->bl_modf_day, 2, 0);
        smemcpy(D_TO_A, H_TO_L, (char *)&hbth->bl_modf_hour,  (char *)&lbth->bl_modf_hour, 2, 0);
        smemcpy(D_TO_A, H_TO_L, (char *)&hbth->bl_modf_min,   (char *)&lbth->bl_modf_min, 2, 0);
#ifdef _VERIFY_
        lane_log("테이블데이터 BL bl_modf_year[%.4s][%02x%02x]\n", hbth->bl_modf_year,
                lbth->bl_modf_year[0], lbth->bl_modf_year[1]);
        lane_log("테이블데이터 BL bl_modf_month[%.2s][%02x]\n", hbth->bl_modf_month, lbth->bl_modf_month);
        lane_log("테이블데이터 BL bl_modf_day[%.2s][%02x]\n", hbth->bl_modf_day, lbth->bl_modf_day);
        lane_log("테이블데이터 BL bl_modf_hour[%.2s][%02x]\n", hbth->bl_modf_hour, lbth->bl_modf_hour);
        lane_log("테이블데이터 BL bl_modf_min[%.2s][%02x]\n", hbth->bl_modf_min, lbth->bl_modf_min);
#endif
        break;

    case 91: /* BL Frame */
        hbtf = (struct hi_pl_tbl_f *)htd;
        lbtf = (struct pl_tbl_f *)ltd;
#if 0
        smemcpy(D_TO_A, H_TO_L, (char *)&hbtf->last_data_seq_no, (char *)&lbtf->last_data_seq_no, 8, 0);
#else
        sscanf((const char *)hbtf->last_data_seq_no  , "%2hhx", &lbtf->last_data_seq_no[0]);
        sscanf((const char *)hbtf->last_data_seq_no+2, "%2hhx", &lbtf->last_data_seq_no[1]);
        sscanf((const char *)hbtf->last_data_seq_no+4, "%2hhx", &lbtf->last_data_seq_no[2]);
        sscanf((const char *)hbtf->last_data_seq_no+6, "%2hhx", &lbtf->last_data_seq_no[3]);
#endif
        //smemcpy(D_TO_A, H_TO_L, (char *)&hbtf->item_cnt, (char *)&lbtf->item_cnt, 4, 0);
		sscanf((const char *)hbtf->item_cnt, "%2hhx", &lbtf->item_cnt);
#ifdef _VERIFY_
        lane_log("테이블데이터 BL item_cnt[%.2s][%02x]\n", hbtf->item_cnt, lbtf->item_cnt);
#endif
        for (i=0; i<111; i++)
        {
            smemcpy(D_TO_A, H_TO_L, (char *)&hbtf->bl_data[i].div ,  (char *)&lbtf->bl_data[i].div , 2, 0);
            smemcpy(D_TO_A, H_TO_L, (char *)&hbtf->bl_data[i].crd_no ,  (char *)&lbtf->bl_data[i].crd_no , 16, 0);
#ifdef _VERIFY_
            //lane_log("테이블데이터 BL div[%.2s][%02x]\n", hbtf->bl_data[i].div , lbtf->bl_data[i].div);
            //lane_log("테이블데이터 BL crd_no[%.16s][%02x%02x%02x%02x%02x%02x%02x%02x]\n", hbtf->bl_data[i].crd_no ,
            //        lbtf->bl_data[i].crd_no[0], lbtf->bl_data[i].crd_no[1], lbtf->bl_data[i].crd_no[2], lbtf->bl_data[i].crd_no[3],
            //        lbtf->bl_data[i].crd_no[4], lbtf->bl_data[i].crd_no[5], lbtf->bl_data[i].crd_no[6], lbtf->bl_data[i].crd_no[7]);
#endif
        }

        break;

    case 100: /* 차량번호 감면정보 Header */
        hrth = (struct hi_reduce_tbl_h *)htd;
        lrth = (struct reduce_tbl_h *)ltd;
#if 0
        smemcpy(D_TO_A, H_TO_L, (char *)&hrth->frame_cnt, (char *)&lrth->frame_cnt, 8, 0);
#else
        sscanf((const char *)hrth->frame_cnt  , "%2hhx", &lrth->frame_cnt[0]);
        sscanf((const char *)hrth->frame_cnt+2, "%2hhx", &lrth->frame_cnt[1]);
        sscanf((const char *)hrth->frame_cnt+4, "%2hhx", &lrth->frame_cnt[2]);
        sscanf((const char *)hrth->frame_cnt+6, "%2hhx", &lrth->frame_cnt[3]);
#endif
        smemcpy(D_TO_A, H_TO_L, (char *)&hrth->rvs_no, (char *)&lrth->rvs_no, 2, 0);
        smemcpy(D_TO_A, H_TO_L, (char *)&hrth->div   , (char *)&lrth->div, 2, 0);
#ifdef _VERIFY_
        lane_log("테이블데이터 차량감면 frame_cnt[%.8s][%02x%02x%02x%02x]\n", hrth->frame_cnt,
                lrth->frame_cnt[0], lrth->frame_cnt[1], lrth->frame_cnt[2], lrth->frame_cnt[3]);
        lane_log("테이블데이터 차량감면 rvs_no[%.2s][%02x]\n", hrth->rvs_no, lrth->rvs_no);
        lane_log("테이블데이터 차량감면 div[%.2s][%02x]\n", hrth->div, lrth->div);
#endif
        smemcpy(D_TO_A, H_TO_L, (char *)&hrth->red_aply_year,  (char *)&lrth->red_aply_year, 4, 0);
        smemcpy(D_TO_A, H_TO_L, (char *)&hrth->red_aply_month, (char *)&lrth->red_aply_month, 2, 0);
        smemcpy(D_TO_A, H_TO_L, (char *)&hrth->red_aply_day,   (char *)&lrth->red_aply_day, 2, 0);
        smemcpy(D_TO_A, H_TO_L, (char *)&hrth->red_aply_hour,  (char *)&lrth->red_aply_hour, 2, 0);
        smemcpy(D_TO_A, H_TO_L, (char *)&hrth->red_aply_min,   (char *)&lrth->red_aply_min, 2, 0);
#ifdef _VERIFY_
        lane_log("테이블데이터 차량감면 red_aply_year[%.4s][%02x%02x]\n", hrth->red_aply_year,
                  lrth->red_aply_year[0], lrth->red_aply_year[1]);
        lane_log("테이블데이터 차량감면 red_aply_month[%.2s][%02x]\n", hrth->red_aply_month, lrth->red_aply_month);
        lane_log("테이블데이터 차량감면 red_aply_day[%.2s][%02x]\n", hrth->red_aply_day, lrth->red_aply_day);
        lane_log("테이블데이터 차량감면 red_aply_hour[%.2s][%02x]\n", hrth->red_aply_hour, lrth->red_aply_hour);
        lane_log("테이블데이터 차량감면 red_aply_min[%.2s][%02x]\n", hrth->red_aply_min, lrth->red_aply_min);
#endif
        smemcpy(D_TO_A, H_TO_L, (char *)&hrth->red_modf_year,  (char *)&lrth->red_modf_year, 4, 0);
        smemcpy(D_TO_A, H_TO_L, (char *)&hrth->red_modf_month, (char *)&lrth->red_modf_month, 2, 0);
        smemcpy(D_TO_A, H_TO_L, (char *)&hrth->red_modf_day,   (char *)&lrth->red_modf_day, 2, 0);
        smemcpy(D_TO_A, H_TO_L, (char *)&hrth->red_modf_hour,  (char *)&lrth->red_modf_hour, 2, 0);
        smemcpy(D_TO_A, H_TO_L, (char *)&hrth->red_modf_min,   (char *)&lrth->red_modf_min, 2, 0);
#ifdef _VERIFY_
        lane_log("테이블데이터 차량감면 red_modf_year[%.4s][%02x%02x]\n", hrth->red_modf_year,
                lrth->red_modf_year[0], lrth->red_modf_year[1]);
        lane_log("테이블데이터 차량감면 red_modf_month[%.2s][%02x]\n", hrth->red_modf_month, lrth->red_modf_month);
        lane_log("테이블데이터 차량감면 red_modf_day[%.2s][%02x]\n", hrth->red_modf_day, lrth->red_modf_day);
        lane_log("테이블데이터 차량감면 red_modf_hour[%.2s][%02x]\n", hrth->red_modf_hour, lrth->red_modf_hour);
        lane_log("테이블데이터 차량감면 red_modf_min[%.2s][%02x]\n", hrth->red_modf_min, lrth->red_modf_min);
#endif
        break;

    case 101: /* 차량번호 감면정보 Frame */
        hrtf = (struct hi_reduce_tbl_f *)htd;
        lrtf = (struct reduce_tbl_f *)ltd;

        sscanf((const char *)hrtf->last_data_seq_no  , "%2hhx", &lrtf->last_data_seq_no[0]);
        sscanf((const char *)hrtf->last_data_seq_no+2, "%2hhx", &lrtf->last_data_seq_no[1]);
        sscanf((const char *)hrtf->last_data_seq_no+4, "%2hhx", &lrtf->last_data_seq_no[2]);
        sscanf((const char *)hrtf->last_data_seq_no+6, "%2hhx", &lrtf->last_data_seq_no[3]);

		sscanf((const char *)hrtf->item_cnt, "%2hhx", &lrtf->item_cnt);

        for (i=0; i<142; i++)
        {
			smemcpy(D_TO_A, H_TO_L, (char *)&hrtf->red_data[i].rgst_div, (char *)&lrtf->red_data[i].rgst_div , 2, 0);
            smemcpy(D_TO_A, H_TO_L, (char *)&hrtf->red_data[i].div     , (char *)&lrtf->red_data[i].div , 2, 0);

            sscanf((const char *)hrtf->red_data[i].car_no   , "%2hhx", &lrtf->red_data[i].car_no[0]);
            sscanf((const char *)hrtf->red_data[i].car_no+2 , "%2hhx", &lrtf->red_data[i].car_no[1]);
            sscanf((const char *)hrtf->red_data[i].car_no+4 , "%2hhx", &lrtf->red_data[i].car_no[2]);
            sscanf((const char *)hrtf->red_data[i].car_no+6 , "%2hhx", &lrtf->red_data[i].car_no[3]);
            sscanf((const char *)hrtf->red_data[i].car_no+8 , "%2hhx", &lrtf->red_data[i].car_no[4]);

#ifdef _VERIFY_
            lane_log("테이블데이터 차량감면 rgst_div[%.2s][%02x]\n", hrtf->red_data[i].rgst_div , lrtf->red_data[i].rgst_div);
            lane_log("테이블데이터 차량감면 div[%.2s][%02x]\n", hrtf->red_data[i].div , lrtf->red_data[i].div);
            lane_log("테이블데이터 차량감면 car_no[%.10s][%02x%02x%02x%02x%02x]\n", hrtf->red_data[i].car_no ,
                    lrtf->red_data[i].car_no[0], lrtf->red_data[i].car_no[1], lrtf->red_data[i].car_no[2],
                    lrtf->red_data[i].car_no[3], lrtf->red_data[i].car_no[4]);
#endif
        }

        break;
#if 0
    case 110: /* BL Header */
        hbth = (struct hi_imbl_tbl_h *)htd;
        lbth = (struct imbl_tbl_h *)ltd;
#if 0
        smemcpy(D_TO_A, H_TO_L, (char *)&hbth->frame_cnt, (char *)&lbth->frame_cnt, 8, 0);
#else
        sscanf((const char *)hbth->frame_cnt  , "%2hhx", &lbth->frame_cnt[0]);
        sscanf((const char *)hbth->frame_cnt+2, "%2hhx", &lbth->frame_cnt[1]);
        sscanf((const char *)hbth->frame_cnt+4, "%2hhx", &lbth->frame_cnt[2]);
        sscanf((const char *)hbth->frame_cnt+6, "%2hhx", &lbth->frame_cnt[3]);
#endif
        smemcpy(D_TO_A, H_TO_L, (char *)&hbth->rvs_no,    (char *)&lbth->rvs_no, 2, 0);
        smemcpy(D_TO_A, H_TO_L, (char *)&hbth->div,       (char *)&lbth->div, 2, 0);
#ifdef _VERIFY_
        lane_log("테이블데이터 IMSI BL frame_cnt[%.8s][%02x%02x%02x%02x]\n", hbth->frame_cnt,
                lbth->frame_cnt[0], lbth->frame_cnt[1], lbth->frame_cnt[2], lbth->frame_cnt[3]);
        lane_log("테이블데이터 IMSI BL rvs_no[%.2s][%02x]\n", hbth->rvs_no, lbth->rvs_no);
        lane_log("테이블데이터 IMSI BL div[%.2s][%02x]\n", hbth->div, lbth->div);
#endif
        smemcpy(D_TO_A, H_TO_L, (char *)&hbth->bl_aply_year,  (char *)&lbth->bl_aply_year, 4, 0);
        smemcpy(D_TO_A, H_TO_L, (char *)&hbth->bl_aply_month, (char *)&lbth->bl_aply_month, 2, 0);
        smemcpy(D_TO_A, H_TO_L, (char *)&hbth->bl_aply_day,   (char *)&lbth->bl_aply_day, 2, 0);
        smemcpy(D_TO_A, H_TO_L, (char *)&hbth->bl_aply_hour,  (char *)&lbth->bl_aply_hour, 2, 0);
        smemcpy(D_TO_A, H_TO_L, (char *)&hbth->bl_aply_min,   (char *)&lbth->bl_aply_min, 2, 0);
#ifdef _VERIFY_
        lane_log("테이블데이터 IMSI BL bl_aply_year[%.4s][%02x%02x]\n", hbth->bl_aply_year,
                  lbth->bl_aply_year[0], lbth->bl_aply_year[1]);
        lane_log("테이블데이터 IMSI BL bl_aply_month[%.2s][%02x]\n", hbth->bl_aply_month, lbth->bl_aply_month);
        lane_log("테이블데이터 IMSI BL bl_aply_day[%.2s][%02x]\n", hbth->bl_aply_day, lbth->bl_aply_day);
        lane_log("테이블데이터 IMSI BL bl_aply_hour[%.2s][%02x]\n", hbth->bl_aply_hour, lbth->bl_aply_hour);
        lane_log("테이블데이터 IMSI BL bl_aply_min[%.2s][%02x]\n", hbth->bl_aply_min, lbth->bl_aply_min);
#endif
        smemcpy(D_TO_A, H_TO_L, (char *)&hbth->bl_modf_year,  (char *)&lbth->bl_modf_year, 4, 0);
        smemcpy(D_TO_A, H_TO_L, (char *)&hbth->bl_modf_month, (char *)&lbth->bl_modf_month, 2, 0);
        smemcpy(D_TO_A, H_TO_L, (char *)&hbth->bl_modf_day,   (char *)&lbth->bl_modf_day, 2, 0);
        smemcpy(D_TO_A, H_TO_L, (char *)&hbth->bl_modf_hour,  (char *)&lbth->bl_modf_hour, 2, 0);
        smemcpy(D_TO_A, H_TO_L, (char *)&hbth->bl_modf_min,   (char *)&lbth->bl_modf_min, 2, 0);
#ifdef _VERIFY_
        lane_log("테이블데이터 IMSI BL bl_modf_year[%.4s][%02x%02x]\n", hbth->bl_modf_year,
                lbth->bl_modf_year[0], lbth->bl_modf_year[1]);
        lane_log("테이블데이터 IMSI BL bl_modf_month[%.2s][%02x]\n", hbth->bl_modf_month, lbth->bl_modf_month);
        lane_log("테이블데이터 IMSI BL bl_modf_day[%.2s][%02x]\n", hbth->bl_modf_day, lbth->bl_modf_day);
        lane_log("테이블데이터 IMSI BL bl_modf_hour[%.2s][%02x]\n", hbth->bl_modf_hour, lbth->bl_modf_hour);
        lane_log("테이블데이터 IMSI BL bl_modf_min[%.2s][%02x]\n", hbth->bl_modf_min, lbth->bl_modf_min);
#endif
        break;

    case 111: /* BL Frame */
        hbtf = (struct hi_imbl_tbl_f *)htd;
        lbtf = (struct imbl_tbl_f *)ltd;

        sscanf((const char *)hbtf->last_data_seq_no  , "%2hhx", &lbtf->last_data_seq_no[0]);
        sscanf((const char *)hbtf->last_data_seq_no+2, "%2hhx", &lbtf->last_data_seq_no[1]);
        sscanf((const char *)hbtf->last_data_seq_no+4, "%2hhx", &lbtf->last_data_seq_no[2]);
        sscanf((const char *)hbtf->last_data_seq_no+6, "%2hhx", &lbtf->last_data_seq_no[3]);

        //smemcpy(D_TO_A, H_TO_L, (char *)&hbtf->item_cnt, (char *)&lbtf->item_cnt, 4, 0);
		sscanf((const char *)hbtf->item_cnt, "%2hhx", &lbtf->item_cnt);
#ifdef _VERIFY_
        lane_log("테이블데이터 IMSI BL last_data_seq_no[%.8s][%02x%02x%02x%02x]\n", hbtf->last_data_seq_no,
				lbtf->last_data_seq_no[0], lbtf->last_data_seq_no[1], lbtf->last_data_seq_no[2], lbtf->last_data_seq_no[3]);
        lane_log("테이블데이터 IMSI BL item_cnt[%.2s][%02x]\n", hbtf->item_cnt, lbtf->item_cnt);
#endif
        for (i=0; i<111; i++)
        {
            smemcpy(D_TO_A, H_TO_L, (char *)&hbtf->bl_data[i].div ,  (char *)&lbtf->bl_data[i].div , 2, 0);
            smemcpy(D_TO_A, H_TO_L, (char *)&hbtf->bl_data[i].crd_no ,  (char *)&lbtf->bl_data[i].crd_no , 16, 0);
#ifdef _VERIFY_
            //lane_log("테이블데이터 IMSI BL div[%.2s][%02x]\n", hbtf->bl_data[i].div , lbtf->bl_data[i].div);
            //lane_log("테이블데이터 IMSI BL crd_no[%.16s][%02x%02x%02x%02x%02x%02x%02x%02x]\n", hbtf->bl_data[i].crd_no ,
            //        lbtf->bl_data[i].crd_no[0], lbtf->bl_data[i].crd_no[1], lbtf->bl_data[i].crd_no[2], lbtf->bl_data[i].crd_no[3],
            //        lbtf->bl_data[i].crd_no[4], lbtf->bl_data[i].crd_no[5], lbtf->bl_data[i].crd_no[6], lbtf->bl_data[i].crd_no[7]);
#endif
        }
#endif
        break;

    case 0xf0: /* 강제발생 ERROR */
    case 0xf1: /* "              */
        break;
    default:
        lane_log(" (ns_packet_chng.c) type ERROR [%x]\n", tbl_typ);
        return (-1);
    }
    return (0);
}

 /*
 *========================================================================
 *
 *   함 수 명 : ns_lane_stat()
 *   작 성 자 : JBY(baarong@neighbor21.co.kr)
 *   작 성 일 : 2018.08.24
 *   수 정 일 :
 *   설    명 : 차로상태정보(영업소 <- 차로)
 *
 *========================================================================
*/
static int ns_lane_stat(uchar *h_buf, uchar *l_buf)
{
    struct hi_lane_stat *hls;
    struct lane_stat    *lls;

    int    i = 0, j;
    char   tmp_mchi[8];
    char   tmp_mch[8];

    hls = (struct hi_lane_stat *)h_buf;
    lls = (struct lane_stat    *)l_buf;

    smemcpy(D_TO_A, L_TO_H, (char *)&hls->seq_no, (char *)&lls->seq_no, 8, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hls->kind,   (char *)&lls->kind, 2, 0);
#ifdef _VERIFY_
    lane_log("===========================================\n");
    lane_log("차로상태정보 seq_no[%.8s][%02x%02x%02x%02x]\n", hls->seq_no,
            lls->seq_no[0], lls->seq_no[1], lls->seq_no[2], lls->seq_no[3]);
    lane_log("차로상태정보 2[%.2s][%02x]\n", hls->kind, lls->kind);
#endif
#if 0
    for (i=0; i<2; i++)
    {
#endif
       for (j=0; j<8; j++)
       {
           //tmp_mchi[j] = (lls->mchi_stat[i] >> j) & 1;
		   tmp_mchi[j] = (lls->mchi_stat >> j) & 1;
           tmp_mch[7-j] = tmp_mchi[j]+'0';
           //tmp_mchi[j] += '0';
       }

       if(i == 0)
		   smemcpy(S_TO_S, L_TO_H, (char *)&hls->mchi_stat, (char *)&tmp_mch, sizeof(tmp_mch), 0);
           //memcpy(&hls->mchi_stat[0], &tmp_mch, sizeof(tmp_mch));
#if 0
       else
           memcpy(&hls->mchi_stat[8], &tmp_mch, sizeof(tmp_mch));
    }

    lane_log("차로상태정보 mchi_stat[%.16s][%02x%02x]\n", hls->mchi_stat,
            lls->mchi_stat[0], lls->mchi_stat[1]);
#endif

    for (i=0; i<20; i++)
    {
        smemcpy(D_TO_A, L_TO_H, (char *)&hls->tbl_stat[i].stat,   (char *)&lls->tbl_stat[i].stat, 2, 1);
        smemcpy(D_TO_A, L_TO_H, (char *)&hls->tbl_stat[i].rvs_no, (char *)&lls->tbl_stat[i].rvs_no, 2, 0);
#ifdef _VERIFY_
        lane_log("차로상태정보 stat-%d[%c][%02x]\n", i, hls->tbl_stat[i].stat, lls->tbl_stat[i].stat);
        lane_log("차로상태정보 rvs_no-%d[%.2s][%02x]\n", i, hls->tbl_stat[i].rvs_no, lls->tbl_stat[i].rvs_no);
#endif
    }

    smemcpy(D_TO_A, L_TO_H, (char *)&hls->bl_seq_no,   (char *)&lls->bl_seq_no, 8, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hls->bef_seq_no,  (char *)&lls->bef_seq_no, 8, 0);
/* 2019.06.15 신규 추가 */
    smemcpy(D_TO_A, L_TO_H, (char *)&hls->imm_carno_seq_no, (char *)&lls->imm_carno_seq_no, 8, 0);
	smemcpy(D_TO_A, L_TO_H, (char *)&hls->rfid_seq_no     , (char *)&lls->rfid_seq_no, 8, 0);
	smemcpy(D_TO_A, L_TO_H, (char *)&hls->red_carno_seq_no, (char *)&lls->red_carno_seq_no, 8, 0);

    smemcpy(D_TO_A, L_TO_H, (char *)&hls->anpr_cam,  (char *)&lls->anpr_cam, 2, 1);
	smemcpy(S_TO_S, L_TO_H, (char *)&hls->anpr_tempa, (char *)&lls->anpr_tempa, sizeof(lls->anpr_tempa), 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hls->anpr_door, (char *)&lls->anpr_door_sd, 1, 2);
    smemcpy(D_TO_A, L_TO_H, (char *)&hls->anpr_sd,   (char *)&lls->anpr_door_sd, 1, 1);

#ifdef _VERIFY_
    lane_log("차로상태정보 mchi_stat[%.8s][%02x]\n", hls->mchi_stat, lls->mchi_stat);
    lane_log("차로상태정보 bl_seq_no[%.8s][%02x%02x%02x%02x]\n", hls->bl_seq_no,
            lls->bl_seq_no[0], lls->bl_seq_no[1], lls->bl_seq_no[2], lls->bl_seq_no[3]);
    lane_log("차로상태정보 bef_seq_no[%.8s][%02x%02x%02x%02x]\n", hls->bef_seq_no,
            lls->bef_seq_no[0], lls->bef_seq_no[1], lls->bef_seq_no[2], lls->bef_seq_no[3]);
/* 2019.06.15 신규 추가 */
    lane_log("NEW 차로상태정보 imm_carno_seq_no[%.8s][%02x%02x%02x%02x]\n", hls->imm_carno_seq_no,
            lls->imm_carno_seq_no[0], lls->imm_carno_seq_no[1], lls->imm_carno_seq_no[2], lls->imm_carno_seq_no[3]);
    lane_log("NEW 차로상태정보 rfid_seq_no[%.8s][%02x%02x%02x%02x]\n", hls->rfid_seq_no,
            lls->rfid_seq_no[0], lls->rfid_seq_no[1], lls->rfid_seq_no[2], lls->rfid_seq_no[3]);
    lane_log("NEW 차로상태정보 red_carno_seq_no[%.8s][%02x%02x%02x%02x]\n", hls->red_carno_seq_no,
            lls->red_carno_seq_no[0], lls->red_carno_seq_no[1], lls->red_carno_seq_no[2], lls->red_carno_seq_no[3]);
    lane_log("차로상태정보 anpr_cam[%c][%02x]\n", hls->anpr_cam, lls->anpr_cam);
    lane_log("차로상태정보 anpr_tempa[%.4s][%.4s]\n", hls->anpr_tempa, lls->anpr_tempa);
    lane_log("차로상태정보 anpr_door_sd[%c][%c][%02x]\n", hls->anpr_door, hls->anpr_sd, lls->anpr_door_sd);
#endif
    return (0);
}

 /*
 *========================================================================
 *
 *   함 수 명 : ns_rpr_data()
 *   작 성 자 : JBY(baarong@neighbor21.co.kr)
 *   작 성 일 : 2018.08.24
 *   수 정 일 :
 *   설    명 : 보수정보(영업소 <- 차로)
 *
 *========================================================================
*/
static int ns_rpr_data(uchar *h_buf, uchar *l_buf)
{
    struct    hi_rpr_data *hrd;
    struct    rpr_data    *lrd;
    
    hrd = (struct hi_rpr_data *)h_buf;
    lrd = (struct rpr_data    *)l_buf;
    
    smemcpy(D_TO_A, L_TO_H, (char *)&hrd->seq_no,      (char *)&lrd->seq_no, 8, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hrd->kind,        (char *)&lrd->kind, 2, 0);
/* 2019.06.13 신규 추가 */
	smemcpy(D_TO_A, L_TO_H, (char *)&hrd->wrk_no,      (char *)&lrd->wrk_no, 4, 0);

    smemcpy(D_TO_A, L_TO_H, (char *)&hrd->year,        (char *)&lrd->year, 4, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hrd->month,       (char *)&lrd->month, 2, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hrd->day,         (char *)&lrd->day, 2, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hrd->hour,        (char *)&lrd->hour, 2, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hrd->min,         (char *)&lrd->min, 2, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hrd->sec,         (char *)&lrd->sec, 2, 0);
/* 2019.06.13 신규 추가 */
	smemcpy(D_TO_A, L_TO_H, (char *)&hrd->lane_no,     (char *)&lrd->lane_no, 2, 0);

    smemcpy(D_TO_A, L_TO_H, (char *)&hrd->terminal_no, (char *)&lrd->terminal_no, 10, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hrd->wrk_stat,    (char *)&lrd->wrk_stat, 2, 1);
    smemcpy(D_TO_A, L_TO_H, (char *)&hrd->mchi_kind,   (char *)&lrd->mchi_kind, 2, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hrd->occ_rest,    (char *)&lrd->occ_rest, 2, 1);
    smemcpy(D_TO_A, L_TO_H, (char *)&hrd->err_code,    (char *)&lrd->err_code, 2, 0);

    smemcpy(D_TO_A, L_TO_H, (char *)&hrd->anpr_cam,  (char *)&lrd->anpr_cam, 2, 1);
	smemcpy(S_TO_S, L_TO_H, (char *)&hrd->anpr_tempa, (char *)&lrd->anpr_tempa, sizeof(lrd->anpr_tempa), 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hrd->anpr_door, (char *)&lrd->anpr_door_sd, 1, 2);
    smemcpy(D_TO_A, L_TO_H, (char *)&hrd->anpr_sd,   (char *)&lrd->anpr_door_sd, 1, 1);
#ifdef _VERIFY_
    lane_log("보수정보 seq_no[%.8s][%02x%02x%02x%02x]\n", hrd->seq_no,
              lrd->seq_no[0], lrd->seq_no[1], lrd->seq_no[2], lrd->seq_no[3]);
    lane_log("보수정보 kind[%.2s][%02x]\n", hrd->kind,  lrd->kind);
	lane_log("NEW 보수정보 wrk_no[%.4s][%02x%02x]\n", hrd->wrk_no,  lrd->wrk_no[0], lrd->wrk_no[1]);
    lane_log("보수정보 year[%.4s][%02x%02x]\n", hrd->year,  lrd->year[0], lrd->year[1]);
    lane_log("보수정보 month[%.2s][%02x]\n", hrd->month, lrd->month);
    lane_log("보수정보 day[%.2s][%02x]\n", hrd->day,   lrd->day);
    lane_log("보수정보 hour[%.2s][%02x]\n", hrd->hour,  lrd->hour);
    lane_log("보수정보 min[%.2s][%02x]\n", hrd->min,   lrd->min);
    lane_log("보수정보 sec[%.2s][%02x]\n", hrd->sec,   lrd->sec);
	lane_log("NEW 보수정보 lane_no[%.2s][%02x]\n", hrd->lane_no, lrd->lane_no);
    lane_log("보수정보 terminal_no[%.4s][%02x%02x]\n", hrd->terminal_no,
            lrd->terminal_no[0], lrd->terminal_no[1]);
    lane_log("보수정보 wrk_stat[%c][%x]\n",    hrd->wrk_stat,    lrd->wrk_stat);
    lane_log("보수정보 mchi_kind[%.2s][%02x]\n",  hrd->mchi_kind,   lrd->mchi_kind);
    lane_log("보수정보 occ_rest[%c][%x]\n",    hrd->occ_rest,    lrd->occ_rest);
    lane_log("보수정보 err_code[%.2s][%02x]\n",  hrd->err_code,   lrd->err_code);
    lane_log("보수정보 anpr_cam[%c][%02x]\n", hrd->anpr_cam, lrd->anpr_cam);
    lane_log("보수정보 anpr_tempa[%.4s][%.4s]\n", hrd->anpr_tempa, lrd->anpr_tempa);
    lane_log("보수정보 anpr_door_sd[%c][%c][%02x]\n", hrd->anpr_door, hrd->anpr_sd, lrd->anpr_door_sd);
#endif
    return (0);
}

 /*
 *========================================================================
 *
 *   함 수 명 : ns_close_pass()
 *   작 성 자 : JBY (baarong@neighbor21.co.kr)
 *   작 성 일 : 2019.05.02
 *   수 정 일 :
 *   설    명 : 야간계수 통행 DATA (영업소 <- 차로)
 *
 *========================================================================
*/
static int ns_close_pass(uchar *h_buf, uchar *l_buf)
{
    struct    hi_close_pass *hclp;
    struct    close_pass    *lclp;
    
    hclp = (struct hi_close_pass *)h_buf;
    lclp = (struct close_pass    *)l_buf;

    smemcpy(D_TO_A, L_TO_H, (char *)&hclp->seq_no,    (char *)&lclp->seq_no, 8, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hclp->kind,      (char *)&lclp->kind, 2, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hclp->wrk_date,  (char *)&lclp->wrk_date, 8, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hclp->lane_no,   (char *)&lclp->lane_no, 2, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hclp->serial_no, (char *)&lclp->serial_no, 6, 0);
    
    smemcpy(D_TO_A, L_TO_H, (char *)&hclp->year,  (char *)&lclp->year, 4, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hclp->month, (char *)&lclp->month, 2, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hclp->day,   (char *)&lclp->day, 2, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hclp->hour,  (char *)&lclp->hour, 2, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hclp->min,   (char *)&lclp->min, 2, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hclp->sec,   (char *)&lclp->sec, 2, 0);

    smemcpy(D_TO_A, L_TO_H, (char *)&hclp->io_div,   (char *)&lclp->io_div, 2, 1);
    smemcpy(D_TO_A, L_TO_H, (char *)&hclp->plz_id,   (char *)&lclp->plz_id, 2, 0);

    smemcpy(D_TO_A, L_TO_H, (char *)&hclp->car_kind, (char *)&lclp->carkind_imageyn, 1, 2);
    smemcpy(D_TO_A, L_TO_H, (char *)&hclp->image_yn, (char *)&lclp->carkind_imageyn, 1, 1);

    smemcpy(S_TO_S, L_TO_H, (char *)&hclp->car_no, (char *)&lclp->car_no, sizeof(lclp->car_no), 0);

    smemcpy(D_TO_A, L_TO_H, (char *)&hclp->x_point,   (char *)&lclp->x_point, 4, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hclp->y_point,   (char *)&lclp->y_point, 4, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hclp->img_width, (char *)&lclp->img_width, 4, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hclp->img_heigh, (char *)&lclp->img_heigh, 4, 0);
#ifdef _VERIFY_
    lane_log("야간계수 seq_no[%.8s][%02x%02x%02x%02x]\n", hclp->seq_no,
            lclp->seq_no[0], lclp->seq_no[1], lclp->seq_no[2], lclp->seq_no[3]);
    lane_log("야간계수 kind[%.2s][%02x]\n", hclp->kind, lclp->kind);
    lane_log("야간계수 wrk_date[%.8s][%02x%02x%02x%02x]\n", hclp->wrk_date,
            lclp->wrk_date[0], lclp->wrk_date[1], lclp->wrk_date[2], lclp->wrk_date[3]);
    lane_log("야간계수 lane_no[%.2s][%02x]\n", hclp->lane_no, lclp->lane_no);
    lane_log("야간계수 serial_no[%.6s][%02x%02x%02x]\n", hclp->serial_no,
            lclp->serial_no[0], lclp->serial_no[1], lclp->serial_no[2]);
    lane_log("야간계수 year[%.4s][%02x%02x]\n", hclp->year,
            lclp->year[0], lclp->year[1]);
    lane_log("야간계수 month[%.2s][%02x]\n", hclp->month, lclp->month);
    lane_log("야간계수 day[%.2s][%02x]\n", hclp->day, lclp->day);
    lane_log("야간계수 hour[%.2s][%02x]\n", hclp->hour, lclp->hour);
    lane_log("야간계수 min[%.2s][%02x]\n", hclp->min, lclp->min);
    lane_log("야간계수 sec[%.2s][%02x]\n", hclp->sec, lclp->sec);
    lane_log("야간계수 io_div[%c][%02x]\n", hclp->io_div, lclp->io_div);
    lane_log("야간계수 plz_id[%.2s][%02x]\n", hclp->plz_id, lclp->plz_id);
    lane_log("야간계수 carkind_imageyn[%c][%c][%02x]\n", hclp->car_kind, hclp->image_yn, lclp->carkind_imageyn);
    lane_log("야간계수 car_no[%.14s][%.14s]\n", hclp->car_no, lclp->car_no);
    lane_log("야간계수 x_point[%.4s][%02x%02x]\n", hclp->x_point,
            lclp->x_point[0], lclp->x_point[1]);
    lane_log("야간계수 y_point[%.4s][%02x%02x]\n", hclp->y_point,
            lclp->y_point[0], lclp->y_point[1]);
    lane_log("야간계수 img_width[%.4s][%02x%02x]\n", hclp->img_width,
            lclp->img_width[0], lclp->img_width[1]);
    lane_log("야간계수 img_heigh[%.4s][%02x%02x]\n", hclp->img_heigh,
            lclp->img_heigh[0], lclp->img_heigh[1]);
#endif
    return (0);
}

 /*
 *========================================================================
 *
 *   함 수 명 : ns_wrk_start()
 *   작 성 자 : JBY(baarong@neighbor21.co.kr)
 *   작 성 일 : 2018.08.24
 *   수 정 일 :
 *   설    명 : 근무개시보고(영업소 <- 차로)
 *
 *========================================================================
*/
static int ns_wrk_start(uchar *h_buf, uchar *l_buf)
{
    struct    hi_wrk_start *hws;
    struct    wrk_start    *lws;
    char      tmp[10]; memset(tmp, 0x00, sizeof(tmp));

    hws = (struct hi_wrk_start *)h_buf;
    lws = (struct wrk_start    *)l_buf;

    smemcpy(D_TO_A, L_TO_H, (char *)&hws->seq_no, (char *)&lws->seq_no, 8, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hws->kind,   (char *)&lws->kind, 2, 0);
    
    smemcpy(D_TO_A, L_TO_H, (char *)&hws->wrk_year,  (char *)&lws->wrk_year, 4, 0);
	smemcpy(D_TO_A, L_TO_H, (char *)&hws->wrk_month, (char *)&lws->wrk_month, 2, 0);
	smemcpy(D_TO_A, L_TO_H, (char *)&hws->wrk_day,   (char *)&lws->wrk_day, 2, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hws->wrk_no,    (char *)&lws->wrk_no, 4, 0);
    
    smemcpy(D_TO_A, L_TO_H, (char *)&hws->wrk_start_year,  (char *)&lws->wrk_start_year, 4, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hws->wrk_start_month, (char *)&lws->wrk_start_month, 2, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hws->wrk_start_day,   (char *)&lws->wrk_start_day, 2, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hws->wrk_start_hour,  (char *)&lws->wrk_start_hour, 2, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hws->wrk_start_min,   (char *)&lws->wrk_start_min, 2, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hws->wrk_start_sec,   (char *)&lws->wrk_start_sec, 2, 0);
    
    smemcpy(D_TO_A, L_TO_H, (char *)&hws->io_div,   (char *)&lws->io_div, 2, 1);
    smemcpy(D_TO_A, L_TO_H, (char *)&hws->week_no, (char *)&lws->week_holi_yn, 1, 2);
    smemcpy(D_TO_A, L_TO_H, (char *)&hws->holi_yn,  (char *)&lws->week_holi_yn, 1, 1);
	smemcpy(D_TO_A, L_TO_H, (char *)&hws->wrkr_no,  (char *)&lws->wrkr_no, 4, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hws->plz_id,   (char *)&lws->plz_id, 2, 0);
#ifdef _VERIFY_
    lane_log("근무개시 seq_no[%.8s][%02x%02x%02x%02x]\n", hws->seq_no,
            lws->seq_no[0], lws->seq_no[1], lws->seq_no[2], lws->seq_no[3]);
    lane_log("근무개시 kind[%.2s][%02x]\n", hws->kind, lws->kind);
    lane_log("근무개시 wrk_date[%.4s%.2s%.2s][%02x%02x%02x%02x]\n", hws->wrk_year, hws->wrk_month, hws->wrk_day,
            lws->wrk_year[0], lws->wrk_year[1], lws->wrk_month, lws->wrk_day);
    lane_log("근무개시 wrk_no[%.4s][%02x%02x]\n", hws->wrk_no, lws->wrk_no[0], lws->wrk_no[1]);

    lane_log("근무개시 wrk_start_year[%.4s][%02x%02x]\n", hws->wrk_start_year,
            lws->wrk_start_year[0], lws->wrk_start_year[1]);
    lane_log("근무개시 wrk_start_month[%.2s][%02x]\n", hws->wrk_start_month, lws->wrk_start_month);
    lane_log("근무개시 wrk_start_day[%.2s][%02x]\n", hws->wrk_start_day, lws->wrk_start_day);
    lane_log("근무개시 wrk_start_hour[%.2s][%02x]\n", hws->wrk_start_hour, lws->wrk_start_hour);
    lane_log("근무개시 wrk_start_min[%.2s][%02x]\n", hws->wrk_start_min, lws->wrk_start_min);
    lane_log("근무개시 wrk_start_sec[%.2s][%02x]\n", hws->wrk_start_sec, lws->wrk_start_sec);

    lane_log("근무개시 io_div[%c][%02x]\n", hws->io_div, lws->io_div);
    lane_log("근무개시 week_holi_yn[%c][%c][%02x]\n", hws->week_no, hws->holi_yn, lws->week_holi_yn);
	lane_log("근무개시 wrkr_no[%.4s][%02x%02x%02x]\n", hws->wrkr_no
	        , lws->wrkr_no[0], lws->wrkr_no[1], lws->wrkr_no[2]);
    lane_log("근무개시 plz_id[%.2s][%02x]\n", hws->plz_id, lws->plz_id);
#endif
    return (0);
}

 /*
 *========================================================================
 *
 *   함 수 명 : ns_hnd_data()
 *   작 성 자 : JBY (baarong@neighbor21.co.kr)
 *   작 성 일 : 2019.05.02
 *   수 정 일 :
 *   설    명 : 처리 DATA(영업소 <- 차로)
 *
 *========================================================================
*/
static int ns_hnd_data(uchar *h_buf, uchar *l_buf)
{
    struct    hi_hnd_data *hhd;
    struct    hnd_data    *lhd;
	char tmp[8];

    hhd = (struct hi_hnd_data *)h_buf;
    lhd = (struct hnd_data    *)l_buf;

    smemcpy(D_TO_A, L_TO_H, (char *)&hhd->seq_no,         (char *)&lhd->seq_no, 8, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hhd->kind,           (char *)&lhd->kind, 2, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hhd->wrk_date,       (char *)&lhd->wrk_date, 8, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hhd->wrk_no,         (char *)&lhd->wrk_no, 4, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hhd->wrkr_no,        (char *)&lhd->wrkr_no, 4, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hhd->serial_no,      (char *)&lhd->serial_no, 6, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hhd->io_div,         (char *)&lhd->io_div, 2, 1);
    smemcpy(D_TO_A, L_TO_H, (char *)&hhd->plz_id,         (char *)&lhd->plz_id, 2, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hhd->lane_no,        (char *)&lhd->lane_no, 2, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hhd->car_kind,       (char *)&lhd->car_kind, 2, 1);
    smemcpy(D_TO_A, L_TO_H, (char *)&hhd->sence_seq_no,   (char *)&lhd->sence_seq_no, 6, 0);
#if 1
    /* 2019.07.26 감지시간 추가 */
    smemcpy(D_TO_A, L_TO_H, (char *)&hhd->sence_time, (char *)&lhd->sence_time, 6, 0);
#endif
#ifdef _VERIFY_
    lane_log("처리 seq_no[%.8s][%02X%02X%02X%02X]\n", hhd->seq_no,
            lhd->seq_no[0], lhd->seq_no[1], lhd->seq_no[2], lhd->seq_no[3]);
    lane_log("처리 kind[%.2s][%02x]\n", hhd->kind, lhd->kind);
    lane_log("처리 wrk_date[%.8s][%02x%02x%02x%02x]\n", hhd->wrk_date,
            lhd->wrk_date[0], lhd->wrk_date[1], lhd->wrk_date[2], lhd->wrk_date[3]);
    lane_log("처리 wrk_no[%.4s][%02x%02x]\n", hhd->wrk_no,
            lhd->wrk_no[0], lhd->wrk_no[1]);
    lane_log("처리 wrkr_no[%.4s][%02x%02x%02x]\n", hhd->wrkr_no,
            lhd->wrkr_no[0], lhd->wrkr_no[1], lhd->wrkr_no[2]);
    lane_log("처리 serial_no[%.6s][%02x%02x%02x]\n", hhd->serial_no,
            lhd->serial_no[0], lhd->serial_no[1], lhd->serial_no[2]);
    lane_log("처리 io_div[%c][%02x]\n", hhd->io_div, lhd->io_div);
    lane_log("처리 plz_id[%.2s][%02x]\n", hhd->plz_id, lhd->plz_id);
    lane_log("처리 lane_no[%.2s][%02x]\n", hhd->lane_no, lhd->lane_no);
    lane_log("처리 car_kind[%c][%02x]\n", hhd->car_kind, lhd->car_kind);
    lane_log("처리 sence_seq_no[%.6s][%02x%02x%02x]\n", hhd->sence_seq_no,
            lhd->sence_seq_no[0], lhd->sence_seq_no[1], lhd->sence_seq_no[2]);
#if 1
    lane_log("처리 sence_time[%.6s][%02x%02x%02x]\n", hhd->sence_time,
            lhd->sence_time[0], lhd->sence_time[1], lhd->sence_time[2]);
#endif
#endif
    smemcpy(D_TO_A, L_TO_H, (char *)&hhd->hnd_info.hnd_year,      (char *)&lhd->hnd_info.hnd_year, 4, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hhd->hnd_info.hnd_month,     (char *)&lhd->hnd_info.hnd_month, 2, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hhd->hnd_info.hnd_day,       (char *)&lhd->hnd_info.hnd_day, 2, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hhd->hnd_info.hnd_hour,      (char *)&lhd->hnd_info.hnd_hour, 2, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hhd->hnd_info.hnd_min,       (char *)&lhd->hnd_info.hnd_min, 2, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hhd->hnd_info.hnd_sec,       (char *)&lhd->hnd_info.hnd_sec, 2, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hhd->hnd_info.org_pass_fare, (char *)&lhd->hnd_info.org_pass_fare, 6, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hhd->hnd_info.pass_fare,     (char *)&lhd->hnd_info.pass_fare, 6, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hhd->hnd_info.rcpt_money,    (char *)&lhd->hnd_info.rcpt_money, 6, 0);
//printf("proc 1\n");
    smemcpy(D_TO_A, L_TO_H, (char *)&hhd->hnd_info.refund_yn,     (char *)&lhd->hnd_info.refund_key_yn, 1, 2);
//printf("proc 2\n");
    smemcpy(D_TO_A, L_TO_H, (char *)&hhd->hnd_info.key_yn,        (char *)&lhd->hnd_info.refund_key_yn, 1, 1);
//printf("proc 3\n");
    smemcpy(D_TO_A, L_TO_H, (char *)&hhd->hnd_info.rcpt_hnd,      (char *)&lhd->hnd_info.rcpt_hnd, 2, 0);
//printf("proc 4\n");
/* 2019.06.13 변경 */
    smemcpy(D_TO_A, L_TO_H, (char *)&tmp, (char *)&lhd->hnd_info.issue_code, 8, 0);
//printf("proc 5\n");
	hhd->hnd_info.red_div=tmp[0];
//printf("proc 6\n");
	sprintf((char *)hhd->hnd_info.issue_code, "%.7s", tmp+1);
//printf("proc 7\n");
    smemcpy(D_TO_A, L_TO_H, (char *)&hhd->hnd_info.crd_no,        (char *)&lhd->hnd_info.crd_no, 20, 0);
//printf("proc 8\n");
    smemcpy(D_TO_A, L_TO_H, (char *)&hhd->hnd_info.rcpt_div,      (char *)&lhd->hnd_info.rcpt_div, 2, 0);
//printf("proc 9\n");
#ifdef _VERIFY_
    lane_log("처리 hnd_year[%.4s][%02x%02x]\n", hhd->hnd_info.hnd_year,
            lhd->hnd_info.hnd_year[0], lhd->hnd_info.hnd_year[1]);
    lane_log("처리 hnd_month[%.2s][%02x]\n", hhd->hnd_info.hnd_month, lhd->hnd_info.hnd_month);
    lane_log("처리 hnd_day[%.2s][%02x]\n", hhd->hnd_info.hnd_day, lhd->hnd_info.hnd_day);
    lane_log("처리 hnd_hour[%.2s][%02x]\n", hhd->hnd_info.hnd_hour, lhd->hnd_info.hnd_hour);
    lane_log("처리 hnd_min[%.2s][%02x]\n", hhd->hnd_info.hnd_min, lhd->hnd_info.hnd_min);
    lane_log("처리 hnd_sec[%.2s][%02x]\n", hhd->hnd_info.hnd_sec, lhd->hnd_info.hnd_sec);
    lane_log("처리 org_pass_fare[%.6s][%02x%02x%02x]\n", hhd->hnd_info.org_pass_fare,
            lhd->hnd_info.org_pass_fare[0], lhd->hnd_info.org_pass_fare[1], lhd->hnd_info.org_pass_fare[2]);
    lane_log("처리 pass_fare[%.6s][%02x%02x%02x]\n", hhd->hnd_info.pass_fare,
            lhd->hnd_info.pass_fare[0], lhd->hnd_info.pass_fare[1], lhd->hnd_info.pass_fare[2]);
    lane_log("처리 rcpt_money[%.6s]%02x%02x%02x]\n", hhd->hnd_info.rcpt_money,
            lhd->hnd_info.rcpt_money[0], lhd->hnd_info.rcpt_money[1], lhd->hnd_info.rcpt_money[2]);
    lane_log("처리 refund_key_yn[%c][%c][%02x]\n", hhd->hnd_info.refund_yn, hhd->hnd_info.key_yn, lhd->hnd_info.refund_key_yn);

    lane_log("처리 rcpt_hnd[%.2s][%02x]\n", hhd->hnd_info.rcpt_hnd, lhd->hnd_info.rcpt_hnd);
    lane_log("MODF 처리 issue_code[%c][%.7s][%02x%02x%02x%02x]\n", hhd->hnd_info.red_div, hhd->hnd_info.issue_code,
            lhd->hnd_info.issue_code[0], lhd->hnd_info.issue_code[1],
            lhd->hnd_info.issue_code[2], lhd->hnd_info.issue_code[3]);
    lane_log("처리 crd_no[%.20s][%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x]\n", hhd->hnd_info.crd_no,
            lhd->hnd_info.crd_no[0], lhd->hnd_info.crd_no[1], lhd->hnd_info.crd_no[2], lhd->hnd_info.crd_no[3],
            lhd->hnd_info.crd_no[4], lhd->hnd_info.crd_no[5], lhd->hnd_info.crd_no[6], lhd->hnd_info.crd_no[7],
            lhd->hnd_info.crd_no[8], lhd->hnd_info.crd_no[9]);
    lane_log("처리 rcpt_div[%.2s][%02x]\n", hhd->hnd_info.rcpt_div, lhd->hnd_info.rcpt_div);
#endif
    smemcpy(D_TO_A, L_TO_H, (char *)&hhd->pre_yn,            (char *)&lhd->img_yn, 1, 2);
	smemcpy(D_TO_A, L_TO_H, (char *)&hhd->img_yn,            (char *)&lhd->img_yn, 1, 1);
	smemcpy(S_TO_S, L_TO_H, (char *)&hhd->car_no1, (char *)&lhd->car_no1, sizeof(lhd->car_no1), 0);
	smemcpy(S_TO_S, L_TO_H, (char *)&hhd->car_no2, (char *)&lhd->car_no2, sizeof(lhd->car_no2), 0);
    //sprintf((char *)hhd->car_no1, "%-14s", lhd->car_no1);
	//sprintf((char *)hhd->car_no2, "%-14s", lhd->car_no2);
    smemcpy(D_TO_A, L_TO_H, (char *)&hhd->x_point,   (char *)&lhd->x_point, 4, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hhd->y_point,   (char *)&lhd->y_point, 4, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hhd->img_width, (char *)&lhd->img_width, 4, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hhd->img_heigh, (char *)&lhd->img_heigh, 4, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hhd->dc_typ,    (char *)&lhd->dc_typ, 2, 0);
#if 1
    smemcpy(D_TO_A, L_TO_H, (char *)&hhd->tag_id1,   (char *)&lhd->tag_id1, 24, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hhd->tag_id2,   (char *)&lhd->tag_id2, 24, 0);
#else
    sscanf((const char *)hhd->tag_id1   , "%2hhx", &lhd->tag_id1[0]);
    sscanf((const char *)hhd->tag_id1+2 , "%2hhx", &lhd->tag_id1[1]);
    sscanf((const char *)hhd->tag_id1+4 , "%2hhx", &lhd->tag_id1[2]);
    sscanf((const char *)hhd->tag_id1+6 , "%2hhx", &lhd->tag_id1[3]);
    sscanf((const char *)hhd->tag_id1+8 , "%2hhx", &lhd->tag_id1[4]);
    sscanf((const char *)hhd->tag_id1+10, "%2hhx", &lhd->tag_id1[5]);
    sscanf((const char *)hhd->tag_id1+12, "%2hhx", &lhd->tag_id1[6]);
    sscanf((const char *)hhd->tag_id1+14, "%2hhx", &lhd->tag_id1[7]);
    sscanf((const char *)hhd->tag_id1+16, "%2hhx", &lhd->tag_id1[8]);
    sscanf((const char *)hhd->tag_id1+18, "%2hhx", &lhd->tag_id1[9]);
    sscanf((const char *)hhd->tag_id1+20, "%2hhx", &lhd->tag_id1[10]);
    sscanf((const char *)hhd->tag_id1+22, "%2hhx", &lhd->tag_id1[11]);

    sscanf((const char *)hhd->tag_id2   , "%2hhx", &lhd->tag_id2[0]);
    sscanf((const char *)hhd->tag_id2+2 , "%2hhx", &lhd->tag_id2[1]);
    sscanf((const char *)hhd->tag_id2+4 , "%2hhx", &lhd->tag_id2[2]);
    sscanf((const char *)hhd->tag_id2+6 , "%2hhx", &lhd->tag_id2[3]);
    sscanf((const char *)hhd->tag_id2+8 , "%2hhx", &lhd->tag_id2[4]);
    sscanf((const char *)hhd->tag_id2+10, "%2hhx", &lhd->tag_id2[5]);
    sscanf((const char *)hhd->tag_id2+12, "%2hhx", &lhd->tag_id2[6]);
    sscanf((const char *)hhd->tag_id2+14, "%2hhx", &lhd->tag_id2[7]);
    sscanf((const char *)hhd->tag_id2+16, "%2hhx", &lhd->tag_id2[8]);
    sscanf((const char *)hhd->tag_id2+18, "%2hhx", &lhd->tag_id2[9]);
    sscanf((const char *)hhd->tag_id2+20, "%2hhx", &lhd->tag_id2[10]);
    sscanf((const char *)hhd->tag_id2+22, "%2hhx", &lhd->tag_id2[11]);
#endif
#ifdef _VERIFY_

    lane_log("처리 img_yn[%c][%x]\n", hhd->img_yn, lhd->img_yn);
    lane_log("처리 car_no1[%.14s][%.14s]\n", hhd->car_no1, lhd->car_no1);
    lane_log("처리 car_no2[%.14s][%.14s]\n", hhd->car_no2, lhd->car_no2);
    lane_log("처리 x_point[%.4s][%02x%02x]\n", hhd->x_point, lhd->x_point[0], lhd->x_point[1]);
    lane_log("처리 y_point[%.4s][%02x%02x]\n", hhd->y_point, lhd->y_point[0], lhd->y_point[1]);
    lane_log("처리 img_width[%.4s][%02x%02x]\n", hhd->img_width, lhd->img_width[0], lhd->img_width[1]);
    lane_log("처리 img_heigh[%.4s][%02x%02x]\n", hhd->img_heigh, lhd->img_heigh[0], lhd->img_heigh[1]);
    lane_log("처리 dc_typ[%.2s][%02x]\n", hhd->dc_typ, lhd->dc_typ);
    lane_log("처리 tag_id1[%.24s][%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x]\n", hhd->tag_id1,
            lhd->tag_id1[0], lhd->tag_id1[1], lhd->tag_id1[2], lhd->tag_id1[3],
            lhd->tag_id1[4], lhd->tag_id1[5], lhd->tag_id1[6], lhd->tag_id1[7],
            lhd->tag_id1[8], lhd->tag_id1[9], lhd->tag_id1[10], lhd->tag_id1[11]);
    lane_log("처리 tag_id2[%.24s][%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x]\n", hhd->tag_id2,
            lhd->tag_id2[0], lhd->tag_id2[1], lhd->tag_id2[2], lhd->tag_id2[3],
            lhd->tag_id2[4], lhd->tag_id2[5], lhd->tag_id2[6], lhd->tag_id2[7],
            lhd->tag_id2[8], lhd->tag_id2[9], lhd->tag_id2[10], lhd->tag_id2[11]);
#endif
    return (0);
}

 /*
 *========================================================================
 *
 *   함 수 명 : ns_crd_hnd_data()
 *   작 성 자 : JBY (baarong@neighbor21.co.kr)
 *   작 성 일 : 2019.05.02
 *   수 정 일 :
 *   설    명 : 카드처리 DATA(영업소 <- 차로)
 *
 *========================================================================
*/
static int ns_crd_hnd_data(uchar *h_buf, uchar *l_buf)
{
    struct    hi_crd_hnd_data *hchd;
    struct    crd_hnd_data    *lchd;
	char tmp[8];

    hchd = (struct hi_crd_hnd_data *)h_buf;
    lchd = (struct crd_hnd_data    *)l_buf;

    smemcpy(D_TO_A, L_TO_H, (char *)&hchd->seq_no,         (char *)&lchd->seq_no, 8, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hchd->kind,           (char *)&lchd->kind, 2, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hchd->wrk_date,       (char *)&lchd->wrk_date, 8, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hchd->wrk_no,         (char *)&lchd->wrk_no, 4, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hchd->wrkr_no,        (char *)&lchd->wrkr_no, 4, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hchd->serial_no,      (char *)&lchd->serial_no, 6, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hchd->io_div,         (char *)&lchd->io_div, 2, 1);
    smemcpy(D_TO_A, L_TO_H, (char *)&hchd->plz_id,         (char *)&lchd->plz_id, 2, 0);
#ifdef _VERIFY_
    lane_log("카드처리 seq_no[%.8s][%02X%02X%02X%02X]\n", hchd->seq_no,
            lchd->seq_no[0], lchd->seq_no[1], lchd->seq_no[2], lchd->seq_no[3]);
    lane_log("카드처리 kind[%.2s][%02x]\n", hchd->kind, lchd->kind);
    lane_log("카드처리 wrk_date[%.8s][%02x%02x%02x%02x]\n", hchd->wrk_date,
            lchd->wrk_date[0], lchd->wrk_date[1], lchd->wrk_date[2], lchd->wrk_date[3]);
    lane_log("카드처리 wrk_no[%.4s][%02x%02x]\n", hchd->wrk_no,
            lchd->wrk_no[0], lchd->wrk_no[1]);
    lane_log("카드처리 wrkr_no[%.4s][%02x%02x%02x]\n", hchd->wrkr_no,
            lchd->wrkr_no[0], lchd->wrkr_no[1], lchd->wrkr_no[2]);
    lane_log("카드처리 serial_no[%.8s][%02x%02x%02x]\n", hchd->serial_no,
            lchd->serial_no[0], lchd->serial_no[1], lchd->serial_no[2]);
    lane_log("카드처리 io_div[%c][%02x]\n", hchd->io_div, lchd->io_div);
    lane_log("카드처리 plz_id[%.2s][%02x]\n", hchd->plz_id, lchd->plz_id);
#endif
    smemcpy(D_TO_A, L_TO_H, (char *)&hchd->hnd_year,      (char *)&lchd->hnd_year, 4, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hchd->hnd_month,     (char *)&lchd->hnd_month, 2, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hchd->hnd_day,       (char *)&lchd->hnd_day, 2, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hchd->hnd_hour,      (char *)&lchd->hnd_hour, 2, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hchd->hnd_min,       (char *)&lchd->hnd_min, 2, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hchd->hnd_sec,       (char *)&lchd->hnd_sec, 2, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hchd->pass_fare,     (char *)&lchd->pass_fare, 6, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hchd->rcpt_money,    (char *)&lchd->rcpt_money, 6, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hchd->bef_rcpt_balc, (char *)&lchd->bef_rcpt_balc, 8, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hchd->aft_rcpt_balc, (char *)&lchd->aft_rcpt_balc, 8, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hchd->rcpt_div,      (char *)&lchd->rcpt_div, 2, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hchd->crd_kind,      (char *)&lchd->crd_kind, 2, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hchd->pre_div,       (char *)&lchd->pre_car_kind, 1, 2);
    smemcpy(D_TO_A, L_TO_H, (char *)&hchd->car_kind,      (char *)&lchd->pre_car_kind, 1, 1);
    smemcpy(D_TO_A, L_TO_H, (char *)&hchd->crd_no,        (char *)&lchd->crd_no, 20, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hchd->pay_div,       (char *)&lchd->pay_div, 2, 0);
#ifdef _VERIFY_
    lane_log("카드처리 hnd_year[%.4s][%02x%02x]\n", hchd->hnd_year,
            lchd->hnd_year[0], lchd->hnd_year[1]);
    lane_log("카드처리 hnd_month[%.2s][%02x]\n", hchd->hnd_month, lchd->hnd_month);
    lane_log("카드처리 hnd_day[%.2s][%02x]\n", hchd->hnd_day, lchd->hnd_day);
    lane_log("카드처리 hnd_hour[%.2s][%02x]\n", hchd->hnd_hour, lchd->hnd_hour);
    lane_log("카드처리 hnd_min[%.2s][%02x]\n", hchd->hnd_min, lchd->hnd_min);
    lane_log("카드처리 hnd_sec[%.2s][%02x]\n", hchd->hnd_sec, lchd->hnd_sec);
    lane_log("카드처리 pass_fare[%.6s][%02x%02x%02x]\n", hchd->pass_fare,
            lchd->pass_fare[0], lchd->pass_fare[1], lchd->pass_fare[2]);
    lane_log("카드처리 rcpt_money[%.6s][%02x%02x%02x]\n", hchd->rcpt_money,
            lchd->rcpt_money[0], lchd->rcpt_money[1], lchd->rcpt_money[2]);
    lane_log("카드처리 bef_rcpt_balc[%.8s][%02x%02x%02x%02x]\n", hchd->bef_rcpt_balc,
            lchd->bef_rcpt_balc[0], lchd->bef_rcpt_balc[1], lchd->bef_rcpt_balc[2], lchd->bef_rcpt_balc[3]);
    lane_log("카드처리 aft_rcpt_balc[%.8s][%02x%02x%02x%02x]\n", hchd->aft_rcpt_balc,
            lchd->aft_rcpt_balc[0], lchd->aft_rcpt_balc[1], lchd->aft_rcpt_balc[2], lchd->aft_rcpt_balc[3]);
    lane_log("카드처리 rcpt_div[%.2s][%02x]\n", hchd->rcpt_div, lchd->rcpt_div);
    lane_log("카드처리 crd_kind[%.2s][%02x]\n", hchd->crd_kind, lchd->crd_kind);
    lane_log("카드처리 pre_car_kind[%c][%c][%02x]\n", hchd->pre_div, hchd->car_kind, lchd->pre_car_kind);
    lane_log("카드처리 crd_no[%.20s][%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x]\n", hchd->crd_no,
            lchd->crd_no[0], lchd->crd_no[1], lchd->crd_no[2], lchd->crd_no[3],
            lchd->crd_no[4], lchd->crd_no[5], lchd->crd_no[6], lchd->crd_no[7],
            lchd->crd_no[8], lchd->crd_no[9]);
    lane_log("카드처리 pay_div[%.2s][%02x]\n", hchd->pay_div, lchd->pay_div);
#endif
    smemcpy(D_TO_A, L_TO_H, (char *)&hchd->terminal_no,  (char *)&lchd->terminal_no, 10, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hchd->terminal_cnt, (char *)&lchd->terminal_cnt, 10, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hchd->alg_id,       (char *)&lchd->alg_id, 2, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hchd->psam_id,      (char *)&lchd->psam_id, 16, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hchd->purch_dt,     (char *)&lchd->purch_dt, 8, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hchd->deal_div,     (char *)&lchd->deal_div, 2, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hchd->elec_iss_id,  (char *)&lchd->elec_iss_id, 6, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hchd->elec_id,      (char *)&lchd->elec_id, 10, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hchd->elec_ser_no,  (char *)&lchd->elec_ser_no, 8, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hchd->deal_ser_no,  (char *)&lchd->deal_ser_no, 8, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hchd->crd_ser_no,   (char *)&lchd->crd_ser_no, 10, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hchd->deal_tot,     (char *)&lchd->deal_tot, 8, 0);
#ifdef _VERIFY_
    lane_log("카드처리 terminal_no[%.10s][%02x%02x%02x%02x%02x]\n", hchd->terminal_no,
            lchd->terminal_no[0], lchd->terminal_no[1], lchd->terminal_no[2], lchd->terminal_no[3], lchd->terminal_no[4]);
    lane_log("카드처리 terminal_cnt[%.10s][%02x%02x%02x%02x%02x]\n", hchd->terminal_cnt,
            lchd->terminal_cnt[0], lchd->terminal_cnt[1], lchd->terminal_cnt[2], lchd->terminal_cnt[3], lchd->terminal_cnt[4]);
    lane_log("카드처리 alg_id[%.2s][%02x]\n", hchd->alg_id, lchd->alg_id);
    lane_log("카드처리 psam_id[%.16s][%02x%02x%02x%02x%02x%02x%02x%02x]\n", hchd->psam_id,
            lchd->psam_id[0], lchd->psam_id[1], lchd->psam_id[2], lchd->psam_id[3],
            lchd->psam_id[4], lchd->psam_id[5], lchd->psam_id[6], lchd->psam_id[7]);
    lane_log("카드처리 purch_dt[%.8s][%02x%02x%02x%02x]\n", hchd->purch_dt,
            lchd->purch_dt[0], lchd->purch_dt[1], lchd->purch_dt[2], lchd->purch_dt[3]);
    lane_log("카드처리 deal_div[%.2s][%02x]\n", hchd->deal_div, lchd->deal_div);
    lane_log("카드처리 elec_iss_id[%.6s][%02x%02x%02x]\n", hchd->elec_iss_id,
            lchd->elec_iss_id[0], lchd->elec_iss_id[1], lchd->elec_iss_id[2]);
    lane_log("카드처리 elec_id[%.10s][%02x%02x%02x%02x%02x]\n", hchd->elec_id,
            lchd->elec_id[0], lchd->elec_id[1], lchd->elec_id[2], lchd->elec_id[3], lchd->elec_id[4]);
    lane_log("카드처리 elec_ser_no[%.8s][%02x%02x%02x%02x]\n", hchd->elec_ser_no,
            lchd->elec_ser_no[0], lchd->elec_ser_no[1], lchd->elec_ser_no[2], lchd->elec_ser_no[3]);
    lane_log("카드처리 deal_ser_no[%.8s][%02x%02x%02x%02x]\n", hchd->deal_ser_no,
            lchd->deal_ser_no[0], lchd->deal_ser_no[1], lchd->deal_ser_no[2], lchd->deal_ser_no[3]);
    lane_log("카드처리 crd_ser_no[%.10s][%02x%02x%02x%02x%02x]\n", hchd->crd_ser_no,
            lchd->crd_ser_no[0], lchd->crd_ser_no[1], lchd->crd_ser_no[2], lchd->crd_ser_no[3], lchd->crd_ser_no[4]);
    lane_log("카드처리 deal_tot[%.8s][%02x%02x%02x%02x]\n", hchd->deal_tot,
            lchd->deal_tot[0], lchd->deal_tot[1], lchd->deal_tot[2], lchd->deal_tot[3]);
#endif
    smemcpy(D_TO_A, L_TO_H, (char *)&hchd->ind_iss_cnt,   (char *)&lchd->ind_iss_cnt, 4, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hchd->rcpt_deal_ser, (char *)&lchd->rcpt_deal_ser, 8, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hchd->ind_sign1,     (char *)&lchd->ind_sign1, 2, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hchd->psam_sign1,    (char *)&lchd->psam_sign1, 8, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hchd->ind_sign2,     (char *)&lchd->ind_sign2, 2, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hchd->psam_sign2,    (char *)&lchd->psam_sign2, 8, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hchd->id_center,     (char *)&lchd->id_center, 2, 0);
/* 2019.06.13 수정 */
    smemcpy(D_TO_A, L_TO_H, (char *)&tmp, (char *)&lchd->iss_code, 8, 0);
	sprintf((char *)hchd->iss_code, "%.7s", tmp+1);

    smemcpy(D_TO_A, L_TO_H, (char *)&hchd->another,       (char *)&lchd->another, 2, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hchd->alias_no,      (char *)&lchd->alias_no, 10, 0);
	smemcpy(S_TO_S, L_TO_H, (char *)&hchd->car_no1, (char *)&lchd->car_no1, sizeof(lchd->car_no1), 0);
	smemcpy(S_TO_S, L_TO_H, (char *)&hchd->car_no2, (char *)&lchd->car_no2, sizeof(lchd->car_no2), 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hchd->tot_id,        (char *)&lchd->tot_id, 12, 0);
#ifdef _VERIFY_
    lane_log("카드처리 ind_iss_cnt[%.4s][%02x%02x]\n", hchd->ind_iss_cnt,
            lchd->ind_iss_cnt[0], lchd->ind_iss_cnt[1]);
    lane_log("카드처리 rcpt_deal_ser[%.8s][%02x%02x%02x%02x]\n", hchd->rcpt_deal_ser,
            lchd->rcpt_deal_ser[0], lchd->rcpt_deal_ser[1], lchd->rcpt_deal_ser[2], lchd->rcpt_deal_ser[3]);
    lane_log("카드처리 ind_sign1[%.2s][%02x]\n", hchd->ind_sign1, lchd->ind_sign1);
    lane_log("카드처리 psam_sign1[%.8s][%02x%02x%02x%02x]\n", hchd->psam_sign1,
            lchd->psam_sign1[0], lchd->psam_sign1[1], lchd->psam_sign1[2], lchd->psam_sign1[3]);
    lane_log("카드처리 ind_sign2[%.2s][%02x]\n", hchd->ind_sign2, lchd->ind_sign2);
    lane_log("카드처리 psam_sign2[%.8s][%02x%02x%02x%02x]\n", hchd->psam_sign2,
            lchd->psam_sign2[0], lchd->psam_sign2[1], lchd->psam_sign2[2], lchd->psam_sign2[3]);
    lane_log("카드처리 id_center[%.2s][%02x]\n", hchd->id_center, lchd->id_center);
    lane_log("MODF 카드처리 iss_code[%.7s][%02x%02x%02x%02x]\n", hchd->iss_code,
            lchd->iss_code[0], lchd->iss_code[1], lchd->iss_code[2], lchd->iss_code[3]);
    lane_log("MODF 카드처리 another[%.2s][%02x]\n", hchd->another, lchd->another);
    lane_log("카드처리 alias_no[%.10s][%02x%02x%02x%02x%02x]\n", hchd->alias_no,
            lchd->alias_no[0], lchd->alias_no[1], lchd->alias_no[2], lchd->alias_no[3], lchd->alias_no[4]);
    lane_log("카드처리 car_no1[%.14s][%.14s]\n", hchd->car_no1, lchd->car_no1);
    lane_log("카드처리 car_no2[%.14s][%.14s]\n", hchd->car_no2, lchd->car_no2);
    lane_log("카드처리 tot_id[%.12s][%02x%02x%02x%02x%02x%02x]\n", hchd->tot_id,
            lchd->tot_id[0], lchd->tot_id[1], lchd->tot_id[2], lchd->tot_id[3], lchd->tot_id[4], lchd->tot_id[5]);
#endif
    return (0);
}

/*
 *========================================================================
 *
 *   함 수 명 : ns_wrk_end()
 *   작 성 자 : JBY (baarong@neighbor21.co.kr)
 *   작 성 일 : 2019.05.02
 *   수 정 일 :
 *   설    명 : 근무종료
 *
 *========================================================================
*/
static int ns_wrk_end(uchar *h_buf, uchar *l_buf)
{
    struct    hi_wrk_end *hwe;
    struct    wrk_end    *lwe;
    int i;
    hwe = (struct hi_wrk_end *)h_buf;
    lwe = (struct wrk_end *)l_buf;

    smemcpy(D_TO_A, L_TO_H, (char *)&hwe->seq_no,   (char *)&lwe->seq_no, 8, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hwe->kind,     (char *)&lwe->kind, 2, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hwe->wrkr_no,  (char *)&lwe->wrkr_no, 4, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hwe->wrk_date, (char *)&lwe->wrk_date, 8, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hwe->wrk_no,   (char *)&lwe->wrk_no, 4, 0);
#ifdef _VERIFY_
    lane_log("근무종료 seq_no[%.8s][%02x%02x%02x%02x]\n", hwe->seq_no,
            lwe->seq_no[0], lwe->seq_no[1], lwe->seq_no[2], lwe->seq_no[3]);
    lane_log("근무종료 kind[%.2s][%02x]\n", hwe->kind, lwe->kind);
    lane_log("근무종료 wrkr_no[%.4s][%02x%02x%02x]\n", hwe->wrkr_no,
            lwe->wrkr_no[0], lwe->wrkr_no[1], lwe->wrkr_no[2]);
    lane_log("근무종료 wrk_date[%.8s][%02x%02x%02x%02x]\n", hwe->wrk_date,
            lwe->wrk_date[0], lwe->wrk_date[1], lwe->wrk_date[2], lwe->wrk_date[3]);
    lane_log("근무종료 wrk_no[%.4s][%02x%02x]\n", hwe->wrk_no,
            lwe->wrk_no[0], lwe->wrk_no[1]);
#endif
    
    smemcpy(D_TO_A, L_TO_H, (char *)&hwe->wrk_start_year,  (char *)&lwe->wrk_start_year, 4, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hwe->wrk_start_month, (char *)&lwe->wrk_start_month, 2, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hwe->wrk_start_day,   (char *)&lwe->wrk_start_day, 2, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hwe->wrk_start_hour,  (char *)&lwe->wrk_start_hour, 2, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hwe->wrk_start_min,   (char *)&lwe->wrk_start_min, 2, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hwe->wrk_start_sec,   (char *)&lwe->wrk_start_sec, 2, 0);
#ifdef _VERIFY_
    lane_log("근무종료 wrk_start_year[%.4s][%02x%02x]\n", hwe->wrk_start_year,
            lwe->wrk_start_year[0], lwe->wrk_start_year[1]);
    lane_log("근무종료 wrk_start_month[%.2s][%02x]\n", hwe->wrk_start_month, lwe->wrk_start_month);
    lane_log("근무종료 wrk_start_day[%.2s][%02x]\n", hwe->wrk_start_day, lwe->wrk_start_day);
    lane_log("근무종료 wrk_start_hour[%.2s][%02x]\n", hwe->wrk_start_hour, lwe->wrk_start_hour);
    lane_log("근무종료 wrk_start_min[%.2s][%02x]\n", hwe->wrk_start_min, lwe->wrk_start_min);
    lane_log("근무종료 wrk_start_sec[%.2s][%02x]\n", hwe->wrk_start_sec, lwe->wrk_start_sec);
#endif
    smemcpy(D_TO_A, L_TO_H, (char *)&hwe->wrk_end_year,  (char *)&lwe->wrk_end_year, 4, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hwe->wrk_end_month, (char *)&lwe->wrk_end_month, 2, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hwe->wrk_end_day,   (char *)&lwe->wrk_end_day, 2, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hwe->wrk_end_hour,  (char *)&lwe->wrk_end_hour, 2, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hwe->wrk_end_min,   (char *)&lwe->wrk_end_min, 2, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hwe->wrk_end_sec,   (char *)&lwe->wrk_end_sec, 2, 0);
#ifdef _VERIFY_
    lane_log("근무종료 wrk_end_year[%.4s][%02x%02x]\n", hwe->wrk_end_year,
            lwe->wrk_end_year[0], lwe->wrk_end_year[1]);
    lane_log("근무종료 wrk_end_month[%.2s][%02x]\n", hwe->wrk_end_month, lwe->wrk_end_month);
    lane_log("근무종료 wrk_end_day[%.2s][%02x]\n", hwe->wrk_end_day, lwe->wrk_end_day);
    lane_log("근무종료 wrk_end_hour[%.2s][%02x]\n", hwe->wrk_end_hour, lwe->wrk_end_hour);
    lane_log("근무종료 wrk_end_min[%.2s][%02x]\n", hwe->wrk_end_min, lwe->wrk_end_min);
    lane_log("근무종료 wrk_end_sec[%.2s][%02x]\n", hwe->wrk_end_sec, lwe->wrk_end_sec);
#endif
    smemcpy(D_TO_A, L_TO_H, (char *)&hwe->io_div,      (char *)&lwe->io_div, 2, 1);
    smemcpy(D_TO_A, L_TO_H, (char *)&hwe->week_div,    (char *)&lwe->week_holi_yn, 1, 2);
    smemcpy(D_TO_A, L_TO_H, (char *)&hwe->holi_yn,     (char *)&lwe->week_holi_yn, 1, 1);
    smemcpy(D_TO_A, L_TO_H, (char *)&hwe->input_fare,  (char *)&lwe->input_fare, 8, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hwe->output_fare, (char *)&lwe->output_fare, 8, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hwe->over_input,  (char *)&lwe->over_input, 8, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hwe->over_output, (char *)&lwe->over_output, 8, 0);
#ifdef _VERIFY_
    lane_log("근무종료 io_div[%c][%02x]\n", hwe->io_div, lwe->io_div);
    lane_log("근무종료 io_div[%c][%c][%02x]\n", hwe->week_div, hwe->holi_yn, lwe->week_holi_yn);
    lane_log("근무종료 input_fare[%.8s][%02x%02x%02x%02x]\n", hwe->input_fare,
            lwe->input_fare[0], lwe->input_fare[1], lwe->input_fare[2], lwe->input_fare[3]);
    lane_log("근무종료 output_fare[%.8s][%02x%02x%02x%02x]\n", hwe->output_fare,
            lwe->output_fare[0], lwe->output_fare[1], lwe->output_fare[2], lwe->output_fare[3]);
    lane_log("근무종료 over_input[%.8s][%02x%02x%02x%02x]\n", hwe->over_input,
            lwe->over_input[0], lwe->over_input[1], lwe->over_input[2], lwe->over_input[3]);
    lane_log("근무종료 over_output[%.8s][%02x%02x%02x%02x]\n", hwe->over_output,
            lwe->over_output[0], lwe->over_output[1], lwe->over_output[2], lwe->over_output[3]);
#endif
    for(i = 0; i<50; i++)
    {
        smemcpy(D_TO_A, L_TO_H, (char *)&hwe->hnd_cnt[i].div,  (char *)&lwe->hnd_cnt[i].div, 2, 0);
        smemcpy(D_TO_A, L_TO_H, (char *)&hwe->hnd_cnt[i].cnt,  (char *)&lwe->hnd_cnt[i].cnt, 4, 0);
        smemcpy(D_TO_A, L_TO_H, (char *)&hwe->hnd_cnt[i].fare, (char *)&lwe->hnd_cnt[i].fare, 8, 0);
#ifdef _VERIFY_
        lane_log("근무종료 div(%d)[%.2s][%02x]\n", i, hwe->hnd_cnt[i].div, lwe->hnd_cnt[i].div);
        lane_log("근무종료 cnt(%d)[%.4s][%02x%02x]\n", i, hwe->hnd_cnt[i].cnt,
                lwe->hnd_cnt[i].cnt[0],  lwe->hnd_cnt[i].cnt[1]);
        lane_log("근무종료 fare(%d)[%.8s][%02x%02x%02x%02x]\n", i, hwe->hnd_cnt[i].fare,
                lwe->hnd_cnt[i].fare[0], lwe->hnd_cnt[i].fare[1], lwe->hnd_cnt[i].fare[2], lwe->hnd_cnt[i].fare[3]);
#endif
    }
	smemcpy(D_TO_A, L_TO_H, (char *)&hwe->repay_cnt, (char *)&lwe->repay_cnt, 4, 0);
	smemcpy(D_TO_A, L_TO_H, (char *)&hwe->repay_fare, (char *)&lwe->repay_fare, 8, 0);

    smemcpy(D_TO_A, L_TO_H, (char *)&hwe->tot_fare, (char *)&lwe->tot_fare, 8, 0);
#ifdef _VERIFY_
    lane_log("근무종료 repay_cnt[%.4s][%02x%02x]\n", hwe->repay_cnt, lwe->repay_cnt[0], lwe->repay_cnt[1]);
    lane_log("근무종료 repay_fare[%.8s][%02x%02x%02x%02x]\n", hwe->repay_fare,
            lwe->repay_fare[0], lwe->repay_fare[1], lwe->repay_fare[2], lwe->repay_fare[3]);
    lane_log("근무종료 tot_fare[%.8s][%02x%02x%02x%02x]\n", hwe->tot_fare,
            lwe->tot_fare[0], lwe->tot_fare[1], lwe->tot_fare[2], lwe->tot_fare[3]);
#endif
    return(0);
}

 /*
 *========================================================================
 *
 *   함 수 명 : ns_warr_snd_no()
 *   작 성 자 : JBY(baarong@neighbor21.co.kr)
 *   작 성 일 : 2018.08.24
 *   수 정 일 :
 *   설    명 : 보증전송연번(영업소 -> 차로)
 *
 *========================================================================
*/
static int ns_warr_snd_no(uchar *h_buf, uchar *l_buf)
{
    struct    hi_warr_snd_no *hwsn;
    struct    warr_snd_no    *lwsn;

    hwsn = (struct hi_warr_snd_no *)h_buf;
    lwsn = (struct warr_snd_no    *)l_buf;

#if 0
    smemcpy(D_TO_A, H_TO_L,  (char *)&hwsn->seq_no,      (char *)&lwsn->seq_no, 8, 0);
    smemcpy(B_TO_B, H_TO_L,  (char *)&hwsn->kind,        (char *)&lwsn->kind, 1, 0);
    smemcpy(D_TO_A, H_TO_L,  (char *)&hwsn->warr_seq_no, (char *)&lwsn->warr_seq_no, 8, 0);
#else
    sscanf((const char *)hwsn->seq_no, "%2hhx", &lwsn->seq_no[0]);
    sscanf((const char *)hwsn->seq_no+2, "%2hhx", &lwsn->seq_no[1]);
    sscanf((const char *)hwsn->seq_no+4, "%2hhx", &lwsn->seq_no[2]);
    sscanf((const char *)hwsn->seq_no+6, "%2hhx", &lwsn->seq_no[3]);
    
    sscanf((const char *)hwsn->kind, "%2hhx", &lwsn->kind);
    
    sscanf((const char *)hwsn->warr_seq_no, "%2hhx", &lwsn->warr_seq_no[0]);
    sscanf((const char *)hwsn->warr_seq_no+2, "%2hhx", &lwsn->warr_seq_no[1]);
    sscanf((const char *)hwsn->warr_seq_no+4, "%2hhx", &lwsn->warr_seq_no[2]);
    sscanf((const char *)hwsn->warr_seq_no+6, "%2hhx", &lwsn->warr_seq_no[3]);
#endif
#ifdef _VERIFY_
    lane_log("===========================================\n");
    lane_log("보증전송연번 seq_no[%.8s][%02x%02x%02x%02x]\n", hwsn->seq_no,
            lwsn->seq_no[0], lwsn->seq_no[1], lwsn->seq_no[2], lwsn->seq_no[3]);
    lane_log("보증전송연번 kind[%02x][%02x]\n", hwsn->kind, lwsn->kind);
    lane_log("보증전송연번 warr_seq_no[%.8s][%02x%02x%02x%02x]\n", hwsn->warr_seq_no,
            lwsn->warr_seq_no[0], lwsn->warr_seq_no[1], lwsn->warr_seq_no[2], lwsn->warr_seq_no[3]);
#endif
    return (0);
}

 /*
 *========================================================================
 *
 *   함 수 명 : ns_lane_line_test()
 *   작 성 자 : JBY(baarong@neighbor21.co.kr)
 *   작 성 일 : 2018.08.24
 *   수 정 일 :
 *   설    명 : 차로측기동회선테스트 테이터
 *
 *========================================================================
*/
static int ns_lane_line_test(uchar *h_buf, uchar *l_buf)
{
    struct    hi_lane_line_test *hllt;
    struct    lane_line_test    *lllt;

    hllt = (struct hi_lane_line_test *)h_buf;
    lllt = (struct lane_line_test    *)l_buf;

    smemcpy(D_TO_A, L_TO_H, (char *)&hllt->seq_no, (char *)&lllt->seq_no, 8, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hllt->kind,   (char *)&lllt->kind, 2, 0);

    smemcpy(S_TO_S, L_TO_H, (char *)&hllt->test_data, (char *)&lllt->test_data, sizeof(lllt->test_data), 0);

    lane_log("차로측기동회선테스트 테이터 1[%.8s][%02x%02x%02x%02x]\n", hllt->seq_no, lllt->seq_no);
    lane_log("차로측기동회선테스트 테이터 2[%.2s][%02x]\n", hllt->kind, lllt->kind);
    lane_log("차로측기동회선테스트 테이터 3[%s][%s]\n", hllt->test_data, lllt->test_data);

    return (0);
}

 /*
 *========================================================================
 *
 *   함 수 명 : ns_lane_line_test_reply()
 *   작 성 자 : JBY(baarong@neighbor21.co.kr)
 *   작 성 일 : 2018.08.24
 *   수 정 일 :
 *   설    명 : 차로측기동회선테스트 테이터 응답
 *
 *========================================================================
*/
static int ns_lane_line_test_reply(uchar *h_buf, uchar *l_buf)
{
    struct    hi_lane_line_test_reply *hllt;
    struct    lane_line_test_reply    *lllt;

    hllt = (struct hi_lane_line_test_reply *)h_buf;
    lllt = (struct lane_line_test_reply    *)l_buf;
#if 0
    smemcpy(B_TO_I, H_TO_L, (char *)&hllt->seq_no, (char *)&lllt->seq_no, 8, 0);
    smemcpy(B_TO_B, H_TO_L, (char *)&hllt->kind,   (char *)&lllt->kind, 1, 0);
#else
    sscanf((const char *)hllt->seq_no  , "%2hhx", &lllt->seq_no[0]);
    sscanf((const char *)hllt->seq_no+2, "%2hhx", &lllt->seq_no[1]);
    sscanf((const char *)hllt->seq_no+4, "%2hhx", &lllt->seq_no[2]);
    sscanf((const char *)hllt->seq_no+6, "%2hhx", &lllt->seq_no[3]);

    sscanf((const char *)hllt->kind, "%2hhx", &lllt->kind);
#endif
    smemcpy(S_TO_S, H_TO_L, (char *)&hllt->test_data, (char *)&lllt->test_data, sizeof(lllt->test_data), 0);

    lane_log("차로측기동회선테스트 테이터 응답 1[%.8s][%02x%02x%02x%02x]\n", hllt->seq_no, lllt->seq_no);
    lane_log("차로측기동회선테스트 테이터 응답 2[%.2s][%02x]\n", hllt->kind, lllt->kind);
    lane_log("차로측기동회선테스트 테이터 응답 3[%s][%s]\n", hllt->test_data, lllt->test_data);

    return (0);
}

 /*
 *========================================================================
 *
 *   함 수 명 : azn_line_test()
 *   작 성 자 : JBY(baarong@neighbor21.co.kr)
 *   작 성 일 : 2018.08.24
 *   수 정 일 :
 *   설    명 : 영업소측 기동회선테스트 테이터
 *
 *========================================================================
*/
static int ns_plz_line_test(uchar *h_buf, uchar *l_buf)
{
    struct    hi_plz_line_test *hllt;
    struct    plz_line_test    *lllt;

    hllt = (struct hi_plz_line_test *)h_buf;
    lllt = (struct plz_line_test    *)l_buf;
#if 0
    smemcpy(B_TO_I, H_TO_L, (char *)&hllt->seq_no, (char *)&lllt->seq_no, 8, 0);
    smemcpy(B_TO_B, H_TO_L, (char *)&hllt->kind,   (char *)&lllt->kind, 1, 0);
#else
    sscanf((const char *)hllt->seq_no  , "%2hhx", &lllt->seq_no[0]);
    sscanf((const char *)hllt->seq_no+2, "%2hhx", &lllt->seq_no[1]);
    sscanf((const char *)hllt->seq_no+4, "%2hhx", &lllt->seq_no[2]);
    sscanf((const char *)hllt->seq_no+6, "%2hhx", &lllt->seq_no[3]);

    sscanf((const char *)hllt->kind, "%2hhx", &lllt->kind);
#endif
    smemcpy(S_TO_S, H_TO_L, (char *)&hllt->test_data, (char *)&lllt->test_data, sizeof(lllt->test_data), 0);

    return (0);
}

 /*
 *========================================================================
 *
 *   함 수 명 : azn_line_test()
 *   작 성 자 : JBY(baarong@neighbor21.co.kr)
 *   작 성 일 : 2018.08.24
 *   수 정 일 :
 *   설    명 : 영업소측 기동회선테스트 테이터 응답
 *
 *========================================================================
*/
static int ns_plz_line_test_reply(uchar *h_buf, uchar *l_buf)
{
    struct    hi_plz_line_test_reply *hllt;
    struct    plz_line_test_reply    *lllt;

    hllt = (struct hi_plz_line_test_reply *)h_buf;
    lllt = (struct plz_line_test_reply    *)l_buf;

    smemcpy(D_TO_A, L_TO_H, (char *)&hllt->seq_no, (char *)&lllt->seq_no, 8, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hllt->kind,   (char *)&lllt->kind, 2, 0);

    smemcpy(S_TO_S, L_TO_H, (char *)&hllt->test_data, (char *)&lllt->test_data, sizeof(lllt->test_data), 0);

    return (0);
}

/*
 *========================================================================
 *
 *   함 수 명 : ns_remote_lane_stat()
 *   작 성 자 : JBY (baarong@neighbor21.co.kr)
 *   작 성 일 : 2019.05.02
 *   수 정 일 :
 *   설    명 : 원격 차로상태 조회
 *
 *========================================================================
*/
static int ns_remote_lane_stat(uchar *h_buf, uchar *l_buf)
{
    struct    hi_remote_lane_stat *hrlt;
    struct    remote_lane_stat    *lrlt;

    hrlt = (struct hi_plz_line_test *)h_buf;
    lrlt = (struct plz_line_test    *)l_buf;
#if 0
    smemcpy(B_TO_I, H_TO_L, (char *)&hrlt->seq_no, (char *)&lrlt->seq_no, 8, 0);
    smemcpy(B_TO_B, H_TO_L, (char *)&hrlt->kind,   (char *)&lrlt->kind, 1, 0);
#else
    sscanf((const char *)hrlt->seq_no  , "%2hhx", &lrlt->seq_no[0]);
    sscanf((const char *)hrlt->seq_no+2, "%2hhx", &lrlt->seq_no[1]);
    sscanf((const char *)hrlt->seq_no+4, "%2hhx", &lrlt->seq_no[2]);
    sscanf((const char *)hrlt->seq_no+6, "%2hhx", &lrlt->seq_no[3]);

    sscanf((const char *)hrlt->kind, "%2hhx", &lrlt->kind);
#endif

#ifdef _VERIFY_
    lane_log("원격 차로상태 seq_no[%.8s][%02x%02x%02x%02x]\n", hrlt->seq_no,
             lrlt->seq_no[0], lrlt->seq_no[1], lrlt->seq_no[2], lrlt->seq_no[3]);
    lane_log("원격 차로상태 kind[%.2s][%02x]\n", hrlt->kind, lrlt->kind);
#endif
    return (0);
}

/*
 *========================================================================
 *
 *   함 수 명 : ns_remote_lane_stat_reply()
 *   작 성 자 : JBY (baarong@neighbor21.co.kr)
 *   작 성 일 : 2019.05.02
 *   수 정 일 :
 *   설    명 : 원격 차로상태 조회 응답
 *
 *========================================================================
*/
static int ns_remote_lane_stat_reply(uchar *h_buf, uchar *l_buf)
{
    struct    hi_remote_lane_stat_reply *hrlsr;
    struct    remote_lane_stat_reply    *lrlsr;

    hrlsr = (struct hi_plz_line_test_reply *)h_buf;
    lrlsr = (struct plz_line_test_reply    *)l_buf;

    smemcpy(D_TO_A, L_TO_H, (char *)&hrlsr->seq_no, (char *)&lrlsr->seq_no, 8, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hrlsr->kind,   (char *)&lrlsr->kind, 2, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hrlsr->lane_stat, (char *)&lrlsr->lane_stat, 8, 0);
#ifdef _VERIFY_
    lane_log("원격 차로상태 조회응답 seq_no[%.8s][%02x%02x%02x%02x]\n", hrlsr->seq_no,
             lrlsr->seq_no[0], lrlsr->seq_no[1], lrlsr->seq_no[2], lrlsr->seq_no[3]);
    lane_log("원격 차로상태 조회응답 kind[%.2s][%02x]\n", hrlsr->kind, lrlsr->kind);
    lane_log("원격 차로상태 조회응답 lane_stat[%.8s][%02x%02x%02x%02x]\n", hrlsr->lane_stat,
             lrlsr->lane_stat[0], lrlsr->lane_stat[1], lrlsr->lane_stat[2], lrlsr->lane_stat[3]);
#endif
    smemcpy(D_TO_A, L_TO_H, (char *)&hrlsr->tick_stat, (char *)&lrlsr->tick_stat, 4, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hrlsr->rcpt_stat, (char *)&lrlsr->rcpt_stat, 4, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hrlsr->car_div_stat, (char *)&lrlsr->car_div_stat, 8, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hrlsr->crd_terminal, (char *)&lrlsr->crd_terminal, 56, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hrlsr->crd_reader, (char *)&lrlsr->crd_reader, 2, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hrlsr->toll_system, (char *)&lrlsr->toll_system, 2, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hrlsr->reserve1, (char *)&lrlsr->reserve1, 2, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hrlsr->reserve2, (char *)&lrlsr->reserve2, 2, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hrlsr->reserve3, (char *)&lrlsr->reserve3, 2, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hrlsr->reserve4, (char *)&lrlsr->reserve4, 2, 0);
#ifdef _VERIFY_
    lane_log("원격 차로상태 조회응답 tick_stat[%.4s][%02x%02x]\n", hrlsr->tick_stat,
             lrlsr->tick_stat[0], lrlsr->tick_stat[1]);
    lane_log("원격 차로상태 조회응답 rcpt_stat[%.4s][%02x%02x]\n", hrlsr->rcpt_stat,
             lrlsr->rcpt_stat[0], lrlsr->rcpt_stat[1]);
    lane_log("원격 차로상태 조회응답 car_div_stat[%.8s][%02x%02x%02x%02x]\n", hrlsr->car_div_stat,
             lrlsr->car_div_stat[0], lrlsr->car_div_stat[1], lrlsr->car_div_stat[2], lrlsr->car_div_stat[3]);
    lane_log("원격 차로상태 조회응답 crd_terminal[%.56s][%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x]\n",
             hrlsr->crd_terminal,
             lrlsr->crd_terminal[0], lrlsr->crd_terminal[1], lrlsr->crd_terminal[2], lrlsr->crd_terminal[3],
             lrlsr->crd_terminal[4], lrlsr->crd_terminal[5], lrlsr->crd_terminal[6], lrlsr->crd_terminal[7],
             lrlsr->crd_terminal[8], lrlsr->crd_terminal[9], lrlsr->crd_terminal[10], lrlsr->crd_terminal[11],
             lrlsr->crd_terminal[12], lrlsr->crd_terminal[13], lrlsr->crd_terminal[14], lrlsr->crd_terminal[15],
             lrlsr->crd_terminal[16], lrlsr->crd_terminal[17], lrlsr->crd_terminal[18], lrlsr->crd_terminal[19],
             lrlsr->crd_terminal[20], lrlsr->crd_terminal[21], lrlsr->crd_terminal[22], lrlsr->crd_terminal[23],
             lrlsr->crd_terminal[24], lrlsr->crd_terminal[25], lrlsr->crd_terminal[26], lrlsr->crd_terminal[27]);
    lane_log("원격 차로상태 조회응답 crd_reader[%.2s][%02x]\n", hrlsr->crd_reader, lrlsr->crd_reader);
    lane_log("원격 차로상태 조회응답 toll_system[%.2s][%02x]\n", hrlsr->toll_system, lrlsr->toll_system);
    lane_log("원격 차로상태 조회응답 reserve1[%.2s][%02x]\n", hrlsr->reserve1, lrlsr->reserve1);
    lane_log("원격 차로상태 조회응답 reserve2[%.2s][%02x]\n", hrlsr->reserve2, lrlsr->reserve2);
    lane_log("원격 차로상태 조회응답 reserve3[%.2s][%02x]\n", hrlsr->reserve3, lrlsr->reserve3);
    lane_log("원격 차로상태 조회응답 reserve4[%.2s][%02x]\n", hrlsr->reserve4, lrlsr->reserve4);
#endif
    return (0);
}

/*
 *========================================================================
 *
 *   함 수 명 : ns_remote_lane_stat()
 *   작 성 자 : JBY (baarong@neighbor21.co.kr)
 *   작 성 일 : 2019.05.02
 *   수 정 일 :
 *   설    명 : 원격차로제어
 *
 *========================================================================
*/
static int ns_remote_lane(uchar *h_buf, uchar *l_buf)
{
    struct    hi_remote_lane *hrl;
    struct    remote_lane    *lrl;

    hrl = (struct hi_plz_line_test *)h_buf;
    lrl = (struct plz_line_test    *)l_buf;
#if 0
    smemcpy(B_TO_I, H_TO_L, (char *)&hrl->seq_no, (char *)&lrl->seq_no, 8, 0);
    smemcpy(B_TO_B, H_TO_L, (char *)&hrl->kind,   (char *)&lrl->kind, 1, 0);
#else
    sscanf((const char *)hrl->seq_no  , "%2hhx", &lrl->seq_no[0]);
    sscanf((const char *)hrl->seq_no+2, "%2hhx", &lrl->seq_no[1]);
    sscanf((const char *)hrl->seq_no+4, "%2hhx", &lrl->seq_no[2]);
    sscanf((const char *)hrl->seq_no+6, "%2hhx", &lrl->seq_no[3]);

    sscanf((const char *)hrl->kind, "%2hhx", &lrl->kind);
#endif
    smemcpy(B_TO_I, H_TO_L, (char *)&hrl->div, (char *)&lrl->div, 2, 0);
#ifdef _VERIFY_
    lane_log("원격차로제어 seq_no[%.8s][%02x%02x%02x%02x]\n", hrl->seq_no,
             lrl->seq_no[0], lrl->seq_no[1], lrl->seq_no[2], lrl->seq_no[3]);
    lane_log("원격차로제어 kind[%.2s][%02x]\n", hrl->kind, lrl->kind);
    lane_log("원격차로제어 div[%.2s][%02x]\n", hrl->div, lrl->div);
#endif
    return (0);
}

/*
 *========================================================================
 *
 *   함 수 명 : ns_non_pay_srch()
 *   작 성 자 : JBY (baarong@neighbor21.co.kr)
 *   작 성 일 : 2019.05.02
 *   수 정 일 :
 *   설    명 : 미납정보조회 (영업소 <- 차로)
 *
 *========================================================================
*/
static int ns_non_pay_srch(uchar *h_buf, uchar *l_buf)
{
    struct    hi_non_pay_srch *hnps;
    struct    non_pay_srch    *lnps;

    hnps = (struct hi_non_pay_srch *)h_buf;
    lnps = (struct non_pay_srch    *)l_buf;

    smemcpy(D_TO_A, L_TO_H, (char *)&hnps->seq_no,   (char *)&lnps->seq_no, 8, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hnps->kind,     (char *)&lnps->kind, 2, 0);
	smemcpy(S_TO_S, L_TO_H, (char *)&hnps->car_no, (char *)&lnps->car_no, sizeof(lnps->car_no), 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hnps->car_code,  (char *)&lnps->car_code, 10, 0);
#ifdef _VERIFY_
    lane_log("미납정보조회 전송연번[%.8s][%02x%02x%02x%02x]\n", hnps->seq_no,
            lnps->seq_no[0], lnps->seq_no[1], lnps->seq_no[2], lnps->seq_no[3]);
    lane_log("미납정보조회 종별[%.2s][%02x]\n", hnps->kind, lnps->kind);
    lane_log("미납정보조회 차량번호[%.16s][%.16s]\n", hnps->car_no, lnps->car_no);
    lane_log("미납정보조회 차량코드[%.10s][%02x%02x%02x%02x%02x]\n", hnps->car_code,
            lnps->car_code[0], lnps->car_code[1], lnps->car_code[2],
            lnps->car_code[3], lnps->car_code[4]);
#endif
    return (0);
}

/*
 *========================================================================
 *
 *   함 수 명 : ns_non_pay_rlt()
 *   작 성 자 : JBY (baarong@neighbor21.co.kr)
 *   작 성 일 : 2019.05.02
 *   수 정 일 :
 *   설    명 : 미납정보 조회결과(영업소 -> 차로)
 *
 *========================================================================
*/
static int ns_non_pay_rlt(uchar *h_buf, uchar *l_buf)
{
    struct    hi_non_pay_rlt *hiir;
    struct    non_pay_rlt    *liir;

    hiir = (struct hi_iss_info_rslt *)h_buf;
    liir = (struct iss_info_rslt    *)l_buf;

    int i, cnt;
#if 0
    smemcpy(D_TO_A, H_TO_L, (char *)&hiir->seq_no,  (char *)&liir->seq_no, 8, 0);
    smemcpy(B_TO_B, H_TO_L, (char *)&hiir->kind,    (char *)&liir->kind, 1, 0);
#else
    sscanf((const char *)hiir->seq_no  , "%2hhx", &liir->seq_no[0]);
    sscanf((const char *)hiir->seq_no+2, "%2hhx", &liir->seq_no[1]);
    sscanf((const char *)hiir->seq_no+4, "%2hhx", &liir->seq_no[2]);
    sscanf((const char *)hiir->seq_no+6, "%2hhx", &liir->seq_no[3]);

    sscanf((const char *)hiir->kind, "%2hhx", &liir->kind);
#endif
    smemcpy(D_TO_A, H_TO_L, (char *)&hiir->tot_cnt,  (char *)&liir->tot_cnt, 4, 0);
    smemcpy(D_TO_A, H_TO_L, (char *)&hiir->tot_fare, (char *)&liir->tot_fare, 8, 0);
#ifdef _VERIFY_
    lane_log("미납정보 조회결과 전송연번[%.8s][%02x%02x%02x%02x]\n", hiir->seq_no,
            liir->seq_no[0], liir->seq_no[1], liir->seq_no[2], liir->seq_no[3]);
    lane_log("미납정보 조회결과 종별[%.2s][%02x]\n", hiir->kind, liir->kind);
    lane_log("미납정보 조회결과 총건수[%.4s][%02x%02x]\n", hiir->tot_cnt,
            liir->tot_cnt[0], liir->tot_cnt[1]);
    lane_log("미납정보 조회결과 총금액[%.8s][%02x%02x%02x%02x]\n", hiir->tot_fare,
            liir->tot_fare[0], liir->tot_fare[1], liir->tot_fare[2], liir->tot_fare[3]);
#endif
    sscanf((const char *)hiir->car_no  , "%2hhx", &liir->car_no[0]);
    sscanf((const char *)hiir->car_no+2, "%2hhx", &liir->car_no[1]);
    sscanf((const char *)hiir->car_no+4, "%2hhx", &liir->car_no[2]);
    sscanf((const char *)hiir->car_no+6, "%2hhx", &liir->car_no[3]);
	sscanf((const char *)hiir->car_no+8, "%2hhx", &liir->car_no[4]);
#ifdef _VERIFY_
    lane_log("미납정보 조회결과 차량코드[%.10s][%02x%02x]\n", hiir->car_no,
            liir->car_no[0], liir->car_no[1], liir->car_no[2], liir->car_no[3], liir->car_no[4]);
#endif
    for (i=0; i<5; i++)
    {
        smemcpy(D_TO_A, H_TO_L, (char *)&hiir->rlt_info[i].wrk_dt,     (char *)&liir->rlt_info[i].wrk_dt, 14, 0);
        smemcpy(D_TO_A, H_TO_L, (char *)&hiir->rlt_info[i].lane_no,    (char *)&liir->rlt_info[i].lane_no, 2, 0);
        smemcpy(D_TO_A, H_TO_L, (char *)&hiir->rlt_info[i].plz_id,     (char *)&liir->rlt_info[i].plz_id, 2, 0);
        smemcpy(D_TO_A, H_TO_L, (char *)&hiir->rlt_info[i].toll_amt,   (char *)&liir->rlt_info[i].toll_amt, 8, 0);
        smemcpy(D_TO_A, H_TO_L, (char *)&hiir->rlt_info[i].notice_cnt, (char *)&liir->rlt_info[i].notice_cnt, 2, 0);
        smemcpy(D_TO_A, H_TO_L, (char *)&hiir->rlt_info[i].end_date,   (char *)&liir->rlt_info[i].end_date, 8, 0);
#ifdef _VERIFY_
        lane_log("미납정보 조회결과[%d] wrk_dt[%.14s][%02x%02x%02x%02x%02x%02x%02x]\n", i, hiir->rlt_info[i].wrk_dt,
                liir->rlt_info[i].wrk_dt[0], liir->rlt_info[i].wrk_dt[1], liir->rlt_info[i].wrk_dt[2], liir->rlt_info[i].wrk_dt[3],
                liir->rlt_info[i].wrk_dt[4], liir->rlt_info[i].wrk_dt[5], liir->rlt_info[i].wrk_dt[6]);
        lane_log("미납정보 조회결과[%d] lane_no[%.2s][%02x]\n", i, hiir->rlt_info[i].lane_no, liir->rlt_info[i].lane_no);
        lane_log("미납정보 조회결과[%d] plz_id[%.2s][%02x]\n", i, hiir->rlt_info[i].plz_id, liir->rlt_info[i].plz_id);
        lane_log("미납정보 조회결과[%d] toll_amt[%.8s][%02x%02x%02x%02x]\n", i, hiir->rlt_info[i].toll_amt,
                liir->rlt_info[i].toll_amt[0], liir->rlt_info[i].toll_amt[1],
                liir->rlt_info[i].toll_amt[2], liir->rlt_info[i].toll_amt[3]);
        lane_log("미납정보 조회결과[%d] notice_cnt[%.2s][%02x]\n", i, hiir->rlt_info[i].notice_cnt, liir->rlt_info[i].notice_cnt);
        lane_log("미납정보 조회결과[%d] end_date[%.8s][%02x%02x%02x%02x]\n", i, hiir->rlt_info[i].end_date,
                liir->rlt_info[i].end_date[0], liir->rlt_info[i].end_date[1],
                liir->rlt_info[i].end_date[2], liir->rlt_info[i].end_date[3]);
#endif
    }

    return (0);
}

/*
 *========================================================================
 *
 *   함 수 명 : ns_non_pay_srch()
 *   작 성 자 : JBY (baarong@neighbor21.co.kr)
 *   작 성 일 : 2019.05.02
 *   수 정 일 :
 *   설    명 : 카드번호조회 (영업소 <- 차로)
 *
 *========================================================================
*/
static int ns_crd_srch(uchar *h_buf, uchar *l_buf)
{
    struct    hi_crd_srch *hnps;
    struct    crd_srch    *lnps;

    hnps = (struct hi_crd_srch *)h_buf;
    lnps = (struct crd_srch    *)l_buf;

    smemcpy(D_TO_A, L_TO_H, (char *)&hnps->seq_no,      (char *)&lnps->seq_no, 8, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hnps->kind,        (char *)&lnps->kind, 2, 0);
    smemcpy(B_TO_B, L_TO_H, (char *)&hnps->div,         (char *)&lnps->div, 1, 0);

    smemcpy(D_TO_A, L_TO_H, (char *)&hnps->srch_number, (char *)&lnps->srch_number, 16, 0);
#ifdef _VERIFY_
    lane_log("카드번호조회 전송연번[%.8s][%02x%02x%02x%02x]\n", hnps->seq_no,
            lnps->seq_no[0], lnps->seq_no[1], lnps->seq_no[2], lnps->seq_no[3]);
    lane_log("카드번호조회 종별[%.2s][%02x]\n", hnps->kind, lnps->kind);
    lane_log("카드번호조회 구분[%02x][%02x]\n", hnps->div, lnps->div);
    lane_log("카드번호조회 카드번호[%.16s][%02x%02x%02x%02x%02x%02x%02x%02x]\n",
            hnps->srch_number,
            lnps->srch_number[0], lnps->srch_number[1], lnps->srch_number[2],
            lnps->srch_number[3], lnps->srch_number[4], lnps->srch_number[5],
            lnps->srch_number[6], lnps->srch_number[7]);
#endif
    return (0);
}

/*
 *========================================================================
 *
 *   함 수 명 : ns_crd_rlt()
 *   작 성 자 : JBY (baarong@neighbor21.co.kr)
 *   작 성 일 : 2019.05.12
 *   수 정 일 :
 *   설    명 : 카드번호결과 (영업소 -> 차로)
 *
 *========================================================================
*/
static int ns_crd_rlt(uchar *h_buf, uchar *l_buf)
{
    struct    hi_crd_rlt *hnps;
    struct    crd_rlt    *lnps;

    hnps = (struct hi_crd_rlt *)h_buf;
    lnps = (struct crd_rlt    *)l_buf;
#if 0
    smemcpy(D_TO_A, H_TO_L, (char *)&hnps->seq_no,      (char *)&lnps->seq_no, 8, 0);
    smemcpy(D_TO_A, H_TO_L, (char *)&hnps->kind,        (char *)&lnps->kind, 2, 0);
#else
	sscanf((const char *)hnps->seq_no  , "%2hhx", &lnps->seq_no[0]);
    sscanf((const char *)hnps->seq_no+2, "%2hhx", &lnps->seq_no[1]);
    sscanf((const char *)hnps->seq_no+4, "%2hhx", &lnps->seq_no[2]);
    sscanf((const char *)hnps->seq_no+6, "%2hhx", &lnps->seq_no[3]);

    sscanf((const char *)hnps->kind, "%2hhx", &lnps->kind);
#endif
    smemcpy(D_TO_A, H_TO_L, (char *)&hnps->rlt,         (char *)&lnps->rlt, 2, 0);
#ifdef _VERIFY_
    lane_log("카드번호조회 전송연번[%.8s][%02x%02x%02x%02x]\n", hnps->seq_no,
            lnps->seq_no[0], lnps->seq_no[1], lnps->seq_no[2], lnps->seq_no[3]);
    lane_log("카드번호조회 종별[%.2s][%02x]\n", hnps->kind, lnps->kind);
    lane_log("카드번호조회 결과[%.2s][%02x]\n", hnps->rlt, lnps->rlt);
#endif
    return (0);
}

/*
 *========================================================================
 *
 *   함 수 명 : ns_refund_data()
 *   작 성 자 : JBY (baarong@neighbor21.co.kr)
 *   작 성 일 : 2019.07.01
 *   수 정 일 :
 *   설    명 : 환불처리데이터 (영업소 -> 차로)
 *
 *========================================================================
*/
static int ns_refund_data(uchar *h_buf, uchar *l_buf)
{
    struct    hi_refund_data *hhd;
    struct    refund_data    *lhd;
	char tmp[8];

    hhd = (struct hi_refund_data *)h_buf;
    lhd = (struct refund_data    *)l_buf;
#if 0
    smemcpy(D_TO_A, L_TO_H, (char *)&hhd->seq_no,    (char *)&lhd->seq_no, 8, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hhd->kind,      (char *)&lhd->kind, 2, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hhd->wrk_date,  (char *)&lhd->wrk_date, 8, 0);

    smemcpy(D_TO_A, L_TO_H, (char *)&hhd->wrk_no,    (char *)&lhd->wrk_no, 4, 0);
	smemcpy(D_TO_A, L_TO_H, (char *)&hhd->wrkr_no,   (char *)&lhd->wrkr_no, 4, 0);
	smemcpy(D_TO_A, L_TO_H, (char *)&hhd->serial_no, (char *)&lhd->serial_no, 6, 0);
	smemcpy(D_TO_A, L_TO_H, (char *)&hhd->plz_id,    (char *)&lhd->plz_id, 2, 0);
	smemcpy(D_TO_A, L_TO_H, (char *)&hhd->lane_no,   (char *)&lhd->lane_no, 2, 0);

	smemcpy(D_TO_A, L_TO_H, (char *)&hhd->hnd_year,  (char *)&lhd->hnd_year, 4, 0);
	smemcpy(D_TO_A, L_TO_H, (char *)&hhd->hnd_month, (char *)&lhd->hnd_month, 2, 0);
	smemcpy(D_TO_A, L_TO_H, (char *)&hhd->hnd_day,   (char *)&lhd->hnd_day, 2, 0);
	smemcpy(D_TO_A, L_TO_H, (char *)&hhd->hnd_hour,  (char *)&lhd->hnd_hour, 2, 0);
	smemcpy(D_TO_A, L_TO_H, (char *)&hhd->hnd_min,   (char *)&lhd->hnd_min, 2, 0);
	smemcpy(D_TO_A, L_TO_H, (char *)&hhd->hnd_sec,   (char *)&lhd->hnd_sec, 2, 0);

	smemcpy(D_TO_A, L_TO_H, (char *)&hhd->org_pass_fare, (char *)&lhd->org_pass_fare, 6, 0);
	smemcpy(D_TO_A, L_TO_H, (char *)&hhd->pass_fare,     (char *)&lhd->pass_fare, 6, 0);
	smemcpy(D_TO_A, L_TO_H, (char *)&hhd->toll_amt,      (char *)&lhd->toll_amt, 6, 0);
	
	smemcpy(D_TO_A, L_TO_H, (char *)&hhd->refund_year,  (char *)&lhd->refund_year, 4, 0);
	smemcpy(D_TO_A, L_TO_H, (char *)&hhd->refund_month, (char *)&lhd->refund_month, 2, 0);
	smemcpy(D_TO_A, L_TO_H, (char *)&hhd->refund_day,   (char *)&lhd->refund_day, 2, 0);
	smemcpy(D_TO_A, L_TO_H, (char *)&hhd->refund_hour,  (char *)&lhd->refund_hour, 2, 0);
	smemcpy(D_TO_A, L_TO_H, (char *)&hhd->refund_min,   (char *)&lhd->refund_min, 2, 0);
	smemcpy(D_TO_A, L_TO_H, (char *)&hhd->refund_sec,   (char *)&lhd->refund_sec, 2, 0);
	
	smemcpy(D_TO_A, L_TO_H, (char *)&hhd->refund_key,   (char *)&lhd->refund_key, 1, 1);
	
#ifdef _VERIFY_
    lane_log("환불처리데이터 전송연번[%.8s][%02x%02x%02x%02x]\n", hhd->seq_no,
            lhd->seq_no[0], lhd->seq_no[1], lhd->seq_no[2], lhd->seq_no[3]);
    lane_log("환불처리데이터 종별[%.2s][%02x]\n", hhd->kind, lhd->kind);
    lane_log("환불처리데이터 근무일자[%.8s][%02x%02x%02x%02x]\n", hhd->wrk_date,
			lhd->wrk_date[0], lhd->wrk_date[1], lhd->wrk_date[2], lhd->wrk_date[3]);
    lane_log("환불처리데이터 근무번호[%.4s][%02x%02x]\n", hhd->wrk_no, lhd->wrk_no[0], lhd->wrk_no[1]);
	lane_log("환불처리데이터 근무자번호[%.4s][%02x%02x]\n", hhd->wrkr_no, lhd->wrkr_no[0], lhd->wrkr_no[1]);
	lane_log("환불처리데이터 일련번호[%.6s][%02x%02x%02x]\n", hhd->serial_no,
			lhd->serial_no[0], lhd->serial_no[1], lhd->serial_no[2]);
	lane_log("환불처리데이터 PLZ_ID[%.2s][%02x]\n", hhd->plz_id, lhd->plz_id);
	lane_log("환불처리데이터 LANE_NO[%.2s][%02x]\n", hhd->lane_no, lhd->lane_no);
	lane_log("환불처리데이터 처리시각[%.4s%.2s%.2s %.2s:%.2s:%.2s][%02x%02x%02x%02x %02x%02x%02x]\n",
			hhd->hnd_year, hhd->hnd_month, hhd->hnd_day, hhd->hnd_hour, hhd->hnd_min, hhd->hnd_sec,
			lhd->hnd_year[0], lhd->hnd_year[1], lhd->hnd_month, lhd->hnd_day, lhd->hnd_hour, lhd->hnd_min, lhd->hnd_sec);
	lane_log("환불처리데이터 원통행요금[%.6s][%02x%02x%02x]\n", hhd->org_pass_fare,
			lhd->org_pass_fare[0], lhd->org_pass_fare[1], lhd->org_pass_fare[2]);
	lane_log("환불처리데이터 통행요금[%.6s][%02x%02x%02x]\n", hhd->pass_fare,
			lhd->pass_fare[0], lhd->pass_fare[1], lhd->pass_fare[2]);
	lane_log("환불처리데이터 환불금액[%.6s][%02x%02x%02x]\n", hhd->serial_no,
			lhd->serial_no[0], lhd->serial_no[1], lhd->serial_no[2]);
	lane_log("환불처리데이터 환불시각[%.4s%.2s%.2s %.2s:%.2s:%.2s][%02x%02x%02x%02x %02x%02x%02x]\n",
			hhd->refund_year, hhd->refund_month, hhd->refund_day, hhd->refund_hour, hhd->refund_min, hhd->refund_sec,
			lhd->refund_year[0], lhd->refund_year[1], lhd->refund_month, lhd->refund_day, lhd->refund_hour, lhd->refund_min, lhd->refund_sec);
	lane_log("환불처리데이터 환불여부[%c][%02x]\n", hhd->refund_key, lhd->refund_key);
#endif
#else

    smemcpy(D_TO_A, L_TO_H, (char *)&hhd->seq_no,         (char *)&lhd->seq_no, 8, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hhd->kind,           (char *)&lhd->kind, 2, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hhd->wrk_date,       (char *)&lhd->wrk_date, 8, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hhd->wrk_no,         (char *)&lhd->wrk_no, 4, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hhd->wrkr_no,        (char *)&lhd->wrkr_no, 4, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hhd->serial_no,      (char *)&lhd->serial_no, 6, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hhd->io_div,         (char *)&lhd->io_div, 2, 1);
    smemcpy(D_TO_A, L_TO_H, (char *)&hhd->plz_id,         (char *)&lhd->plz_id, 2, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hhd->lane_no,        (char *)&lhd->lane_no, 2, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hhd->car_kind,       (char *)&lhd->car_kind, 2, 1);
    smemcpy(D_TO_A, L_TO_H, (char *)&hhd->sence_seq_no,   (char *)&lhd->sence_seq_no, 6, 0);
	smemcpy(D_TO_A, L_TO_H, (char *)&hhd->sence_time,     (char *)&lhd->sence_time, 6, 0);
#ifdef _VERIFY_
    lane_log("환불처리 seq_no[%.8s][%02X%02X%02X%02X]\n", hhd->seq_no,
            lhd->seq_no[0], lhd->seq_no[1], lhd->seq_no[2], lhd->seq_no[3]);
    lane_log("환불처리 kind[%.2s][%02x]\n", hhd->kind, lhd->kind);
    lane_log("환불처리 wrk_date[%.8s][%02x%02x%02x%02x]\n", hhd->wrk_date,
            lhd->wrk_date[0], lhd->wrk_date[1], lhd->wrk_date[2], lhd->wrk_date[3]);
    lane_log("환불처리 wrk_no[%.4s][%02x%02x]\n", hhd->wrk_no,
            lhd->wrk_no[0], lhd->wrk_no[1]);
    lane_log("환불처리 wrkr_no[%.4s][%02x%02x%02x]\n", hhd->wrkr_no,
            lhd->wrkr_no[0], lhd->wrkr_no[1], lhd->wrkr_no[2]);
    lane_log("환불처리 serial_no[%.6s][%02x%02x%02x]\n", hhd->serial_no,
            lhd->serial_no[0], lhd->serial_no[1], lhd->serial_no[2]);
    lane_log("환불처리 io_div[%c][%02x]\n", hhd->io_div, lhd->io_div);
    lane_log("환불처리 plz_id[%.2s][%02x]\n", hhd->plz_id, lhd->plz_id);
    lane_log("환불처리 lane_no[%.2s][%02x]\n", hhd->lane_no, lhd->lane_no);
    lane_log("환불처리 car_kind[%c][%02x]\n", hhd->car_kind, lhd->car_kind);
    lane_log("환불처리 sence_seq_no[%.6s][%02x%02x%02x]\n", hhd->sence_seq_no,
            lhd->sence_seq_no[0], lhd->sence_seq_no[1], lhd->sence_seq_no[2]);
    lane_log("환불처리 sence_time[%.6s][%02x%02x%02x]\n", hhd->sence_time,
            lhd->sence_time[0], lhd->sence_time[1], lhd->sence_time[2]);
#endif
    smemcpy(D_TO_A, L_TO_H, (char *)&hhd->hnd_info.hnd_year,      (char *)&lhd->hnd_info.hnd_year, 4, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hhd->hnd_info.hnd_month,     (char *)&lhd->hnd_info.hnd_month, 2, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hhd->hnd_info.hnd_day,       (char *)&lhd->hnd_info.hnd_day, 2, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hhd->hnd_info.hnd_hour,      (char *)&lhd->hnd_info.hnd_hour, 2, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hhd->hnd_info.hnd_min,       (char *)&lhd->hnd_info.hnd_min, 2, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hhd->hnd_info.hnd_sec,       (char *)&lhd->hnd_info.hnd_sec, 2, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hhd->hnd_info.org_pass_fare, (char *)&lhd->hnd_info.org_pass_fare, 6, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hhd->hnd_info.pass_fare,     (char *)&lhd->hnd_info.pass_fare, 6, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hhd->hnd_info.rcpt_money,    (char *)&lhd->hnd_info.rcpt_money, 6, 0);

    smemcpy(D_TO_A, L_TO_H, (char *)&hhd->hnd_info.refund_yn,     (char *)&lhd->hnd_info.refund_key_yn, 1, 2);

    smemcpy(D_TO_A, L_TO_H, (char *)&hhd->hnd_info.key_yn,        (char *)&lhd->hnd_info.refund_key_yn, 1, 1);

    smemcpy(D_TO_A, L_TO_H, (char *)&hhd->hnd_info.rcpt_hnd,      (char *)&lhd->hnd_info.rcpt_hnd, 2, 0);

    smemcpy(D_TO_A, L_TO_H, (char *)&tmp, (char *)&lhd->hnd_info.issue_code, 8, 0);

	hhd->hnd_info.red_div=tmp[0];

	sprintf((char *)hhd->hnd_info.issue_code, "%.7s", tmp+1);

    smemcpy(D_TO_A, L_TO_H, (char *)&hhd->hnd_info.crd_no,        (char *)&lhd->hnd_info.crd_no, 20, 0);

    smemcpy(D_TO_A, L_TO_H, (char *)&hhd->hnd_info.rcpt_div,      (char *)&lhd->hnd_info.rcpt_div, 2, 0);

#ifdef _VERIFY_
    lane_log("환불처리 hnd_year[%.4s][%02x%02x]\n", hhd->hnd_info.hnd_year,
            lhd->hnd_info.hnd_year[0], lhd->hnd_info.hnd_year[1]);
    lane_log("환불처리 hnd_month[%.2s][%02x]\n", hhd->hnd_info.hnd_month, lhd->hnd_info.hnd_month);
    lane_log("환불처리 hnd_day[%.2s][%02x]\n", hhd->hnd_info.hnd_day, lhd->hnd_info.hnd_day);
    lane_log("환불처리 hnd_hour[%.2s][%02x]\n", hhd->hnd_info.hnd_hour, lhd->hnd_info.hnd_hour);
    lane_log("환불처리 hnd_min[%.2s][%02x]\n", hhd->hnd_info.hnd_min, lhd->hnd_info.hnd_min);
    lane_log("환불처리 hnd_sec[%.2s][%02x]\n", hhd->hnd_info.hnd_sec, lhd->hnd_info.hnd_sec);
    lane_log("환불처리 org_pass_fare[%.6s][%02x%02x%02x]\n", hhd->hnd_info.org_pass_fare,
            lhd->hnd_info.org_pass_fare[0], lhd->hnd_info.org_pass_fare[1], lhd->hnd_info.org_pass_fare[2]);
    lane_log("환불처리 pass_fare[%.6s][%02x%02x%02x]\n", hhd->hnd_info.pass_fare,
            lhd->hnd_info.pass_fare[0], lhd->hnd_info.pass_fare[1], lhd->hnd_info.pass_fare[2]);
    lane_log("환불처리 rcpt_money[%.6s]%02x%02x%02x]\n", hhd->hnd_info.rcpt_money,
            lhd->hnd_info.rcpt_money[0], lhd->hnd_info.rcpt_money[1], lhd->hnd_info.rcpt_money[2]);
    lane_log("환불처리 refund_key_yn[%c][%c][%02x]\n", hhd->hnd_info.refund_yn, hhd->hnd_info.key_yn, lhd->hnd_info.refund_key_yn);

    lane_log("환불처리 rcpt_hnd[%.2s][%02x]\n", hhd->hnd_info.rcpt_hnd, lhd->hnd_info.rcpt_hnd);
    lane_log("MODF 환불처리 issue_code[%c][%.7s][%02x%02x%02x%02x]\n", hhd->hnd_info.red_div, hhd->hnd_info.issue_code,
            lhd->hnd_info.issue_code[0], lhd->hnd_info.issue_code[1],
            lhd->hnd_info.issue_code[2], lhd->hnd_info.issue_code[3]);
    lane_log("환불처리 crd_no[%.20s][%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x]\n", hhd->hnd_info.crd_no,
            lhd->hnd_info.crd_no[0], lhd->hnd_info.crd_no[1], lhd->hnd_info.crd_no[2], lhd->hnd_info.crd_no[3],
            lhd->hnd_info.crd_no[4], lhd->hnd_info.crd_no[5], lhd->hnd_info.crd_no[6], lhd->hnd_info.crd_no[7],
            lhd->hnd_info.crd_no[8], lhd->hnd_info.crd_no[9]);
    lane_log("환불처리 rcpt_div[%.2s][%02x]\n", hhd->hnd_info.rcpt_div, lhd->hnd_info.rcpt_div);
#endif
    smemcpy(D_TO_A, L_TO_H, (char *)&hhd->pre_yn,            (char *)&lhd->img_yn, 1, 2);
	smemcpy(D_TO_A, L_TO_H, (char *)&hhd->img_yn,            (char *)&lhd->img_yn, 1, 1);
	smemcpy(S_TO_S, L_TO_H, (char *)&hhd->car_no1, (char *)&lhd->car_no1, sizeof(lhd->car_no1), 0);
	smemcpy(S_TO_S, L_TO_H, (char *)&hhd->car_no2, (char *)&lhd->car_no2, sizeof(lhd->car_no2), 0);
    //sprintf((char *)hhd->car_no1, "%-14s", lhd->car_no1);
	//sprintf((char *)hhd->car_no2, "%-14s", lhd->car_no2);
    smemcpy(D_TO_A, L_TO_H, (char *)&hhd->x_point,   (char *)&lhd->x_point, 4, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hhd->y_point,   (char *)&lhd->y_point, 4, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hhd->img_width, (char *)&lhd->img_width, 4, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hhd->img_heigh, (char *)&lhd->img_heigh, 4, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hhd->dc_typ,    (char *)&lhd->dc_typ, 2, 0);
#if 1
    smemcpy(D_TO_A, L_TO_H, (char *)&hhd->tag_id1,   (char *)&lhd->tag_id1, 24, 0);
    smemcpy(D_TO_A, L_TO_H, (char *)&hhd->tag_id2,   (char *)&lhd->tag_id2, 24, 0);
#else
    sscanf((const char *)hhd->tag_id1   , "%2hhx", &lhd->tag_id1[0]);
    sscanf((const char *)hhd->tag_id1+2 , "%2hhx", &lhd->tag_id1[1]);
    sscanf((const char *)hhd->tag_id1+4 , "%2hhx", &lhd->tag_id1[2]);
    sscanf((const char *)hhd->tag_id1+6 , "%2hhx", &lhd->tag_id1[3]);
    sscanf((const char *)hhd->tag_id1+8 , "%2hhx", &lhd->tag_id1[4]);
    sscanf((const char *)hhd->tag_id1+10, "%2hhx", &lhd->tag_id1[5]);
    sscanf((const char *)hhd->tag_id1+12, "%2hhx", &lhd->tag_id1[6]);
    sscanf((const char *)hhd->tag_id1+14, "%2hhx", &lhd->tag_id1[7]);
    sscanf((const char *)hhd->tag_id1+16, "%2hhx", &lhd->tag_id1[8]);
    sscanf((const char *)hhd->tag_id1+18, "%2hhx", &lhd->tag_id1[9]);
    sscanf((const char *)hhd->tag_id1+20, "%2hhx", &lhd->tag_id1[10]);
    sscanf((const char *)hhd->tag_id1+22, "%2hhx", &lhd->tag_id1[11]);

    sscanf((const char *)hhd->tag_id2   , "%2hhx", &lhd->tag_id2[0]);
    sscanf((const char *)hhd->tag_id2+2 , "%2hhx", &lhd->tag_id2[1]);
    sscanf((const char *)hhd->tag_id2+4 , "%2hhx", &lhd->tag_id2[2]);
    sscanf((const char *)hhd->tag_id2+6 , "%2hhx", &lhd->tag_id2[3]);
    sscanf((const char *)hhd->tag_id2+8 , "%2hhx", &lhd->tag_id2[4]);
    sscanf((const char *)hhd->tag_id2+10, "%2hhx", &lhd->tag_id2[5]);
    sscanf((const char *)hhd->tag_id2+12, "%2hhx", &lhd->tag_id2[6]);
    sscanf((const char *)hhd->tag_id2+14, "%2hhx", &lhd->tag_id2[7]);
    sscanf((const char *)hhd->tag_id2+16, "%2hhx", &lhd->tag_id2[8]);
    sscanf((const char *)hhd->tag_id2+18, "%2hhx", &lhd->tag_id2[9]);
    sscanf((const char *)hhd->tag_id2+20, "%2hhx", &lhd->tag_id2[10]);
    sscanf((const char *)hhd->tag_id2+22, "%2hhx", &lhd->tag_id2[11]);
#endif
#ifdef _VERIFY_

    lane_log("환불처리 img_yn[%c][%x]\n", hhd->img_yn, lhd->img_yn);
    lane_log("환불처리 car_no1[%.14s][%.14s]\n", hhd->car_no1, lhd->car_no1);
    lane_log("환불처리 car_no2[%.14s][%.14s]\n", hhd->car_no2, lhd->car_no2);
    lane_log("환불처리 x_point[%.4s][%02x%02x]\n", hhd->x_point, lhd->x_point[0], lhd->x_point[1]);
    lane_log("환불처리 y_point[%.4s][%02x%02x]\n", hhd->y_point, lhd->y_point[0], lhd->y_point[1]);
    lane_log("환불처리 img_width[%.4s][%02x%02x]\n", hhd->img_width, lhd->img_width[0], lhd->img_width[1]);
    lane_log("환불처리 img_heigh[%.4s][%02x%02x]\n", hhd->img_heigh, lhd->img_heigh[0], lhd->img_heigh[1]);
    lane_log("환불처리 dc_typ[%.2s][%02x]\n", hhd->dc_typ, lhd->dc_typ);
    lane_log("환불처리 tag_id1[%.24s][%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x]\n", hhd->tag_id1,
            lhd->tag_id1[0], lhd->tag_id1[1], lhd->tag_id1[2], lhd->tag_id1[3],
            lhd->tag_id1[4], lhd->tag_id1[5], lhd->tag_id1[6], lhd->tag_id1[7],
            lhd->tag_id1[8], lhd->tag_id1[9], lhd->tag_id1[10], lhd->tag_id1[11]);
    lane_log("환불처리 tag_id2[%.24s][%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x]\n", hhd->tag_id2,
            lhd->tag_id2[0], lhd->tag_id2[1], lhd->tag_id2[2], lhd->tag_id2[3],
            lhd->tag_id2[4], lhd->tag_id2[5], lhd->tag_id2[6], lhd->tag_id2[7],
            lhd->tag_id2[8], lhd->tag_id2[9], lhd->tag_id2[10], lhd->tag_id2[11]);
#endif
#endif
    return (0);
}
