public bool SetAlarmConnectPortSetting(Controller controller, AlarmConnectPortSetting setting) { WGPacket packet = new WGPacket(0xC6); packet.SetDevSn(controller.sn); packet.SetAlarmConnectPortSetting(setting); DoSend(packet, controller.ip, controller.port); List <WGPacket> packets = WGRecievePacketAddClose(1); if (packets.Count == 1) { return(packets[0].data[0] == 1); } return(false); }