public RecepteurCodeCouleur(int socket)
     : base(socket)
 {
     this.adapteur = new GTM.GHIElectronics.XBeeAdapter(socket);
     adapteur.Configure(9600, GT.SocketInterfaces.SerialParity.None, GT.SocketInterfaces.SerialStopBits.One, 8, GT.SocketInterfaces.HardwareFlowControl.NotRequired);
     this.m_port = adapteur.Port;
     m_port.Open();
     Informations.printInformations(Priority.HIGH, "Port COM Recepteur code couleur ouvert.");
 }
Exemple #2
0
 void Port_LineReceived(GT.SocketInterfaces.Serial sender, string line)
 {
     Debug.Print(DateTime.Now + " : " + line);
     try
     {
         var detail = Json.NETMF.JsonSerializer.DeserializeString(line) as Hashtable;
         //var detail = obj["Data"] as Hashtable;
         SensorData data = new SensorData()
         {
             temp = Convert.ToDouble(detail["temp"].ToString()), humid = Convert.ToDouble(detail["humid"].ToString()), light = Convert.ToDouble(detail["light"].ToString())
         };
     }
     catch (Exception ex)
     {
         PrintToLCD(ex.Message);
     }
     submitData(line);
 }
Exemple #3
0
 void Port_LineReceived(GT.SocketInterfaces.Serial sender, string line)
 {
     Debug.Print(DateTime.Now + " : " + line);
 }