static struct qmi_nas_set_system_selection_preference_request sel_req;
+#define cmd_nas_do_set_system_selection_cb no_cb
+static enum qmi_cmd_result
+cmd_nas_do_set_system_selection_prepare(struct qmi_dev *qmi, struct qmi_request *req, struct qmi_msg *msg, char *arg)
+{
+ qmi_set_nas_set_system_selection_preference_request(msg, &sel_req);
+ return QMI_CMD_REQUEST;
+}
+
+static enum qmi_cmd_result
+do_sel_network(void)
+{
+ static bool use_sel_req = false;
+
+ if (!use_sel_req) {
+ use_sel_req = true;
+ uqmi_add_command(NULL, __UQMI_COMMAND_nas_do_set_system_selection);
+ }
+
+ return QMI_CMD_DONE;
+}
+
#define cmd_nas_set_network_modes_cb no_cb
static enum qmi_cmd_result
cmd_nas_set_network_modes_prepare(struct qmi_dev *qmi, struct qmi_request *req, struct qmi_msg *msg, char *arg)
}
qmi_set(&sel_req, mode_preference, val);
- qmi_set_nas_set_system_selection_preference_request(msg, &sel_req);
- return QMI_CMD_REQUEST;
+ return do_sel_network();
}
#define cmd_nas_set_network_preference_cb no_cb
pref = QMI_NAS_GSM_WCDMA_ACQUISITION_ORDER_PREFERENCE_WCDMA;
qmi_set(&sel_req, gsm_wcdma_acquisition_order_preference, pref);
- qmi_set_nas_set_system_selection_preference_request(msg, &sel_req);
- return QMI_CMD_REQUEST;
+ return do_sel_network();
+}
+
+#define cmd_nas_set_roaming_cb no_cb
+static enum qmi_cmd_result
+cmd_nas_set_roaming_prepare(struct qmi_dev *qmi, struct qmi_request *req, struct qmi_msg *msg, char *arg)
+{
+ QmiNasRoamingPreference pref;
+
+ if (!strcmp(arg, "any"))
+ pref = QMI_NAS_ROAMING_PREFERENCE_ANY;
+ else if (!strcmp(arg, "only"))
+ pref = QMI_NAS_ROAMING_PREFERENCE_NOT_OFF;
+ else if (!strcmp(arg, "off"))
+ pref = QMI_NAS_ROAMING_PREFERENCE_OFF;
+ else
+ return uqmi_add_error("Invalid argument");
+
+ qmi_set(&sel_req, roaming_preference, pref);
+ return do_sel_network();
}
#define cmd_nas_initiate_network_register_cb no_cb
#define __uqmi_nas_commands \
- __uqmi_command(nas_set_network_modes, set-network-modes, required, QMI_SERVICE_NAS), \
+ __uqmi_command(nas_do_set_system_selection, __set-system-selection, no, QMI_SERVICE_NAS), \
+ __uqmi_command(nas_set_network_modes, set-network-modes, required, CMD_TYPE_OPTION), \
__uqmi_command(nas_initiate_network_register, network-register, no, QMI_SERVICE_NAS), \
__uqmi_command(nas_network_scan, network-scan, no, QMI_SERVICE_NAS), \
__uqmi_command(nas_get_signal_info, get-signal-info, no, QMI_SERVICE_NAS), \
__uqmi_command(nas_get_serving_system, get-serving-system, no, QMI_SERVICE_NAS), \
- __uqmi_command(nas_set_network_preference, set-network-preference, required, QMI_SERVICE_NAS) \
+ __uqmi_command(nas_set_network_preference, set-network-preference, required, CMD_TYPE_OPTION), \
+ __uqmi_command(nas_set_roaming, set-network-roaming, required, CMD_TYPE_OPTION) \
#define nas_helptext \
" --set-network-modes <modes>: Set usable network modes (Syntax: <mode1>[,<mode2>,...])\n" \
" Available modes: all, lte, umts, gsm, cdma, td-scdma\n" \
- " --set-network-preference <mode> Set preferred network mode to <mode>\n" \
+ " --set-network-preference <mode>: Set preferred network mode to <mode>\n" \
" Available modes: auto, gsm, wcdma\n" \
+ " --set-network-roaming <mode>: Set roaming preference:\n" \
+ " Available modes: any, off, only\n" \
" --network-scan: Initiate network scan\n" \
" --network-register: Initiate network register\n" \
" --get-signal-info: Get signal strength info\n" \