public MasterKeepAliveRequest(RadioID id, RadioSystemType type) : base(PacketType.MasterKeepAliveRequest)
 {
     this.id           = id;
     this.digital      = true;
     this.supportsCSBK = true;
     this.systype      = type;
 }
Example #2
0
 public Preamble(byte followingBlocks, RadioID target, RadioID source) : base(CSBKOpCode.Preamble)
 {
     this.csbkBlocksFollow = followingBlocks;
     this.target           = target;
     this.source           = source;
     this.lastBlock        = true;
 }
 public MasterRegistrationRequest(RadioID id, RadioSystemType type) : base(PacketType.RegistrationRequest)
 {
     this.id           = id;
     this.digital      = true;
     this.supportsCSBK = true;
     this.systype      = type;
 }
Example #4
0
 public VoiceHeader(byte[] data) : base(data)
 {
     this.isProtected    = ((data[8] & 0x80) != 0);
     this.featureID      = data[9];
     this.serviceOptions = data[10];
     this.dest           = new RadioID(data, 11, 3);
     this.src            = new RadioID(data, 14, 3);
 }
Example #5
0
 public Preamble(byte[] data) : base(data)
 {
     dataNext         = ((this.data[0] & 0x80) != 0);
     isGroup          = ((this.data[0] & 0x40) != 0);
     csbkBlocksFollow = this.data[1];
     this.target      = new RadioID(this.data, 2, 3);
     this.source      = new RadioID(this.data, 5, 3);
 }
Example #6
0
 public LRRPPacketEventArgs(LRRPPacket p, IPEndPoint ep)
 {
     this.Packet   = p;
     this.Endpoint = ep;
     byte[] tmp = ep.Address.GetAddressBytes();
     this.CAI       = tmp[0];
     this.ID        = new RadioID(tmp, 1, 3);
     this.Timestamp = DateTime.Now;
 }
Example #7
0
 public TMSMessageEventArgs(TMSMessage p, IPEndPoint ep, DataCall call)
 {
     this.Packet   = p;
     this.Endpoint = ep;
     byte[] tmp = ep.Address.GetAddressBytes();
     this.CAI       = tmp[0];
     this.ID        = new RadioID(tmp, 1, 3);
     this.Timestamp = DateTime.Now;
     this.Call      = call;
 }
Example #8
0
 public UserPacket(RadioID id, bool data, bool group, RadioID source, RadioID target, bool encrypted, bool phone, UInt32 groupTag, Burst b) : this(data, group)
 {
     this.id        = id;
     this.src       = source;
     this.dest      = target;
     this.encrypted = encrypted;
     this.phone     = phone;
     this.groupTag  = groupTag;
     this.burst     = b;
 }
Example #9
0
        public XNLClient(Radio r, RadioID sysid)
        {
            this.r                   = r;
            this.id                  = sysid;
            this.transactionID       = 0;
            this.flags               = 0;
            this.pendingTransactions = new Dictionary <ushort, XNLPacket>();

            r.GotXNLXCMPPacket += new PacketHandler(this.HandleXNLPacket);
            this.initSuccess    = this.Init();
        }
Example #10
0
 public RadioCheck(RadioID from, RadioID to) : base(CSBKOpCode.MototrboRadioCheck)
 {
     //Radio Check is motorola specific.
     this.featureID   = 0x10;
     this.lastBlock   = true;
     this.hasSlotType = true;
     this.slotType    = 3;
     this.syncType    = 2;
     this.from        = from;
     this.to          = to;
 }
Example #11
0
        public void WriteRSSI(RadioID id, Tuple <float, float> rssis)
        {
            string       sql = "INSERT INTO rssi(radioid, time, rssi1, rssi2) VALUES (@id, NOW(), @rssi1, @rssi2);";
            MySqlCommand cmd = new MySqlCommand(sql, this.conn);

            cmd.Parameters.AddWithValue("@id", id.Int);
            cmd.Parameters.AddWithValue("@rssi1", rssis.Item1);
            cmd.Parameters.AddWithValue("@rssi2", rssis.Item2);
            cmd.Prepare();
            cmd.ExecuteNonQuery();
        }
Example #12
0
 public DataHeader(byte[] data) : base(data)
 {
     this.isGroup           = ((data[8] & 0x80) != 0);
     this.responseRequested = ((data[8] & 0x40) != 0);
     this.compressed        = ((data[8] & 0x20) != 0);
     this.headerType        = (byte)(data[8] & 0x0F);
     this.padOctetCount     = (byte)(data[8] & 0x10);
     this.padOctetCount    |= (byte)(data[9] & 0x0F);
     this.contentType       = (ContentType)(data[9] >> 4);
     this.to           = new RadioID(data, 10, 3);
     this.from         = new RadioID(data, 13, 3);
     this.fullMessage  = ((data[16] & 0x80) != 0);
     this.blocksFollow = (byte)(data[16] & 0x7F);
     this.crc          = (UInt16)(data[17] << 8 | data[18]);
 }
Example #13
0
        public DBRadio ReadRadio(RadioID id)
        {
            string       sql = "SELECT * FROM radio WHERE id=@id";
            MySqlCommand cmd = new MySqlCommand(sql, this.conn);

            cmd.Parameters.AddWithValue("@id", id.Int);
            using (MySqlDataReader rdr = cmd.ExecuteReader())
            {
                if (rdr.Read())
                {
                    return(new DBRadio(rdr.GetUInt32(0), rdr.GetString(1), rdr.GetDateTime(2), rdr.GetFloat(3), rdr.GetInt32(4), rdr.GetDouble(5), rdr.GetFloat(6), rdr.GetDateTime(7), rdr.GetFloat(8), rdr.GetDateTime(9)));
                }
                return(null);
            }
        }
Example #14
0
        public void WriteVoiceCall(RadioID from, RadioID to, DateTime start, DateTime end, float rssi, int slot, string filename)
        {
            string       sql = "INSERT INTO voicecalls(source, dest, start, end, rssi, slot, recordingpath) VALUES (@src, @dest, @start, @end, @rssi, @slot, @path);";
            MySqlCommand cmd = new MySqlCommand(sql, this.conn);

            cmd.Parameters.AddWithValue("@src", from.Int);
            cmd.Parameters.AddWithValue("@dest", to.Int);
            cmd.Parameters.AddWithValue("@start", start);
            cmd.Parameters.AddWithValue("@end", end);
            cmd.Parameters.AddWithValue("@rssi", rssi);
            cmd.Parameters.AddWithValue("@slot", slot);
            cmd.Parameters.AddWithValue("@path", filename);
            cmd.Prepare();
            cmd.ExecuteNonQuery();
        }
Example #15
0
        public string UpdateRepeater(RadioID id, string serialNum, string modelNum, string fwver)
        {
            string       sql = "INSERT INTO repeaters(id, serialnumber, modelnumber, firmwareversion, lastseen) VALUES (@id, @serialnumber, @modelnumber, @fw, NOW()) ON DUPLICATE KEY UPDATE serialnumber=@serialnumber, modelnumber=@modelnumber, firmwareversion=@fw, lastseen=NOW();";
            MySqlCommand cmd = new MySqlCommand(sql, this.conn);

            cmd.Parameters.AddWithValue("@id", id.Int);
            cmd.Parameters.AddWithValue("@serialnumber", serialNum);
            cmd.Parameters.AddWithValue("@modelnumber", modelNum);
            cmd.Parameters.AddWithValue("@fw", fwver);
            cmd.Prepare();
            cmd.ExecuteNonQuery();

            cmd = new MySqlCommand("SELECT name from repeaters WHERE id=" + id.Int, this.conn);
            object test = cmd.ExecuteScalar();

            if (test.GetType() == typeof(DBNull))
            {
                return(String.Empty);
            }
            return((string)test);
        }
Example #16
0
 public UserPacket(byte[] data) : base(data)
 {
     this.src      = new RadioID(data, 6, 3);
     this.dest     = new RadioID(data, 9, 3);
     this.calltype = data[12];
     //This seems to be some kind of group tag to help group packets together
     this.groupTag  = (UInt32)((data[13] << 24) | (data[14] << 16) | (data[15] << 8) | data[16]);
     this.encrypted = ((data[17] & 0x80) != 0);
     this.end       = ((data[17] & 0x40) != 0);
     this.timeslot  = ((data[17] & 0x20) != 0);
     this.phone     = ((data[17] & 0x10) != 0);
     //RTP Data...
     this.rtp = new RTPData(data, 18);
     //Burst data...
     if (this.rtp.Extension)
     {
         throw new Exception("Have a header extenstion! Don't know how to process packet!");
     }
     else
     {
         this.burst = Burst.Decode(data.Skip(30).ToArray());
     }
 }
Example #17
0
 public PeerRegistrationRequest(RadioID id) : this(id, RadioSystemType.IPSiteConnect)
 {
 }
Example #18
0
        public Tuple <float, float, float?> GetCurrentLocation(RadioID id, RadioSystem sys)
        {
            IPAddress ip = sys.GetIPForRadio(id);

            return(this.GetCurrentLocation(ip.ToString()));
        }
Example #19
0
        public int GetRemoteRadioLRRPVersion(RadioID id, RadioSystem sys)
        {
            IPAddress ip = sys.GetIPForRadio(id);

            return(this.GetRemoteRadioLRRPVersion(ip.ToString()));
        }
Example #20
0
 public Packet(Byte[] data)
 {
     this.type = (PacketType)data[0];
     this.id   = new RadioID(data, 1);
     this.data = data.Skip(5).ToArray();
 }
Example #21
0
 public XNLXCMPPacket(RadioID id, XNLPacket pkt) : base(PacketType.XnlXCMPPacket)
 {
     this.id   = id;
     this.data = pkt.Encode();
 }
Example #22
0
 public PeerListRequest(RadioID id) : base(PacketType.PeerListRequest)
 {
     this.id   = id;
     this.data = new byte[0];
 }
Example #23
0
 public RadioCheck(byte[] data) : base(data)
 {
     isAck = (this.data[1] & 0x80) != 0;
     from  = new RadioID(this.data, 2, 3);
     to    = new RadioID(this.data, 5, 3);
 }
Example #24
0
 public PeerKeepAliveRequest(RadioID id) : this(id, true, true)
 {
 }
Example #25
0
        public bool SendText(string message, RadioID id, RadioSystem sys, bool confirmReciept)
        {
            IPAddress ip = sys.GetIPForRadio(id);

            return(this.SendText(message, ip.ToString(), confirmReciept));
        }
Example #26
0
 public PeerKeepAliveRequest(RadioID id, bool digital, bool csbk) : base(PacketType.PeerKeepAliveRequest)
 {
     this.id           = id;
     this.digital      = digital;
     this.supportsCSBK = csbk;
 }
 public MasterKeepAliveRequest(RadioID id) : this(id, RadioSystemType.IPSiteConnect)
 {
 }
Example #28
0
 public PeerKeepAliveReply(RadioID id, RadioSystemType type) : base(PacketType.PeerKeepAliveReply)
 {
     this.id      = id;
     this.systype = type;
 }
Example #29
0
 public PeerKeepAliveReply(RadioID id) : this(id, RadioSystemType.IPSiteConnect)
 {
 }
Example #30
0
 public PeerRegistrationRequest(RadioID id, RadioSystemType type) : base(PacketType.PeerRegisterRequest)
 {
     this.id      = id;
     this.systype = type;
 }