Index: trunk/lib/FlairMeta/src/UavFactory.cpp
===================================================================
--- trunk/lib/FlairMeta/src/UavFactory.cpp	(revision 38)
+++ trunk/lib/FlairMeta/src/UavFactory.cpp	(revision 41)
@@ -29,9 +29,18 @@
 using namespace flair::meta;
 
+namespace { // anonymous
+     vector<flair::meta::Uav* (*)(FrameworkManager*,string,string,UavMultiplex*)> vectoroffunctions;
+}
+
 Uav *CreateUav(FrameworkManager *parent, string uav_name, string uav_type,
                UavMultiplex *multiplex) {
-  /*if(uav_type=="ardrone2") {
-        return new ArDrone2(parent,uav_name,multiplex);
-    } else */ if (uav_type == "hds_x4") {
+
+  Uav *uav;
+  for(int i=0;i<vectoroffunctions.size();i++) {
+    uav=vectoroffunctions.at(i)(parent, uav_name, uav_type,multiplex);
+    if(uav!=NULL) return uav;
+  }
+
+  if (uav_type == "hds_x4") {
     parent->Err("UAV type %s not yet implemented\n", uav_type.c_str());
     return NULL;
@@ -60,2 +69,8 @@
   }
 }
+
+void RegisterUavCreator(flair::meta::Uav*(*func)(FrameworkManager *parent, string uav_name, string uav_type,
+               UavMultiplex *multiplex)) {
+                 vectoroffunctions.push_back(func);
+
+}
Index: trunk/lib/FlairMeta/src/UavFactory.h
===================================================================
--- trunk/lib/FlairMeta/src/UavFactory.h	(revision 38)
+++ trunk/lib/FlairMeta/src/UavFactory.h	(revision 41)
@@ -25,3 +25,6 @@
                             flair::filter::UavMultiplex *multiplex = NULL);
 
+void RegisterUavCreator(flair::meta::Uav*(*func)(flair::core::FrameworkManager *parent,
+                                   std::string uav_name, std::string uav_type,
+                                   flair::filter::UavMultiplex *multiplex));
 #endif // UAVFACTORY
Index: trunk/lib/FlairSensorActuator/src/Mb800.cpp
===================================================================
--- trunk/lib/FlairSensorActuator/src/Mb800.cpp	(revision 38)
+++ trunk/lib/FlairSensorActuator/src/Mb800.cpp	(revision 41)
@@ -43,5 +43,5 @@
   /** Debut init **/
   char response[200] = {0};
-  int size;
+  int size,written;
 
   /** Fin init **/
@@ -49,29 +49,44 @@
   /** Debut config **/
   char to_send[] = "$PASHS,NME,ALL,A,OFF\r\n";
-  serialport->Write(to_send, sizeof(to_send));
-
+  written=serialport->Write(to_send, sizeof(to_send));
+  if (written< 0) {
+      Thread::Err("erreur Write (%s)\n", strerror(-written));
+  }
+/*
   {
     char to_send[] = "$PASHS,CPD,AFP,95.0\r\n";
-    serialport->Write(to_send, sizeof(to_send));
+    written=serialport->Write(to_send, sizeof(to_send));
+    if (written< 0) {
+      Thread::Err("erreur Write (%s)\n", strerror(-written));
+    }
   }
   {
     char to_send[] = "$PASHS,DIF,PRT,C,RT3\r\n";
-    serialport->Write(to_send, sizeof(to_send));
+    written=serialport->Write(to_send, sizeof(to_send));
+    if (written< 0) {
+      Thread::Err("erreur Write (%s)\n", strerror(-written));
+    }
   }
-
+*/
   if ((NMEAFlags & GGA) != 0) {
     char to_send[] = "$PASHS,NME,GGA,A,ON,0.05\r\n";
-    size = serialport->Write(to_send, sizeof(to_send));
-    // Printf("ecrit %i\n",size);
+    written = serialport->Write(to_send, sizeof(to_send));
+    if (written< 0) {
+      Thread::Err("erreur Write (%s)\n", strerror(-written));
+    }
   }
   if ((NMEAFlags & VTG) != 0) {
     char to_send[] = "$PASHS,NME,VTG,A,ON,0.05\r\n";
-    size = serialport->Write(to_send, sizeof(to_send));
-    // Printf("%i\n",size);
+    written = serialport->Write(to_send, sizeof(to_send));
+    if (written< 0) {
+      Thread::Err("erreur Write (%s)\n", strerror(-written));
+    }
   }
   if ((NMEAFlags & GST) != 0) {
     char to_send[] = "$PASHS,NME,GST,A,ON,0.05\r\n";
-    size = serialport->Write(to_send, sizeof(to_send));
-    // Printf("%i\n",size);
+    written = serialport->Write(to_send, sizeof(to_send));
+    if (written< 0) {
+      Thread::Err("erreur Write (%s)\n", strerror(-written));
+    }
   }
 
@@ -84,6 +99,7 @@
 
   while (!ToBeStopped()) {
+    //Printf("loop\n");
     SleepMS(10);
-    size = 0;
+    size = 0;/*
     while (!ToBeStopped()) {
       ssize_t read = serialport->Read(&response[size], 1);
@@ -95,7 +111,7 @@
         break;
       size++;
-    }
+    }*/
     size++;
-    parseFrame(response, size);
+    //parseFrame(response, size);
   }
   /** fin running loop **/
@@ -106,8 +122,10 @@
   char data = 0;
   ssize_t read = 0;
-
+Printf("sync\n");
   // attente fin trame
-  while (data != 0x0a) {
+  while (data != 0x0a && !ToBeStopped()) {
     read = serialport->Read(&data, 1);
+    SleepMS(10);
+    Printf("%i %x\n",read,data);
     if (read < 0) {
       Thread::Err("erreur Read (%s)\n", strerror(-read));
