#include <string.h>
#include <stdio.h>
#include <errno.h>
+#include <stdint.h>
#include <glib.h>
#include <gdbus.h>
enum ofono_radio_band_gsm pending_band_gsm;
enum ofono_radio_band_umts pending_band_umts;
ofono_bool_t fast_dormancy_pending;
+ uint32_t available_rats;
const struct ofono_radio_settings_driver *driver;
void *driver_data;
struct ofono_atom *atom;
DBUS_TYPE_BOOLEAN, &value);
}
+ if (rs->available_rats) {
+ const char *rats_strs[OFONO_RADIO_ACCESS_MODE_LTE + 1];
+ const char **strs = rats_strs;
+ int str_i = 0;
+ size_t i, techs = sizeof(rats_strs)/sizeof(rats_strs[0]) - 1;
+
+ for (i = 0; i < techs; ++i)
+ if (rs->available_rats & (1 << i))
+ rats_strs[str_i++] =
+ radio_access_mode_to_string(i + 1);
+
+ rats_strs[str_i] = NULL;
+
+ ofono_dbus_dict_append_array(&dict, "AvailableTechnologies",
+ DBUS_TYPE_STRING, &strs);
+ }
+
dbus_message_iter_close_container(&iter, &dict);
return reply;
__ofono_dbus_pending_reply(&rs->pending, reply);
}
+static void radio_available_rats_query_callback(const struct ofono_error *error,
+ unsigned int available_rats,
+ void *data)
+{
+ struct ofono_radio_settings *rs = data;
+
+ if (error->type == OFONO_ERROR_TYPE_NO_ERROR)
+ rs->available_rats = available_rats;
+ else
+ DBG("Error while querying available rats");
+
+ radio_send_properties_reply(rs);
+}
+
+static void radio_query_available_rats(struct ofono_radio_settings *rs)
+{
+ /* Modem technology is not supposed to change, so one query is enough */
+ if (rs->driver->query_available_rats == NULL || rs->available_rats) {
+ radio_send_properties_reply(rs);
+ return;
+ }
+
+ rs->driver->query_available_rats(
+ rs, radio_available_rats_query_callback, rs);
+}
+
static void radio_fast_dormancy_query_callback(const struct ofono_error *error,
ofono_bool_t enable, void *data)
{
}
radio_set_fast_dormancy(rs, enable);
- radio_send_properties_reply(rs);
+ radio_query_available_rats(rs);
}
static void radio_query_fast_dormancy(struct ofono_radio_settings *rs)