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

            if (handler != null)
            {
                handler(this, msg);
            }
        }
Example #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; }
 }
Example #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; }
        }
    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();
      }
    }
 private void OnTCPMessageArrived(object sender, EventArgMessage msg) {
   Thread moteMessenger = new Thread(new ParameterizedThreadStart(SendMessageToMote));
   moteMessenger.Start(msg.getMsg());
 }