Exemplo n.º 1
0
 private void _onPacketEvent(Packet _packet, EventHandler<DataEventArgs> _handler)
 {
     if (_handler != null)
         _handler(this, new DataEventArgs(_packet));
 }
Exemplo n.º 2
0
 public DataEventArgs(Packet _packet)
 {
     m_packet = _packet;
 }
Exemplo n.º 3
0
 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);
 }