hardware/gps
Revisión | 598ad0a81eb4dd7ad2482f092dc494057fd57897 (tree) |
---|---|
Tiempo | 2015-03-24 10:33:42 |
Autor | Keith Conger <keith.conger@gmai...> |
Commiter | Chih-Wei Huang |
* Added 4800 baud support
@@ -60,7 +60,7 @@ static int id_in_fixed[12]; | ||
60 | 60 | #define GPS_DEV_SLOW_UPDATE_RATE (10) |
61 | 61 | #define GPS_DEV_HIGH_UPDATE_RATE (1) |
62 | 62 | |
63 | -#define GPS_DEV_LOW_BAUD (B9600) | |
63 | +#define GPS_DEV_LOW_BAUD (B4800) | |
64 | 64 | #define GPS_DEV_HIGH_BAUD (B115200) |
65 | 65 | static void gps_dev_init(int fd); |
66 | 66 | static void gps_dev_deinit(int fd); |
@@ -966,7 +966,10 @@ gps_state_init( GpsState* state, GpsCallbacks* callbacks ) | ||
966 | 966 | ios.c_iflag |= (IGNCR | IXOFF); /* Ignore \r & XON/XOFF on input */ |
967 | 967 | // set baud rate and other flags |
968 | 968 | property_get("ro.kernel.android.gpsttybaud",baud,"9600"); |
969 | - if (strcmp(baud, "9600") == 0) { | |
969 | + if (strcmp(baud, "4800") == 0) { | |
970 | + ALOGE("setting gps baud rate to 4800"); | |
971 | + ios.c_cflag = B4800 | CRTSCTS | CS8 | CLOCAL | CREAD; | |
972 | + } else if (strcmp(baud, "9600") == 0) { | |
970 | 973 | ALOGE("setting gps baud rate to 9600"); |
971 | 974 | ios.c_cflag = B9600 | CRTSCTS | CS8 | CLOCAL | CREAD; |
972 | 975 | } else if (strcmp(baud, "19200") == 0) { |