Example #1
0
 public void add_message(Message msg)
 {
     this.comms_q.Enqueue(msg);
 }
Example #2
0
 public void run()
 {
     while (run_th)
     {
         if (comms_q.Count > 0)
         {
             messg = comms_q.Dequeue();
             switch (messg.GetRequest())
             {
                 case Message.MsgRequest.FIND_DEVICES:
                     find_devices();
                     break;
                 case Message.MsgRequest.CONNECT_DEVICE:
                     connect_device(messg.GetMessage());
                     break;
             }
         }
         Thread.Sleep(10);
     }
 }