示例#1
0
 protected void RaiseMessageArrived(EventArgMessage msg) {
   RaiseRxPacket(); 
   EventHandler<EventArgMessage> handler = messageArrivedEvent;
   if (handler != null) {
     handler(this, msg);
   }
 }
示例#2
0
        protected void RaiseMessageArrived(EventArgMessage msg)
        {
            RaiseRxPacket();
            EventHandler <EventArgMessage> handler = messageArrivedEvent;

            if (handler != null)
            {
                handler(this, msg);
            }
        }
示例#3
0
 private void onReceive(object sender, EventArgMessage msg) {
   Message recMsg;
   try {
     recMsg = new SerialMessage(msg.getMsg());
     EventArgSerialMessage eventArgSerialMessage = new EventArgSerialMessage();
     eventArgSerialMessage.msg = (SerialMessage)recMsg;
     EventHandler<EventArgSerialMessage> handler = onMessageArrived;
     if (handler != null) {
       handler(this, eventArgSerialMessage);
     }
   } catch (Exception e) { throw e; }
 }
示例#4
0
        private void onReceive(object sender, EventArgMessage msg)
        {
            Message recMsg;

            try {
                recMsg = new SerialMessage(msg.getMsg());
                EventArgSerialMessage eventArgSerialMessage = new EventArgSerialMessage();
                eventArgSerialMessage.msg = (SerialMessage)recMsg;
                EventHandler <EventArgSerialMessage> handler = onMessageArrived;
                if (handler != null)
                {
                    handler(this, eventArgSerialMessage);
                }
            } catch (Exception e) { throw e; }
        }
示例#5
0
    private void OnMoteMessageArrived(object sender, EventArgMessage msg) {

      if (!tcpClient.Connected) {
        return;
      }
      try {
        this.Send(msg.getMsg());
      } catch (Exception e) {
        RaiseEventClientDC(e.Message);
        this.tcpClient.Close();
      }
    }
示例#6
0
 private void OnTCPMessageArrived(object sender, EventArgMessage msg) {
   Thread moteMessenger = new Thread(new ParameterizedThreadStart(SendMessageToMote));
   moteMessenger.Start(msg.getMsg());
 }