Exemple #1
0
        private void buttonDoor_Click(object sender, EventArgs e)
        {
            List <Packet> packetList = new List <Packet>();

            packetList = SensorDataAccess.ListSensorTypeData(REED);
            displayPacketList(packetList);
        }
Exemple #2
0
        private void buttonAll_Click(object sender, EventArgs e)
        {
            List <Packet> packetList = new List <Packet>();

            packetList = SensorDataAccess.ListAll();
            displayPacketList(packetList);
        }
Exemple #3
0
        private void buttonSelect_Click(object sender, EventArgs e)
        {
            List <Packet> packetList = new List <Packet>();

            packetList = SensorDataAccess.ListByAddress(selectedSensor);
            displayPacketList(packetList);
        }
Exemple #4
0
        private void populateSensorList()
        {
            List <byte> addresses = new List <byte>();

            addresses = SensorDataAccess.ListSensorAddresses();

            foreach (byte address in addresses)
            {
                listBoxSensors.Items.Add(address.ToString());
            }
        }
Exemple #5
0
        private void handleData(byte[] buf)
        {
            Packet packet = new Packet(buf);

            // if the checksum is correct store the packet in the db and send ack
            if (packet.correctCheckSum())
            {
                SensorDataAccess.SaveData(packet);
                transmitACK(packet);
            }
            else
            {
                transmitNACK(packet);
            }
        }
Exemple #6
0
        private void displayText(object o, EventArgs e)
        {
            // visa data för samtliga element i kön
            richTextBoxRX.Clear();
            List <Packet> packetList = new List <Packet>();

            packetList = SensorDataAccess.ListAll();

            if (packetList.Count > 0)
            {
                richTextBoxRX.AppendText("The database contains the following packets: \n");

                foreach (Packet packet in packetList)
                {
                    displayPacketContent(packet);
                }
            }
            else
            {
                richTextBoxRX.AppendText("There is nothing in the queue!!");
            }
        }