Index: ORadio/libindi/libindi/BAOTest/BAOtest_main.cpp
===================================================================
--- /BAORadio/libindi/libindi/BAOTest/BAOtest_main.cpp	(revision 494)
+++ 	(revision )
@@ -1,315 +1,0 @@
-/**************************************************************************************
-** Petit simulateur d'antenne
-** BAORadio
-** Franck RICHARD
-***************************************************************************************/
-
-#include "ClientSocket.h"
-#include "SocketException.h"
-#include <iostream>
-#include <string>
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <net/if.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <sys/ioctl.h>
-#include <netinet/in.h>
-
-using namespace std;
-
-
-/**************************************************************************************
-** Extraction de la position de l'antenne
-**
-***************************************************************************************/
-
-Position ExtractPosition(std::string str)
-{
-    Position result;
-
-    std::string str2, str3;
-
-    result.x=-1;
-    result.y=-1;
-
-    int pos = str.find("#");
-
-    if (pos!=string::npos)
-    {
-        str2 = str.substr(pos+2);
-
-        pos = str2.find("Az");
-
-        result.x=atoi(str2.substr(0, pos-1).c_str());
-
-        pos = str2.find("#");
-
-        if (pos!=string::npos)
-        {
-            str3 = str2.substr(pos+2);
-
-            pos = str3.find("Alt");
-
-            result.y=atoi(str3.substr(0, pos-1).c_str());;
-
-        }
-    }
-
-    return result;
-}
-
-Position ExtractPosition2(std::string str)
-{
-    Position result;
-
-    result.x=1000;
-    result.y=1000;
-
-    if (str.length()>9)
-    {
-        result.x=atoi(str.substr(2, 4).c_str());
-
-        result.y=atoi(str.substr(7, 4).c_str());
-
-        if (str[1]=='b') result.x=-result.x;
-
-        if (str[6]=='b') result.y=-result.y;
-    }
-
-    return result;
-}
-
-/**************************************************************************************
-** CrÃ©ation de l'identifiant de l'antenne Ã  partir de l'IP
-**
-***************************************************************************************/
-/*
-int NumeroServeur()
-{
-    std::string str, str2;
-
-    int fd;
-    struct ifreq ifr;
-
-    fd=socket(AF_INET, SOCK_DGRAM, 0);
-
-    ifr.ifr_addr.sa_family=AF_INET;
-
-    strncpy(ifr.ifr_name, "eth0", IFNAMSIZ-1);
-
-    ioctl(fd, SIOCGIFADDR, &ifr);
-
-    close(fd);
-
-    str=(std::string)inet_ntoa(((struct sockaddr_in *)&ifr.ifr_addr)->sin_addr);
-
-    int pos = str.find_last_of(".");
-
-    if (pos!=string::npos)
-    {
-        str2 = str.substr(pos+1);
-
-        return atoi(str2.c_str());
-    }
-
-    return -1;
-}
-*/
-
-
-/**************************************************************************************
-** MAIN
-**
-***************************************************************************************/
-
-#define ERREURS 50
-
-int main ( int argc, int argv[] )
-{
-    Position Pos;
-    char cIP;
-    char IP[20];
-    bool Aleat;
-
-    // Parametres sups
-    bool ErreursAleatoires=false;
-    bool Affichage=true;
-
-    // Position PARK
-    Pos.x=3000;
-    Pos.y=3000;
-
-    //init nbs alÃ©atoires
-    if (ErreursAleatoires) srand(time(NULL));
-
-    
-
-    std::cout <<  "******************\n";
-    std::cout <<  "* Simulateur BAO *\n";
-    std::cout <<  "******************\n\n";
-    std::cout <<  "Adresse IP du serveur :\n";
-    std::cout <<  "1)-  192.168.0.1\n";
-    std::cout <<  "2)-  127.0.0.1\n\n? ";
-    std::cin >> cIP;
-
-    if (cIP=='1') strcpy(IP, "192.168.0.1");
-    else strcpy(IP, "127.0.0.1");
-
-
-    try
-    {
-        ClientSocket client_socket ( IP, 8000 );
-
-        std::string reply;
-        std::string asks,memasks;
-        char chaine[5000];
-
-        while (true)
-        {
-            
-                client_socket.recv(asks);
-
-                int pos=asks.find("\n");
-                memasks=asks;
-		
-                while ((pos!=string::npos) && (asks.length()>1))
-                {
-                    memasks=asks.substr(pos+1);
-                    asks=asks.substr(0,pos);
-
-                    strcpy(chaine, "");
-
-                   
-                        if (ErreursAleatoires) Aleat=rand()%ERREURS != 1; else Aleat=1;
-
-                        if (Affichage) std::cout <<  "Pilote BAO : " << asks << "\n" ;
-         
-
-                        if (asks.find("s")!=string::npos)
-                        {
-                            strcpy(chaine, "ACK/STATUS\n");
-                            client_socket << chaine;
-
-                            if (Affichage) std::cout <<  "MicrocontrÃŽleur : " << chaine;
-
-                            if (Aleat)
-                            {
-                                strcpy(chaine, "STATUS/READY\n");
-                            }
-                            else
-                            {
-                                strcpy(chaine, "STATUS/BUSY\n");
-                            }
-                        }
-
-                        if (asks.find("p")!=string::npos)
-                        {
-
-                            strcpy(chaine,"ACK/POSITION\n");
-                            client_socket << chaine;
-
-                            if (Affichage) std::cout <<  "MicrocontrÃŽleur : " << chaine;
-
-                            if (Aleat)
-                            {
-                                sprintf(chaine, "POSITION/%i/%i/\n", Pos.x, Pos.y);
-                            }
-                            else
-                            {
-                                strcpy(chaine, "NACK/HALT/POSITION/\n");   //erreur moteur !
-                            }
-                        }
-
-                        if (asks.find("g")!=string::npos)
-                        {
-                            Pos=ExtractPosition2(asks);
-
-                            strcpy(chaine,"ACK/GOTO/\n");
-                            client_socket << chaine;
-
-                            if (Affichage)
-			    { 
-                               std::cout <<  "MicrocontrÃŽleur : " << chaine;
-
-                               std::cout <<  "Positionnement de l antenne...\n";
-                            }
-
-                            // sleep(rand()%10);
-
-                            if (Aleat)
-                            {
-                                strcpy(chaine, "OK/GOTO/\n");
-                            }
-                            else
-                            {
-                                strcpy(chaine, "NACK/HALT/GOTO/\n");   //erreur moteur !
-                            }
-                        }
-
-                        if (asks.find("pa")!=string::npos)
-                        {
-
-                            strcpy(chaine, "ACK/PARK\n");
-                            client_socket << chaine;
-
-                            if (Affichage) std::cout <<  "MicrocontrÃŽleur : " << chaine;
-
-                            if (Aleat)
-                            {
-                                strcpy(chaine, "OK/PARK/\n");
-                            }
-                            else
-                            {
-                                strcpy(chaine, "NACK/HALT/PARK/\n");   //erreur
-                            }
-                        }
-
-                        if (asks.find("a")!=string::npos)
-                        {
-
-                            strcpy(chaine,"ACK/ABORT\n");
-                            client_socket << chaine;
-
-                            if (Affichage) std::cout <<  "MicrocontrÃŽleur : " << chaine;
-
-                            if (Aleat)
-                            {
-                                strcpy(chaine, "OK/ABORT/\n");
-                            }
-                            else
-                            {
-                                strcpy(chaine, "NACK/HALT/ABORT/\n");   //erreur
-                            }
-                        }
-
-                        if (strlen(chaine)>1)
-                        {
-                            //   usleep(200);
-
-                            client_socket << chaine;
-
-
-                            if (Affichage)
-                            {
-                                std::cout <<  "MicrocontrÃŽleur : " << chaine;
-
-                                std::cout <<  "---------\n";
-                            }
-                        }
-                    
-
-                    asks=memasks;
-                    pos=asks.find("\n");
-                }           
-            
-        }
-    }
-    catch ( SocketException& e )
-    {
-        std::cout << "Exception was caught:" << e.description() << "\n";
-    }
-
-    return 0;
-}
Index: /BAORadio/libindi/libindi/BAOTest/Makefile
===================================================================
--- /BAORadio/libindi/libindi/BAOTest/Makefile	(revision 494)
+++ /BAORadio/libindi/libindi/BAOTest/Makefile	(revision 495)
@@ -4,5 +4,5 @@
 simple_server_objects = ServerSocket.o Socket.o simple_server_main.o
 simple_client_objects = ClientSocket.o Socket.o simple_client_main.o
-BAOtest_objects = ClientSocket.o  Socket.o BAOtest_main.o
+BAOtest_objects = ClientSocket.o ServerSocket.o Socket.o BAOtest_main.o
 
 
Index: /BAORadio/libindi/libindi/BAOTest/ServerSocket.cpp
===================================================================
--- /BAORadio/libindi/libindi/BAOTest/ServerSocket.cpp	(revision 494)
+++ /BAORadio/libindi/libindi/BAOTest/ServerSocket.cpp	(revision 495)
@@ -21,5 +21,5 @@
       throw SocketException ( "Could not listen to socket." );
     }
-Socket::set_non_blocking(true);
+//Socket::set_non_blocking(true);
 }
 
@@ -45,5 +45,5 @@
   if ( ! Socket::recv ( s ) )
     {
-      throw SocketException ( "Could not read from socket." );
+     throw SocketException ( "Could not read from socket." );
     }
 
@@ -58,2 +58,10 @@
     }
 }
+
+void ServerSocket::recv( std::string& s ) 
+{
+  if ( ! Socket::recv ( s ) )
+    {
+    throw SocketException ( "Could  not read from socket." );
+    }
+}
Index: /BAORadio/libindi/libindi/BAOTest/ServerSocket.h
===================================================================
--- /BAORadio/libindi/libindi/BAOTest/ServerSocket.h	(revision 494)
+++ /BAORadio/libindi/libindi/BAOTest/ServerSocket.h	(revision 495)
@@ -18,4 +18,6 @@
   const ServerSocket& operator >> ( std::string& ) const;
 
+  void recv( std::string& s );
+
   void accept ( ServerSocket& );
 
Index: /BAORadio/libindi/libindi/drivers/telescope/BAO.cpp
===================================================================
--- /BAORadio/libindi/libindi/drivers/telescope/BAO.cpp	(revision 494)
+++ /BAORadio/libindi/libindi/drivers/telescope/BAO.cpp	(revision 495)
@@ -225,4 +225,8 @@
     SocketsNumber  = 1;
     
+    ActualisationTM1 = 15.0*60.0;
+    
+    ActualisationTM2 = 5.0;
+    
     InitThreadOK=false;
     LecturePosition=false;
@@ -299,14 +303,20 @@
     IUFillNumberVector(&GeographicCoordsWNP, GeographicCoordsWN, NARRAY(GeographicCoordsWN), mydev, "GEOGRAPHIC_COORD" , "Geographic coords", OPTIONS_GROUP, IP_WO, 0, IPS_IDLE);
     
+    // Actualisation - SET
+    IUFillNumber(&ActualisationN1[0], "DELAY", "Transit mode delay (Sec)", "%10.6m",  0., 3600., 0., 0.);
+    IUFillNumberVector(&ActualisationNP1, ActualisationN1, NARRAY(ActualisationN1), mydev, "DELAY1" , "", OPTIONS_GROUP, IP_WO, 0, IPS_IDLE);
+    
+    IUFillNumber(&ActualisationN2[0], "DELAY", "Tracking mode delay (Sec)", "%10.6m",  0., 3600., 0., 0.);
+    IUFillNumberVector(&ActualisationNP2, ActualisationN2, NARRAY(ActualisationN2), mydev, "DELAY2" , "", OPTIONS_GROUP, IP_WO, 0, IPS_IDLE);
     
     // Transit threshold
-    IUFillNumber(&SlewAccuracyN[0], "TransitRA",  "RA (arcmin)", "%10.6m",  0., 60., 1., 3.0);
-    IUFillNumber(&SlewAccuracyN[1], "TransitDEC", "Dec (arcmin)", "%10.6m", 0., 60., 1., 3.0);
-    IUFillNumberVector(&SlewAccuracyNP, SlewAccuracyN, NARRAY(SlewAccuracyN), mydev, "Transit Accuracy", "", OPTIONS_GROUP, IP_RW, 0, IPS_IDLE);
+    //IUFillNumber(&SlewAccuracyN[0], "TransitRA",  "RA (arcmin)", "%10.6m",  0., 60., 1., 3.0);
+    //IUFillNumber(&SlewAccuracyN[1], "TransitDEC", "Dec (arcmin)", "%10.6m", 0., 60., 1., 3.0);
+    //IUFillNumberVector(&SlewAccuracyNP, SlewAccuracyN, NARRAY(SlewAccuracyN), mydev, "Transit Accuracy", "", OPTIONS_GROUP, IP_RW, 0, IPS_IDLE);
     
     // Tracking threshold
-    IUFillNumber(&TrackAccuracyN[0], "TrackingRA", "RA (arcmin)", "%10.6m",  0., 60., 1., 3.0);
-    IUFillNumber(&TrackAccuracyN[1], "TrackingDEC", "Dec (arcmin)", "%10.6m", 0., 60., 1., 3.0);
-    IUFillNumberVector(&TrackAccuracyNP, TrackAccuracyN, NARRAY(TrackAccuracyN), mydev, "Tracking Accuracy", "", OPTIONS_GROUP, IP_RW, 0, IPS_IDLE);
+    //IUFillNumber(&TrackAccuracyN[0], "TrackingRA", "RA (arcmin)", "%10.6m",  0., 60., 1., 3.0);
+    //IUFillNumber(&TrackAccuracyN[1], "TrackingDEC", "Dec (arcmin)", "%10.6m", 0., 60., 1., 3.0);
+    //IUFillNumberVector(&TrackAccuracyNP, TrackAccuracyN, NARRAY(TrackAccuracyN), mydev, "Tracking Accuracy", "", OPTIONS_GROUP, IP_RW, 0, IPS_IDLE);
     
   }
@@ -332,6 +342,8 @@
     
     // Options
-    IDDefNumber(&SlewAccuracyNP, NULL);
-    IDDefNumber(&TrackAccuracyNP, NULL);
+    //IDDefNumber(&SlewAccuracyNP, NULL);
+    //IDDefNumber(&TrackAccuracyNP, NULL);   
+    IDDefNumber(&ActualisationNP1, NULL);
+    IDDefNumber(&ActualisationNP2, NULL);
     
   }
@@ -448,5 +460,5 @@
 	if (eqp == &EquatorialCoordsWN[0])
 	{
-	  newRA = values[i];
+	  newRA = values[i];	  
 	  nset += newRA >= 0 && newRA <= 24.0;
 	}
@@ -489,4 +501,65 @@
       
       return;
+    }
+      
+    // ===================================
+    // Actualisation
+    // ===================================
+    if (!strcmp (name, ActualisationNP1.name))
+    {
+      int i=0, nset=0, error_code=0;
+      double newAct1 =0;
+      
+      for (nset = i = 0; i < n; i++)
+      {
+	INumber *eqp = IUFindNumber (&ActualisationNP1, names[i]);
+	if (eqp == &ActualisationN1[0])
+	{
+	  newAct1 = values[i];
+	  
+	  if (newAct1 >= 0.0 && newAct1 <= 3600.0)
+	  {
+	    ActualisationTM1=newAct1;
+		
+	    ActualisationNP1.s = IPS_OK;
+	    IDSetNumber(&ActualisationNP1, NULL);
+          }
+          else
+          {
+	    ActualisationNP1.s = IPS_ALERT;
+	    IDSetNumber(&ActualisationNP1, "Delay invalid");
+          }
+	}
+      }
+      
+    }
+    
+    if (!strcmp (name, ActualisationNP2.name))
+    {
+      int i=0, nset=0, error_code=0;
+      double newAct2 =0;
+      
+      for (nset = i = 0; i < n; i++)
+      {
+	INumber *eqp = IUFindNumber (&ActualisationNP2, names[i]);
+	if (eqp == &ActualisationN2[0])
+	{
+	  newAct2 = values[i];
+	  
+	  if (newAct2 >= 0.0 && newAct2 <= 3600.0)
+	  {
+	    ActualisationTM2=newAct2;
+		
+	    ActualisationNP2.s = IPS_OK;
+	    IDSetNumber(&ActualisationNP2, NULL);
+          }
+          else
+          {
+	    ActualisationNP2.s = IPS_ALERT;
+	    IDSetNumber(&ActualisationNP2, "Delay invalid");
+          }
+	}
+      }
+      
     } /* end EquatorialCoordsWNP */
   }
@@ -620,6 +693,8 @@
     //EquatorialCoordsRNP.s	= IPS_IDLE;
     GeographicCoordsWNP.s	= IPS_IDLE;
-    SlewAccuracyNP.s		= IPS_IDLE;
-    TrackAccuracyNP.s		= IPS_IDLE;
+    //SlewAccuracyNP.s		= IPS_IDLE;
+    //TrackAccuracyNP.s		= IPS_IDLE;
+    ActualisationNP1.s		= IPS_IDLE;
+    ActualisationNP2.s		= IPS_IDLE;
     
     IUResetSwitch(&OnCoordSetSP);
@@ -639,6 +714,9 @@
     //IDSetNumber(&EquatorialCoordsRNP, NULL);
     IDSetNumber(&GeographicCoordsWNP, NULL);
-    IDSetNumber(&SlewAccuracyNP, NULL);
-    IDSetNumber(&TrackAccuracyNP, NULL);
+    //IDSetNumber(&SlewAccuracyNP, NULL);
+    //IDSetNumber(&TrackAccuracyNP, NULL);
+    IDSetNumber(&ActualisationNP1, NULL);
+    IDSetNumber(&ActualisationNP2, NULL);
+   
   }
   
@@ -843,5 +921,5 @@
       //Y a-t-il de nouvelles tentatives de connexion sur le serveur ?
       
-      InitThread();
+      InitThread();          
     }
     
@@ -1101,7 +1179,7 @@
 	// DurÃ©e entre deux actualisations
 	
-	double delai=15.0/60.0/24.0;   // Actualisation toutes les 15 minutes en mode transit
-	
-	if (TrackingMode==2) delai=5.0/3600.0/24.0;   //et 5 secs en mode tracking
+	double delai=ActualisationTM1/3600.0/24.0;   // Actualisation toutes les 15 minutes en mode transit
+	
+	if (TrackingMode==2) delai=ActualisationTM2/3600.0/24.0;   //et 5 secs en mode tracking
 	  
 	  
@@ -1363,7 +1441,7 @@
 	  
 	  //pour tester le programme de FranÃ§ois, on envoie ces coordonnees sur sa demande
-	   if (!GOTO(i, 1000, -3000)) Sockets[i].sendalertes++;
-	  
-	  //if (!GOTO(i, TargetPosition.x, TargetPosition.y)) Sockets[i].sendalertes++;
+	  //if (!GOTO(i, 1000, -3000)) Sockets[i].sendalertes++;
+	  
+	  if (!GOTO(i, Sockets[i].Pos.x - TargetPosition.x, Sockets[i].Pos.y - TargetPosition.y )) Sockets[i].sendalertes++;
 	  
 	  Sockets[i].etape++;
@@ -1487,4 +1565,5 @@
 	IDSetSwitch (&ConnectSP, "BAORadio is online. Retrieving basic data...");
 	
+	
 	break;
 	
@@ -1519,4 +1598,6 @@
   {
     //  IDSetNumber (&EquatorialCoordsRNP, NULL);
+    
+     
   }
   
@@ -1677,5 +1758,5 @@
     }
     
-    sprintf(Params, "%c%03i%c%03i", sensAz, deltaAz, sensAlt, deltaAlt);
+    sprintf(Params, "%c%04i%c%04i", sensAz, deltaAz, sensAlt, deltaAlt);
     
     return COMMANDE(numsocket, (char*)"g", Params);
Index: /BAORadio/libindi/libindi/drivers/telescope/BAO.h
===================================================================
--- /BAORadio/libindi/libindi/drivers/telescope/BAO.h	(revision 494)
+++ /BAORadio/libindi/libindi/drivers/telescope/BAO.h	(revision 495)
@@ -117,6 +117,9 @@
     INumber EquatorialCoordsWN[2];
     INumber GeographicCoordsWN[2];
-    INumber SlewAccuracyN[2];
-    INumber TrackAccuracyN[2];
+    INumber ActualisationN1[1];
+    INumber ActualisationN2[1];
+    
+    //INumber SlewAccuracyN[2];
+    //INumber TrackAccuracyN[2];
 
     /* Switch Vectors */
@@ -130,6 +133,9 @@
     INumberVectorProperty EquatorialCoordsWNP;
     INumberVectorProperty GeographicCoordsWNP;
-    INumberVectorProperty SlewAccuracyNP;
-    INumberVectorProperty TrackAccuracyNP;
+    //INumberVectorProperty SlewAccuracyNP;
+    //INumberVectorProperty TrackAccuracyNP;
+    INumberVectorProperty ActualisationNP1;
+    INumberVectorProperty ActualisationNP2;
+   
 
     /* Text Vectors */
@@ -170,4 +176,6 @@
     double lastDEC;
     double JJAnc;                       // Sauvegarde du jour julien de la derniÃšre actualisation de la position (fct Goto)
+    double ActualisationTM1;
+    double ActualisationTM2;
     bool   simulation;
     bool   fault;
