private void buttonDoor_Click(object sender, EventArgs e) { List <Packet> packetList = new List <Packet>(); packetList = SensorDataAccess.ListSensorTypeData(REED); displayPacketList(packetList); }
private void buttonAll_Click(object sender, EventArgs e) { List <Packet> packetList = new List <Packet>(); packetList = SensorDataAccess.ListAll(); displayPacketList(packetList); }
private void buttonSelect_Click(object sender, EventArgs e) { List <Packet> packetList = new List <Packet>(); packetList = SensorDataAccess.ListByAddress(selectedSensor); displayPacketList(packetList); }
private void populateSensorList() { List <byte> addresses = new List <byte>(); addresses = SensorDataAccess.ListSensorAddresses(); foreach (byte address in addresses) { listBoxSensors.Items.Add(address.ToString()); } }
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); } }
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!!"); } }