protected virtual void OnDigitalIODataRead(DigitalIOdata e) { if (DigitalIODataRead != null) { DigitalIODataRead(this, e); } }
/// <summary> /// Constructs an encoded digital I/O packet. /// </summary> /// <param name="digitalIOdata"> /// DigitalIOdata object containing output states to be set. /// </param> /// <returns> /// Constructed and encoded digital I/O packet. /// </returns> public static byte[] ConstructDigitalIOpacket(DigitalIOdata digitalIOdata) { byte[] decodedPacket = new byte[] { (byte)PacketHeaders.DigitalIOdata, 0x00, digitalIOdata.State.ConvertToByte(), 0 }; decodedPacket = InsertChecksum(decodedPacket); return(PacketEncoding.EncodePacket(decodedPacket)); }
protected virtual void OnDigitalIODataReceived(DigitalIOdata e) { if (DigitalIODataReceived != null) DigitalIODataReceived(this, e); }
/// <summary> /// Sends digital IO packet to set digital output states. /// </summary> /// <param name="digitalIOdata"> /// Digital IO data representing digital output states to be set. /// </param> public void SendDigitalIOpacket(DigitalIOdata digitalIOdata) { SendByteArray(PacketConstruction.ConstructDigitalIOpacket(digitalIOdata)); PacketsWrittenCounter.DigitalIOdataPackets++; }
/// <summary> /// Writes <see cref="DigitalIOdata"/> to CSV file. Will create new file if required. /// </summary> /// <param name="digitalIOdata"> /// x-IMU digital I/O data. /// </param> public void WriteDigitalIOdata(DigitalIOdata digitalIOdata) { WriteCSVlineAtFileIndex(digitalIOdata.ConvertToCSVstring(), FileIndexes.DigitalIO); PacketsWrittenCounter.DigitalIOdataPackets++; }
/// <summary> /// Constructs an encoded digital I/O packet. /// </summary> /// <param name="digitalIOdata"> /// DigitalIOdata object containing output states to be set. /// </param> /// <returns> /// Constructed and encoded digital I/O packet. /// </returns> public static byte[] ConstructDigitalIOpacket(DigitalIOdata digitalIOdata) { byte[] decodedPacket = new byte[] { (byte)PacketHeaders.DigitalIOdata, 0x00, digitalIOdata.State.ConvertToByte(), 0}; decodedPacket = InsertChecksum(decodedPacket); return PacketEncoding.EncodePacket(decodedPacket); }