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 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; } }
static private void newMsgHandler(Object sender, EventArgSerialMessage e) { TestSerialMessage testSerialMsg = new TestSerialMessage(e.msg.GetPayload()); Console.WriteLine("Received packet sequence number " + testSerialMsg[TestSerialMessage.COUNTER]); }
private void newMsgHandler(Object sender, EventArgSerialMessage e) { prompt.WriteLine(BitConverter.ToString(e.msg.GetMessageBytes(), 0), Console.ForegroundColor); }
static void mote_onMessageArrived(object sender, EventArgSerialMessage e) { MoteMessage data = new MoteMessage(e.msg.GetPayload()); data.Print(); }