import wei.yigulu.iec104.apdumodel.Apdu;
import wei.yigulu.iec104.apdumodel.Asdu;
import wei.yigulu.iec104.asdudataframe.PulseTotalSummonType;
import wei.yigulu.iec104.nettyconfig.Iec104HSMasterBuilder;
import wei.yigulu.iec104.util.SendDataFrameHelper;


/**
 * 客户端测试
 *
 * @author 修唯xiuwei
 * @create 2019-01-22 16:05
 * @Email 524710549@qq.com
 **/
public class ClientTest {

	public static void main(String[] args) throws Exception {
		Iec104HSMasterBuilder iec104HSMasterBuilder = new Iec104HSMasterBuilder("127.0.0.1", 2404);
				iec104HSMasterBuilder.createByUnBlock();
		Thread.sleep(3000L);
		PulseTotalSummonType pulseTotalSummonType =new PulseTotalSummonType();
		Asdu asdu = pulseTotalSummonType.generateBack();
		Apdu apdu=new Apdu();
		apdu.setAsdu(asdu);
		iec104HSMasterBuilder.sendFrameToOpposite(apdu.encode());
		/*Apdu apdu=new Apdu();
		iec104HSMasterBuilder.sendFrameToOpposite(apdu.encode());
		SendDataFrameHelper.sendTotalSummonFrame(iec104HSMasterBuilder.getFuture().channel(),1,6,iec104HSMasterBuilder.getLog());
		System.out.println(123);*/
	}

}
