private void _onPacketEvent(Packet _packet, EventHandler<DataEventArgs> _handler) { if (_handler != null) _handler(this, new DataEventArgs(_packet)); }
public DataEventArgs(Packet _packet) { m_packet = _packet; }
public bool sendPacket(Packet _packet) { if (m_writer == null) m_writer = new BinaryWriter(new MemoryStream(m_sendBuffer)); _clearSendBuffer(); m_writer.Seek(0, SeekOrigin.Begin); _packet.write(m_writer); m_writer.Flush(); return m_comPort.sendData(m_sendBuffer, 0U, DataConnector.mc_uPacketSize); }