public SactaMsg(MsgType type, int id, int seq, int version = 0, int result = 0) { Type = type; Id = (ushort)((id & 0xE000) | (seq & 0x1FFF)); Hour = (uint)(DateTime.Now - new DateTime(1970, 1, 1)).TotalSeconds; switch (type) { case MsgType.Presence: Length = 11; Info = new PresenceInfo(); break; case MsgType.SectAnwer: Length = 3; Info = new SectAnswerInfo((uint)version, (byte)result); break; } }
public SactaMsg(MsgType type, ushort id) { Type = type; Id = id; Hour = (uint)(DateTime.Now - new DateTime(1970, 1, 1)).TotalSeconds; switch (type) { case MsgType.Presence: Length = 11; Info = new PresenceInfo(); break; case MsgType.SectAnwer: Length = 3; Info = new SectAnswerInfo(); break; } }
public SactaMsg(MsgType type, ushort id, uint sectVersion, string[] sectorUcs) { Type = type; Id = id; Hour = (uint)(DateTime.Now - new DateTime(1970, 1, 1)).TotalSeconds; switch (type) { case MsgType.Presence: Length = 11; Info = new PresenceInfo(); break; case MsgType.Sectorization: UserOrg = Settings.Default.SactaSPSIUser; Info = new SectInfo(sectVersion, sectorUcs); Length = (ushort)(4 + (4 * ((SectInfo)Info).NumSectors)); break; } }
public SactaMsg(MsgType type, int id, int seq, Dictionary <string, int> sectorUcs = null, int version = 0, int result = 0) { Type = type; Id = (ushort)((id & 0xE000) | (seq & 0x1FFF)); Hour = (uint)(DateTime.Now - new DateTime(1970, 1, 1)).TotalSeconds; switch (type) { case MsgType.Presence: Length = 11; Info = new PresenceInfo(); break; case MsgType.SectAnswer: Length = 3; Info = new SectAnswerInfo((uint)version, (byte)result); break; case MsgType.Sectorization: Info = new SectInfo((uint)version, sectorUcs); Length = (ushort)(4 + (4 * ((SectInfo)Info).NumSectors)); break; } }