package com.imdroid.beidou_fwd.task;

import com.imdroid.beidou_fwd.service.TCPClient;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;

@Component
@Configuration
@EnableScheduling
public class GXXfz2Forwarder extends GXXfzForwarder{
    private String FORWARDER_NAME = "广西路建";
    @Value("${gxlj.server.host}")
    private String host;

    @Value("${gxlj.server.port}")
    private int port;

    @PostConstruct
    @Override
    void registerMe(){
        init(FORWARDER_NAME, "TCP "+host+":"+port,6,FWD_DEVICE_ID,30);
        xfzTcpClient = new TCPClient();
        xfzTcpClient.init(host, port,listener);
        xfzTcpClient.start();
    }
}
