package com.cisdi.data.RFID.gateway.test;

import com.cisdi.data.RFID.gateway.RfidClient;
import com.cisdi.data.RFID.gateway.RfidDaemonTask;
import com.cisdi.data.RFID.gateway.RfidTaskStartVo;
import com.cisdi.data.sdk.param.PullSocketParam;

import java.util.concurrent.atomic.AtomicBoolean;

/**
 * @program: dacoo-data-sdk-DI-client
 * @description: RFID测试
 * @author: Mo
 * @created: 2021/06/02 14:46
 */
public class StartRfidTest {
    public static void main(String[] args) {
        try {
        RfidTaskStartVo taskStartVo = new RfidTaskStartVo();
        taskStartVo.setDeviceId("1000800");
        taskStartVo.setShouldRun(new AtomicBoolean(true));
        PullSocketParam socketParam = new PullSocketParam();
        socketParam.setPullInternal(2000);
        socketParam.setPeerIp("127.0.0.1");
        socketParam.setPeerPort(2112);
        socketParam.setTimeout(5000);
        taskStartVo.setSocketParam(socketParam);

        RfidClient fireClient = new RfidClient(taskStartVo);
        RfidDaemonTask daemonTask = new RfidDaemonTask(fireClient, taskStartVo);
        Thread thread = new Thread(daemonTask, "Rfid-Daemon-Task" );
        thread.start();
            Thread.sleep(100000000);
        } catch (Exception e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }
}