public Packet CreateGateOperatePacket(byte address, GateOperation action) { Packet order = new Packet(); order.Address = address; order.Order = OrderCode.Comm_GateOperationNotify; order.Parameters.AddRange(GetGateOperationParas(action)); return(order); }
/// <summary> /// 获取道闸操作指令 /// </summary> /// <param name="action"></param> /// <returns></returns> private byte[] GetGateOperationParas(GateOperation action) { byte[] operation = new byte[2]; switch (action) { case GateOperation.Close: operation[0] = (byte)Convert.ToChar("d"); operation[1] = (byte)Convert.ToChar("w"); break; case GateOperation.Open: operation[0] = (byte)Convert.ToChar("u"); operation[1] = 0; break; case GateOperation.Stop: operation[0] = (byte)Convert.ToChar("s"); operation[1] = (byte)Convert.ToChar("t"); break; } return(operation); }
public GateOperationNotify(int entranceID, GateOperation action, string operatorID) { this.EntranceID = entranceID; this.Action = action; this.OperatorID = operatorID; }