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

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

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

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

            addresses = SensorDataAccess.ListSensorAddresses();

            foreach (byte address in addresses)
            {
                listBoxSensors.Items.Add(address.ToString());
            }
        }
예제 #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);
            }
        }
예제 #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!!");
            }
        }