diff --git a/src/gnss.c b/src/gnss.c index d95f071..502612c 100644 --- a/src/gnss.c +++ b/src/gnss.c @@ -14,7 +14,7 @@ #include #define BUFFER_SIZE 256 -#define UPLOAD_DELAY_US 10000 +#define UPLOAD_DELAY_US 25000 #define UPLOAD_TIMEOUT_S 10 #define RESCHEDULE_IN_SECS 30 @@ -342,7 +342,7 @@ static void upload_assistance_data(struct EG25Manager *manager) do { errno = 0; /* Copy downloaded XTRA assistance data to the modem over serial */ - ret = sendfile(manager->at_fd, manager->gnss_assistance_fd, &written_total, sb.st_size); + ret = sendfile(manager->at_fd, manager->gnss_assistance_fd, &written_total, BUFFER_SIZE); error = errno; usleep(UPLOAD_DELAY_US); } while ((!error && written_total < sb.st_size) || (ret == -1 && error == EAGAIN)); @@ -376,13 +376,13 @@ static void finish_assistance_data_upload(struct EG25Manager *manager) /* Configure GNSS assistance clock to current system time (UTC) */ datetime = g_date_time_new_now_utc(); - timestring = g_date_time_format(datetime, "0,\"%Y/%m/%d,%H:%M:%S\"\r\n"); + timestring = g_date_time_format(datetime, "0,\"%Y/%m/%d,%H:%M:%S\""); g_message("Setting GNSS assistance UTC clock to: %s", timestring); at_append_command(manager, "QGPSXTRATIME", NULL, timestring, NULL, at_process_result); /* Configure GNSS engine to use uploaded GNSS assistance data */ - g_snprintf(value, BUFFER_SIZE, "\"RAM:%s\"\r\n", + g_snprintf(value, BUFFER_SIZE, "\"RAM:%s\"", manager->gnss_assistance_file); g_message("Setting GNSS assistance file to: %s", value); at_append_command(manager, "QGPSXTRADATA", NULL, value, NULL,