public CCResultCode NewEmptyOperaionalList() { if (this.cci == null) { return CCResultCode.CCERR_UNKNOWN_FAILURE; } NewOperationalMessage msg = new NewOperationalMessage(); MemoryStream stream = new MemoryStream(); stream.Write(Encoding.ASCII.GetBytes(" "), 0, 4); stream.Write(Encoding.ASCII.GetBytes("0000"), 0, 4); stream.Position = 0; bool a = msg.Init(stream); return (CCResultCode)this.cci.SendMessage(msg); }
public CCResultCode NewOperationalMessage(string timeStamp, string operationalMessageId, string description, bool isHighPriority) { if (this.cci == null) { return CCResultCode.CCERR_UNKNOWN_FAILURE; } NewOperationalMessage msg = new NewOperationalMessage(); msg.MsgSeq = " "; msg.NumOfSubMessages = "0001"; MemoryStream stream = new MemoryStream(); stream.Write(Encoding.ASCII.GetBytes(" "), 0, 4); stream.Write(Encoding.ASCII.GetBytes("0001"), 0, 4); byte[] p1 = Encoding.ASCII.GetBytes(timeStamp.ToString(14)); //14 stream.Write(p1, 0, p1.Length); byte[] p2 = Encoding.ASCII.GetBytes(operationalMessageId.ToString(12)); //12 stream.Write(p2, 0, p2.Length); byte[] p3 = Encoding.ASCII.GetBytes(description.ToString(80)); //80 stream.Write(p3, 0, p3.Length); byte[] p4 = Encoding.ASCII.GetBytes(isHighPriority ? "1" : "0".ToString(1)); //1 stream.Write(p4, 0, p4.Length); stream.Position = 0; bool a = msg.Init(stream); return (CCResultCode)this.cci.SendMessage(msg); }