mirror of
https://gitlab.com/mobian1/eg25-manager.git
synced 2025-08-30 07:42:23 +02:00
Merge branch 'gnss-upload-failure' into 'master'
gnss: properly clean temporary file before downloading assistance data Closes #17 See merge request mobian1/devices/eg25-manager!27
This commit is contained in:
12
src/at.c
12
src/at.c
@@ -77,20 +77,20 @@ gboolean at_send_command(struct EG25Manager *manager)
|
|||||||
} else {
|
} else {
|
||||||
/* Allow the modem to enter soft sleep again when we sent the AT command*/
|
/* Allow the modem to enter soft sleep again when we sent the AT command*/
|
||||||
gpio_sequence_sleep(manager);
|
gpio_sequence_sleep(manager);
|
||||||
|
|
||||||
if (manager->modem_state < EG25_STATE_CONFIGURED) {
|
if (manager->modem_state < EG25_STATE_CONFIGURED) {
|
||||||
if (manager->modem_iface == MODEM_IFACE_MODEMMANAGER) {
|
if (manager->modem_iface == MODEM_IFACE_MODEMMANAGER) {
|
||||||
#ifdef HAVE_MMGLIB
|
#ifdef HAVE_MMGLIB
|
||||||
MMModemState modem_state = mm_modem_get_state(manager->mm_modem);
|
MMModemState modem_state = mm_modem_get_state(manager->mm_modem);
|
||||||
|
|
||||||
if (manager->mm_modem && modem_state >= MM_MODEM_STATE_REGISTERED)
|
if (manager->mm_modem && modem_state >= MM_MODEM_STATE_REGISTERED)
|
||||||
modem_update_state(manager, modem_state);
|
modem_update_state(manager, modem_state);
|
||||||
else
|
else
|
||||||
manager->modem_state = EG25_STATE_CONFIGURED;
|
manager->modem_state = EG25_STATE_CONFIGURED;
|
||||||
#endif
|
#endif
|
||||||
} else {
|
} else {
|
||||||
manager->modem_state = EG25_STATE_CONFIGURED;
|
manager->modem_state = EG25_STATE_CONFIGURED;
|
||||||
}
|
}
|
||||||
} else if (manager->modem_state == EG25_STATE_SUSPENDING) {
|
} else if (manager->modem_state == EG25_STATE_SUSPENDING) {
|
||||||
modem_suspend_post(manager);
|
modem_suspend_post(manager);
|
||||||
} else if (manager->modem_state == EG25_STATE_RESETTING) {
|
} else if (manager->modem_state == EG25_STATE_RESETTING) {
|
||||||
|
@@ -190,7 +190,9 @@ static void fetch_assistance_data(struct EG25Manager *manager)
|
|||||||
long int size;
|
long int size;
|
||||||
|
|
||||||
/* Fetch assistance data with curl */
|
/* Fetch assistance data with curl */
|
||||||
tmp_file = fdopen(manager->gnss_assistance_fd, "wb");
|
tmp_file = fdopen(manager->gnss_assistance_fd, "wb+");
|
||||||
|
lseek(manager->gnss_assistance_fd, 0, SEEK_SET);
|
||||||
|
ftruncate(manager->gnss_assistance_fd, 0);
|
||||||
url = g_strconcat(manager->gnss_assistance_url, "/",
|
url = g_strconcat(manager->gnss_assistance_url, "/",
|
||||||
manager->gnss_assistance_file, NULL);
|
manager->gnss_assistance_file, NULL);
|
||||||
curl = curl_easy_init();
|
curl = curl_easy_init();
|
||||||
|
@@ -7,6 +7,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
#include <unistd.h>
|
||||||
#include <curl/curl.h>
|
#include <curl/curl.h>
|
||||||
|
|
||||||
#include "manager.h"
|
#include "manager.h"
|
||||||
|
Reference in New Issue
Block a user