backup
authorBenoit Papillault <benoit.papillault@gmail.com>
Tue, 19 Dec 2017 14:00:51 +0000 (15:00 +0100)
committerBenoit Papillault <benoit.papillault@gmail.com>
Tue, 19 Dec 2017 14:00:51 +0000 (15:00 +0100)
Makefile
sirf3.cpp

index ff70db1..1ce768c 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -13,8 +13,8 @@ LDLIBS                += -lgps -lm
 #GPSTK_HOME    = $(HOME)/gpstk
 GPSTK_HOME     = /usr/local
 CPPFLAGS       += -I$(GPSTK_HOME)/include/gpstk/
-LDFLAGS                += -L$(GPSTK_HOME)/lib
-LDLIBS         += -lprocframe -lgpstk
+#LDFLAGS               += -L$(GPSTK_HOME)/lib
+#LDLIBS                += -lprocframe -lgpstk
 
 default: mygps sirf
 
index 57fbabe..8c685c5 100644 (file)
--- a/sirf3.cpp
+++ b/sirf3.cpp
@@ -780,8 +780,8 @@ int main(int argc, const char *argv[])
                perror("tcgetattr");
        }
        cfmakeraw(&term);
-       cfsetispeed(&term, B115200);
-       cfsetospeed(&term, B115200);
+       cfsetispeed(&term, B9600);
+       cfsetospeed(&term, B9600);
        /* 8N1 */
        term.c_cflag &= ~(CSIZE|PARENB|CSTOPB);
        term.c_cflag |=   CS8;
@@ -793,7 +793,7 @@ int main(int argc, const char *argv[])
 
        const char to_sirf[] = "$PSRF100,0,9600,8,1,0*0C\n";
        /* -1 : we do not want to send the null terminating character */
-       //write(fd, to_sirf, sizeof(to_sirf)-1);
+       write(fd, to_sirf, sizeof(to_sirf)-1);
 
        /* Set Binary Serial Port.  Note : the effect of changing the baud
           rate is not immediate at all */
@@ -809,14 +809,14 @@ int main(int argc, const char *argv[])
           115200       115200 bit/s
        */
 
-       unsigned int baud = 115200;
+       unsigned int baud = 9600;
        unsigned char msg_134[] = { 134, 
                                    (baud >> 24) & 0xff,
                                    (baud >> 16) & 0xff,
                                    (baud >>  8) & 0xff,
                                    (baud >>  0) & 0xff,
                                    8, 1, 0, 0 };
-       sirf_msg_send(fd, msg_134, sizeof(msg_134));
+       //sirf_msg_send(fd, msg_134, sizeof(msg_134));
        /*
        if (tcgetattr(fd, &term) != 0) {
                perror("tcgetattr");
@@ -857,7 +857,9 @@ int main(int argc, const char *argv[])
                                    0x00, 0x00,
                                    12,
                                    /* Clear memory */
-                                   /* (1<<2) | */
+                                   //(1<<2) |
+                                   /* Factory reset = 4800, 8N1, NMEA */
+                                   //(1<<3) |
                                    /* Enable raw track & debug data */
                                    (1<<4) | (1<<5) };
        sirf_msg_send(fd, msg_128, sizeof(msg_128));