int signal_min; /* min strength reported via CIND */
int signal_max; /* max strength reported via CIND */
int tech;
+ struct ofono_network_time time;
unsigned int vendor;
};
static void ctzv_notify(GAtResult *result, gpointer user_data)
{
- //struct ofono_netreg *netreg = user_data;
- //struct netreg_data *nd = ofono_netreg_get_data(netreg);
+ struct ofono_netreg *netreg = user_data;
+ struct netreg_data *nd = ofono_netreg_get_data(netreg);
+ int year, mon, mday, hour, min, sec;
const char *tz, *time;
GAtResultIter iter;
return;
DBG("tz %s time %s", tz, time);
+
+ if (sscanf(time, "%u/%u/%u,%u:%u:%u", &year, &mon, &mday,
+ &hour, &min, &sec) != 6)
+ return;
+
+ nd->time.sec = sec;
+ nd->time.min = min;
+ nd->time.hour = hour;
+ nd->time.mday = mday;
+ nd->time.mon = mon;
+ nd->time.year = 2000 + year;
}
static void ctzdst_notify(GAtResult *result, gpointer user_data)
{
- //struct ofono_netreg *netreg = user_data;
- //struct netreg_data *nd = ofono_netreg_get_data(netreg);
+ struct ofono_netreg *netreg = user_data;
+ struct netreg_data *nd = ofono_netreg_get_data(netreg);
int dst;
GAtResultIter iter;
return;
DBG("dst %d", dst);
+
+ nd->time.dst = dst;
+
+ ofono_netreg_time_notify(netreg, &nd->time);
}
static void cind_cb(gboolean ok, GAtResult *result, gpointer user_data)
nd->chat = g_at_chat_clone(chat);
nd->vendor = vendor;
nd->tech = -1;
+ nd->time.sec = -1;
+ nd->time.min = -1;
+ nd->time.hour = -1;
+ nd->time.mday = -1;
+ nd->time.mon = -1;
+ nd->time.year = -1;
+ nd->time.dst = 0;
+ nd->time.utcoff = 0;
ofono_netreg_set_data(netreg, nd);
g_at_chat_send(nd->chat, "AT+CREG=?", creg_prefix,