public ControllerState GetControllerRecord(Controller controller, long recordIndex) { WGPacket packet = new WGPacket(0xB0); packet.SetDevSn(controller.sn); packet.SetRecordIndex(recordIndex); DoSend(packet, controller.ip, controller.port); List <WGPacket> packets = WGRecievePacketAddClose(1); if (packets.Count == 1) { return(packets[0].ToControllerState(true)); } return(null); }
public bool SetControllerReadedIndex(Controller controller, long recordIndex) { WGPacket packet = new WGPacket(0xB2); packet.SetDevSn(controller.sn); packet.SetRecordIndex(recordIndex); packet.SetReadedIndexTag(); DoSend(packet, controller.ip, controller.port); List <WGPacket> packets = WGRecievePacketAddClose(1); if (packets.Count == 1) { return(packets[0].data[0] == 1); } return(false); }