Add files via upload
parent
3ddd25a1ba
commit
e4faf0a403
@ -0,0 +1,50 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=uqmi
|
||||
PKG_RELEASE:=2021-11-19_2
|
||||
|
||||
# PKG_SOURCE_PROTO:=git
|
||||
# PKG_SOURCE_URL=$(PROJECT_GIT)/project/uqmi.git
|
||||
# PKG_SOURCE_DATE:=2019-06-27
|
||||
# PKG_SOURCE_VERSION:=1965c713937495a5cb029165c16acdb6572c3f87
|
||||
# PKG_MIRROR_HASH:=3c39b1c1f20b7d523b0891d08b3d10233331ada8e11d0b55cfd4882816308951
|
||||
# PKG_MAINTAINER:=Matti Laakso <malaakso@elisanet.fi>
|
||||
|
||||
PKG_LICENSE:=GPL-2.0
|
||||
PKG_LICENSE_FILES:=
|
||||
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
|
||||
PKG_FLAGS:=nonshared
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include $(INCLUDE_DIR)/cmake.mk
|
||||
|
||||
define Package/uqmi
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
SUBMENU:=WWAN
|
||||
DEPENDS:=+libubox +libblobmsg-json +kmod-usb-net +kmod-usb-net-qmi-wwan +wwan
|
||||
TITLE:=Control utility for mobile modems with APN
|
||||
endef
|
||||
|
||||
define Package/uqmi/description
|
||||
uqmi is a command line tool for controlling mobile broadband modems using
|
||||
the QMI-protocol.
|
||||
endef
|
||||
|
||||
TARGET_CFLAGS += \
|
||||
-I$(STAGING_DIR)/usr/include -ffunction-sections -fdata-sections
|
||||
|
||||
TARGET_LDFLAGS += -Wl,--gc-sections
|
||||
|
||||
CMAKE_OPTIONS += \
|
||||
-DDEBUG=1
|
||||
|
||||
define Package/uqmi/install
|
||||
$(INSTALL_DIR) $(1)/sbin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/uqmi $(1)/sbin/
|
||||
$(CP) ./files/* $(1)/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,uqmi))
|
@ -0,0 +1,71 @@
|
||||
cmake_minimum_required(VERSION 2.6)
|
||||
|
||||
PROJECT(uqmi C)
|
||||
|
||||
OPTION(BUILD_STATIC OFF)
|
||||
|
||||
ADD_DEFINITIONS(-Os -ggdb -Wall -Werror --std=gnu99 -Wmissing-declarations -Wno-enum-conversion)
|
||||
|
||||
SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "")
|
||||
|
||||
SET(SOURCES main.c dev.c commands.c qmi-message.c mbim.c)
|
||||
|
||||
FIND_PATH(ubox_include_dir libubox/usock.h)
|
||||
FIND_PATH(blobmsg_json_include_dir libubox/blobmsg_json.h)
|
||||
FIND_PATH(json_include_dir json-c/json.h json/json.h json.h)
|
||||
INCLUDE_DIRECTORIES(${ubox_include_dir} ${blobmsg_json_include_dir} ${json_include_dir})
|
||||
|
||||
IF(BUILD_STATIC)
|
||||
FIND_LIBRARY(json_library NAMES libjson.a libjson-c.a)
|
||||
FIND_LIBRARY(blobmsg_json_library NAMES libblobmsg_json.a)
|
||||
FIND_LIBRARY(ubox_library NAMES libubox.a)
|
||||
ELSE(BUILD_STATIC)
|
||||
FIND_LIBRARY(json_library NAMES json-c json)
|
||||
FIND_LIBRARY(blobmsg_json_library NAMES blobmsg_json)
|
||||
FIND_LIBRARY(ubox_library NAMES ubox)
|
||||
ENDIF(BUILD_STATIC)
|
||||
|
||||
SET(LIBS ${ubox_library} ${blobmsg_json_library} ${json_library})
|
||||
|
||||
IF(DEBUG_PACKET)
|
||||
ADD_DEFINITIONS(-DDEBUG_PACKET)
|
||||
ENDIF()
|
||||
|
||||
IF(DEBUG)
|
||||
ADD_DEFINITIONS(-DDEBUG -g3)
|
||||
ENDIF()
|
||||
|
||||
SET(service_headers)
|
||||
SET(service_sources)
|
||||
FOREACH(service ctl dms nas pds wds wms wda uim)
|
||||
ADD_CUSTOM_COMMAND(
|
||||
OUTPUT ${CMAKE_SOURCE_DIR}/qmi-message-${service}.h
|
||||
COMMAND ${CMAKE_SOURCE_DIR}/data/gen-header.pl ${service}_ ${CMAKE_SOURCE_DIR}/data/qmi-service-${service}.json > ${CMAKE_SOURCE_DIR}/qmi-message-${service}.h
|
||||
DEPENDS ${CMAKE_SOURCE_DIR}/data/gen-header.pl ${CMAKE_SOURCE_DIR}/data/qmi-service-${service}.json ${CMAKE_SOURCE_DIR}/data/gen-common.pm
|
||||
)
|
||||
SET(service_headers ${service_headers} qmi-message-${service}.h)
|
||||
ADD_CUSTOM_COMMAND(
|
||||
OUTPUT ${CMAKE_SOURCE_DIR}/qmi-message-${service}.c
|
||||
COMMAND ${CMAKE_SOURCE_DIR}/data/gen-code.pl ${service}_ ${CMAKE_SOURCE_DIR}/data/qmi-service-${service}.json > ${CMAKE_SOURCE_DIR}/qmi-message-${service}.c
|
||||
DEPENDS ${CMAKE_SOURCE_DIR}/data/gen-code.pl ${CMAKE_SOURCE_DIR}/data/qmi-service-${service}.json ${CMAKE_SOURCE_DIR}/data/gen-common.pm
|
||||
)
|
||||
SET(service_sources ${service_sources} qmi-message-${service}.c)
|
||||
set_property(SOURCE qmi-message-${service}.c PROPERTY COMPILE_FLAGS "-Wno-unused")
|
||||
ENDFOREACH()
|
||||
|
||||
ADD_CUSTOM_COMMAND(
|
||||
OUTPUT ${CMAKE_SOURCE_DIR}/qmi-errors.c
|
||||
COMMAND ${CMAKE_SOURCE_DIR}/data/gen-error-list.pl ${CMAKE_SOURCE_DIR}/qmi-errors.h > ${CMAKE_SOURCE_DIR}/qmi-errors.c
|
||||
DEPENDS ${CMAKE_SOURCE_DIR}/data/gen-error-list.pl ${CMAKE_SOURCE_DIR}/qmi-errors.h
|
||||
)
|
||||
ADD_CUSTOM_TARGET(gen-errors DEPENDS qmi-errors.c)
|
||||
ADD_CUSTOM_TARGET(gen-headers DEPENDS ${service_headers})
|
||||
|
||||
ADD_EXECUTABLE(uqmi ${SOURCES} ${service_sources})
|
||||
ADD_DEPENDENCIES(uqmi gen-headers gen-errors)
|
||||
|
||||
TARGET_LINK_LIBRARIES(uqmi ${LIBS})
|
||||
|
||||
INSTALL(TARGETS uqmi
|
||||
RUNTIME DESTINATION sbin
|
||||
)
|
@ -0,0 +1,450 @@
|
||||
/*
|
||||
* uqmi -- tiny QMI support implementation
|
||||
*
|
||||
* Copyright (C) 2014-2015 Felix Fietkau <nbd@openwrt.org>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301 USA.
|
||||
*/
|
||||
#include "qmi-message.h"
|
||||
|
||||
static struct {
|
||||
QmiDmsUimPinId pin_id;
|
||||
char* pin;
|
||||
char* new_pin;
|
||||
char* puk;
|
||||
} dms_req_data;
|
||||
|
||||
static void cmd_dms_get_capabilities_cb(struct qmi_dev *qmi, struct qmi_request *req, struct qmi_msg *msg)
|
||||
{
|
||||
void *t, *networks;
|
||||
int i;
|
||||
struct qmi_dms_get_capabilities_response res;
|
||||
const char *radio_cap[] = {
|
||||
[QMI_DMS_RADIO_INTERFACE_CDMA20001X] = "cdma1x",
|
||||
[QMI_DMS_RADIO_INTERFACE_EVDO] = "cdma1xevdo",
|
||||
[QMI_DMS_RADIO_INTERFACE_GSM] = "gsm",
|
||||
[QMI_DMS_RADIO_INTERFACE_UMTS] = "umts",
|
||||
[QMI_DMS_RADIO_INTERFACE_LTE] = "lte",
|
||||
};
|
||||
const char *service_cap[] = {
|
||||
[QMI_DMS_DATA_SERVICE_CAPABILITY_NONE] = "none",
|
||||
[QMI_DMS_DATA_SERVICE_CAPABILITY_CS] = "cs",
|
||||
[QMI_DMS_DATA_SERVICE_CAPABILITY_PS] = "ps",
|
||||
[QMI_DMS_DATA_SERVICE_CAPABILITY_SIMULTANEOUS_CS_PS] = "simultaneous_cs_ps",
|
||||
[QMI_DMS_DATA_SERVICE_CAPABILITY_NON_SIMULTANEOUS_CS_PS] = "non_simultaneous_cs_ps",
|
||||
};
|
||||
|
||||
qmi_parse_dms_get_capabilities_response(msg, &res);
|
||||
|
||||
t = blobmsg_open_table(&status, NULL);
|
||||
|
||||
blobmsg_add_u32(&status, "max_tx_channel_rate", (int32_t) res.data.info.max_tx_channel_rate);
|
||||
blobmsg_add_u32(&status, "max_rx_channel_rate", (int32_t) res.data.info.max_rx_channel_rate);
|
||||
if ((int)res.data.info.data_service_capability >= 0 && res.data.info.data_service_capability < ARRAY_SIZE(service_cap))
|
||||
blobmsg_add_string(&status, "data_service", service_cap[res.data.info.data_service_capability]);
|
||||
|
||||
if(res.data.info.sim_capability == QMI_DMS_SIM_CAPABILITY_NOT_SUPPORTED)
|
||||
blobmsg_add_string(&status, "sim", "not supported");
|
||||
else if(res.data.info.sim_capability == QMI_DMS_SIM_CAPABILITY_SUPPORTED)
|
||||
blobmsg_add_string(&status, "sim", "supported");
|
||||
|
||||
networks = blobmsg_open_array(&status, "networks");
|
||||
for (i = 0; i < res.data.info.radio_interface_list_n; i++) {
|
||||
if ((int)res.data.info.radio_interface_list[i] >= 0 && res.data.info.radio_interface_list[i] < ARRAY_SIZE(radio_cap))
|
||||
blobmsg_add_string(&status, NULL, radio_cap[res.data.info.radio_interface_list[i]]);
|
||||
else
|
||||
blobmsg_add_string(&status, NULL, "unknown");
|
||||
}
|
||||
blobmsg_close_array(&status, networks);
|
||||
|
||||
blobmsg_close_table(&status, t);
|
||||
}
|
||||
|
||||
static enum qmi_cmd_result
|
||||
cmd_dms_get_capabilities_prepare(struct qmi_dev *qmi, struct qmi_request *req, struct qmi_msg *msg, char *arg)
|
||||
{
|
||||
qmi_set_dms_get_capabilities_request(msg);
|
||||
return QMI_CMD_REQUEST;
|
||||
}
|
||||
|
||||
const char *get_pin_status(int status)
|
||||
{
|
||||
static const char *pin_status[] = {
|
||||
[QMI_DMS_UIM_PIN_STATUS_NOT_INITIALIZED] = "not_initialized",
|
||||
[QMI_DMS_UIM_PIN_STATUS_ENABLED_NOT_VERIFIED] = "not_verified",
|
||||
[QMI_DMS_UIM_PIN_STATUS_ENABLED_VERIFIED] = "verified",
|
||||
[QMI_DMS_UIM_PIN_STATUS_DISABLED] = "disabled",
|
||||
[QMI_DMS_UIM_PIN_STATUS_BLOCKED] = "blocked",
|
||||
[QMI_DMS_UIM_PIN_STATUS_PERMANENTLY_BLOCKED] = "permanently_blocked",
|
||||
[QMI_DMS_UIM_PIN_STATUS_UNBLOCKED] = "unblocked",
|
||||
[QMI_DMS_UIM_PIN_STATUS_CHANGED] = "changed",
|
||||
};
|
||||
const char *res = "Unknown";
|
||||
|
||||
if (status < ARRAY_SIZE(pin_status) && pin_status[status])
|
||||
res = pin_status[status];
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
static void cmd_dms_get_pin_status_cb(struct qmi_dev *qmi, struct qmi_request *req, struct qmi_msg *msg)
|
||||
{
|
||||
struct qmi_dms_uim_get_pin_status_response res;
|
||||
void *c;
|
||||
|
||||
qmi_parse_dms_uim_get_pin_status_response(msg, &res);
|
||||
c = blobmsg_open_table(&status, NULL);
|
||||
if (res.set.pin1_status) {
|
||||
blobmsg_add_string(&status, "pin1_status", get_pin_status(res.data.pin1_status.current_status));
|
||||
blobmsg_add_u32(&status, "pin1_verify_tries", (int32_t) res.data.pin1_status.verify_retries_left);
|
||||
blobmsg_add_u32(&status, "pin1_unblock_tries", (int32_t) res.data.pin1_status.unblock_retries_left);
|
||||
}
|
||||
if (res.set.pin2_status) {
|
||||
blobmsg_add_string(&status, "pin2_status", get_pin_status(res.data.pin2_status.current_status));
|
||||
blobmsg_add_u32(&status, "pin2_verify_tries", (int32_t) res.data.pin2_status.verify_retries_left);
|
||||
blobmsg_add_u32(&status, "pin2_unblock_tries", (int32_t) res.data.pin2_status.unblock_retries_left);
|
||||
}
|
||||
blobmsg_close_table(&status, c);
|
||||
}
|
||||
|
||||
static enum qmi_cmd_result
|
||||
cmd_dms_get_pin_status_prepare(struct qmi_dev *qmi, struct qmi_request *req, struct qmi_msg *msg, char *arg)
|
||||
{
|
||||
qmi_set_dms_uim_get_pin_status_request(msg);
|
||||
return QMI_CMD_REQUEST;
|
||||
}
|
||||
|
||||
#define cmd_dms_verify_pin1_cb no_cb
|
||||
static enum qmi_cmd_result
|
||||
cmd_dms_verify_pin1_prepare(struct qmi_dev *qmi, struct qmi_request *req, struct qmi_msg *msg, char *arg)
|
||||
{
|
||||
struct qmi_dms_uim_verify_pin_request data = {
|
||||
QMI_INIT_SEQUENCE(info,
|
||||
.pin_id = QMI_DMS_UIM_PIN_ID_PIN,
|
||||
.pin = arg
|
||||
)
|
||||
};
|
||||
qmi_set_dms_uim_verify_pin_request(msg, &data);
|
||||
return QMI_CMD_REQUEST;
|
||||
}
|
||||
|
||||
#define cmd_dms_verify_pin2_cb no_cb
|
||||
static enum qmi_cmd_result
|
||||
cmd_dms_verify_pin2_prepare(struct qmi_dev *qmi, struct qmi_request *req, struct qmi_msg *msg, char *arg)
|
||||
{
|
||||
struct qmi_dms_uim_verify_pin_request data = {
|
||||
QMI_INIT_SEQUENCE(info,
|
||||
.pin_id = QMI_DMS_UIM_PIN_ID_PIN2,
|
||||
.pin = arg
|
||||
)
|
||||
};
|
||||
qmi_set_dms_uim_verify_pin_request(msg, &data);
|
||||
return QMI_CMD_REQUEST;
|
||||
}
|
||||
|
||||
#define cmd_dms_set_pin_cb no_cb
|
||||
static enum qmi_cmd_result
|
||||
cmd_dms_set_pin_prepare(struct qmi_dev *qmi, struct qmi_request *req, struct qmi_msg *msg, char *arg)
|
||||
{
|
||||
dms_req_data.pin = arg;
|
||||
return QMI_CMD_DONE;
|
||||
}
|
||||
|
||||
static enum qmi_cmd_result
|
||||
cmd_dms_set_pin_protection_prepare(struct qmi_msg *msg, char *arg)
|
||||
{
|
||||
if (!dms_req_data.pin) {
|
||||
uqmi_add_error("Missing argument");
|
||||
return QMI_CMD_EXIT;
|
||||
}
|
||||
|
||||
int is_enabled;
|
||||
if (strcasecmp(arg, "disabled") == 0)
|
||||
is_enabled = false;
|
||||
else if (strcasecmp(arg, "enabled") == 0)
|
||||
is_enabled = true;
|
||||
else {
|
||||
uqmi_add_error("Invalid value (valid: disabled, enabled)");
|
||||
return QMI_CMD_EXIT;
|
||||
}
|
||||
|
||||
struct qmi_dms_uim_set_pin_protection_request dms_pin_protection_req = {
|
||||
QMI_INIT_SEQUENCE(info,
|
||||
.pin_id = dms_req_data.pin_id
|
||||
),
|
||||
QMI_INIT_PTR(info.pin, dms_req_data.pin),
|
||||
QMI_INIT_PTR(info.protection_enabled, is_enabled)
|
||||
};
|
||||
|
||||
qmi_set_dms_uim_set_pin_protection_request(msg, &dms_pin_protection_req);
|
||||
return QMI_CMD_REQUEST;
|
||||
}
|
||||
|
||||
#define cmd_dms_set_pin1_protection_cb no_cb
|
||||
static enum qmi_cmd_result
|
||||
cmd_dms_set_pin1_protection_prepare(struct qmi_dev *qmi, struct qmi_request *req, struct qmi_msg *msg, char *arg)
|
||||
{
|
||||
dms_req_data.pin_id = QMI_DMS_UIM_PIN_ID_PIN;
|
||||
return cmd_dms_set_pin_protection_prepare(msg, arg);
|
||||
}
|
||||
|
||||
#define cmd_dms_set_pin2_protection_cb no_cb
|
||||
static enum qmi_cmd_result
|
||||
cmd_dms_set_pin2_protection_prepare(struct qmi_dev *qmi, struct qmi_request *req, struct qmi_msg *msg, char *arg)
|
||||
{
|
||||
dms_req_data.pin_id = QMI_DMS_UIM_PIN_ID_PIN2;
|
||||
return cmd_dms_set_pin_protection_prepare(msg, arg);
|
||||
}
|
||||
|
||||
static enum qmi_cmd_result
|
||||
cmd_dms_change_pin_prepare(struct qmi_msg *msg, char *arg)
|
||||
{
|
||||
if (!dms_req_data.pin || !dms_req_data.new_pin) {
|
||||
uqmi_add_error("Missing argument");
|
||||
return QMI_CMD_EXIT;
|
||||
}
|
||||
|
||||
struct qmi_dms_uim_change_pin_request dms_change_pin_req = {
|
||||
QMI_INIT_SEQUENCE(info,
|
||||
.pin_id = dms_req_data.pin_id
|
||||
),
|
||||
QMI_INIT_PTR(info.old_pin, dms_req_data.pin),
|
||||
QMI_INIT_PTR(info.new_pin, dms_req_data.new_pin)
|
||||
};
|
||||
|
||||
qmi_set_dms_uim_change_pin_request(msg, &dms_change_pin_req);
|
||||
return QMI_CMD_REQUEST;
|
||||
}
|
||||
|
||||
#define cmd_dms_change_pin1_cb no_cb
|
||||
static enum qmi_cmd_result
|
||||
cmd_dms_change_pin1_prepare(struct qmi_dev *qmi, struct qmi_request *req, struct qmi_msg *msg, char *arg)
|
||||
{
|
||||
dms_req_data.pin_id = QMI_DMS_UIM_PIN_ID_PIN;
|
||||
return cmd_dms_change_pin_prepare(msg, arg);
|
||||
}
|
||||
|
||||
#define cmd_dms_change_pin2_cb no_cb
|
||||
static enum qmi_cmd_result
|
||||
cmd_dms_change_pin2_prepare(struct qmi_dev *qmi, struct qmi_request *req, struct qmi_msg *msg, char *arg)
|
||||
{
|
||||
dms_req_data.pin_id = QMI_DMS_UIM_PIN_ID_PIN2;
|
||||
return cmd_dms_change_pin_prepare(msg, arg);
|
||||
}
|
||||
|
||||
#define cmd_dms_set_new_pin_cb no_cb
|
||||
static enum qmi_cmd_result
|
||||
cmd_dms_set_new_pin_prepare(struct qmi_dev *qmi, struct qmi_request *req, struct qmi_msg *msg, char *arg)
|
||||
{
|
||||
dms_req_data.new_pin = arg;
|
||||
return QMI_CMD_DONE;
|
||||
}
|
||||
|
||||
#define cmd_dms_set_puk_cb no_cb
|
||||
static enum qmi_cmd_result
|
||||
cmd_dms_set_puk_prepare(struct qmi_dev *qmi, struct qmi_request *req, struct qmi_msg *msg, char *arg)
|
||||
{
|
||||
dms_req_data.puk = arg;
|
||||
return QMI_CMD_DONE;
|
||||
}
|
||||
|
||||
#define cmd_dms_unblock_pin1_cb no_cb
|
||||
static enum qmi_cmd_result
|
||||
cmd_dms_unblock_pin1_prepare(struct qmi_dev *qmi, struct qmi_request *req, struct qmi_msg *msg, char *arg)
|
||||
{
|
||||
if (!dms_req_data.puk || !dms_req_data.new_pin) {
|
||||
uqmi_add_error("Missing argument");
|
||||
return QMI_CMD_EXIT;
|
||||
}
|
||||
|
||||
struct qmi_dms_uim_unblock_pin_request dms_unlock_pin_req = {
|
||||
QMI_INIT_SEQUENCE(info,
|
||||
.pin_id = QMI_DMS_UIM_PIN_ID_PIN
|
||||
),
|
||||
QMI_INIT_PTR(info.puk, dms_req_data.puk),
|
||||
QMI_INIT_PTR(info.new_pin, dms_req_data.new_pin)
|
||||
};
|
||||
|
||||
qmi_set_dms_uim_unblock_pin_request(msg, &dms_unlock_pin_req);
|
||||
return QMI_CMD_REQUEST;
|
||||
}
|
||||
|
||||
#define cmd_dms_unblock_pin2_cb no_cb
|
||||
static enum qmi_cmd_result
|
||||
cmd_dms_unblock_pin2_prepare(struct qmi_dev *qmi, struct qmi_request *req, struct qmi_msg *msg, char *arg)
|
||||
{
|
||||
if (!dms_req_data.puk || !dms_req_data.new_pin) {
|
||||
uqmi_add_error("Missing argument");
|
||||
return QMI_CMD_EXIT;
|
||||
}
|
||||
|
||||
struct qmi_dms_uim_unblock_pin_request dms_unlock_pin_req = {
|
||||
QMI_INIT_SEQUENCE(info,
|
||||
.pin_id = QMI_DMS_UIM_PIN_ID_PIN2
|
||||
),
|
||||
QMI_INIT_PTR(info.puk, dms_req_data.puk),
|
||||
QMI_INIT_PTR(info.new_pin, dms_req_data.new_pin)
|
||||
};
|
||||
|
||||
qmi_set_dms_uim_unblock_pin_request(msg, &dms_unlock_pin_req);
|
||||
return QMI_CMD_REQUEST;
|
||||
}
|
||||
|
||||
static void cmd_dms_get_iccid_cb(struct qmi_dev *qmi, struct qmi_request *req, struct qmi_msg *msg)
|
||||
{
|
||||
struct qmi_dms_uim_get_iccid_response res;
|
||||
|
||||
qmi_parse_dms_uim_get_iccid_response(msg, &res);
|
||||
if (res.data.iccid)
|
||||
blobmsg_add_string(&status, NULL, res.data.iccid);
|
||||
}
|
||||
|
||||
static enum qmi_cmd_result
|
||||
cmd_dms_get_iccid_prepare(struct qmi_dev *qmi, struct qmi_request *req, struct qmi_msg *msg, char *arg)
|
||||
{
|
||||
qmi_set_dms_uim_get_iccid_request(msg);
|
||||
return QMI_CMD_REQUEST;
|
||||
}
|
||||
|
||||
static void cmd_dms_get_imsi_cb(struct qmi_dev *qmi, struct qmi_request *req, struct qmi_msg *msg)
|
||||
{
|
||||
struct qmi_dms_uim_get_imsi_response res;
|
||||
|
||||
qmi_parse_dms_uim_get_imsi_response(msg, &res);
|
||||
if (res.data.imsi)
|
||||
blobmsg_add_string(&status, NULL, res.data.imsi);
|
||||
}
|
||||
|
||||
static enum qmi_cmd_result
|
||||
cmd_dms_get_imsi_prepare(struct qmi_dev *qmi, struct qmi_request *req, struct qmi_msg *msg, char *arg)
|
||||
{
|
||||
qmi_set_dms_uim_get_imsi_request(msg);
|
||||
return QMI_CMD_REQUEST;
|
||||
}
|
||||
|
||||
static void cmd_dms_get_msisdn_cb(struct qmi_dev *qmi, struct qmi_request *req, struct qmi_msg *msg)
|
||||
{
|
||||
struct qmi_dms_get_msisdn_response res;
|
||||
|
||||
qmi_parse_dms_get_msisdn_response(msg, &res);
|
||||
if (res.data.msisdn)
|
||||
blobmsg_add_string(&status, NULL, res.data.msisdn);
|
||||
}
|
||||
|
||||
static enum qmi_cmd_result
|
||||
cmd_dms_get_msisdn_prepare(struct qmi_dev *qmi, struct qmi_request *req, struct qmi_msg *msg, char *arg)
|
||||
{
|
||||
qmi_set_dms_get_msisdn_request(msg);
|
||||
return QMI_CMD_REQUEST;
|
||||
}
|
||||
|
||||
static void cmd_dms_get_imei_cb(struct qmi_dev *qmi, struct qmi_request *req, struct qmi_msg *msg)
|
||||
{
|
||||
struct qmi_dms_get_ids_response res;
|
||||
|
||||
qmi_parse_dms_get_ids_response(msg, &res);
|
||||
if (res.data.imei)
|
||||
blobmsg_add_string(&status, NULL, res.data.imei);
|
||||
}
|
||||
|
||||
static enum qmi_cmd_result
|
||||
cmd_dms_get_imei_prepare(struct qmi_dev *qmi, struct qmi_request *req, struct qmi_msg *msg, char *arg)
|
||||
{
|
||||
qmi_set_dms_get_ids_request(msg);
|
||||
return QMI_CMD_REQUEST;
|
||||
}
|
||||
|
||||
#define cmd_dms_reset_cb no_cb
|
||||
static enum qmi_cmd_result
|
||||
cmd_dms_reset_prepare(struct qmi_dev *qmi, struct qmi_request *req, struct qmi_msg *msg, char *arg)
|
||||
{
|
||||
qmi_set_dms_reset_request(msg);
|
||||
return QMI_CMD_REQUEST;
|
||||
}
|
||||
|
||||
static void
|
||||
cmd_dms_get_operating_mode_cb(struct qmi_dev *qmi, struct qmi_request *req, struct qmi_msg *msg)
|
||||
{
|
||||
struct qmi_dms_get_operating_mode_response res;
|
||||
|
||||
const char *modes[] = {
|
||||
[QMI_DMS_OPERATING_MODE_ONLINE] = "online",
|
||||
[QMI_DMS_OPERATING_MODE_LOW_POWER] = "low_power",
|
||||
[QMI_DMS_OPERATING_MODE_FACTORY_TEST] = "factory_test",
|
||||
[QMI_DMS_OPERATING_MODE_OFFLINE] = "offline",
|
||||
[QMI_DMS_OPERATING_MODE_RESET] = "reset",
|
||||
[QMI_DMS_OPERATING_MODE_SHUTTING_DOWN] = "shutting_down",
|
||||
[QMI_DMS_OPERATING_MODE_PERSISTENT_LOW_POWER] = "persistent_low_power",
|
||||
[QMI_DMS_OPERATING_MODE_MODE_ONLY_LOW_POWER] = "mode_only_low_power",
|
||||
};
|
||||
int s = 0;
|
||||
|
||||
qmi_parse_dms_get_operating_mode_response(msg, &res);
|
||||
if (res.set.mode &&
|
||||
res.data.mode < ARRAY_SIZE(modes))
|
||||
s = res.data.mode;
|
||||
|
||||
blobmsg_add_string(&status, NULL, modes[s]);
|
||||
}
|
||||
|
||||
static enum qmi_cmd_result
|
||||
cmd_dms_get_operating_mode_prepare(struct qmi_dev *qmi, struct qmi_request *req, struct qmi_msg *msg, char *arg)
|
||||
{
|
||||
qmi_set_dms_get_operating_mode_request(msg);
|
||||
return QMI_CMD_REQUEST;
|
||||
}
|
||||
|
||||
#define cmd_dms_set_operating_mode_cb no_cb
|
||||
static enum qmi_cmd_result
|
||||
cmd_dms_set_operating_mode_prepare(struct qmi_dev *qmi, struct qmi_request *req, struct qmi_msg *msg, char *arg)
|
||||
{
|
||||
static const char *modes[] = {
|
||||
[QMI_DMS_OPERATING_MODE_ONLINE] = "online",
|
||||
[QMI_DMS_OPERATING_MODE_LOW_POWER] = "low_power",
|
||||
[QMI_DMS_OPERATING_MODE_FACTORY_TEST] = "factory_test",
|
||||
[QMI_DMS_OPERATING_MODE_OFFLINE] = "offline",
|
||||
[QMI_DMS_OPERATING_MODE_RESET] = "reset",
|
||||
[QMI_DMS_OPERATING_MODE_SHUTTING_DOWN] = "shutting_down",
|
||||
[QMI_DMS_OPERATING_MODE_PERSISTENT_LOW_POWER] = "persistent_low_power",
|
||||
[QMI_DMS_OPERATING_MODE_MODE_ONLY_LOW_POWER] = "mode_only_low_power",
|
||||
};
|
||||
static struct qmi_dms_set_operating_mode_request sreq = {
|
||||
QMI_INIT(mode, QMI_DMS_OPERATING_MODE_ONLINE),
|
||||
};
|
||||
int i;
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(modes); i++) {
|
||||
if (!modes[i])
|
||||
continue;
|
||||
|
||||
if (strcmp(arg, modes[i]) != 0)
|
||||
continue;
|
||||
|
||||
sreq.data.mode = i;
|
||||
qmi_set_dms_set_operating_mode_request(msg, &sreq);
|
||||
return QMI_CMD_REQUEST;
|
||||
}
|
||||
|
||||
return uqmi_add_error("Invalid argument");
|
||||
}
|
||||
|
||||
#define cmd_dms_set_fcc_authentication_cb no_cb
|
||||
static enum qmi_cmd_result
|
||||
cmd_dms_set_fcc_authentication_prepare(struct qmi_dev *qmi, struct qmi_request *req, struct qmi_msg *msg, char *arg)
|
||||
{
|
||||
qmi_set_dms_set_fcc_authentication_request(msg);
|
||||
return QMI_CMD_REQUEST;
|
||||
}
|
@ -0,0 +1,78 @@
|
||||
/*
|
||||
* uqmi -- tiny QMI support implementation
|
||||
*
|
||||
* Copyright (C) 2014-2015 Felix Fietkau <nbd@openwrt.org>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
#define __uqmi_dms_commands \
|
||||
__uqmi_command(dms_get_capabilities, get-capabilities, no, QMI_SERVICE_DMS), \
|
||||
__uqmi_command(dms_get_pin_status, get-pin-status, no, QMI_SERVICE_DMS), \
|
||||
__uqmi_command(dms_verify_pin1, verify-pin1, required, QMI_SERVICE_DMS), \
|
||||
__uqmi_command(dms_verify_pin2, verify-pin2, required, QMI_SERVICE_DMS), \
|
||||
__uqmi_command(dms_set_pin1_protection, set-pin1-protection, required, QMI_SERVICE_DMS), \
|
||||
__uqmi_command(dms_set_pin2_protection, set-pin2-protection, required, QMI_SERVICE_DMS), \
|
||||
__uqmi_command(dms_set_pin, pin, required, CMD_TYPE_OPTION), \
|
||||
__uqmi_command(dms_change_pin1, change-pin1, no, QMI_SERVICE_DMS), \
|
||||
__uqmi_command(dms_change_pin2, change-pin2, no, QMI_SERVICE_DMS), \
|
||||
__uqmi_command(dms_unblock_pin1, unblock-pin1, no, QMI_SERVICE_DMS), \
|
||||
__uqmi_command(dms_unblock_pin2, unblock-pin2, no, QMI_SERVICE_DMS), \
|
||||
__uqmi_command(dms_set_puk, puk, required, CMD_TYPE_OPTION), \
|
||||
__uqmi_command(dms_set_new_pin, new-pin, required, CMD_TYPE_OPTION), \
|
||||
__uqmi_command(dms_get_iccid, get-iccid, no, QMI_SERVICE_DMS), \
|
||||
__uqmi_command(dms_get_imsi, get-imsi, no, QMI_SERVICE_DMS), \
|
||||
__uqmi_command(dms_get_imei, get-imei, no, QMI_SERVICE_DMS), \
|
||||
__uqmi_command(dms_get_msisdn, get-msisdn, no, QMI_SERVICE_DMS), \
|
||||
__uqmi_command(dms_get_operating_mode, get-device-operating-mode, no, QMI_SERVICE_DMS), \
|
||||
__uqmi_command(dms_set_operating_mode, set-device-operating-mode, required, QMI_SERVICE_DMS), \
|
||||
__uqmi_command(dms_reset, reset-dms, no, QMI_SERVICE_DMS), \
|
||||
__uqmi_command(dms_set_fcc_authentication, fcc-auth, no, QMI_SERVICE_DMS) \
|
||||
|
||||
#define dms_helptext \
|
||||
" --get-capabilities: List device capabilities\n" \
|
||||
" --get-pin-status: Get PIN verification status\n" \
|
||||
" --verify-pin1 <pin>: Verify PIN1\n" \
|
||||
" --verify-pin2 <pin>: Verify PIN2\n" \
|
||||
" --set-pin1-protection <state>: Set PIN1 protection state (disabled, enabled)\n" \
|
||||
" --pin <pin>: PIN1 needed to change state\n" \
|
||||
" --set-pin2-protection <state>: Set PIN2 protection state (disabled, enabled)\n" \
|
||||
" --pin <pin2>: PIN2 needed to change state\n" \
|
||||
" --change-pin1: Change PIN1\n" \
|
||||
" --pin <old pin>: Current PIN1\n" \
|
||||
" --new-pin <new pin>: New pin\n" \
|
||||
" --change-pin2: Change PIN2\n" \
|
||||
" --pin <old pin>: Current PIN2\n" \
|
||||
" --new-pin <new pin>: New pin\n" \
|
||||
" --unblock-pin1: Unblock PIN1\n" \
|
||||
" --puk <puk>: PUK needed to unblock\n" \
|
||||
" --new-pin <new pin>: New pin\n" \
|
||||
" --unblock-pin2: Unblock PIN2\n" \
|
||||
" --puk <puk>: PUK needed to unblock\n" \
|
||||
" --new-pin <new pin>: New pin\n" \
|
||||
" --get-iccid: Get the ICCID\n" \
|
||||
" --get-imsi: Get International Mobile Subscriber ID\n" \
|
||||
" --get-imei: Get International Mobile Equipment ID\n" \
|
||||
" --get-msisdn: Get the MSISDN (telephone number)\n" \
|
||||
" --reset-dms: Reset the DMS service\n" \
|
||||
" --get-device-operating-mode Get the device operating mode\n" \
|
||||
" --set-device-operating-mode <m> Set the device operating mode\n" \
|
||||
" (modes: online, low_power, factory_test, offline\n" \
|
||||
" reset, shutting_down, persistent_low_power,\n" \
|
||||
" mode_only_low_power)\n" \
|
||||
" --fcc-auth: Set FCC authentication\n" \
|
||||
|
||||
const char *get_pin_status(int status);
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,59 @@
|
||||
/*
|
||||
* uqmi -- tiny QMI support implementation
|
||||
*
|
||||
* Copyright (C) 2014-2015 Felix Fietkau <nbd@openwrt.org>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
#define __uqmi_nas_commands \
|
||||
__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_set_plmn, set-plmn, no, QMI_SERVICE_NAS), \
|
||||
__uqmi_command(nas_get_plmn, get-plmn, no, QMI_SERVICE_NAS), \
|
||||
__uqmi_command(nas_set_mcc, mcc, required, CMD_TYPE_OPTION), \
|
||||
__uqmi_command(nas_set_mnc, mnc, required, CMD_TYPE_OPTION), \
|
||||
__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, CMD_TYPE_OPTION), \
|
||||
__uqmi_command(nas_set_roaming, set-network-roaming, required, CMD_TYPE_OPTION), \
|
||||
__uqmi_command(nas_get_system_info, get-system-info, no, QMI_SERVICE_NAS), \
|
||||
__uqmi_command(nas_get_lte_cphy_ca_info, get-lte-cphy-ca-info, no, QMI_SERVICE_NAS), \
|
||||
__uqmi_command(nas_get_cell_location_info, get-cell-location-info, no, QMI_SERVICE_NAS), \
|
||||
__uqmi_command(nas_get_tx_rx_info, get-tx-rx-info, required, QMI_SERVICE_NAS) \
|
||||
|
||||
#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" \
|
||||
" 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" \
|
||||
" --set-plmn: Register at specified network\n" \
|
||||
" --mcc <mcc>: Mobile Country Code (0 - auto)\n" \
|
||||
" --mnc <mnc>: Mobile Network Code\n" \
|
||||
" --get-plmn: Get preferred network selection info\n" \
|
||||
" --get-signal-info: Get signal strength info\n" \
|
||||
" --get-serving-system: Get serving system info\n" \
|
||||
" --get-system-info: Get system info\n" \
|
||||
" --get-lte-cphy-ca-info: Get LTE Cphy CA Info\n" \
|
||||
" --get-cell-location-info: Get Cell Location Info\n" \
|
||||
" --get-tx-rx-info <radio>: Get TX/RX Info (gsm, umts, lte)\n" \
|
||||
|
@ -0,0 +1,115 @@
|
||||
/*
|
||||
* uqmi -- tiny QMI support implementation
|
||||
*
|
||||
* Copyright (C) 2016 Felix Fietkau <nbd@nbd.name>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
#define cmd_uim_verify_pin1_cb no_cb
|
||||
static enum qmi_cmd_result
|
||||
cmd_uim_verify_pin1_prepare(struct qmi_dev *qmi, struct qmi_request *req, struct qmi_msg *msg, char *arg)
|
||||
{
|
||||
struct qmi_uim_verify_pin_request data = {
|
||||
QMI_INIT_SEQUENCE(session,
|
||||
.session_type = QMI_UIM_SESSION_TYPE_CARD_SLOT_1,
|
||||
.application_identifier_n = 0
|
||||
),
|
||||
QMI_INIT_SEQUENCE(info,
|
||||
.pin_id = QMI_UIM_PIN_ID_PIN1,
|
||||
.pin_value = arg
|
||||
)
|
||||
};
|
||||
qmi_set_uim_verify_pin_request(msg, &data);
|
||||
return QMI_CMD_REQUEST;
|
||||
}
|
||||
|
||||
#define cmd_uim_verify_pin2_cb no_cb
|
||||
static enum qmi_cmd_result
|
||||
cmd_uim_verify_pin2_prepare(struct qmi_dev *qmi, struct qmi_request *req, struct qmi_msg *msg, char *arg)
|
||||
{
|
||||
struct qmi_uim_verify_pin_request data = {
|
||||
QMI_INIT_SEQUENCE(session,
|
||||
.session_type = QMI_UIM_SESSION_TYPE_CARD_SLOT_1,
|
||||
.application_identifier_n = 0
|
||||
),
|
||||
QMI_INIT_SEQUENCE(info,
|
||||
.pin_id = QMI_UIM_PIN_ID_PIN2,
|
||||
.pin_value = arg
|
||||
)
|
||||
};
|
||||
qmi_set_uim_verify_pin_request(msg, &data);
|
||||
return QMI_CMD_REQUEST;
|
||||
}
|
||||
|
||||
static void cmd_uim_get_sim_state_cb(struct qmi_dev *qmi, struct qmi_request *req, struct qmi_msg *msg)
|
||||
{
|
||||
struct qmi_uim_get_card_status_response res;
|
||||
void * const card_table = blobmsg_open_table(&status, NULL);
|
||||
|
||||
qmi_parse_uim_get_card_status_response(msg, &res);
|
||||
|
||||
for (int i = 0; i < res.data.card_status.cards_n; ++i) {
|
||||
if (res.data.card_status.cards[i].card_state != QMI_UIM_CARD_STATE_PRESENT)
|
||||
continue;
|
||||
|
||||
uint8_t pin1_state = res.data.card_status.cards[i].upin_state;
|
||||
uint8_t pin1_retries = res.data.card_status.cards[i].upin_retries;
|
||||
uint8_t puk1_retries = res.data.card_status.cards[i].upuk_retries;
|
||||
uint8_t pin2_state;
|
||||
uint8_t pin2_retries;
|
||||
uint8_t puk2_retries;
|
||||
bool has_pin2 = false;
|
||||
|
||||
for (int j = 0; j < res.data.card_status.cards[i].applications_n; ++j) {
|
||||
if (res.data.card_status.cards[i].applications[j].type == QMI_UIM_CARD_APPLICATION_TYPE_UNKNOWN)
|
||||
continue;
|
||||
|
||||
if (!res.data.card_status.cards[i].applications[j].upin_replaces_pin1) {
|
||||
pin1_state = res.data.card_status.cards[i].applications[j].pin1_state;
|
||||
pin1_retries = res.data.card_status.cards[i].applications[j].pin1_retries;
|
||||
puk1_retries = res.data.card_status.cards[i].applications[j].puk1_retries;
|
||||
}
|
||||
|
||||
pin2_state = res.data.card_status.cards[i].applications[j].pin2_state;
|
||||
pin2_retries = res.data.card_status.cards[i].applications[j].pin2_retries;
|
||||
puk2_retries = res.data.card_status.cards[i].applications[j].puk2_retries;
|
||||
has_pin2 = true;
|
||||
|
||||
break; /* handle first application only for now */
|
||||
}
|
||||
|
||||
blobmsg_add_string(&status, "pin1_status", get_pin_status(pin1_state));
|
||||
blobmsg_add_u32(&status, "pin1_verify_tries", pin1_retries);
|
||||
blobmsg_add_u32(&status, "pin1_unlock_tries", puk1_retries);
|
||||
if (has_pin2) {
|
||||
blobmsg_add_string(&status, "pin2_status", get_pin_status(pin2_state));
|
||||
blobmsg_add_u32(&status, "pin2_verify_tries", pin2_retries);
|
||||
blobmsg_add_u32(&status, "pin2_unlock_tries", puk2_retries);
|
||||
}
|
||||
|
||||
break; /* handle only first preset SIM card for now */
|
||||
}
|
||||
|
||||
blobmsg_close_table(&status, card_table);
|
||||
}
|
||||
|
||||
static enum qmi_cmd_result
|
||||
cmd_uim_get_sim_state_prepare(struct qmi_dev *qmi, struct qmi_request *req, struct qmi_msg *msg, char *arg)
|
||||
{
|
||||
qmi_set_uim_get_card_status_request(msg);
|
||||
return QMI_CMD_REQUEST;
|
||||
}
|
@ -0,0 +1,32 @@
|
||||
/*
|
||||
* uqmi -- tiny QMI support implementation
|
||||
*
|
||||
* Copyright (C) 2016 Felix Fietkau <nbd@nbd.name>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
#define __uqmi_uim_commands \
|
||||
__uqmi_command(uim_verify_pin1, uim-verify-pin1, required, QMI_SERVICE_UIM), \
|
||||
__uqmi_command(uim_verify_pin2, uim-verify-pin2, required, QMI_SERVICE_UIM), \
|
||||
__uqmi_command(uim_get_sim_state, uim-get-sim-state, no, QMI_SERVICE_UIM) \
|
||||
|
||||
|
||||
#define uim_helptext \
|
||||
" --uim-verify-pin1 <pin>: Verify PIN1 (new devices)\n" \
|
||||
" --uim-verify-pin2 <pin>: Verify PIN2 (new devices)\n" \
|
||||
" --uim-get-sim-state: Get current SIM state\n" \
|
||||
|
@ -0,0 +1,80 @@
|
||||
/*
|
||||
* uqmi -- tiny QMI support implementation
|
||||
*
|
||||
* Copyright (C) 2014-2015 Felix Fietkau <nbd@openwrt.org>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "qmi-message.h"
|
||||
|
||||
static const struct {
|
||||
const char *name;
|
||||
QmiWdaLinkLayerProtocol val;
|
||||
} link_modes[] = {
|
||||
{ "802.3", QMI_WDA_LINK_LAYER_PROTOCOL_802_3 },
|
||||
{ "raw-ip", QMI_WDA_LINK_LAYER_PROTOCOL_RAW_IP },
|
||||
};
|
||||
|
||||
#define cmd_wda_set_data_format_cb no_cb
|
||||
|
||||
static enum qmi_cmd_result
|
||||
cmd_wda_set_data_format_prepare(struct qmi_dev *qmi, struct qmi_request *req, struct qmi_msg *msg, char *arg)
|
||||
{
|
||||
struct qmi_wda_set_data_format_request data_req = {};
|
||||
int i;
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(link_modes); i++) {
|
||||
if (strcasecmp(link_modes[i].name, arg) != 0)
|
||||
continue;
|
||||
|
||||
qmi_set(&data_req, link_layer_protocol, link_modes[i].val);
|
||||
qmi_set_wda_set_data_format_request(msg, &data_req);
|
||||
return QMI_CMD_REQUEST;
|
||||
}
|
||||
|
||||
uqmi_add_error("Invalid auth mode (valid: 802.3, raw-ip)");
|
||||
return QMI_CMD_EXIT;
|
||||
}
|
||||
|
||||
static void
|
||||
cmd_wda_get_data_format_cb(struct qmi_dev *qmi, struct qmi_request *req, struct qmi_msg *msg)
|
||||
{
|
||||
struct qmi_wda_get_data_format_response res;
|
||||
const char *name = "unknown";
|
||||
int i;
|
||||
|
||||
qmi_parse_wda_get_data_format_response(msg, &res);
|
||||
for (i = 0; i < ARRAY_SIZE(link_modes); i++) {
|
||||
if (link_modes[i].val != res.data.link_layer_protocol)
|
||||
continue;
|
||||
|
||||
name = link_modes[i].name;
|
||||
break;
|
||||
}
|
||||
|
||||
blobmsg_add_string(&status, NULL, name);
|
||||
}
|
||||
|
||||
static enum qmi_cmd_result
|
||||
cmd_wda_get_data_format_prepare(struct qmi_dev *qmi, struct qmi_request *req, struct qmi_msg *msg, char *arg)
|
||||
{
|
||||
struct qmi_wda_get_data_format_request data_req = {};
|
||||
qmi_set_wda_get_data_format_request(msg, &data_req);
|
||||
return QMI_CMD_REQUEST;
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
/*
|
||||
* uqmi -- tiny QMI support implementation
|
||||
*
|
||||
* Copyright (C) 2014-2015 Felix Fietkau <nbd@openwrt.org>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
#define __uqmi_wda_commands \
|
||||
__uqmi_command(wda_set_data_format, wda-set-data-format, required, QMI_SERVICE_WDA), \
|
||||
__uqmi_command(wda_get_data_format, wda-get-data-format, no, QMI_SERVICE_WDA)
|
||||
|
||||
|
||||
#define wda_helptext \
|
||||
" --wda-set-data-format <type>: Set data format (type: 802.3|raw-ip)\n" \
|
||||
" --wda-get-data-format: Get data format\n" \
|
||||
|
@ -0,0 +1,590 @@
|
||||
/*
|
||||
* uqmi -- tiny QMI support implementation
|
||||
*
|
||||
* Copyright (C) 2014-2015 Felix Fietkau <nbd@openwrt.org>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <arpa/inet.h>
|
||||
|
||||
#include "qmi-message.h"
|
||||
|
||||
static struct qmi_wds_start_network_request wds_sn_req = {
|
||||
QMI_INIT(authentication_preference,
|
||||
QMI_WDS_AUTHENTICATION_PAP | QMI_WDS_AUTHENTICATION_CHAP),
|
||||
};
|
||||
|
||||
static struct qmi_wds_stop_network_request wds_stn_req;
|
||||
|
||||
static struct qmi_wds_modify_profile_request wds_mp_req = {
|
||||
QMI_INIT_SEQUENCE(profile_identifier,
|
||||
.profile_type = QMI_WDS_PROFILE_TYPE_3GPP,
|
||||
.profile_index = 1,
|
||||
)
|
||||
};
|
||||
|
||||
#define cmd_wds_set_apn_cb no_cb
|
||||
static enum qmi_cmd_result
|
||||
cmd_wds_set_apn_prepare(struct qmi_dev *qmi, struct qmi_request *req, struct qmi_msg *msg, char *arg)
|
||||
{
|
||||
qmi_set_ptr(&wds_sn_req, apn, arg);
|
||||
qmi_set_ptr(&wds_mp_req, apn_name, arg);
|
||||
return QMI_CMD_DONE;
|
||||
}
|
||||
|
||||
#define cmd_wds_set_auth_cb no_cb
|
||||
static enum qmi_cmd_result
|
||||
cmd_wds_set_auth_prepare(struct qmi_dev *qmi, struct qmi_request *req, struct qmi_msg *msg, char *arg)
|
||||
{
|
||||
static const struct {
|
||||
const char *name;
|
||||
QmiWdsAuthentication auth;
|
||||
} modes[] = {
|
||||
{ "pap", QMI_WDS_AUTHENTICATION_PAP },
|
||||
{ "chap", QMI_WDS_AUTHENTICATION_CHAP },
|
||||
{ "both", QMI_WDS_AUTHENTICATION_PAP | QMI_WDS_AUTHENTICATION_CHAP },
|
||||
{ "none", QMI_WDS_AUTHENTICATION_NONE },
|
||||
};
|
||||
int i;
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(modes); i++) {
|
||||
if (strcasecmp(modes[i].name, arg) != 0)
|
||||
continue;
|
||||
|
||||
qmi_set(&wds_sn_req, authentication_preference, modes[i].auth);
|
||||
qmi_set(&wds_mp_req, authentication, modes[i].auth);
|
||||
return QMI_CMD_DONE;
|
||||
}
|
||||
|
||||
uqmi_add_error("Invalid auth mode (valid: pap, chap, both, none)");
|
||||
return QMI_CMD_EXIT;
|
||||
}
|
||||
|
||||
#define cmd_wds_set_username_cb no_cb
|
||||
static enum qmi_cmd_result
|
||||
cmd_wds_set_username_prepare(struct qmi_dev *qmi, struct qmi_request *req, struct qmi_msg *msg, char *arg)
|
||||
{
|
||||
qmi_set_ptr(&wds_sn_req, username, arg);
|
||||
qmi_set_ptr(&wds_mp_req, username, arg);
|
||||
return QMI_CMD_DONE;
|
||||
}
|
||||
|
||||
#define cmd_wds_set_password_cb no_cb
|
||||
static enum qmi_cmd_result
|
||||
cmd_wds_set_password_prepare(struct qmi_dev *qmi, struct qmi_request *req, struct qmi_msg *msg, char *arg)
|
||||
{
|
||||
qmi_set_ptr(&wds_sn_req, password, arg);
|
||||
qmi_set_ptr(&wds_mp_req, password, arg);
|
||||
return QMI_CMD_DONE;
|
||||
}
|
||||
|
||||
#define cmd_wds_set_autoconnect_cb no_cb
|
||||
static enum qmi_cmd_result
|
||||
cmd_wds_set_autoconnect_prepare(struct qmi_dev *qmi, struct qmi_request *req, struct qmi_msg *msg, char *arg)
|
||||
{
|
||||
qmi_set(&wds_sn_req, enable_autoconnect, true);
|
||||
qmi_set(&wds_stn_req, disable_autoconnect, true);
|
||||
return QMI_CMD_DONE;
|
||||
}
|
||||
|
||||
#define cmd_wds_set_ip_family_pref_cb no_cb
|
||||
static enum qmi_cmd_result
|
||||
cmd_wds_set_ip_family_pref_prepare(struct qmi_dev *qmi, struct qmi_request *req, struct qmi_msg *msg, char *arg)
|
||||
{
|
||||
static const struct {
|
||||
const char *name;
|
||||
const QmiWdsIpFamily mode;
|
||||
} modes[] = {
|
||||
{ "ipv4", QMI_WDS_IP_FAMILY_IPV4 },
|
||||
{ "ipv6", QMI_WDS_IP_FAMILY_IPV6 },
|
||||
{ "unspecified", QMI_WDS_IP_FAMILY_UNSPECIFIED },
|
||||
};
|
||||
int i;
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(modes); i++) {
|
||||
if (strcasecmp(modes[i].name, arg) != 0)
|
||||
continue;
|
||||
|
||||
qmi_set(&wds_sn_req, ip_family_preference, modes[i].mode);
|
||||
return QMI_CMD_DONE;
|
||||
}
|
||||
|
||||
uqmi_add_error("Invalid value (valid: ipv4, ipv6, unspecified)");
|
||||
return QMI_CMD_EXIT;
|
||||
}
|
||||
|
||||
#define cmd_wds_set_pdp_type_cb no_cb
|
||||
static enum qmi_cmd_result
|
||||
cmd_wds_set_pdp_type_prepare(struct qmi_dev *qmi, struct qmi_request *req, struct qmi_msg *msg, char *arg)
|
||||
{
|
||||
static const struct {
|
||||
const char *name;
|
||||
const QmiWdsPdpType type;
|
||||
} types[] = {
|
||||
{ "ipv4", QMI_WDS_PDP_TYPE_IPV4 },
|
||||
{ "ipv6", QMI_WDS_PDP_TYPE_IPV6 },
|
||||
{ "ipv4v6", QMI_WDS_PDP_TYPE_IPV4_OR_IPV6 },
|
||||
};
|
||||
int i;
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(types); i++) {
|
||||
if (strcasecmp(types[i].name, arg) != 0)
|
||||
continue;
|
||||
|
||||
qmi_set(&wds_mp_req, pdp_type, types[i].type);
|
||||
return QMI_CMD_DONE;
|
||||
}
|
||||
|
||||
uqmi_add_error("Invalid value (valid: ipv4, ipv6, ipv4v6)");
|
||||
return QMI_CMD_EXIT;
|
||||
}
|
||||
|
||||
#define cmd_wds_set_profile_cb no_cb
|
||||
static enum qmi_cmd_result
|
||||
cmd_wds_set_profile_prepare(struct qmi_dev *qmi, struct qmi_request *req, struct qmi_msg *msg, char *arg)
|
||||
{
|
||||
uint32_t idx = strtoul(arg, NULL, 10);
|
||||
|
||||
qmi_set(&wds_sn_req, profile_index_3gpp, idx);
|
||||
return QMI_CMD_DONE;
|
||||
}
|
||||
|
||||
static void
|
||||
cmd_wds_start_network_cb(struct qmi_dev *qmi, struct qmi_request *req, struct qmi_msg *msg)
|
||||
{
|
||||
struct qmi_wds_start_network_response res;
|
||||
|
||||
qmi_parse_wds_start_network_response(msg, &res);
|
||||
if (res.set.packet_data_handle)
|
||||
blobmsg_add_u32(&status, NULL, res.data.packet_data_handle);
|
||||
}
|
||||
|
||||
static enum qmi_cmd_result
|
||||
cmd_wds_start_network_prepare(struct qmi_dev *qmi, struct qmi_request *req, struct qmi_msg *msg, char *arg)
|
||||
{
|
||||
qmi_set_wds_start_network_request(msg, &wds_sn_req);
|
||||
return QMI_CMD_REQUEST;
|
||||
}
|
||||
|
||||
#define cmd_wds_stop_network_cb no_cb
|
||||
static enum qmi_cmd_result
|
||||
cmd_wds_stop_network_prepare(struct qmi_dev *qmi, struct qmi_request *req, struct qmi_msg *msg, char *arg)
|
||||
{
|
||||
uint32_t pdh = strtoul(arg, NULL, 0);
|
||||
|
||||
qmi_set(&wds_stn_req, packet_data_handle, pdh);
|
||||
qmi_set_wds_stop_network_request(msg, &wds_stn_req);
|
||||
return QMI_CMD_REQUEST;
|
||||
}
|
||||
|
||||
static void
|
||||
cmd_wds_modify_profile_cb(struct qmi_dev *qmi, struct qmi_request *req, struct qmi_msg *msg)
|
||||
{
|
||||
struct qmi_wds_modify_profile_response res;
|
||||
qmi_parse_wds_modify_profile_response(msg, &res);
|
||||
}
|
||||
|
||||
static enum qmi_cmd_result
|
||||
cmd_wds_modify_profile_prepare(struct qmi_dev *qmi, struct qmi_request *req, struct qmi_msg *msg, char *arg)
|
||||
{
|
||||
int id;
|
||||
char *s;
|
||||
char *p_type;
|
||||
|
||||
s = strchr(arg, ',');
|
||||
if (!s) {
|
||||
fprintf(stderr, "Invalid argument\n");
|
||||
return QMI_CMD_EXIT;
|
||||
}
|
||||
*s = 0;
|
||||
s++;
|
||||
|
||||
id = strtoul(s, &s, 0);
|
||||
if (s && *s) {
|
||||
fprintf(stderr, "Invalid argument\n");
|
||||
return QMI_CMD_EXIT;
|
||||
}
|
||||
|
||||
p_type = strtok(arg, ",");
|
||||
|
||||
const struct profile_types {
|
||||
const char *name;
|
||||
const QmiWdsProfileType type;
|
||||
} ptypes[] = {
|
||||
{ "3gpp", QMI_WDS_PROFILE_TYPE_3GPP },
|
||||
{ "3gpp2", QMI_WDS_PROFILE_TYPE_3GPP2 },
|
||||
};
|
||||
int i;
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(ptypes); i++) {
|
||||
if (strcasecmp(ptypes[i].name, p_type) != 0)
|
||||
continue;
|
||||
|
||||
qmi_set_ptr(&wds_mp_req, profile_identifier.profile_type, ptypes[i].type);
|
||||
qmi_set_ptr(&wds_mp_req, profile_identifier.profile_index, id);
|
||||
|
||||
qmi_set_wds_modify_profile_request(msg, &wds_mp_req);
|
||||
return QMI_CMD_REQUEST;
|
||||
}
|
||||
|
||||
uqmi_add_error("Invalid value (valid: 3gpp or 3gpp2)");
|
||||
return QMI_CMD_EXIT;
|
||||
}
|
||||
|
||||
static void
|
||||
cmd_wds_get_packet_service_status_cb(struct qmi_dev *qmi, struct qmi_request *req, struct qmi_msg *msg)
|
||||
{
|
||||
struct qmi_wds_get_packet_service_status_response res;
|
||||
const char *data_status[] = {
|
||||
[QMI_WDS_CONNECTION_STATUS_UNKNOWN] = "unknown",
|
||||
[QMI_WDS_CONNECTION_STATUS_DISCONNECTED] = "disconnected",
|
||||
[QMI_WDS_CONNECTION_STATUS_CONNECTED] = "connected",
|
||||
[QMI_WDS_CONNECTION_STATUS_SUSPENDED] = "suspended",
|
||||
[QMI_WDS_CONNECTION_STATUS_AUTHENTICATING] = "authenticating",
|
||||
};
|
||||
int s = 0;
|
||||
|
||||
qmi_parse_wds_get_packet_service_status_response(msg, &res);
|
||||
if (res.set.connection_status &&
|
||||
res.data.connection_status < ARRAY_SIZE(data_status))
|
||||
s = res.data.connection_status;
|
||||
|
||||
blobmsg_add_string(&status, NULL, data_status[s]);
|
||||
}
|
||||
|
||||
static enum qmi_cmd_result
|
||||
cmd_wds_get_packet_service_status_prepare(struct qmi_dev *qmi, struct qmi_request *req, struct qmi_msg *msg, char *arg)
|
||||
{
|
||||
qmi_set_wds_get_packet_service_status_request(msg);
|
||||
return QMI_CMD_REQUEST;
|
||||
}
|
||||
|
||||
#define cmd_wds_set_autoconnect_settings_cb no_cb
|
||||
static enum qmi_cmd_result
|
||||
cmd_wds_set_autoconnect_settings_prepare(struct qmi_dev *qmi, struct qmi_request *req, struct qmi_msg *msg, char *arg)
|
||||
{
|
||||
struct qmi_wds_set_autoconnect_settings_request ac_req;
|
||||
const char *modes[] = {
|
||||
[QMI_WDS_AUTOCONNECT_SETTING_DISABLED] = "disabled",
|
||||
[QMI_WDS_AUTOCONNECT_SETTING_ENABLED] = "enabled",
|
||||
[QMI_WDS_AUTOCONNECT_SETTING_PAUSED] = "paused",
|
||||
};
|
||||
int i;
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(modes); i++) {
|
||||
if (strcasecmp(modes[i], arg) != 0)
|
||||
continue;
|
||||
|
||||
qmi_set(&ac_req, status, i);
|
||||
qmi_set_wds_set_autoconnect_settings_request(msg, &ac_req);
|
||||
return QMI_CMD_DONE;
|
||||
}
|
||||
|
||||
uqmi_add_error("Invalid value (valid: disabled, enabled, paused)");
|
||||
return QMI_CMD_EXIT;
|
||||
}
|
||||
|
||||
#define cmd_wds_reset_cb no_cb
|
||||
static enum qmi_cmd_result
|
||||
cmd_wds_reset_prepare(struct qmi_dev *qmi, struct qmi_request *req, struct qmi_msg *msg, char *arg)
|
||||
{
|
||||
qmi_set_wds_reset_request(msg);
|
||||
return QMI_CMD_REQUEST;
|
||||
}
|
||||
|
||||
#define cmd_wds_set_ip_family_cb no_cb
|
||||
static enum qmi_cmd_result
|
||||
cmd_wds_set_ip_family_prepare(struct qmi_dev *qmi, struct qmi_request *req, struct qmi_msg *msg, char *arg)
|
||||
{
|
||||
struct qmi_wds_set_ip_family_request ipf_req;
|
||||
const struct ip_modes {
|
||||
const char *name;
|
||||
const QmiWdsIpFamily mode;
|
||||
} modes[] = {
|
||||
{ "ipv4", QMI_WDS_IP_FAMILY_IPV4 },
|
||||
{ "ipv6", QMI_WDS_IP_FAMILY_IPV6 },
|
||||
{ "unspecified", QMI_WDS_IP_FAMILY_UNSPECIFIED },
|
||||
};
|
||||
int i;
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(modes); i++) {
|
||||
if (strcasecmp(modes[i].name, arg) != 0)
|
||||
continue;
|
||||
|
||||
qmi_set(&ipf_req, preference, modes[i].mode);
|
||||
qmi_set_wds_set_ip_family_request(msg, &ipf_req);
|
||||
return QMI_CMD_REQUEST;
|
||||
}
|
||||
|
||||
uqmi_add_error("Invalid value (valid: ipv4, ipv6, unspecified)");
|
||||
return QMI_CMD_EXIT;
|
||||
}
|
||||
|
||||
static void wds_to_ipv4(const char *name, const uint32_t addr)
|
||||
{
|
||||
struct in_addr ip_addr;
|
||||
char buf[INET_ADDRSTRLEN];
|
||||
|
||||
ip_addr.s_addr = htonl(addr);
|
||||
blobmsg_add_string(&status, name, inet_ntop(AF_INET, &ip_addr, buf, sizeof(buf)));
|
||||
}
|
||||
|
||||
static void wds_to_ipv6(const char *name, const uint16_t *addr)
|
||||
{
|
||||
char buf[INET6_ADDRSTRLEN];
|
||||
uint16_t ip_addr[8];
|
||||
int i;
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(ip_addr); i++)
|
||||
ip_addr[i] = htons(addr[i]);
|
||||
|
||||
blobmsg_add_string(&status, name, inet_ntop(AF_INET6, &ip_addr, buf, sizeof(buf)));
|
||||
}
|
||||
|
||||
static enum qmi_cmd_result
|
||||
cmd_wds_get_profile_settings_prepare(struct qmi_dev *qmi, struct qmi_request *req, struct qmi_msg *msg, char *arg)
|
||||
{
|
||||
int id;
|
||||
char *s;
|
||||
char *p_type;
|
||||
|
||||
s = strchr(arg, ',');
|
||||
if (!s) {
|
||||
fprintf(stderr, "Invalid argument\n");
|
||||
return QMI_CMD_EXIT;
|
||||
}
|
||||
*s = 0;
|
||||
s++;
|
||||
|
||||
id = strtoul(s, &s, 0);
|
||||
if (s && *s) {
|
||||
fprintf(stderr, "Invalid argument\n");
|
||||
return QMI_CMD_EXIT;
|
||||
}
|
||||
|
||||
p_type = strtok(arg, ",");
|
||||
|
||||
const struct profile_types {
|
||||
const char *name;
|
||||
const QmiWdsProfileType type;
|
||||
} ptypes[] = {
|
||||
{ "3gpp", QMI_WDS_PROFILE_TYPE_3GPP },
|
||||
{ "3gpp2", QMI_WDS_PROFILE_TYPE_3GPP2 },
|
||||
};
|
||||
int i;
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(ptypes); i++) {
|
||||
if (strcasecmp(ptypes[i].name, p_type) != 0)
|
||||
continue;
|
||||
|
||||
struct qmi_wds_get_profile_settings_request p_num = {
|
||||
QMI_INIT_SEQUENCE(profile_id,
|
||||
.profile_type = ptypes[i].type,
|
||||
.profile_index = id,
|
||||
)
|
||||
};
|
||||
qmi_set_wds_get_profile_settings_request(msg, &p_num);
|
||||
return QMI_CMD_REQUEST;
|
||||
}
|
||||
|
||||
uqmi_add_error("Invalid value (valid: 3gpp or 3gpp2)");
|
||||
return QMI_CMD_EXIT;
|
||||
}
|
||||
|
||||
static void
|
||||
cmd_wds_get_profile_settings_cb(struct qmi_dev *qmi, struct qmi_request *req, struct qmi_msg *msg)
|
||||
{
|
||||
struct qmi_wds_get_profile_settings_response res;
|
||||
const char *pdptypes[] = {
|
||||
[QMI_WDS_PDP_TYPE_IPV4] = "ipv4",
|
||||
[QMI_WDS_PDP_TYPE_PPP] = "ppp",
|
||||
[QMI_WDS_PDP_TYPE_IPV6] = "ipv6",
|
||||
[QMI_WDS_PDP_TYPE_IPV4_OR_IPV6] = "ipv4-or-ipv6",
|
||||
};
|
||||
|
||||
const char *authtypes[] = {
|
||||
[QMI_WDS_AUTHENTICATION_NONE] = "none",
|
||||
[QMI_WDS_AUTHENTICATION_PAP] = "PAP",
|
||||
[QMI_WDS_AUTHENTICATION_CHAP] = "CHAP",
|
||||
};
|
||||
|
||||
void *p;
|
||||
|
||||
qmi_parse_wds_get_profile_settings_response(msg, &res);
|
||||
|
||||
p = blobmsg_open_table(&status, NULL);
|
||||
|
||||
blobmsg_add_string(&status, "apn", res.data.apn_name);
|
||||
|
||||
if (res.set.pdp_type && (int) res.data.pdp_type < ARRAY_SIZE(pdptypes))
|
||||
blobmsg_add_string(&status, "pdp-type", pdptypes[res.data.pdp_type]);
|
||||
|
||||
blobmsg_add_string(&status, "username", res.data.username);
|
||||
|
||||
blobmsg_add_string(&status, "password", res.data.password);
|
||||
|
||||
if (res.set.authentication && (int) res.data.authentication < ARRAY_SIZE(authtypes))
|
||||
blobmsg_add_string(&status, "auth", authtypes[res.data.authentication]);
|
||||
|
||||
blobmsg_close_table(&status, p);
|
||||
}
|
||||
|
||||
static void
|
||||
cmd_wds_get_current_settings_cb(struct qmi_dev *qmi, struct qmi_request *req, struct qmi_msg *msg)
|
||||
{
|
||||
void *v4, *v6, *d, *t;
|
||||
struct qmi_wds_get_current_settings_response res;
|
||||
const char *pdptypes[] = {
|
||||
[QMI_WDS_PDP_TYPE_IPV4] = "ipv4",
|
||||
[QMI_WDS_PDP_TYPE_PPP] = "ppp",
|
||||
[QMI_WDS_PDP_TYPE_IPV6] = "ipv6",
|
||||
[QMI_WDS_PDP_TYPE_IPV4_OR_IPV6] = "ipv4-or-ipv6",
|
||||
};
|
||||
const struct ip_modes {
|
||||
const char *name;
|
||||
const QmiWdsIpFamily mode;
|
||||
} modes[] = {
|
||||
{ "ipv4", QMI_WDS_IP_FAMILY_IPV4 },
|
||||
{ "ipv6", QMI_WDS_IP_FAMILY_IPV6 },
|
||||
{ "unspecified", QMI_WDS_IP_FAMILY_UNSPECIFIED },
|
||||
};
|
||||
int i;
|
||||
|
||||
qmi_parse_wds_get_current_settings_response(msg, &res);
|
||||
|
||||
t = blobmsg_open_table(&status, NULL);
|
||||
|
||||
if (res.set.pdp_type && (int) res.data.pdp_type < ARRAY_SIZE(pdptypes))
|
||||
blobmsg_add_string(&status, "pdp-type", pdptypes[res.data.pdp_type]);
|
||||
|
||||
if (res.set.ip_family) {
|
||||
for (i = 0; i < ARRAY_SIZE(modes); i++) {
|
||||
if (modes[i].mode != res.data.ip_family)
|
||||
continue;
|
||||
blobmsg_add_string(&status, "ip-family", modes[i].name);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (res.set.mtu)
|
||||
blobmsg_add_u32(&status, "mtu", res.data.mtu);
|
||||
|
||||
/* IPV4 */
|
||||
v4 = blobmsg_open_table(&status, "ipv4");
|
||||
|
||||
if (res.set.ipv4_address)
|
||||
wds_to_ipv4("ip", res.data.ipv4_address);
|
||||
if (res.set.primary_ipv4_dns_address)
|
||||
wds_to_ipv4("dns1", res.data.primary_ipv4_dns_address);
|
||||
if (res.set.secondary_ipv4_dns_address)
|
||||
wds_to_ipv4("dns2", res.data.secondary_ipv4_dns_address);
|
||||
if (res.set.ipv4_gateway_address)
|
||||
wds_to_ipv4("gateway", res.data.ipv4_gateway_address);
|
||||
if (res.set.ipv4_gateway_subnet_mask)
|
||||
wds_to_ipv4("subnet", res.data.ipv4_gateway_subnet_mask);
|
||||
blobmsg_close_table(&status, v4);
|
||||
|
||||
/* IPV6 */
|
||||
v6 = blobmsg_open_table(&status, "ipv6");
|
||||
|
||||
if (res.set.ipv6_address) {
|
||||
wds_to_ipv6("ip", res.data.ipv6_address.address);
|
||||
blobmsg_add_u32(&status, "ip-prefix-length", res.data.ipv6_address.prefix_length);
|
||||
}
|
||||
if (res.set.ipv6_gateway_address) {
|
||||
wds_to_ipv6("gateway", res.data.ipv6_gateway_address.address);
|
||||
blobmsg_add_u32(&status, "gw-prefix-length", res.data.ipv6_gateway_address.prefix_length);
|
||||
}
|
||||
if (res.set.ipv6_primary_dns_address)
|
||||
wds_to_ipv6("dns1", res.data.ipv6_primary_dns_address);
|
||||
if (res.set.ipv6_secondary_dns_address)
|
||||
wds_to_ipv6("dns2", res.data.ipv6_secondary_dns_address);
|
||||
|
||||
blobmsg_close_table(&status, v6);
|
||||
|
||||
d = blobmsg_open_table(&status, "domain-names");
|
||||
for (i = 0; i < res.data.domain_name_list_n; i++) {
|
||||
blobmsg_add_string(&status, NULL, res.data.domain_name_list[i]);
|
||||
}
|
||||
blobmsg_close_table(&status, d);
|
||||
|
||||
blobmsg_close_table(&status, t);
|
||||
}
|
||||
|
||||
static enum qmi_cmd_result
|
||||
cmd_wds_get_current_settings_prepare(struct qmi_dev *qmi, struct qmi_request *req, struct qmi_msg *msg, char *arg)
|
||||
{
|
||||
struct qmi_wds_get_current_settings_request gcs_req;
|
||||
memset(&gcs_req, '\0', sizeof(struct qmi_wds_get_current_settings_request));
|
||||
qmi_set(&gcs_req, requested_settings,
|
||||
QMI_WDS_GET_CURRENT_SETTINGS_REQUESTED_SETTINGS_PDP_TYPE |
|
||||
QMI_WDS_GET_CURRENT_SETTINGS_REQUESTED_SETTINGS_DNS_ADDRESS |
|
||||
QMI_WDS_GET_CURRENT_SETTINGS_REQUESTED_SETTINGS_GRANTED_QOS |
|
||||
QMI_WDS_GET_CURRENT_SETTINGS_REQUESTED_SETTINGS_IP_ADDRESS |
|
||||
QMI_WDS_GET_CURRENT_SETTINGS_REQUESTED_SETTINGS_GATEWAY_INFO |
|
||||
QMI_WDS_GET_CURRENT_SETTINGS_REQUESTED_SETTINGS_MTU |
|
||||
QMI_WDS_GET_CURRENT_SETTINGS_REQUESTED_SETTINGS_DOMAIN_NAME_LIST |
|
||||
QMI_WDS_GET_CURRENT_SETTINGS_REQUESTED_SETTINGS_IP_FAMILY);
|
||||
qmi_set_wds_get_current_settings_request(msg, &gcs_req);
|
||||
return QMI_CMD_REQUEST;
|
||||
}
|
||||
|
||||
static enum qmi_cmd_result
|
||||
cmd_wds_get_default_profile_number_prepare(struct qmi_dev *qmi, struct qmi_request *req, struct qmi_msg *msg, char *arg)
|
||||
{
|
||||
const struct profile_types {
|
||||
const char *name;
|
||||
const QmiWdsProfileType type;
|
||||
} ptypes[] = {
|
||||
{ "3gpp", QMI_WDS_PROFILE_TYPE_3GPP },
|
||||
{ "3gpp2", QMI_WDS_PROFILE_TYPE_3GPP2 },
|
||||
};
|
||||
int i;
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(ptypes); i++) {
|
||||
if (strcasecmp(ptypes[i].name, arg) != 0)
|
||||
continue;
|
||||
|
||||
struct qmi_wds_get_default_profile_number_request type_family = {
|
||||
QMI_INIT_SEQUENCE(profile_type,
|
||||
.type = ptypes[i].type,
|
||||
.family = QMI_WDS_PROFILE_FAMILY_TETHERED,
|
||||
)
|
||||
};
|
||||
|
||||
qmi_set_wds_get_default_profile_number_request(msg, &type_family);
|
||||
return QMI_CMD_REQUEST;
|
||||
}
|
||||
|
||||
uqmi_add_error("Invalid value (valid: 3gpp or 3gpp2)");
|
||||
return QMI_CMD_EXIT;
|
||||
}
|
||||
|
||||
static void
|
||||
cmd_wds_get_default_profile_number_cb(struct qmi_dev *qmi, struct qmi_request *req, struct qmi_msg *msg)
|
||||
{
|
||||
struct qmi_wds_get_default_profile_number_response res;
|
||||
void *p;
|
||||
qmi_parse_wds_get_default_profile_number_response(msg, &res);
|
||||
|
||||
p = blobmsg_open_table(&status, NULL);
|
||||
|
||||
blobmsg_add_u32(&status, "default-profile", res.data.index);
|
||||
|
||||
blobmsg_close_table(&status, p);
|
||||
}
|
@ -0,0 +1,66 @@
|
||||
/*
|
||||
* uqmi -- tiny QMI support implementation
|
||||
*
|
||||
* Copyright (C) 2014-2015 Felix Fietkau <nbd@openwrt.org>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
#define __uqmi_wds_commands \
|
||||
__uqmi_command(wds_start_network, start-network, no, QMI_SERVICE_WDS), \
|
||||
__uqmi_command(wds_set_apn, apn, required, CMD_TYPE_OPTION), \
|
||||
__uqmi_command(wds_set_auth, auth-type, required, CMD_TYPE_OPTION), \
|
||||
__uqmi_command(wds_set_username, username, required, CMD_TYPE_OPTION), \
|
||||
__uqmi_command(wds_set_password, password, required, CMD_TYPE_OPTION), \
|
||||
__uqmi_command(wds_set_ip_family_pref, ip-family, required, CMD_TYPE_OPTION), \
|
||||
__uqmi_command(wds_set_autoconnect, autoconnect, no, CMD_TYPE_OPTION), \
|
||||
__uqmi_command(wds_set_profile, profile, required, CMD_TYPE_OPTION), \
|
||||
__uqmi_command(wds_stop_network, stop-network, required, QMI_SERVICE_WDS), \
|
||||
__uqmi_command(wds_get_packet_service_status, get-data-status, no, QMI_SERVICE_WDS), \
|
||||
__uqmi_command(wds_set_ip_family, set-ip-family, required, QMI_SERVICE_WDS), \
|
||||
__uqmi_command(wds_set_autoconnect_settings, set-autoconnect, required, QMI_SERVICE_WDS), \
|
||||
__uqmi_command(wds_reset, reset-wds, no, QMI_SERVICE_WDS), \
|
||||
__uqmi_command(wds_get_profile_settings, get-profile-settings, required, QMI_SERVICE_WDS), \
|
||||
__uqmi_command(wds_get_default_profile_number, get-default-profile-number, required, QMI_SERVICE_WDS), \
|
||||
__uqmi_command(wds_modify_profile, modify-profile, required, QMI_SERVICE_WDS), \
|
||||
__uqmi_command(wds_set_pdp_type, pdp-type, required, CMD_TYPE_OPTION), \
|
||||
__uqmi_command(wds_get_current_settings, get-current-settings, no, QMI_SERVICE_WDS) \
|
||||
|
||||
|
||||
#define wds_helptext \
|
||||
" --start-network: Start network connection (use with options below)\n" \
|
||||
" --apn <apn>: Use APN\n" \
|
||||
" --auth-type pap|chap|both|none: Use network authentication type\n" \
|
||||
" --username <name>: Use network username\n" \
|
||||
" --password <password>: Use network password\n" \
|
||||
" --ip-family <family>: Use ip-family for the connection (ipv4, ipv6, unspecified)\n" \
|
||||
" --autoconnect: Enable automatic connect/reconnect\n" \
|
||||
" --profile <index>: Use connection profile\n" \
|
||||
" --stop-network <pdh>: Stop network connection (use with option below)\n" \
|
||||
" --autoconnect: Disable automatic connect/reconnect\n" \
|
||||
" --get-data-status: Get current data access status\n" \
|
||||
" --set-ip-family <val>: Set ip-family (ipv4, ipv6, unspecified)\n" \
|
||||
" --set-autoconnect <val>: Set automatic connect/reconnect (disabled, enabled, paused)\n" \
|
||||
" --get-profile-settings <val,#>: Get APN profile settings (3gpp, 3gpp2),#\n" \
|
||||
" --get-default-profile-number <val>: Get default profile number (3gpp, 3gpp2)\n" \
|
||||
" --modify-profile <val>,# Modify profile number (3gpp, 3gpp2)\n" \
|
||||
" --apn <apn>: Use APN\n" \
|
||||
" --pdp-type ipv4|ipv6|ipv4v6>: Use pdp-type for the connection\n" \
|
||||
" --username <name>: Use network username\n" \
|
||||
" --password <password>: Use network password\n" \
|
||||
" --auth-type pap|chap|both|none: Use network authentication type\n" \
|
||||
" --get-current-settings: Get current connection settings\n" \
|
||||
|
@ -0,0 +1,668 @@
|
||||
/*
|
||||
* uqmi -- tiny QMI support implementation
|
||||
*
|
||||
* Copyright (C) 2014-2015 Felix Fietkau <nbd@openwrt.org>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
#include "qmi-message.h"
|
||||
|
||||
#define MIN(a,b) (((a)<(b))?(a):(b))
|
||||
#define CEILDIV(x,y) (((x) + (y) - 1) / (y))
|
||||
|
||||
static void cmd_wms_list_messages_cb(struct qmi_dev *qmi, struct qmi_request *req, struct qmi_msg *msg)
|
||||
{
|
||||
struct qmi_wms_list_messages_response res;
|
||||
void *c;
|
||||
int i;
|
||||
|
||||
qmi_parse_wms_list_messages_response(msg, &res);
|
||||
c = blobmsg_open_array(&status, NULL);
|
||||
for (i = 0; i < res.data.message_list_n; i++)
|
||||
blobmsg_add_u32(&status, NULL, res.data.message_list[i].memory_index);
|
||||
|
||||
blobmsg_close_array(&status, c);
|
||||
}
|
||||
|
||||
static enum qmi_cmd_result
|
||||
cmd_wms_list_messages_prepare(struct qmi_dev *qmi, struct qmi_request *req, struct qmi_msg *msg, char *arg)
|
||||
{
|
||||
static struct qmi_wms_list_messages_request mreq = {
|
||||
QMI_INIT(storage_type, QMI_WMS_STORAGE_TYPE_UIM),
|
||||
QMI_INIT(message_tag, QMI_WMS_MESSAGE_TAG_TYPE_MT_NOT_READ),
|
||||
};
|
||||
|
||||
qmi_set_wms_list_messages_request(msg, &mreq);
|
||||
|
||||
return QMI_CMD_REQUEST;
|
||||
}
|
||||
|
||||
static int
|
||||
put_unicode_char(char *dest, uint16_t c)
|
||||
{
|
||||
if (c < 0x80) {
|
||||
*dest = c;
|
||||
return 1;
|
||||
} else if (c < 0x800) {
|
||||
*(dest++) = 0xc0 | ((c >> 6) & 0x1f);
|
||||
*dest = 0x80 | (c & 0x3f);
|
||||
return 2;
|
||||
} else {
|
||||
*(dest++) = 0xe0 | ((c >> 12) & 0xf);
|
||||
*(dest++) = 0x80 | ((c >> 6) & 0x3f);
|
||||
*dest = 0x80 | (c & 0x3f);
|
||||
return 3;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
pdu_decode_7bit_char(char *dest, int len, unsigned char c, bool *escape)
|
||||
{
|
||||
uint16_t conv_0x20[] = {
|
||||
0x0040, 0x00A3, 0x0024, 0x00A5, 0x00E8, 0x00E9, 0x00F9, 0x00EC,
|
||||
0x00F2, 0x00E7, 0x000A, 0x00D8, 0x00F8, 0x000D, 0x00C5, 0x00E5,
|
||||
0x0394, 0x005F, 0x03A6, 0x0393, 0x039B, 0x03A9, 0x03A0, 0x03A8,
|
||||
0x03A3, 0x0398, 0x039E, 0x00A0, 0x00C6, 0x00E6, 0x00DF, 0x00C9,
|
||||
};
|
||||
uint16_t conv_0x5b[] = {
|
||||
0x00C4, 0x00D6, 0x00D1, 0x00DC, 0x00A7, 0x00BF,
|
||||
};
|
||||
uint16_t conv_0x7b[] = {
|
||||
0x00E4, 0x00F6, 0x00F1, 0x00FC, 0x00E0
|
||||
};
|
||||
int cur_len = 0;
|
||||
uint16_t outc;
|
||||
|
||||
fprintf(stderr, " %02x", c);
|
||||
dest += len;
|
||||
if (*escape) {
|
||||
*escape = false;
|
||||
switch(c) {
|
||||
case 0x0A:
|
||||
*dest = 0x0C;
|
||||
return 1;
|
||||
case 0x14:
|
||||
*dest = 0x5E;
|
||||
return 1;
|
||||
case 0x28:
|
||||
*dest = 0x7B;
|
||||
return 1;
|
||||
case 0x29:
|
||||
*dest = 0x7D;
|
||||
return 1;
|
||||
case 0x2F:
|
||||
*dest = 0x5C;
|
||||
return 1;
|
||||
case 0x3C:
|
||||
*dest = 0x5B;
|
||||
return 1;
|
||||
case 0x3D:
|
||||
*dest = 0x7E;
|
||||
return 1;
|
||||
case 0x3E:
|
||||
*dest = 0x5D;
|
||||
return 1;
|
||||
case 0x40:
|
||||
*dest = 0x7C;
|
||||
return 1;
|
||||
case 0x65:
|
||||
outc = 0x20AC;
|
||||
goto out;
|
||||
case 0x1B:
|
||||
goto normal;
|
||||
default:
|
||||
/* invalid */
|
||||
*(dest++) = conv_0x20[0x1B];
|
||||
cur_len++;
|
||||
goto normal;
|
||||
}
|
||||
}
|
||||
|
||||
if (c == 0x1b) {
|
||||
*escape = true;
|
||||
return 0;
|
||||
}
|
||||
|
||||
normal:
|
||||
if (c < 0x20)
|
||||
outc = conv_0x20[(int) c];
|
||||
else if (c == 0x40)
|
||||
outc = 0x00A1;
|
||||
else if (c >= 0x5b && c <= 0x60)
|
||||
outc = conv_0x5b[c - 0x5b];
|
||||
else if (c >= 0x7b && c <= 0x7f)
|
||||
outc = conv_0x7b[c - 0x7b];
|
||||
else
|
||||
outc = c;
|
||||
|
||||
out:
|
||||
return cur_len + put_unicode_char(dest, outc);
|
||||
}
|
||||
|
||||
static int
|
||||
pdu_decode_7bit_str(char *dest, const unsigned char *data, int data_len, int bit_offset)
|
||||
{
|
||||
bool escape = false;
|
||||
int len = 0;
|
||||
int i;
|
||||
|
||||
fprintf(stderr, "Raw text:");
|
||||
for (i = 0; i < data_len; i++) {
|
||||
int pos = (i + bit_offset) % 7;
|
||||
|
||||
if (pos == 0) {
|
||||
len += pdu_decode_7bit_char(dest, len, data[i] & 0x7f, &escape);
|
||||
} else {
|
||||
if (i)
|
||||
len += pdu_decode_7bit_char(dest, len,
|
||||
(data[i - 1] >> (7 + 1 - pos)) |
|
||||
((data[i] << pos) & 0x7f), &escape);
|
||||
|
||||
if (pos == 6)
|
||||
len += pdu_decode_7bit_char(dest, len, (data[i] >> 1) & 0x7f,
|
||||
&escape);
|
||||
}
|
||||
}
|
||||
dest[len] = 0;
|
||||
fprintf(stderr, "\n");
|
||||
return len;
|
||||
}
|
||||
|
||||
static int decode_udh(const unsigned char *data)
|
||||
{
|
||||
const unsigned char *end;
|
||||
unsigned int type, len, udh_len;
|
||||
|
||||
udh_len = *(data++);
|
||||
end = data + udh_len;
|
||||
while (data < end) {
|
||||
const unsigned char *val;
|
||||
|
||||
type = data[0];
|
||||
len = data[1];
|
||||
val = &data[2];
|
||||
data += 2 + len;
|
||||
if (data > end)
|
||||
break;
|
||||
|
||||
switch (type) {
|
||||
case 0x00:
|
||||
blobmsg_add_u32(&status, "concat_ref", (uint32_t) val[0]);
|
||||
blobmsg_add_u32(&status, "concat_part", (uint32_t) val[2]);
|
||||
blobmsg_add_u32(&status, "concat_parts", (uint32_t) val[1]);
|
||||
break;
|
||||
case 0x08:
|
||||
blobmsg_add_u32(&status, "concat_ref", (uint32_t) (val[0] << 8 | val[1]));
|
||||
blobmsg_add_u32(&status, "concat_part", (uint32_t) val[3]);
|
||||
blobmsg_add_u32(&status, "concat_parts", (uint32_t) val[2]);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return udh_len + 1;
|
||||
}
|
||||
|
||||
static void decode_7bit_field(char *name, const unsigned char *data, int data_len, int bit_offset)
|
||||
{
|
||||
char *dest = blobmsg_alloc_string_buffer(&status, name, 3 * data_len + 2);
|
||||
pdu_decode_7bit_str(dest, data, CEILDIV(data_len * 7, 8), bit_offset);
|
||||
dest[data_len] = 0;
|
||||
blobmsg_add_string_buffer(&status);
|
||||
}
|
||||
|
||||
static char *pdu_add_semioctet(char *str, char val)
|
||||
{
|
||||
*str = '0' + (val & 0xf);
|
||||
if (*str <= '9')
|
||||
str++;
|
||||
|
||||
*str = '0' + ((val >> 4) & 0xf);
|
||||
if (*str <= '9')
|
||||
str++;
|
||||
|
||||
return str;
|
||||
}
|
||||
|
||||
static void
|
||||
pdu_decode_address(char *str, unsigned char *data, int len)
|
||||
{
|
||||
unsigned char toa;
|
||||
|
||||
toa = *(data++);
|
||||
switch (toa & 0x70) {
|
||||
case 0x50:
|
||||
pdu_decode_7bit_str(str, data, len, 0);
|
||||
return;
|
||||
case 0x10:
|
||||
*(str++) = '+';
|
||||
/* fall through */
|
||||
default:
|
||||
while (len--) {
|
||||
str = pdu_add_semioctet(str, *data);
|
||||
data++;
|
||||
}
|
||||
}
|
||||
|
||||
*str = 0;
|
||||
}
|
||||
|
||||
static void wms_decode_address(char *name, unsigned char *data, int len)
|
||||
{
|
||||
char *str = blobmsg_alloc_string_buffer(&status, name, len * 2 + 2);
|
||||
pdu_decode_address(str, data, len);
|
||||
blobmsg_add_string_buffer(&status);
|
||||
}
|
||||
|
||||
static void blobmsg_add_hex(struct blob_buf *buf, const char *name, unsigned const char *data, int len)
|
||||
{
|
||||
char* str = blobmsg_alloc_string_buffer(buf, name, len * 2 + 1);
|
||||
for (int i = 0; i < len; i++) {
|
||||
str += sprintf(str, "%02x", data[i]);
|
||||
}
|
||||
blobmsg_add_string_buffer(buf);
|
||||
}
|
||||
|
||||
#define cmd_wms_delete_message_cb no_cb
|
||||
static enum qmi_cmd_result
|
||||
cmd_wms_delete_message_prepare(struct qmi_dev *qmi, struct qmi_request *req, struct qmi_msg *msg, char *arg)
|
||||
{
|
||||
char *err;
|
||||
int id;
|
||||
|
||||
id = strtoul(arg, &err, 10);
|
||||
if (err && *err) {
|
||||
uqmi_add_error("Invalid message ID");
|
||||
return QMI_CMD_EXIT;
|
||||
}
|
||||
|
||||
static struct qmi_wms_delete_request mreq = {
|
||||
QMI_INIT(memory_storage, QMI_WMS_STORAGE_TYPE_UIM),
|
||||
QMI_INIT(message_mode, QMI_WMS_MESSAGE_MODE_GSM_WCDMA),
|
||||
};
|
||||
|
||||
mreq.set.memory_index = 1;
|
||||
mreq.data.memory_index = id;
|
||||
|
||||
qmi_set_wms_delete_request(msg, &mreq);
|
||||
|
||||
return QMI_CMD_REQUEST;
|
||||
}
|
||||
|
||||
|
||||
static void cmd_wms_get_message_cb(struct qmi_dev *qmi, struct qmi_request *req, struct qmi_msg *msg)
|
||||
{
|
||||
struct qmi_wms_raw_read_response res;
|
||||
unsigned char *data, *end;
|
||||
char *str;
|
||||
int cur_len;
|
||||
bool sent;
|
||||
unsigned char first, dcs;
|
||||
void *c;
|
||||
|
||||
qmi_parse_wms_raw_read_response(msg, &res);
|
||||
c = blobmsg_open_table(&status, NULL);
|
||||
data = (unsigned char *) res.data.raw_message_data.raw_data;
|
||||
end = data + res.data.raw_message_data.raw_data_n;
|
||||
|
||||
cur_len = *(data++);
|
||||
if (data + cur_len >= end)
|
||||
goto error;
|
||||
|
||||
if (cur_len) {
|
||||
wms_decode_address("smsc", data, cur_len - 1);
|
||||
data += cur_len;
|
||||
}
|
||||
|
||||
if (data + 3 >= end)
|
||||
goto error;
|
||||
|
||||
first = *(data++);
|
||||
sent = (first & 0x3) == 1;
|
||||
if (sent)
|
||||
data++;
|
||||
|
||||
cur_len = *(data++);
|
||||
if (data + cur_len >= end)
|
||||
goto error;
|
||||
|
||||
if (cur_len) {
|
||||
cur_len = (cur_len + 1) / 2;
|
||||
wms_decode_address(sent ? "receiver" : "sender", data, cur_len);
|
||||
data += cur_len + 1;
|
||||
}
|
||||
|
||||
if (data + 3 >= end)
|
||||
goto error;
|
||||
|
||||
/* Protocol ID */
|
||||
if (*(data++) != 0)
|
||||
goto error;
|
||||
|
||||
/* Data Encoding */
|
||||
dcs = *(data++);
|
||||
|
||||
if (dcs & 0x10)
|
||||
blobmsg_add_u32(&status, "class", (dcs & 3));
|
||||
|
||||
if (sent) {
|
||||
/* Message validity */
|
||||
data++;
|
||||
} else {
|
||||
if (data + 6 >= end)
|
||||
goto error;
|
||||
|
||||
str = blobmsg_alloc_string_buffer(&status, "timestamp", 32);
|
||||
|
||||
/* year */
|
||||
*(str++) = '2';
|
||||
*(str++) = '0';
|
||||
str = pdu_add_semioctet(str, data[0]);
|
||||
/* month */
|
||||
*(str++) = '-';
|
||||
str = pdu_add_semioctet(str, data[1]);
|
||||
/* day */
|
||||
*(str++) = '-';
|
||||
str = pdu_add_semioctet(str, data[2]);
|
||||
|
||||
/* hour */
|
||||
*(str++) = ' ';
|
||||
str = pdu_add_semioctet(str, data[3]);
|
||||
/* minute */
|
||||
*(str++) = ':';
|
||||
str = pdu_add_semioctet(str, data[4]);
|
||||
/* second */
|
||||
*(str++) = ':';
|
||||
str = pdu_add_semioctet(str, data[5]);
|
||||
*str = 0;
|
||||
|
||||
blobmsg_add_string_buffer(&status);
|
||||
|
||||
data += 7;
|
||||
}
|
||||
|
||||
int message_len = *(data++);
|
||||
int udh_len = 0;
|
||||
int bit_offset = 0;
|
||||
|
||||
/* User Data Header */
|
||||
if (first & 0x40) {
|
||||
udh_len = decode_udh(data);
|
||||
data += udh_len;
|
||||
bit_offset = udh_len % 7;
|
||||
}
|
||||
|
||||
if (data >= end)
|
||||
goto error;
|
||||
|
||||
switch(dcs & 0x0c) {
|
||||
case 0x00:
|
||||
/* 7 bit GSM alphabet */
|
||||
message_len = message_len - CEILDIV(udh_len * 8, 7);
|
||||
message_len = MIN(message_len, CEILDIV((end - data) * 8, 7));
|
||||
decode_7bit_field("text", data, message_len, bit_offset);
|
||||
break;
|
||||
case 0x04:
|
||||
/* 8 bit data */
|
||||
message_len = MIN(message_len - udh_len, end - data);
|
||||
blobmsg_add_hex(&status, "data", data, message_len);
|
||||
break;
|
||||
case 0x08:
|
||||
/* 16 bit UCS-2 string */
|
||||
message_len = MIN(message_len - udh_len, end - data);
|
||||
blobmsg_add_hex(&status, "ucs-2", data, message_len);
|
||||
break;
|
||||
default:
|
||||
goto error;
|
||||
}
|
||||
|
||||
blobmsg_close_table(&status, c);
|
||||
return;
|
||||
|
||||
error:
|
||||
blobmsg_close_table(&status, c);
|
||||
fprintf(stderr, "There was an error reading message.\n");
|
||||
}
|
||||
|
||||
static enum qmi_cmd_result
|
||||
cmd_wms_get_message_prepare(struct qmi_dev *qmi, struct qmi_request *req, struct qmi_msg *msg, char *arg)
|
||||
{
|
||||
static struct qmi_wms_raw_read_request mreq = {
|
||||
QMI_INIT_SEQUENCE(message_memory_storage_id,
|
||||
.storage_type = QMI_WMS_STORAGE_TYPE_UIM,
|
||||
),
|
||||
QMI_INIT(message_mode, QMI_WMS_MESSAGE_MODE_GSM_WCDMA),
|
||||
};
|
||||
char *err;
|
||||
int id;
|
||||
|
||||
id = strtoul(arg, &err, 10);
|
||||
if (err && *err) {
|
||||
uqmi_add_error("Invalid message ID");
|
||||
return QMI_CMD_EXIT;
|
||||
}
|
||||
|
||||
mreq.data.message_memory_storage_id.memory_index = id;
|
||||
qmi_set_wms_raw_read_request(msg, &mreq);
|
||||
|
||||
return QMI_CMD_REQUEST;
|
||||
}
|
||||
|
||||
|
||||
static void cmd_wms_get_raw_message_cb(struct qmi_dev *qmi, struct qmi_request *req, struct qmi_msg *msg)
|
||||
{
|
||||
struct qmi_wms_raw_read_response res;
|
||||
unsigned char *data;
|
||||
char *str;
|
||||
int i;
|
||||
|
||||
qmi_parse_wms_raw_read_response(msg, &res);
|
||||
data = (unsigned char *) res.data.raw_message_data.raw_data;
|
||||
str = blobmsg_alloc_string_buffer(&status, NULL, res.data.raw_message_data.raw_data_n * 3);
|
||||
for (i = 0; i < res.data.raw_message_data.raw_data_n; i++) {
|
||||
str += sprintf(str, &" %02x"[i ? 0 : 1], data[i]);
|
||||
}
|
||||
blobmsg_add_string_buffer(&status);
|
||||
}
|
||||
|
||||
#define cmd_wms_get_raw_message_prepare cmd_wms_get_message_prepare
|
||||
|
||||
|
||||
static struct {
|
||||
const char *smsc;
|
||||
const char *target;
|
||||
bool flash;
|
||||
} _send;
|
||||
|
||||
|
||||
#define cmd_wms_send_message_smsc_cb no_cb
|
||||
static enum qmi_cmd_result
|
||||
cmd_wms_send_message_smsc_prepare(struct qmi_dev *qmi, struct qmi_request *req, struct qmi_msg *msg, char *arg)
|
||||
{
|
||||
_send.smsc = arg;
|
||||
return QMI_CMD_DONE;
|
||||
}
|
||||
|
||||
#define cmd_wms_send_message_target_cb no_cb
|
||||
static enum qmi_cmd_result
|
||||
cmd_wms_send_message_target_prepare(struct qmi_dev *qmi, struct qmi_request *req, struct qmi_msg *msg, char *arg)
|
||||
{
|
||||
_send.target = arg;
|
||||
return QMI_CMD_DONE;
|
||||
}
|
||||
|
||||
#define cmd_wms_send_message_flash_cb no_cb
|
||||
static enum qmi_cmd_result
|
||||
cmd_wms_send_message_flash_prepare(struct qmi_dev *qmi, struct qmi_request *req, struct qmi_msg *msg, char *arg)
|
||||
{
|
||||
_send.flash = true;
|
||||
return QMI_CMD_DONE;
|
||||
}
|
||||
|
||||
static int
|
||||
pdu_encode_semioctet(unsigned char *dest, const char *str)
|
||||
{
|
||||
int len = 0;
|
||||
bool lower = true;
|
||||
|
||||
while (*str) {
|
||||
char digit = *str - '0';
|
||||
|
||||
if (lower)
|
||||
dest[len] = 0xf0 | digit;
|
||||
else
|
||||
dest[len++] &= (digit << 4) | 0xf;
|
||||
|
||||
lower = !lower;
|
||||
str++;
|
||||
}
|
||||
|
||||
return lower ? len : (len + 1);
|
||||
}
|
||||
|
||||
static int
|
||||
pdu_encode_7bit_str(unsigned char *data, const char *str)
|
||||
{
|
||||
unsigned char c;
|
||||
int len = 0;
|
||||
int ofs = 0;
|
||||
|
||||
while(1) {
|
||||
c = *(str++) & 0x7f;
|
||||
if (!c)
|
||||
break;
|
||||
|
||||
switch(ofs) {
|
||||
case 0:
|
||||
data[len] = c;
|
||||
break;
|
||||
default:
|
||||
data[len++] |= c << (8 - ofs);
|
||||
data[len] = c >> ofs;
|
||||
break;
|
||||
}
|
||||
|
||||
ofs = (ofs + 1) % 8;
|
||||
}
|
||||
|
||||
return len + 1;
|
||||
}
|
||||
|
||||
static int
|
||||
pdu_encode_number(unsigned char *dest, const char *str, bool smsc)
|
||||
{
|
||||
unsigned char format;
|
||||
bool ascii = false;
|
||||
int len = 0;
|
||||
int i;
|
||||
|
||||
dest[len++] = 0;
|
||||
if (*str == '+') {
|
||||
str++;
|
||||
format = 0x91;
|
||||
} else {
|
||||
format = 0x81;
|
||||
}
|
||||
|
||||
for (i = 0; str[i]; i++) {
|
||||
if (str[i] >= '0' && str[i] <= '9')
|
||||
continue;
|
||||
|
||||
ascii = true;
|
||||
break;
|
||||
}
|
||||
|
||||
if (ascii)
|
||||
format |= 0x40;
|
||||
|
||||
dest[len++] = format;
|
||||
if (!ascii)
|
||||
len += pdu_encode_semioctet(&dest[len], str);
|
||||
else
|
||||
len += pdu_encode_7bit_str(&dest[len], str);
|
||||
|
||||
if (smsc)
|
||||
dest[0] = len - 1;
|
||||
else
|
||||
dest[0] = strlen(str);
|
||||
|
||||
return len;
|
||||
}
|
||||
|
||||
static int
|
||||
pdu_encode_data(unsigned char *dest, const char *str)
|
||||
{
|
||||
int len = 0;
|
||||
|
||||
dest[len++] = 0;
|
||||
len += pdu_encode_7bit_str(&dest[len], str);
|
||||
dest[0] = strlen(str);
|
||||
|
||||
return len;
|
||||
}
|
||||
|
||||
#define cmd_wms_send_message_cb no_cb
|
||||
static enum qmi_cmd_result
|
||||
cmd_wms_send_message_prepare(struct qmi_dev *qmi, struct qmi_request *req, struct qmi_msg *msg, char *arg)
|
||||
{
|
||||
static unsigned char buf[512];
|
||||
static struct qmi_wms_raw_send_request mreq = {
|
||||
QMI_INIT_SEQUENCE(raw_message_data,
|
||||
.format = QMI_WMS_MESSAGE_FORMAT_GSM_WCDMA_POINT_TO_POINT,
|
||||
.raw_data = buf,
|
||||
),
|
||||
};
|
||||
unsigned char *cur = buf;
|
||||
unsigned char first_octet = 0x11;
|
||||
unsigned char protocol_id = 0x00;
|
||||
unsigned char dcs = 0x00;
|
||||
|
||||
if (!_send.target || !*_send.target) {
|
||||
uqmi_add_error("Missing argument");
|
||||
return QMI_CMD_EXIT;
|
||||
}
|
||||
|
||||
if ((_send.smsc && strlen(_send.smsc) > 16) || strlen(_send.target) > 16 || strlen(arg) > 160) {
|
||||
uqmi_add_error("Argument too long");
|
||||
return QMI_CMD_EXIT;
|
||||
}
|
||||
|
||||
if (_send.flash)
|
||||
dcs |= 0x10;
|
||||
|
||||
if (!_send.smsc || !*_send.smsc)
|
||||
*(cur++) = 0;
|
||||
else
|
||||
cur += pdu_encode_number(cur, _send.smsc, true);
|
||||
|
||||
*(cur++) = first_octet;
|
||||
*(cur++) = 0; /* reference */
|
||||
|
||||
cur += pdu_encode_number(cur, _send.target, false);
|
||||
*(cur++) = protocol_id;
|
||||
*(cur++) = dcs;
|
||||
|
||||
*(cur++) = 0xff; /* validity */
|
||||
cur += pdu_encode_data(cur, arg);
|
||||
|
||||
mreq.data.raw_message_data.raw_data_n = cur - buf;
|
||||
qmi_set_wms_raw_send_request(msg, &mreq);
|
||||
|
||||
return QMI_CMD_REQUEST;
|
||||
}
|
@ -0,0 +1,41 @@
|
||||
/*
|
||||
* uqmi -- tiny QMI support implementation
|
||||
*
|
||||
* Copyright (C) 2014-2015 Felix Fietkau <nbd@openwrt.org>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
#define __uqmi_wms_commands \
|
||||
__uqmi_command(wms_list_messages, list-messages, no, QMI_SERVICE_WMS), \
|
||||
__uqmi_command(wms_delete_message, delete-message, required, QMI_SERVICE_WMS), \
|
||||
__uqmi_command(wms_get_message, get-message, required, QMI_SERVICE_WMS), \
|
||||
__uqmi_command(wms_get_raw_message, get-raw-message, required, QMI_SERVICE_WMS), \
|
||||
__uqmi_command(wms_send_message_smsc, send-message-smsc, required, CMD_TYPE_OPTION), \
|
||||
__uqmi_command(wms_send_message_target, send-message-target, required, CMD_TYPE_OPTION), \
|
||||
__uqmi_command(wms_send_message_flash, send-message-flash, no, CMD_TYPE_OPTION), \
|
||||
__uqmi_command(wms_send_message, send-message, required, QMI_SERVICE_WMS)
|
||||
|
||||
#define wms_helptext \
|
||||
" --list-messages: List SMS messages\n" \
|
||||
" --delete-message <id>: Delete SMS message at index <id>\n" \
|
||||
" --get-message <id>: Get SMS message at index <id>\n" \
|
||||
" --get-raw-message <id>: Get SMS raw message contents at index <id>\n" \
|
||||
" --send-message <data>: Send SMS message (use options below)\n" \
|
||||
" --send-message-smsc <nr>: SMSC number\n" \
|
||||
" --send-message-target <nr>: Destination number (required)\n" \
|
||||
" --send-message-flash: Send as Flash SMS\n" \
|
||||
|
@ -0,0 +1,273 @@
|
||||
/*
|
||||
* uqmi -- tiny QMI support implementation
|
||||
*
|
||||
* Copyright (C) 2014-2015 Felix Fietkau <nbd@openwrt.org>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <strings.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <libubox/blobmsg.h>
|
||||
#include <libubox/blobmsg_json.h>
|
||||
|
||||
#include "uqmi.h"
|
||||
#include "commands.h"
|
||||
|
||||
static struct blob_buf status;
|
||||
bool single_line = false;
|
||||
|
||||
static void no_cb(struct qmi_dev *qmi, struct qmi_request *req, struct qmi_msg *msg)
|
||||
{
|
||||
}
|
||||
|
||||
static void cmd_version_cb(struct qmi_dev *qmi, struct qmi_request *req, struct qmi_msg *msg)
|
||||
{
|
||||
struct qmi_ctl_get_version_info_response res;
|
||||
void *c;
|
||||
char name_buf[16];
|
||||
int i;
|
||||
|
||||
qmi_parse_ctl_get_version_info_response(msg, &res);
|
||||
|
||||
c = blobmsg_open_table(&status, NULL);
|
||||
for (i = 0; i < res.data.service_list_n; i++) {
|
||||
sprintf(name_buf, "service_%d", res.data.service_list[i].service);
|
||||
blobmsg_printf(&status, name_buf, "%d,%d",
|
||||
res.data.service_list[i].major_version,
|
||||
res.data.service_list[i].minor_version);
|
||||
}
|
||||
blobmsg_close_table(&status, c);
|
||||
}
|
||||
|
||||
static enum qmi_cmd_result
|
||||
cmd_version_prepare(struct qmi_dev *qmi, struct qmi_request *req, struct qmi_msg *msg, char *arg)
|
||||
{
|
||||
qmi_set_ctl_get_version_info_request(msg);
|
||||
return QMI_CMD_REQUEST;
|
||||
}
|
||||
|
||||
#define cmd_sync_cb no_cb
|
||||
static enum qmi_cmd_result
|
||||
cmd_sync_prepare(struct qmi_dev *qmi, struct qmi_request *req, struct qmi_msg *msg, char *arg)
|
||||
{
|
||||
qmi_set_ctl_sync_request(msg);
|
||||
return QMI_CMD_REQUEST;
|
||||
}
|
||||
|
||||
#define cmd_get_client_id_cb no_cb
|
||||
static enum qmi_cmd_result
|
||||
cmd_get_client_id_prepare(struct qmi_dev *qmi, struct qmi_request *req, struct qmi_msg *msg, char *arg)
|
||||
{
|
||||
QmiService svc = qmi_service_get_by_name(arg);
|
||||
|
||||
if (svc < 0) {
|
||||
fprintf(stderr, "Invalid service name '%s'\n", arg);
|
||||
return QMI_CMD_EXIT;
|
||||
}
|
||||
|
||||
if (qmi_service_connect(qmi, svc, -1)) {
|
||||
fprintf(stderr, "Failed to connect to service\n");
|
||||
return QMI_CMD_EXIT;
|
||||
}
|
||||
|
||||
printf("%d\n", qmi_service_get_client_id(qmi, svc));
|
||||
return QMI_CMD_DONE;
|
||||
}
|
||||
|
||||
#define cmd_set_client_id_cb no_cb
|
||||
static enum qmi_cmd_result
|
||||
cmd_set_client_id_prepare(struct qmi_dev *qmi, struct qmi_request *req, struct qmi_msg *msg, char *arg)
|
||||
{
|
||||
QmiService svc;
|
||||
int id;
|
||||
char *s;
|
||||
|
||||
s = strchr(arg, ',');
|
||||
if (!s) {
|
||||
fprintf(stderr, "Invalid argument\n");
|
||||
return QMI_CMD_EXIT;
|
||||
}
|
||||
*s = 0;
|
||||
s++;
|
||||
|
||||
id = strtoul(s, &s, 0);
|
||||
if (s && *s) {
|
||||
fprintf(stderr, "Invalid argument\n");
|
||||
return QMI_CMD_EXIT;
|
||||
}
|
||||
|
||||
svc = qmi_service_get_by_name(arg);
|
||||
if (svc < 0) {
|
||||
fprintf(stderr, "Invalid service name '%s'\n", arg);
|
||||
return QMI_CMD_EXIT;
|
||||
}
|
||||
|
||||
if (qmi_service_connect(qmi, svc, id)) {
|
||||
fprintf(stderr, "Failed to connect to service\n");
|
||||
return QMI_CMD_EXIT;
|
||||
}
|
||||
|
||||
return QMI_CMD_DONE;
|
||||
}
|
||||
|
||||
static int
|
||||
qmi_get_array_idx(const char **array, int size, const char *str)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < size; i++) {
|
||||
if (!array[i])
|
||||
continue;
|
||||
|
||||
if (!strcmp(array[i], str))
|
||||
return i;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
#define cmd_ctl_set_data_format_cb no_cb
|
||||
static enum qmi_cmd_result
|
||||
cmd_ctl_set_data_format_prepare(struct qmi_dev *qmi, struct qmi_request *req, struct qmi_msg *msg, char *arg)
|
||||
{
|
||||
struct qmi_ctl_set_data_format_request sreq = {};
|
||||
const char *modes[] = {
|
||||
[QMI_CTL_DATA_LINK_PROTOCOL_802_3] = "802.3",
|
||||
[QMI_CTL_DATA_LINK_PROTOCOL_RAW_IP] = "raw-ip",
|
||||
};
|
||||
int mode = qmi_get_array_idx(modes, ARRAY_SIZE(modes), arg);
|
||||
|
||||
if (mode < 0) {
|
||||
uqmi_add_error("Invalid mode (modes: 802.3, raw-ip)");
|
||||
return QMI_CMD_EXIT;
|
||||
}
|
||||
|
||||
qmi_set_ctl_set_data_format_request(msg, &sreq);
|
||||
return QMI_CMD_DONE;
|
||||
}
|
||||
|
||||
#include "commands-wds.c"
|
||||
#include "commands-dms.c"
|
||||
#include "commands-nas.c"
|
||||
#include "commands-wms.c"
|
||||
#include "commands-wda.c"
|
||||
#include "commands-uim.c"
|
||||
|
||||
#define __uqmi_command(_name, _optname, _arg, _type) \
|
||||
[__UQMI_COMMAND_##_name] = { \
|
||||
.name = #_optname, \
|
||||
.type = _type, \
|
||||
.prepare = cmd_##_name##_prepare, \
|
||||
.cb = cmd_##_name##_cb, \
|
||||
}
|
||||
|
||||
const struct uqmi_cmd_handler uqmi_cmd_handler[__UQMI_COMMAND_LAST] = {
|
||||
__uqmi_commands
|
||||
};
|
||||
#undef __uqmi_command
|
||||
|
||||
static struct uqmi_cmd *cmds;
|
||||
static int n_cmds;
|
||||
|
||||
void uqmi_add_command(char *arg, int cmd)
|
||||
{
|
||||
int idx = n_cmds++;
|
||||
|
||||
cmds = realloc(cmds, n_cmds * sizeof(*cmds));
|
||||
cmds[idx].handler = &uqmi_cmd_handler[cmd];
|
||||
cmds[idx].arg = arg;
|
||||
}
|
||||
|
||||
static void uqmi_print_result(struct blob_attr *data)
|
||||
{
|
||||
char *str;
|
||||
|
||||
if (!blob_len(data))
|
||||
return;
|
||||
|
||||
str = blobmsg_format_json_indent(blob_data(data), false, single_line ? -1 : 0);
|
||||
if (!str)
|
||||
return;
|
||||
|
||||
printf("%s\n", str);
|
||||
free(str);
|
||||
}
|
||||
|
||||
static bool __uqmi_run_commands(struct qmi_dev *qmi, bool option)
|
||||
{
|
||||
static struct qmi_request req;
|
||||
char *buf = qmi->buf;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < n_cmds; i++) {
|
||||
enum qmi_cmd_result res;
|
||||
bool cmd_option = cmds[i].handler->type == CMD_TYPE_OPTION;
|
||||
bool do_break = false;
|
||||
|
||||
if (cmd_option != option)
|
||||
continue;
|
||||
|
||||
blob_buf_init(&status, 0);
|
||||
if (cmds[i].handler->type > QMI_SERVICE_CTL &&
|
||||
qmi_service_connect(qmi, cmds[i].handler->type, -1)) {
|
||||
uqmi_add_error("Failed to connect to service");
|
||||
res = QMI_CMD_EXIT;
|
||||
} else {
|
||||
res = cmds[i].handler->prepare(qmi, &req, (void *) buf, cmds[i].arg);
|
||||
}
|
||||
|
||||
if (res == QMI_CMD_REQUEST) {
|
||||
qmi_request_start(qmi, &req, cmds[i].handler->cb);
|
||||
req.no_error_cb = true;
|
||||
if (qmi_request_wait(qmi, &req)) {
|
||||
uqmi_add_error(qmi_get_error_str(req.ret));
|
||||
do_break = true;
|
||||
}
|
||||
} else if (res == QMI_CMD_EXIT) {
|
||||
do_break = true;
|
||||
}
|
||||
|
||||
uqmi_print_result(status.head);
|
||||
if (do_break)
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
int uqmi_add_error(const char *msg)
|
||||
{
|
||||
blobmsg_add_string(&status, NULL, msg);
|
||||
return QMI_CMD_EXIT;
|
||||
}
|
||||
|
||||
bool uqmi_run_commands(struct qmi_dev *qmi)
|
||||
{
|
||||
bool ret;
|
||||
|
||||
ret = __uqmi_run_commands(qmi, true) &&
|
||||
__uqmi_run_commands(qmi, false);
|
||||
|
||||
free(cmds);
|
||||
cmds = NULL;
|
||||
n_cmds = 0;
|
||||
|
||||
return ret;
|
||||
}
|
@ -0,0 +1,82 @@
|
||||
/*
|
||||
* uqmi -- tiny QMI support implementation
|
||||
*
|
||||
* Copyright (C) 2014-2015 Felix Fietkau <nbd@openwrt.org>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
#ifndef __UQMI_COMMANDS_H
|
||||
#define __UQMI_COMMANDS_H
|
||||
|
||||
#include <stdbool.h>
|
||||
#include "commands-wds.h"
|
||||
#include "commands-dms.h"
|
||||
#include "commands-nas.h"
|
||||
#include "commands-wms.h"
|
||||
#include "commands-wda.h"
|
||||
#include "commands-uim.h"
|
||||
|
||||
enum qmi_cmd_result {
|
||||
QMI_CMD_DONE,
|
||||
QMI_CMD_REQUEST,
|
||||
QMI_CMD_EXIT,
|
||||
};
|
||||
|
||||
enum {
|
||||
CMD_TYPE_OPTION = -1,
|
||||
};
|
||||
|
||||
struct uqmi_cmd_handler {
|
||||
const char *name;
|
||||
int type;
|
||||
|
||||
enum qmi_cmd_result (*prepare)(struct qmi_dev *qmi, struct qmi_request *req, struct qmi_msg *msg, char *arg);
|
||||
void (*cb)(struct qmi_dev *qmi, struct qmi_request *req, struct qmi_msg *msg);
|
||||
};
|
||||
|
||||
struct uqmi_cmd {
|
||||
const struct uqmi_cmd_handler *handler;
|
||||
char *arg;
|
||||
};
|
||||
|
||||
#define __uqmi_commands \
|
||||
__uqmi_command(version, get-versions, no, QMI_SERVICE_CTL), \
|
||||
__uqmi_command(sync, sync, no, QMI_SERVICE_CTL), \
|
||||
__uqmi_command(set_client_id, set-client-id, required, CMD_TYPE_OPTION), \
|
||||
__uqmi_command(get_client_id, get-client-id, required, QMI_SERVICE_CTL), \
|
||||
__uqmi_command(ctl_set_data_format, set-data-format, required, QMI_SERVICE_CTL), \
|
||||
__uqmi_wds_commands, \
|
||||
__uqmi_dms_commands, \
|
||||
__uqmi_nas_commands, \
|
||||
__uqmi_wms_commands, \
|
||||
__uqmi_wda_commands, \
|
||||
__uqmi_uim_commands
|
||||
|
||||
#define __uqmi_command(_name, _optname, _arg, _option) __UQMI_COMMAND_##_name
|
||||
enum uqmi_command {
|
||||
__uqmi_commands,
|
||||
__UQMI_COMMAND_LAST
|
||||
};
|
||||
#undef __uqmi_command
|
||||
|
||||
extern bool single_line;
|
||||
extern const struct uqmi_cmd_handler uqmi_cmd_handler[];
|
||||
void uqmi_add_command(char *arg, int longidx);
|
||||
bool uqmi_run_commands(struct qmi_dev *qmi);
|
||||
int uqmi_add_error(const char *msg);
|
||||
|
||||
#endif
|
@ -0,0 +1,457 @@
|
||||
#!/usr/bin/env perl
|
||||
use strict;
|
||||
|
||||
use FindBin '$Bin';
|
||||
require "$Bin/gen-common.pm";
|
||||
|
||||
our %tlv_types;
|
||||
our $ctl;
|
||||
|
||||
my $data = get_json();
|
||||
my $varsize_field;
|
||||
|
||||
my %tlv_get = (
|
||||
gint8 => "*(int8_t *) get_next(1)",
|
||||
guint8 => "*(uint8_t *) get_next(1)",
|
||||
gint16 => "le16_to_cpu(*(uint16_t *) get_next(2))",
|
||||
guint16 => "le16_to_cpu(*(uint16_t *) get_next(2))",
|
||||
gint32 => "le32_to_cpu(*(uint32_t *) get_next(4))",
|
||||
guint32 => "le32_to_cpu(*(uint32_t *) get_next(4))",
|
||||
gint64 => "le64_to_cpu(*(uint64_t *) get_next(8))",
|
||||
guint64 => "le64_to_cpu(*(uint64_t *) get_next(8))",
|
||||
gfloat => "({ uint32_t data = le32_to_cpu(*(uint32_t *) get_next(4)); float _val; memcpy(&_val, &data, sizeof(_val)); _val; })"
|
||||
);
|
||||
|
||||
my %tlv_get_be = (
|
||||
gint16 => "be16_to_cpu(*(uint16_t *) get_next(2))",
|
||||
guint16 => "be16_to_cpu(*(uint16_t *) get_next(2))",
|
||||
gint32 => "be32_to_cpu(*(uint32_t *) get_next(4))",
|
||||
guint32 => "be32_to_cpu(*(uint32_t *) get_next(4))",
|
||||
gint64 => "be64_to_cpu(*(uint64_t *) get_next(8))",
|
||||
guint64 => "be64_to_cpu(*(uint64_t *) get_next(8))",
|
||||
);
|
||||
|
||||
sub gen_tlv_parse_field($$$$) {
|
||||
my $var = shift;
|
||||
my $elem = shift;
|
||||
my $n_indent = shift;
|
||||
my $iterator = shift;
|
||||
my $data = "";
|
||||
|
||||
my $indent = "\t" x ($n_indent + 3);
|
||||
my $use_iterator = 0;
|
||||
my $field = 0;
|
||||
|
||||
my $type = $elem->{"format"};
|
||||
|
||||
$varsize_field and die "Cannot place fields after a variable-sized field (var: $var, field: $varsize_field)\n";
|
||||
|
||||
my $val;
|
||||
if ($elem->{endian} eq 'network') {
|
||||
$val = $tlv_get_be{$type};
|
||||
} else {
|
||||
$val = $tlv_get{$type};
|
||||
}
|
||||
|
||||
if ($val) {
|
||||
return $indent."$var = $val;\n";
|
||||
} elsif ($type eq "array") {
|
||||
my $size;
|
||||
my $cur_varsize_field;
|
||||
my $var_data;
|
||||
my $var_iterator;
|
||||
|
||||
if ($elem->{"fixed-size"}) {
|
||||
$size = $elem->{"fixed-size"};
|
||||
$data .= $indent."for ($iterator = 0; $iterator < $size; $iterator\++) {\n";
|
||||
|
||||
($var_data, $var_iterator) =
|
||||
gen_tlv_parse_field($var."[$iterator]", $elem->{"array-element"}, $n_indent + 1, "i$iterator");
|
||||
|
||||
} else {
|
||||
my $prefix = $elem->{"size-prefix-format"};
|
||||
$prefix or $prefix = 'guint8';
|
||||
|
||||
$size = $tlv_get{$prefix};
|
||||
die "Unknown size element type '$prefix'" if not defined $size;
|
||||
|
||||
my $curvar = "$var\_n";
|
||||
if (rindex($var,"]") == length($var)-1) {
|
||||
$curvar = substr($var, 0, index($var, "["))."\_i";
|
||||
$data .= $indent."$curvar = 0;\n";
|
||||
}
|
||||
($var_data, $var_iterator) =
|
||||
gen_tlv_parse_field($var."[$curvar]", $elem->{"array-element"}, $n_indent + 1, "i$iterator");
|
||||
|
||||
$var_data .= $indent."\t$curvar++;\n";
|
||||
$data .= $indent."$iterator = $size;\n";
|
||||
$data .= $indent."$var = __qmi_alloc_static($iterator * sizeof($var\[0]));\n";
|
||||
$data .= $indent."while($iterator\-- > 0) {\n";
|
||||
}
|
||||
|
||||
$var_iterator and $data .= $indent."\tunsigned int i$iterator;\n";
|
||||
$data .= $var_data;
|
||||
$data .= $indent."}\n";
|
||||
|
||||
$varsize_field = $cur_varsize_field;
|
||||
|
||||
return $data, 1;
|
||||
} elsif ($type eq "struct" or $type eq "sequence") {
|
||||
foreach my $field (@{$elem->{contents}}) {
|
||||
my $field_cname = gen_cname($field->{name});
|
||||
my ($var_data, $var_iterator) =
|
||||
gen_tlv_parse_field("$var.$field_cname", $field, $n_indent, $iterator);
|
||||
|
||||
$data .= $var_data;
|
||||
$var_iterator and $use_iterator = 1;
|
||||
}
|
||||
return $data, $use_iterator;
|
||||
} elsif ($type eq "string") {
|
||||
my $size = $elem->{"fixed-size"};
|
||||
$size or do {
|
||||
my $prefix = $elem->{"size-prefix-format"};
|
||||
$prefix or do {
|
||||
$elem->{type} eq 'TLV' or $prefix = 'guint8';
|
||||
};
|
||||
|
||||
if ($prefix) {
|
||||
$size = $tlv_get{$prefix};
|
||||
} else {
|
||||
$size = "cur_tlv_len - ofs";
|
||||
$varsize_field = $var;
|
||||
}
|
||||
};
|
||||
|
||||
$data .= $indent."$iterator = $size;\n";
|
||||
my $maxsize = $elem->{"max-size"};
|
||||
$maxsize and do {
|
||||
$data .= $indent."if ($iterator > $maxsize)\n";
|
||||
$data .= $indent."\t$iterator = $maxsize;\n";
|
||||
};
|
||||
$data .= $indent.$var." = __qmi_copy_string(get_next($iterator), $iterator);\n";
|
||||
return $data, 1;
|
||||
} elsif ($type eq "guint-sized") {
|
||||
my $size = $elem->{"guint-size"};
|
||||
return $indent."$var = ({ uint64_t var; memcpy(&var, get_next($size), $size); le64_to_cpu(var); });\n";
|
||||
} else {
|
||||
die "Invalid type $type for variable $var";
|
||||
}
|
||||
}
|
||||
|
||||
sub gen_tlv_type($$$) {
|
||||
my $cname = shift;
|
||||
my $elem = shift;
|
||||
my $idx = shift;
|
||||
my $idx_word = "found[".int($idx / 32)."]";
|
||||
my $idx_bit = "(1 << ".($idx % 32).")";
|
||||
|
||||
my $type = $elem->{"format"};
|
||||
my $id = $elem->{"id"};
|
||||
my $data = "";
|
||||
undef $varsize_field;
|
||||
my $indent = "\t\t\t";
|
||||
|
||||
$type or return undef;
|
||||
|
||||
print <<EOF;
|
||||
case $id:
|
||||
if ($idx_word & $idx_bit)
|
||||
break;
|
||||
|
||||
$idx_word |= $idx_bit;
|
||||
EOF
|
||||
|
||||
my $val = $tlv_get{$type};
|
||||
if ($val) {
|
||||
print $indent."qmi_set(res, $cname, $val);\n";
|
||||
} elsif ($type eq "string") {
|
||||
my ($var_data, $var_iterator) =
|
||||
gen_tlv_parse_field("res->data.$cname", $elem, 0, "i");
|
||||
print "$var_data";
|
||||
} elsif ($type eq "array") {
|
||||
$elem->{"fixed-size"} and $data = $indent."res->set.$cname = 1;\n";
|
||||
my ($var_data, $var_iterator) =
|
||||
gen_tlv_parse_field("res->data.$cname", $elem, 0, "i");
|
||||
print "$data$var_data\n";
|
||||
} elsif ($type eq "sequence" or $type eq "struct") {
|
||||
my ($var_data, $var_iterator) =
|
||||
gen_tlv_parse_field("res->data.$cname", $elem, 0, "i");
|
||||
|
||||
print $indent."res->set.$cname = 1;\n".$var_data;
|
||||
}
|
||||
print <<EOF;
|
||||
break;
|
||||
|
||||
EOF
|
||||
}
|
||||
|
||||
sub gen_parse_func($$)
|
||||
{
|
||||
my $name = shift;
|
||||
my $data = shift;
|
||||
|
||||
my $type = "svc";
|
||||
$ctl and $type = "ctl";
|
||||
|
||||
print gen_tlv_parse_func($name, $data)."\n";
|
||||
print <<EOF;
|
||||
{
|
||||
void *tlv_buf = &msg->$type.tlv;
|
||||
unsigned int tlv_len = le16_to_cpu(msg->$type.tlv_len);
|
||||
EOF
|
||||
|
||||
if (gen_has_types($data)) {
|
||||
my $n_bits = scalar @$data;
|
||||
my $n_words = int(($n_bits + 31) / 32);
|
||||
my $i = 0;
|
||||
|
||||
print <<EOF;
|
||||
struct tlv *tlv;
|
||||
int i;
|
||||
uint32_t found[$n_words] = {};
|
||||
|
||||
memset(res, 0, sizeof(*res));
|
||||
|
||||
__qmi_alloc_reset();
|
||||
while ((tlv = tlv_get_next(&tlv_buf, &tlv_len)) != NULL) {
|
||||
unsigned int cur_tlv_len = le16_to_cpu(tlv->len);
|
||||
unsigned int ofs = 0;
|
||||
|
||||
switch(tlv->type) {
|
||||
EOF
|
||||
foreach my $field (@$data) {
|
||||
$field = gen_common_ref($field);
|
||||
my $cname = gen_cname($field->{name});
|
||||
gen_tlv_type($cname, $field, $i++);
|
||||
}
|
||||
|
||||
print <<EOF;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
error_len:
|
||||
fprintf(stderr, "%s: Invalid TLV length in message, tlv=0x%02x, len=%d\\n",
|
||||
__func__, tlv->type, le16_to_cpu(tlv->len));
|
||||
return QMI_ERROR_INVALID_DATA;
|
||||
EOF
|
||||
} else {
|
||||
print <<EOF;
|
||||
|
||||
return qmi_check_message_status(tlv_buf, tlv_len);
|
||||
EOF
|
||||
}
|
||||
|
||||
print <<EOF;
|
||||
}
|
||||
|
||||
EOF
|
||||
}
|
||||
|
||||
my %tlv_set = (
|
||||
guint8 => sub { my $a = shift; my $b = shift; print "*(uint8_t *) $a = $b;\n" },
|
||||
guint16 => sub { my $a = shift; my $b = shift; print "*(uint16_t *) $a = cpu_to_le16($b);\n" },
|
||||
guint32 => sub { my $a = shift; my $b = shift; print "*(uint32_t *) $a = cpu_to_le32($b);\n" },
|
||||
);
|
||||
|
||||
my %tlv_put = (
|
||||
gint8 => sub { my $a = shift; "put_tlv_var(uint8_t, $a, 1);\n" },
|
||||
guint8 => sub { my $a = shift; "put_tlv_var(uint8_t, $a, 1);\n" },
|
||||
gint16 => sub { my $a = shift; "put_tlv_var(uint16_t, cpu_to_le16($a), 2);\n" },
|
||||
guint16 => sub { my $a = shift; "put_tlv_var(uint16_t, cpu_to_le16($a), 2);\n" },
|
||||
gint32 => sub { my $a = shift; "put_tlv_var(uint32_t, cpu_to_le32($a), 4);\n" },
|
||||
guint32 => sub { my $a = shift; "put_tlv_var(uint32_t, cpu_to_le32($a), 4);\n" },
|
||||
gint64 => sub { my $a = shift; "put_tlv_var(uint64_t, cpu_to_le64($a), 8);\n" },
|
||||
guint64 => sub { my $a = shift; "put_tlv_var(uint64_t, cpu_to_le64($a), 8);\n" },
|
||||
);
|
||||
|
||||
my %tlv_put_be = (
|
||||
gint16 => sub { my $a = shift; "put_tlv_var(uint16_t, cpu_to_be16($a), 2);\n" },
|
||||
guint16 => sub { my $a = shift; "put_tlv_var(uint16_t, cpu_to_be16($a), 2);\n" },
|
||||
gint32 => sub { my $a = shift; "put_tlv_var(uint32_t, cpu_to_be32($a), 4);\n" },
|
||||
guint32 => sub { my $a = shift; "put_tlv_var(uint32_t, cpu_to_be32($a), 4);\n" },
|
||||
gint64 => sub { my $a = shift; "put_tlv_var(uint64_t, cpu_to_be64($a), 8);\n" },
|
||||
guint64 => sub { my $a = shift; "put_tlv_var(uint64_t, cpu_to_be64($a), 8);\n" },
|
||||
);
|
||||
|
||||
sub gen_tlv_val_set($$$$$)
|
||||
{
|
||||
my $cname = shift;
|
||||
my $elem = shift;
|
||||
my $indent = shift;
|
||||
my $iterator = shift;
|
||||
my $cond = shift;
|
||||
my $prev_cond;
|
||||
|
||||
my $type = $elem->{format};
|
||||
my $data = "";
|
||||
|
||||
my $put;
|
||||
if ($elem->{endian} eq 'network') {
|
||||
$put = $tlv_put_be{$type};
|
||||
} else {
|
||||
$put = $tlv_put{$type};
|
||||
}
|
||||
$put and return $indent.&$put($cname);
|
||||
|
||||
$type eq 'array' and do {
|
||||
my $size = $elem->{"fixed-size"};
|
||||
|
||||
$size or do {
|
||||
$cond and $$cond = $cname;
|
||||
$size = $cname."_n";
|
||||
|
||||
my $prefix = $elem->{"size-prefix-format"};
|
||||
$prefix or $prefix = 'gint8';
|
||||
|
||||
$put = $tlv_put{$prefix};
|
||||
$put or die "Unknown size prefix type $prefix\n";
|
||||
|
||||
$data .= $indent.&$put($size);
|
||||
};
|
||||
|
||||
$data .= $indent."for ($iterator = 0; $iterator < $size; $iterator++) {\n";
|
||||
my ($var_data, $var_iterator) =
|
||||
gen_tlv_val_set($cname."[$iterator]", $elem->{"array-element"}, "$indent\t", "i$iterator", undef);
|
||||
|
||||
$var_iterator and $data .= $indent."\tunsigned int i$iterator;\n";
|
||||
$data .= $var_data;
|
||||
$data .= $indent."}\n";
|
||||
|
||||
return $data, 1;
|
||||
};
|
||||
|
||||
$type eq 'string' and do {
|
||||
$cond and $$cond = $cname;
|
||||
|
||||
my $len = $elem->{"fixed-size"};
|
||||
$len or $len = "strlen($cname)";
|
||||
|
||||
$data .= $indent."$iterator = $len;\n";
|
||||
|
||||
$len = $elem->{"max-size"};
|
||||
$len and do {
|
||||
$data .= $indent."if ($iterator > $len)\n";
|
||||
$data .= $indent."\t$iterator = $len;\n";
|
||||
};
|
||||
|
||||
my $prefix = $elem->{"size-prefix-format"};
|
||||
$prefix or do {
|
||||
$elem->{"type"} eq 'TLV' or $prefix = 'guint8';
|
||||
};
|
||||
|
||||
$prefix and do {
|
||||
my $put = $tlv_put{$prefix} or die "Unknown size prefix format $prefix";
|
||||
$data .= $indent.&$put("$iterator");
|
||||
};
|
||||
|
||||
$data .= $indent."strncpy(__qmi_alloc_static($iterator), $cname, $iterator);\n";
|
||||
|
||||
return $data, 1;
|
||||
};
|
||||
|
||||
($type eq 'sequence' or $type eq 'struct') and do {
|
||||
my $use_iterator;
|
||||
|
||||
foreach my $field (@{$elem->{contents}}) {
|
||||
my $field_cname = gen_cname($field->{name});
|
||||
my ($var_data, $var_iterator) =
|
||||
gen_tlv_val_set("$cname.$field_cname", $field, $indent, $iterator, undef);
|
||||
|
||||
$var_iterator and $use_iterator = 1;
|
||||
$data .= $var_data;
|
||||
}
|
||||
return $data, $use_iterator;
|
||||
};
|
||||
|
||||
die "Unknown type $type";
|
||||
}
|
||||
|
||||
sub gen_tlv_attr_set($$)
|
||||
{
|
||||
my $cname = shift;
|
||||
my $elem = shift;
|
||||
my $indent = "\t";
|
||||
my $data = "";
|
||||
my $iterator = "";
|
||||
my $size_var = "";
|
||||
my $id = $elem->{id};
|
||||
|
||||
my $cond = "req->set.$cname";
|
||||
my ($var_data, $use_iterator) =
|
||||
gen_tlv_val_set("req->data.$cname", $elem, "\t\t", "i", \$cond);
|
||||
$use_iterator and $iterator = "\t\tunsigned int i;\n";
|
||||
|
||||
$data = <<EOF;
|
||||
if ($cond) {
|
||||
void *buf;
|
||||
unsigned int ofs;
|
||||
$iterator$size_var
|
||||
__qmi_alloc_reset();
|
||||
$var_data
|
||||
buf = __qmi_get_buf(&ofs);
|
||||
tlv_new(msg, $id, ofs, buf);
|
||||
}
|
||||
|
||||
EOF
|
||||
print "$data";
|
||||
}
|
||||
|
||||
sub gen_set_func($$)
|
||||
{
|
||||
my $name = shift;
|
||||
my $fields = shift;
|
||||
my $data = shift;
|
||||
|
||||
my $type = "svc";
|
||||
my $service = $data->{service};
|
||||
my $id = $data->{id};
|
||||
|
||||
$service eq 'CTL' and $type = 'ctl';
|
||||
|
||||
print gen_tlv_set_func($name, $fields)."\n";
|
||||
print <<EOF;
|
||||
{
|
||||
qmi_init_request_message(msg, QMI_SERVICE_$service);
|
||||
msg->$type.message = cpu_to_le16($id);
|
||||
|
||||
EOF
|
||||
foreach my $field (@$fields) {
|
||||
$field = gen_common_ref($field);
|
||||
my $cname = gen_cname($field->{name});
|
||||
gen_tlv_attr_set($cname, $field);
|
||||
}
|
||||
|
||||
print <<EOF;
|
||||
return 0;
|
||||
}
|
||||
|
||||
EOF
|
||||
}
|
||||
|
||||
print <<EOF;
|
||||
/* generated by uqmi gen-code.pl */
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include "qmi-message.h"
|
||||
|
||||
#define get_next(_size) ({ void *_buf = &tlv->data[ofs]; ofs += _size; if (ofs > cur_tlv_len) goto error_len; _buf; })
|
||||
#define copy_tlv(_val, _size) \\
|
||||
do { \\
|
||||
unsigned int __size = _size; \\
|
||||
if (__size > 0) \\
|
||||
memcpy(__qmi_alloc_static(__size), _val, __size); \\
|
||||
} while (0);
|
||||
|
||||
#define put_tlv_var(_type, _val, _size) \\
|
||||
do { \\
|
||||
_type __var = _val; \\
|
||||
copy_tlv(&__var, _size); \\
|
||||
} while(0)
|
||||
|
||||
EOF
|
||||
|
||||
gen_foreach_message_type($data, \&gen_set_func, \&gen_parse_func);
|
@ -0,0 +1,99 @@
|
||||
use lib "$Bin/lib";
|
||||
use JSON;
|
||||
|
||||
@ARGV < 2 and die "Usage: $0 <prefix> <file>\n";
|
||||
my $prefix = shift @ARGV;
|
||||
|
||||
our $ctl;
|
||||
our %tlv_types = (
|
||||
gint8 => "int8_t",
|
||||
guint8 => "uint8_t",
|
||||
gint16 => "int16_t",
|
||||
guint16 => "uint16_t",
|
||||
gint32 => "int32_t",
|
||||
guint32 => "uint32_t",
|
||||
gint64 => "int64_t",
|
||||
guint64 => "uint64_t",
|
||||
gfloat => "float",
|
||||
gboolean => "bool",
|
||||
);
|
||||
our %common_ref = ();
|
||||
|
||||
$prefix eq 'ctl_' and $ctl = 1;
|
||||
|
||||
sub get_json() {
|
||||
local $/;
|
||||
my $json = <>;
|
||||
$json =~ s/^\s*\/\/.*$//mg;
|
||||
return decode_json($json);
|
||||
}
|
||||
|
||||
sub gen_cname($) {
|
||||
my $name = shift;
|
||||
|
||||
$name =~ s/[^a-zA-Z0-9_]/_/g;
|
||||
return lc($name);
|
||||
}
|
||||
|
||||
sub gen_has_types($) {
|
||||
my $data = shift;
|
||||
|
||||
foreach my $field (@$data) {
|
||||
$field = gen_common_ref($field);
|
||||
my $type = $field->{"format"};
|
||||
$type and return 1;
|
||||
}
|
||||
return undef
|
||||
}
|
||||
|
||||
sub gen_tlv_set_func($$) {
|
||||
my $name = shift;
|
||||
my $data = shift;
|
||||
|
||||
$name = gen_cname($name);
|
||||
if (gen_has_types($data)) {
|
||||
return "int qmi_set_$name(struct qmi_msg *msg, struct qmi_$name *req)"
|
||||
} else {
|
||||
return "int qmi_set_$name(struct qmi_msg *msg)"
|
||||
}
|
||||
}
|
||||
|
||||
sub gen_tlv_parse_func($$) {
|
||||
my $name = shift;
|
||||
my $data = shift;
|
||||
|
||||
$name = gen_cname($name);
|
||||
if (gen_has_types($data)) {
|
||||
return "int qmi_parse_$name(struct qmi_msg *msg, struct qmi_$name *res)"
|
||||
} else {
|
||||
return "int qmi_parse_$name(struct qmi_msg *msg)"
|
||||
}
|
||||
}
|
||||
|
||||
sub gen_common_ref($$) {
|
||||
my $field = shift;
|
||||
$field = $common_ref{$field->{'common-ref'}} if $field->{'common-ref'} ne '';
|
||||
return $field;
|
||||
}
|
||||
|
||||
sub gen_foreach_message_type($$$)
|
||||
{
|
||||
my $data = shift;
|
||||
my $req_sub = shift;
|
||||
my $res_sub = shift;
|
||||
|
||||
foreach my $entry (@$data) {
|
||||
my $args = [];
|
||||
my $fields = [];
|
||||
|
||||
$common_ref{$entry->{'common-ref'}} = $entry if $entry->{'common-ref'} ne '';
|
||||
|
||||
next if $entry->{type} ne 'Message';
|
||||
next if not defined $entry->{input} and not defined $entry->{output};
|
||||
|
||||
&$req_sub($prefix.$entry->{name}." Request", $entry->{input}, $entry);
|
||||
&$res_sub($prefix.$entry->{name}." Response", $entry->{output}, $entry);
|
||||
}
|
||||
}
|
||||
|
||||
1;
|
@ -0,0 +1,41 @@
|
||||
#!/usr/bin/env perl
|
||||
use strict;
|
||||
my $doc_start;
|
||||
my $error_data;
|
||||
my $line;
|
||||
my @errors;
|
||||
|
||||
while ($line = <>) {
|
||||
chomp $line;
|
||||
|
||||
$line =~ /^\/\*\*/ and do {
|
||||
$doc_start = 1;
|
||||
next;
|
||||
};
|
||||
|
||||
$line =~ /^\s*\*\// and undef $error_data;
|
||||
|
||||
$doc_start and $line =~ /^\s*\*\s*QmiProtocolError:/ and do {
|
||||
$error_data = 1;
|
||||
undef $doc_start;
|
||||
next;
|
||||
};
|
||||
undef $doc_start;
|
||||
|
||||
$line =~ /^.*@([A-Z0-9_]+): ([A-z0-9 ]+)[.].*$/ and push @errors, [ $1, $2 ];
|
||||
}
|
||||
|
||||
@errors > 0 or die "No data found\n";
|
||||
|
||||
print <<EOF;
|
||||
static const struct {
|
||||
QmiProtocolError code;
|
||||
const char *text;
|
||||
} qmi_errors[] = {
|
||||
EOF
|
||||
foreach my $error (@errors) {
|
||||
print "\t{ ".$error->[0].", \"".$error->[1]."\" },\n";
|
||||
}
|
||||
print <<EOF;
|
||||
};
|
||||
EOF
|
@ -0,0 +1,119 @@
|
||||
#!/usr/bin/env perl
|
||||
use strict;
|
||||
|
||||
use FindBin '$Bin';
|
||||
require "$Bin/gen-common.pm";
|
||||
|
||||
our %tlv_types;
|
||||
|
||||
my $data = get_json();
|
||||
|
||||
sub gen_tlv_type($$$) {
|
||||
my $cname = shift;
|
||||
my $elem = shift;
|
||||
my $indent = shift;
|
||||
|
||||
my $type = $elem->{"format"};
|
||||
my $ptype = $elem->{"public-format"};
|
||||
my $data;
|
||||
|
||||
$type or return undef;
|
||||
$ptype or $ptype = $type;
|
||||
|
||||
if ($type eq "guint-sized") {
|
||||
my $size = $elem->{"guint-size"};
|
||||
|
||||
if ($size > 4 and $size < 8) {
|
||||
$ptype = "guint64";
|
||||
} elsif ($size > 2) {
|
||||
$ptype = "guint32";
|
||||
} else {
|
||||
die "Invalid size for guint-sized";
|
||||
}
|
||||
}
|
||||
|
||||
if ($tlv_types{$ptype}) {
|
||||
return $indent.$tlv_types{$ptype}." $cname;";
|
||||
} elsif ($tlv_types{$type}) {
|
||||
return $indent.$tlv_types{$type}." $cname;";
|
||||
} elsif ($type eq "string") {
|
||||
return $indent."char *$cname;", 1;
|
||||
} elsif ($type eq "array") {
|
||||
if ($elem->{"fixed-size"}) {
|
||||
my $len_f = '['.$elem->{"fixed-size"}.']';
|
||||
return gen_tlv_type("$cname$len_f", $elem->{"array-element"}, $indent);
|
||||
}
|
||||
my ($type, $no_set_field) = gen_tlv_type("*$cname", $elem->{"array-element"}, $indent);
|
||||
return undef if not defined $type;
|
||||
return $indent."unsigned int ".substr($cname,1)."\_i;$type", 1 if (!rindex($cname,"*",0));
|
||||
return $indent."unsigned int $cname\_n;$type", 1;
|
||||
} elsif ($type eq "sequence" or $type eq "struct") {
|
||||
my $contents = $elem->{"contents"};
|
||||
my $data = "struct {";
|
||||
|
||||
foreach my $field (@$contents) {
|
||||
$field = gen_common_ref($field);
|
||||
my $_cname = gen_cname($field->{name});
|
||||
my ($_data, $no_set_field) = gen_tlv_type($_cname, $field, "$indent\t");
|
||||
$data .= $_data;
|
||||
}
|
||||
return $indent.$data.$indent."} $cname;";
|
||||
} else {
|
||||
die "Unknown type: $ptype\n";
|
||||
}
|
||||
}
|
||||
|
||||
sub gen_tlv_struct($$) {
|
||||
my $name = shift;
|
||||
my $data = shift;
|
||||
my $_set = "";
|
||||
my $_data = "";
|
||||
|
||||
foreach my $field (@$data) {
|
||||
$field = gen_common_ref($field);
|
||||
my $cname = gen_cname($field->{name});
|
||||
my ($data, $no_set_field) = gen_tlv_type($cname, $field, "\n\t\t");
|
||||
|
||||
next if not defined $data;
|
||||
$_data .= $data;
|
||||
|
||||
next if $no_set_field;
|
||||
$_set .= "\n\t\tunsigned int $cname : 1;";
|
||||
}
|
||||
|
||||
$name = gen_cname($name);
|
||||
|
||||
$_data or return;
|
||||
|
||||
$_set .= "\n\t";
|
||||
$_data .= "\n\t";
|
||||
|
||||
print <<EOF
|
||||
struct qmi_$name {
|
||||
struct {$_set} set;
|
||||
struct {$_data} data;
|
||||
};
|
||||
|
||||
EOF
|
||||
}
|
||||
|
||||
sub gen_set_func_header($$)
|
||||
{
|
||||
my $name = shift;
|
||||
my $data = shift;
|
||||
|
||||
my $func = gen_tlv_set_func($name, $data);
|
||||
$func and print "$func;\n";
|
||||
}
|
||||
|
||||
sub gen_parse_func_header($$)
|
||||
{
|
||||
my $name = shift;
|
||||
my $data = shift;
|
||||
|
||||
my $func = gen_tlv_parse_func($name, $data);
|
||||
$func and print "$func;\n\n";
|
||||
}
|
||||
|
||||
gen_foreach_message_type($data, \&gen_tlv_struct, \&gen_tlv_struct);
|
||||
gen_foreach_message_type($data, \&gen_set_func_header, \&gen_parse_func_header);
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,26 @@
|
||||
=head1 NAME
|
||||
|
||||
JSON::PP::Boolean - dummy module providing JSON::PP::Boolean
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
# do not "use" yourself
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
This module exists only to provide overload resolution for Storable and similar modules. See
|
||||
L<JSON::PP> for more info about this class.
|
||||
|
||||
=cut
|
||||
|
||||
use JSON::backportPP ();
|
||||
use strict;
|
||||
|
||||
1;
|
||||
|
||||
=head1 AUTHOR
|
||||
|
||||
This idea is from L<JSON::XS::Boolean> written by Marc Lehmann <schmorp[at]schmorp.de>
|
||||
|
||||
=cut
|
||||
|
@ -0,0 +1,131 @@
|
||||
package # This is JSON::backportPP
|
||||
JSON::backportPP5005;
|
||||
|
||||
use 5.005;
|
||||
use strict;
|
||||
|
||||
my @properties;
|
||||
|
||||
$JSON::PP5005::VERSION = '1.10';
|
||||
|
||||
BEGIN {
|
||||
|
||||
sub utf8::is_utf8 {
|
||||
0; # It is considered that UTF8 flag off for Perl 5.005.
|
||||
}
|
||||
|
||||
sub utf8::upgrade {
|
||||
}
|
||||
|
||||
sub utf8::downgrade {
|
||||
1; # must always return true.
|
||||
}
|
||||
|
||||
sub utf8::encode {
|
||||
}
|
||||
|
||||
sub utf8::decode {
|
||||
}
|
||||
|
||||
*JSON::PP::JSON_PP_encode_ascii = \&_encode_ascii;
|
||||
*JSON::PP::JSON_PP_encode_latin1 = \&_encode_latin1;
|
||||
*JSON::PP::JSON_PP_decode_surrogates = \&_decode_surrogates;
|
||||
*JSON::PP::JSON_PP_decode_unicode = \&_decode_unicode;
|
||||
|
||||
# missing in B module.
|
||||
sub B::SVp_IOK () { 0x01000000; }
|
||||
sub B::SVp_NOK () { 0x02000000; }
|
||||
sub B::SVp_POK () { 0x04000000; }
|
||||
|
||||
$INC{'bytes.pm'} = 1; # dummy
|
||||
}
|
||||
|
||||
|
||||
|
||||
sub _encode_ascii {
|
||||
join('', map { $_ <= 127 ? chr($_) : sprintf('\u%04x', $_) } unpack('C*', $_[0]) );
|
||||
}
|
||||
|
||||
|
||||
sub _encode_latin1 {
|
||||
join('', map { chr($_) } unpack('C*', $_[0]) );
|
||||
}
|
||||
|
||||
|
||||
sub _decode_surrogates { # from http://homepage1.nifty.com/nomenclator/unicode/ucs_utf.htm
|
||||
my $uni = 0x10000 + (hex($_[0]) - 0xD800) * 0x400 + (hex($_[1]) - 0xDC00); # from perlunicode
|
||||
my $bit = unpack('B32', pack('N', $uni));
|
||||
|
||||
if ( $bit =~ /^00000000000(...)(......)(......)(......)$/ ) {
|
||||
my ($w, $x, $y, $z) = ($1, $2, $3, $4);
|
||||
return pack('B*', sprintf('11110%s10%s10%s10%s', $w, $x, $y, $z));
|
||||
}
|
||||
else {
|
||||
Carp::croak("Invalid surrogate pair");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
sub _decode_unicode {
|
||||
my ($u) = @_;
|
||||
my ($utf8bit);
|
||||
|
||||
if ( $u =~ /^00([89a-f][0-9a-f])$/i ) { # 0x80-0xff
|
||||
return pack( 'H2', $1 );
|
||||
}
|
||||
|
||||
my $bit = unpack("B*", pack("H*", $u));
|
||||
|
||||
if ( $bit =~ /^00000(.....)(......)$/ ) {
|
||||
$utf8bit = sprintf('110%s10%s', $1, $2);
|
||||
}
|
||||
elsif ( $bit =~ /^(....)(......)(......)$/ ) {
|
||||
$utf8bit = sprintf('1110%s10%s10%s', $1, $2, $3);
|
||||
}
|
||||
else {
|
||||
Carp::croak("Invalid escaped unicode");
|
||||
}
|
||||
|
||||
return pack('B*', $utf8bit);
|
||||
}
|
||||
|
||||
|
||||
sub JSON::PP::incr_text {
|
||||
$_[0]->{_incr_parser} ||= JSON::PP::IncrParser->new;
|
||||
|
||||
if ( $_[0]->{_incr_parser}->{incr_parsing} ) {
|
||||
Carp::croak("incr_text can not be called when the incremental parser already started parsing");
|
||||
}
|
||||
|
||||
$_[0]->{_incr_parser}->{incr_text} = $_[1] if ( @_ > 1 );
|
||||
$_[0]->{_incr_parser}->{incr_text};
|
||||
}
|
||||
|
||||
|
||||
1;
|
||||
__END__
|
||||
|
||||
=pod
|
||||
|
||||
=head1 NAME
|
||||
|
||||
JSON::PP5005 - Helper module in using JSON::PP in Perl 5.005
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
JSON::PP calls internally.
|
||||
|
||||
=head1 AUTHOR
|
||||
|
||||
Makamaka Hannyaharamitu, E<lt>makamaka[at]cpan.orgE<gt>
|
||||
|
||||
|
||||
=head1 COPYRIGHT AND LICENSE
|
||||
|
||||
Copyright 2007-2010 by Makamaka Hannyaharamitu
|
||||
|
||||
This library is free software; you can redistribute it and/or modify
|
||||
it under the same terms as Perl itself.
|
||||
|
||||
=cut
|
||||
|
@ -0,0 +1,173 @@
|
||||
package # This is JSON::backportPP
|
||||
JSON::backportPP56;
|
||||
|
||||
use 5.006;
|
||||
use strict;
|
||||
|
||||
my @properties;
|
||||
|
||||
$JSON::PP56::VERSION = '1.08';
|
||||
|
||||
BEGIN {
|
||||
|
||||
sub utf8::is_utf8 {
|
||||
my $len = length $_[0]; # char length
|
||||
{
|
||||
use bytes; # byte length;
|
||||
return $len != length $_[0]; # if !=, UTF8-flagged on.
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
sub utf8::upgrade {
|
||||
; # noop;
|
||||
}
|
||||
|
||||
|
||||
sub utf8::downgrade ($;$) {
|
||||
return 1 unless ( utf8::is_utf8( $_[0] ) );
|
||||
|
||||
if ( _is_valid_utf8( $_[0] ) ) {
|
||||
my $downgrade;
|
||||
for my $c ( unpack( "U*", $_[0] ) ) {
|
||||
if ( $c < 256 ) {
|
||||
$downgrade .= pack("C", $c);
|
||||
}
|
||||
else {
|
||||
$downgrade .= pack("U", $c);
|
||||
}
|
||||
}
|
||||
$_[0] = $downgrade;
|
||||
return 1;
|
||||
}
|
||||
else {
|
||||
Carp::croak("Wide character in subroutine entry") unless ( $_[1] );
|
||||
0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
sub utf8::encode ($) { # UTF8 flag off
|
||||
if ( utf8::is_utf8( $_[0] ) ) {
|
||||
$_[0] = pack( "C*", unpack( "C*", $_[0] ) );
|
||||
}
|
||||
else {
|
||||
$_[0] = pack( "U*", unpack( "C*", $_[0] ) );
|
||||
$_[0] = pack( "C*", unpack( "C*", $_[0] ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
sub utf8::decode ($) { # UTF8 flag on
|
||||
if ( _is_valid_utf8( $_[0] ) ) {
|
||||
utf8::downgrade( $_[0] );
|
||||
$_[0] = pack( "U*", unpack( "U*", $_[0] ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
*JSON::PP::JSON_PP_encode_ascii = \&_encode_ascii;
|
||||
*JSON::PP::JSON_PP_encode_latin1 = \&_encode_latin1;
|
||||
*JSON::PP::JSON_PP_decode_surrogates = \&JSON::PP::_decode_surrogates;
|
||||
*JSON::PP::JSON_PP_decode_unicode = \&JSON::PP::_decode_unicode;
|
||||
|
||||
unless ( defined &B::SVp_NOK ) { # missing in B module.
|
||||
eval q{ sub B::SVp_NOK () { 0x02000000; } };
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
sub _encode_ascii {
|
||||
join('',
|
||||
map {
|
||||
$_ <= 127 ?
|
||||
chr($_) :
|
||||
$_ <= 65535 ?
|
||||
sprintf('\u%04x', $_) : sprintf('\u%x\u%x', JSON::PP::_encode_surrogates($_));
|
||||
} _unpack_emu($_[0])
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
sub _encode_latin1 {
|
||||
join('',
|
||||
map {
|
||||
$_ <= 255 ?
|
||||
chr($_) :
|
||||
$_ <= 65535 ?
|
||||
sprintf('\u%04x', $_) : sprintf('\u%x\u%x', JSON::PP::_encode_surrogates($_));
|
||||
} _unpack_emu($_[0])
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
sub _unpack_emu { # for Perl 5.6 unpack warnings
|
||||
return !utf8::is_utf8($_[0]) ? unpack('C*', $_[0])
|
||||
: _is_valid_utf8($_[0]) ? unpack('U*', $_[0])
|
||||
: unpack('C*', $_[0]);
|
||||
}
|
||||
|
||||
|
||||
sub _is_valid_utf8 {
|
||||
my $str = $_[0];
|
||||
my $is_utf8;
|
||||
|
||||
while ($str =~ /(?:
|
||||
(
|
||||
[\x00-\x7F]
|
||||
|[\xC2-\xDF][\x80-\xBF]
|
||||
|[\xE0][\xA0-\xBF][\x80-\xBF]
|
||||
|[\xE1-\xEC][\x80-\xBF][\x80-\xBF]
|
||||
|[\xED][\x80-\x9F][\x80-\xBF]
|
||||
|[\xEE-\xEF][\x80-\xBF][\x80-\xBF]
|
||||
|[\xF0][\x90-\xBF][\x80-\xBF][\x80-\xBF]
|
||||
|[\xF1-\xF3][\x80-\xBF][\x80-\xBF][\x80-\xBF]
|
||||
|[\xF4][\x80-\x8F][\x80-\xBF][\x80-\xBF]
|
||||
)
|
||||
| (.)
|
||||
)/xg)
|
||||
{
|
||||
if (defined $1) {
|
||||
$is_utf8 = 1 if (!defined $is_utf8);
|
||||
}
|
||||
else {
|
||||
$is_utf8 = 0 if (!defined $is_utf8);
|
||||
if ($is_utf8) { # eventually, not utf8
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $is_utf8;
|
||||
}
|
||||
|
||||
|
||||
1;
|
||||
__END__
|
||||
|
||||
=pod
|
||||
|
||||
=head1 NAME
|
||||
|
||||
JSON::PP56 - Helper module in using JSON::PP in Perl 5.6
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
JSON::PP calls internally.
|
||||
|
||||
=head1 AUTHOR
|
||||
|
||||
Makamaka Hannyaharamitu, E<lt>makamaka[at]cpan.orgE<gt>
|
||||
|
||||
|
||||
=head1 COPYRIGHT AND LICENSE
|
||||
|
||||
Copyright 2007-2009 by Makamaka Hannyaharamitu
|
||||
|
||||
This library is free software; you can redistribute it and/or modify
|
||||
it under the same terms as Perl itself.
|
||||
|
||||
=cut
|
||||
|
@ -0,0 +1,172 @@
|
||||
|
||||
[
|
||||
// *********************************************************************************
|
||||
{ "name" : "CTL",
|
||||
"type" : "Service" },
|
||||
|
||||
// *********************************************************************************
|
||||
{ "name" : "QMI Client CTL",
|
||||
"type" : "Client",
|
||||
"since" : "1.0" },
|
||||
|
||||
// *********************************************************************************
|
||||
{ "name" : "QMI Message CTL",
|
||||
"type" : "Message-ID-Enum" },
|
||||
|
||||
// *********************************************************************************
|
||||
{ "name" : "QMI Indication CTL",
|
||||
"type" : "Indication-ID-Enum" },
|
||||
|
||||
// *********************************************************************************
|
||||
{ "name" : "Set Instance ID",
|
||||
"type" : "Message",
|
||||
"service" : "CTL",
|
||||
"id" : "0x0020",
|
||||
"since" : "1.0",
|
||||
"input" : [ { "name" : "ID",
|
||||
"id" : "0x01",
|
||||
"type" : "TLV",
|
||||
"since" : "1.0",
|
||||
"format" : "guint8" } ],
|
||||
"output" : [ { "common-ref" : "Operation Result" },
|
||||
{ "name" : "Link ID",
|
||||
"id" : "0x01",
|
||||
"type" : "TLV",
|
||||
"since" : "1.0",
|
||||
"format" : "guint16",
|
||||
"prerequisites": [ { "common-ref" : "Success" } ] } ] },
|
||||
|
||||
// *********************************************************************************
|
||||
{ "name" : "Get Version Info",
|
||||
"type" : "Message",
|
||||
"service" : "CTL",
|
||||
"id" : "0x0021",
|
||||
"since" : "1.0",
|
||||
"output" : [ { "common-ref" : "Operation Result" },
|
||||
{ "name" : "Service list",
|
||||
"id" : "0x01",
|
||||
"type" : "TLV",
|
||||
"since" : "1.0",
|
||||
"format" : "array",
|
||||
"array-element" : { "name" : "Service",
|
||||
"format" : "struct",
|
||||
"contents" : [ { "name" : "Service",
|
||||
"format" : "guint8",
|
||||
"public-format" : "QmiService" },
|
||||
{ "name" : "Major version",
|
||||
"format" : "guint16" },
|
||||
{ "name" : "Minor version",
|
||||
"format" : "guint16" } ] },
|
||||
"prerequisites": [ { "common-ref" : "Success" } ] } ] },
|
||||
|
||||
// *********************************************************************************
|
||||
{ "name" : "Allocate CID",
|
||||
"type" : "Message",
|
||||
"service" : "CTL",
|
||||
"id" : "0x0022",
|
||||
"since" : "1.0",
|
||||
"input" : [ { "name" : "Service",
|
||||
"id" : "0x01",
|
||||
"type" : "TLV",
|
||||
"since" : "1.0",
|
||||
"format" : "guint8" ,
|
||||
"public-format" : "QmiService" } ],
|
||||
"output" : [ { "common-ref" : "Operation Result" },
|
||||
{ "name" : "Allocation Info",
|
||||
"id" : "0x01",
|
||||
"type" : "TLV",
|
||||
"since" : "1.0",
|
||||
"format" : "sequence",
|
||||
"contents" : [ { "name" : "Service",
|
||||
"format" : "guint8",
|
||||
"public-format" : "QmiService" },
|
||||
{ "name" : "Cid",
|
||||
"format" : "guint8" } ],
|
||||
"prerequisites": [ { "common-ref" : "Success" } ] } ] },
|
||||
|
||||
// *********************************************************************************
|
||||
{ "name" : "Release CID",
|
||||
"type" : "Message",
|
||||
"service" : "CTL",
|
||||
"id" : "0x0023",
|
||||
"since" : "1.0",
|
||||
"input" : [ { "name" : "Release Info",
|
||||
"id" : "0x01",
|
||||
"type" : "TLV",
|
||||
"since" : "1.0",
|
||||
"format" : "sequence",
|
||||
"contents" : [ { "name" : "Service",
|
||||
"format" : "guint8",
|
||||
"public-format" : "QmiService" },
|
||||
{ "name" : "Cid",
|
||||
"format" : "guint8" } ] } ],
|
||||
"output" : [ { "common-ref" : "Operation Result" },
|
||||
{ "name" : "Release Info",
|
||||
"id" : "0x01",
|
||||
"type" : "TLV",
|
||||
"since" : "1.0",
|
||||
"format" : "sequence",
|
||||
"contents" : [ { "name" : "Service",
|
||||
"format" : "guint8",
|
||||
"public-format" : "QmiService" },
|
||||
{ "name" : "Cid",
|
||||
"format" : "guint8" } ],
|
||||
"prerequisites": [ { "common-ref" : "Success" } ] } ] },
|
||||
|
||||
// *********************************************************************************
|
||||
{ "name" : "Set Data Format",
|
||||
"type" : "Message",
|
||||
"service" : "CTL",
|
||||
"id" : "0x0026",
|
||||
"since" : "1.0",
|
||||
"input" : [ { "name" : "Format",
|
||||
"id" : "0x01",
|
||||
"type" : "TLV",
|
||||
"since" : "1.0",
|
||||
"format" : "guint8",
|
||||
"public-format" : "QmiCtlDataFormat" },
|
||||
{ "name" : "Protocol",
|
||||
"id" : "0x10",
|
||||
"type" : "TLV",
|
||||
"since" : "1.0",
|
||||
"format" : "guint16",
|
||||
"public-format" : "QmiCtlDataLinkProtocol" } ],
|
||||
"output" : [ { "common-ref" : "Operation Result" },
|
||||
{ "name" : "Protocol",
|
||||
"id" : "0x10",
|
||||
"mandatory" : "yes",
|
||||
"type" : "TLV",
|
||||
"since" : "1.0",
|
||||
"format" : "guint16",
|
||||
"public-format" : "QmiCtlDataLinkProtocol",
|
||||
"prerequisites" : [ { "common-ref" : "Success" } ] } ] },
|
||||
|
||||
// *********************************************************************************
|
||||
{ "name" : "Sync",
|
||||
"type" : "Message",
|
||||
"service" : "CTL",
|
||||
"id" : "0x0027",
|
||||
"since" : "1.0",
|
||||
"output" : [ { "common-ref" : "Operation Result" } ] },
|
||||
|
||||
{ "name" : "Sync",
|
||||
"type" : "Indication",
|
||||
"service" : "CTL",
|
||||
"id" : "0x0027",
|
||||
"since" : "1.0" },
|
||||
|
||||
// *********************************************************************************
|
||||
// Internal
|
||||
{ "name" : "Internal Proxy Open",
|
||||
"type" : "Message",
|
||||
"service" : "CTL",
|
||||
"id" : "0xFF00",
|
||||
"since" : "1.8",
|
||||
"input" : [ { "name" : "Device Path",
|
||||
"id" : "0x01",
|
||||
"type" : "TLV",
|
||||
"since" : "1.8",
|
||||
"format" : "string" } ],
|
||||
"output" : [ { "common-ref" : "Operation Result" } ] }
|
||||
|
||||
]
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,229 @@
|
||||
|
||||
[
|
||||
// *********************************************************************************
|
||||
{ "name" : "OMA",
|
||||
"type" : "Service" },
|
||||
|
||||
// *********************************************************************************
|
||||
{ "name" : "QMI Client OMA",
|
||||
"type" : "Client",
|
||||
"since" : "1.6" },
|
||||
|
||||
// *********************************************************************************
|
||||
{ "name" : "QMI Message OMA",
|
||||
"type" : "Message-ID-Enum" },
|
||||
|
||||
// *********************************************************************************
|
||||
{ "name" : "QMI Indication OMA",
|
||||
"type" : "Indication-ID-Enum" },
|
||||
|
||||
// *********************************************************************************
|
||||
{ "name" : "Reset",
|
||||
"type" : "Message",
|
||||
"service" : "OMA",
|
||||
"id" : "0x0000",
|
||||
"since" : "1.6",
|
||||
"output" : [ { "common-ref" : "Operation Result" } ] },
|
||||
|
||||
// *********************************************************************************
|
||||
{ "name" : "Set Event Report",
|
||||
"type" : "Message",
|
||||
"service" : "OMA",
|
||||
"id" : "0x0001",
|
||||
"since" : "1.6",
|
||||
"input" : [ { "name" : "Network Initiated Alert Reporting",
|
||||
"id" : "0x10",
|
||||
"type" : "TLV",
|
||||
"since" : "1.6",
|
||||
"format" : "guint8",
|
||||
"public-format" : "gboolean" },
|
||||
{ "name" : "Session State Reporting",
|
||||
"id" : "0x11",
|
||||
"type" : "TLV",
|
||||
"since" : "1.6",
|
||||
"format" : "guint8",
|
||||
"public-format" : "gboolean" } ],
|
||||
"output" : [ { "common-ref" : "Operation Result" } ] },
|
||||
|
||||
{ "name" : "Event Report",
|
||||
"type" : "Indication",
|
||||
"service" : "OMA",
|
||||
"id" : "0x0001",
|
||||
"since" : "1.6",
|
||||
"output" : [ { "name" : "Network Initiated Alert",
|
||||
"id" : "0x10",
|
||||
"type" : "TLV",
|
||||
"since" : "1.6",
|
||||
"format" : "sequence",
|
||||
"contents" : [ { "name" : "Session Type",
|
||||
"format" : "guint8",
|
||||
"public-format" : "QmiOmaSessionType" },
|
||||
{ "name" : "Session ID",
|
||||
"format" : "guint16" } ] },
|
||||
{ "name" : "Session State",
|
||||
"id" : "0x11",
|
||||
"type" : "TLV",
|
||||
"since" : "1.6",
|
||||
"format" : "guint8",
|
||||
"public-format" : "QmiOmaSessionState" },
|
||||
{ "name" : "Session Fail Reason",
|
||||
"id" : "0x12",
|
||||
"type" : "TLV",
|
||||
"since" : "1.6",
|
||||
"format" : "guint8",
|
||||
"public-format" : "QmiOmaSessionFailedReason" } ] },
|
||||
|
||||
// *********************************************************************************
|
||||
{ "name" : "Start Session",
|
||||
"type" : "Message",
|
||||
"service" : "OMA",
|
||||
"id" : "0x0020",
|
||||
"since" : "1.6",
|
||||
"input" : [ { "name" : "Session Type",
|
||||
"id" : "0x10",
|
||||
"type" : "TLV",
|
||||
"since" : "1.6",
|
||||
"format" : "guint8",
|
||||
"public-format" : "QmiOmaSessionType" } ],
|
||||
"output" : [ { "common-ref" : "Operation Result" } ] },
|
||||
|
||||
// *********************************************************************************
|
||||
{ "name" : "Cancel Session",
|
||||
"type" : "Message",
|
||||
"service" : "OMA",
|
||||
"id" : "0x0021",
|
||||
"since" : "1.6",
|
||||
"output" : [ { "common-ref" : "Operation Result" } ] },
|
||||
|
||||
// *********************************************************************************
|
||||
{ "name" : "Get Session Info",
|
||||
"type" : "Message",
|
||||
"service" : "OMA",
|
||||
"id" : "0x0022",
|
||||
"since" : "1.6",
|
||||
"output" : [ { "name" : "Session Info",
|
||||
"id" : "0x10",
|
||||
"type" : "TLV",
|
||||
"since" : "1.6",
|
||||
"format" : "sequence",
|
||||
"contents" : [ { "name" : "Session State",
|
||||
"format" : "guint8",
|
||||
"public-format" : "QmiOmaSessionState" },
|
||||
{ "name" : "Session Type",
|
||||
"format" : "guint8",
|
||||
"public-format" : "QmiOmaSessionType" } ],
|
||||
"prerequisites": [ { "common-ref" : "Success" } ] },
|
||||
{ "name" : "Session Failed Reason",
|
||||
"id" : "0x11",
|
||||
"type" : "TLV",
|
||||
"since" : "1.6",
|
||||
"format" : "guint8",
|
||||
"public-format" : "QmiOmaSessionFailedReason",
|
||||
"prerequisites" : [ { "field" : "Session Info Session State",
|
||||
"operation" : "==",
|
||||
"value" : "QMI_OMA_SESSION_STATE_FAILED" } ] },
|
||||
{ "name" : "Retry Info",
|
||||
"id" : "0x12",
|
||||
"type" : "TLV",
|
||||
"since" : "1.6",
|
||||
"format" : "sequence",
|
||||
"contents" : [ { "name" : "Retry Count",
|
||||
"format" : "guint8" },
|
||||
{ "name" : "Retry Pause Timer",
|
||||
"format" : "guint16" },
|
||||
{ "name" : "Retry Pause Timer Remaining",
|
||||
"format" : "guint16" } ],
|
||||
"prerequisites": [ { "common-ref" : "Success" } ] },
|
||||
{ "name" : "Network Initiated Alert",
|
||||
"id" : "0x13",
|
||||
"type" : "TLV",
|
||||
"since" : "1.6",
|
||||
"format" : "sequence",
|
||||
"contents" : [ { "name" : "Session Type",
|
||||
"format" : "guint8",
|
||||
"public-format" : "QmiOmaSessionType" },
|
||||
{ "name" : "Session ID",
|
||||
"format" : "guint16" } ],
|
||||
"prerequisites": [ { "common-ref" : "Success" } ] },
|
||||
{ "common-ref" : "Operation Result" } ] },
|
||||
|
||||
// *********************************************************************************
|
||||
{ "name" : "Send Selection",
|
||||
"type" : "Message",
|
||||
"service" : "OMA",
|
||||
"id" : "0x0023",
|
||||
"since" : "1.6",
|
||||
"input" : [ { "name" : "Network Initiated Alert Selection",
|
||||
"id" : "0x10",
|
||||
"type" : "TLV",
|
||||
"since" : "1.6",
|
||||
"format" : "sequence",
|
||||
"contents" : [ { "name" : "Control Point Selection Accept",
|
||||
"format" : "guint8",
|
||||
"public-format" : "gboolean" },
|
||||
{ "name" : "Session ID",
|
||||
"format" : "guint16" } ] } ],
|
||||
"output" : [ { "common-ref" : "Operation Result" } ] },
|
||||
|
||||
// *********************************************************************************
|
||||
{ "name" : "Get Feature Setting",
|
||||
"type" : "Message",
|
||||
"service" : "OMA",
|
||||
"id" : "0x0024",
|
||||
"since" : "1.6",
|
||||
"output" : [ { "name" : "Device Provisioning Service Update Config",
|
||||
"id" : "0x10",
|
||||
"type" : "TLV",
|
||||
"since" : "1.6",
|
||||
"format" : "guint8",
|
||||
"public-format" : "gboolean",
|
||||
"prerequisites" : [ { "common-ref" : "Success" } ] },
|
||||
{ "name" : "PRL Update Service Config",
|
||||
"id" : "0x11",
|
||||
"type" : "TLV",
|
||||
"since" : "1.6",
|
||||
"format" : "guint8",
|
||||
"public-format" : "gboolean",
|
||||
"prerequisites" : [ { "common-ref" : "Success" } ] },
|
||||
{ "name" : "HFA Feature Config",
|
||||
"id" : "0x12",
|
||||
"type" : "TLV",
|
||||
"since" : "1.6",
|
||||
"format" : "guint8",
|
||||
"public-format" : "gboolean",
|
||||
"prerequisites" : [ { "common-ref" : "Success" } ] },
|
||||
{ "name" : "HFA Feature Done State",
|
||||
"id" : "0x13",
|
||||
"type" : "TLV",
|
||||
"since" : "1.6",
|
||||
"format" : "guint8",
|
||||
"public-format" : "QmiOmaHfaFeatureDoneState",
|
||||
"prerequisites" : [ { "common-ref" : "Success" } ] },
|
||||
{ "common-ref" : "Operation Result" } ] },
|
||||
|
||||
// *********************************************************************************
|
||||
{ "name" : "Set Feature Setting",
|
||||
"type" : "Message",
|
||||
"service" : "OMA",
|
||||
"id" : "0x0025",
|
||||
"since" : "1.6",
|
||||
"input" : [ { "name" : "Device Provisioning Service Update Config",
|
||||
"id" : "0x10",
|
||||
"type" : "TLV",
|
||||
"since" : "1.6",
|
||||
"format" : "guint8",
|
||||
"public-format" : "gboolean" },
|
||||
{ "name" : "PRL Update Service Config",
|
||||
"id" : "0x11",
|
||||
"type" : "TLV",
|
||||
"since" : "1.6",
|
||||
"format" : "guint8",
|
||||
"public-format" : "gboolean" },
|
||||
{ "name" : "HFA Feature Config",
|
||||
"id" : "0x12",
|
||||
"type" : "TLV",
|
||||
"since" : "1.6",
|
||||
"format" : "guint8",
|
||||
"public-format" : "gboolean" } ],
|
||||
"output" : [ { "common-ref" : "Operation Result" } ] }
|
||||
]
|
@ -0,0 +1,299 @@
|
||||
|
||||
[
|
||||
// *********************************************************************************
|
||||
{ "name" : "PBM",
|
||||
"type" : "Service" },
|
||||
|
||||
// *********************************************************************************
|
||||
{ "name" : "QMI Client PBM",
|
||||
"type" : "Client",
|
||||
"since" : "1.6" },
|
||||
|
||||
// *********************************************************************************
|
||||
{ "name" : "QMI Message PBM",
|
||||
"type" : "Message-ID-Enum" },
|
||||
|
||||
// *********************************************************************************
|
||||
{ "name" : "Indication Register",
|
||||
"type" : "Message",
|
||||
"service" : "PBM",
|
||||
"id" : "0x0001",
|
||||
"since" : "1.6",
|
||||
"input" : [ { "name" : "Event Registration Mask",
|
||||
"id" : "0x01",
|
||||
"type" : "TLV",
|
||||
"since" : "1.6",
|
||||
"format" : "guint32",
|
||||
"public-format" : "QmiPbmEventRegistrationFlag" } ],
|
||||
"output" : [ { "common-ref" : "Operation Result" },
|
||||
{ "name" : "Event Registration Mask",
|
||||
"id" : "0x10",
|
||||
"type" : "TLV",
|
||||
"since" : "1.6",
|
||||
"format" : "guint32",
|
||||
"public-format" : "QmiPbmEventRegistrationFlag",
|
||||
"prerequisites" : [ { "common-ref" : "Success" } ] } ] },
|
||||
|
||||
// *********************************************************************************
|
||||
{ "name" : "Get Capabilities",
|
||||
"type" : "Message",
|
||||
"service" : "PBM",
|
||||
"id" : "0x0002",
|
||||
"since" : "1.6",
|
||||
"input" : [ { "name" : "Phonebook Information",
|
||||
"id" : "0x01",
|
||||
"type" : "TLV",
|
||||
"since" : "1.6",
|
||||
"format" : "sequence",
|
||||
"contents" : [ { "name" : "Session Type",
|
||||
"format" : "guint8",
|
||||
"public-format" : "QmiPbmSessionType" },
|
||||
{ "name" : "Phonebook Type",
|
||||
"format" : "guint16",
|
||||
"public-format" : "QmiPbmPhonebookType" } ] } ],
|
||||
"output" : [ { "common-ref" : "Operation Result" },
|
||||
{ "name" : "Capability Basic Information",
|
||||
"id" : "0x10",
|
||||
"type" : "TLV",
|
||||
"since" : "1.6",
|
||||
"format" : "sequence",
|
||||
"contents" : [ { "name" : "Session Type",
|
||||
"format" : "guint8",
|
||||
"public-format" : "QmiPbmSessionType" },
|
||||
{ "name" : "Phonebook Type",
|
||||
"format" : "guint16",
|
||||
"public-format" : "QmiPbmPhonebookType" },
|
||||
{ "name" : "Used Records",
|
||||
"format" : "guint16" },
|
||||
{ "name" : "Maximum Records",
|
||||
"format" : "guint16" },
|
||||
{ "name" : "Maximum Number Length",
|
||||
"format" : "guint8" },
|
||||
{ "name" : "Maximum Name Length",
|
||||
"format" : "guint8" } ],
|
||||
"prerequisites" : [ { "common-ref" : "Success" } ] },
|
||||
{ "name" : "Group Capability",
|
||||
"id" : "0x11",
|
||||
"type" : "TLV",
|
||||
"since" : "1.6",
|
||||
"format" : "sequence",
|
||||
"contents" : [ { "name" : "Maximum Groups",
|
||||
"format" : "guint8" },
|
||||
{ "name" : "Maximum Group Tag Length",
|
||||
"format" : "guint8" } ],
|
||||
"prerequisites" : [ { "common-ref" : "Success" } ] },
|
||||
{ "name" : "Additional Number Capability",
|
||||
"id" : "0x12",
|
||||
"type" : "TLV",
|
||||
"since" : "1.6",
|
||||
"format" : "sequence",
|
||||
"contents" : [ { "name" : "Maximum Additional Numbers",
|
||||
"format" : "guint8" },
|
||||
{ "name" : "Maximum Additional Number Length",
|
||||
"format" : "guint8" },
|
||||
{ "name" : "Maximum Additional Number Tag Length",
|
||||
"format" : "guint8" } ],
|
||||
"prerequisites" : [ { "common-ref" : "Success" } ] },
|
||||
{ "name" : "Email Capability",
|
||||
"id" : "0x13",
|
||||
"type" : "TLV",
|
||||
"since" : "1.6",
|
||||
"format" : "sequence",
|
||||
"contents" : [ { "name" : "Maximum Emails",
|
||||
"format" : "guint8" },
|
||||
{ "name" : "Maximum Email Address Length",
|
||||
"format" : "guint8" } ],
|
||||
"prerequisites" : [ { "common-ref" : "Success" } ] },
|
||||
{ "name" : "Second Name Capability",
|
||||
"id" : "0x14",
|
||||
"type" : "TLV",
|
||||
"since" : "1.6",
|
||||
"format" : "sequence",
|
||||
"contents" : [ { "name" : "Maximum Second Name Length",
|
||||
"format" : "guint8" } ],
|
||||
"prerequisites" : [ { "common-ref" : "Success" } ] },
|
||||
{ "name" : "Hidden Records Capability",
|
||||
"id" : "0x15",
|
||||
"type" : "TLV",
|
||||
"since" : "1.6",
|
||||
"format" : "sequence",
|
||||
"contents" : [ { "name" : "Supported",
|
||||
"format" : "guint8",
|
||||
"public-format" : "gboolean" } ],
|
||||
"prerequisites" : [ { "common-ref" : "Success" } ] },
|
||||
{ "name" : "Grouping Information Alpha String Capability",
|
||||
"id" : "0x16",
|
||||
"type" : "TLV",
|
||||
"since" : "1.6",
|
||||
"format" : "sequence",
|
||||
"contents" : [ { "name" : "Maximum Records",
|
||||
"format" : "guint8" },
|
||||
{ "name" : "Used Records",
|
||||
"format" : "guint8" },
|
||||
{ "name" : "Maximum String Length",
|
||||
"format" : "guint8" } ],
|
||||
"prerequisites" : [ { "common-ref" : "Success" } ] },
|
||||
{ "name" : "Additional Number Alpha String Capability",
|
||||
"id" : "0x17",
|
||||
"type" : "TLV",
|
||||
"since" : "1.6",
|
||||
"format" : "sequence",
|
||||
"contents" : [ { "name" : "Maximum Records",
|
||||
"format" : "guint8" },
|
||||
{ "name" : "Used Records",
|
||||
"format" : "guint8" },
|
||||
{ "name" : "Maximum String Length",
|
||||
"format" : "guint8" } ],
|
||||
"prerequisites" : [ { "common-ref" : "Success" } ] } ] },
|
||||
|
||||
// *********************************************************************************
|
||||
{ "name" : "Get All Capabilities",
|
||||
"type" : "Message",
|
||||
"service" : "PBM",
|
||||
"id" : "0x0003",
|
||||
"since" : "1.6",
|
||||
"output" : [ { "common-ref" : "Operation Result" },
|
||||
{ "name" : "Capability Basic Information",
|
||||
"id" : "0x10",
|
||||
"type" : "TLV",
|
||||
"since" : "1.6",
|
||||
"format" : "array",
|
||||
"size-prefix-format" : "guint8",
|
||||
"array-element" : { "name" : "Element",
|
||||
"format" : "struct",
|
||||
"contents" : [ { "name" : "Session Type",
|
||||
"format" : "guint8",
|
||||
"public-format" : "QmiPbmSessionType" },
|
||||
{ "name" : "Phonebooks",
|
||||
"format" : "array",
|
||||
"size-prefix-format" : "guint8",
|
||||
"array-element" : { "name" : "Element",
|
||||
"format" : "struct",
|
||||
"contents" : [ { "name" : "Phonebook Type",
|
||||
"format" : "guint16",
|
||||
"public-format" : "QmiPbmPhonebookType" },
|
||||
{ "name" : "Used Records",
|
||||
"format" : "guint16" },
|
||||
{ "name" : "Maximum Records",
|
||||
"format" : "guint16" },
|
||||
{ "name" : "Maximum Number Length",
|
||||
"format" : "guint8" },
|
||||
{ "name" : "Maximum Name Length",
|
||||
"format" : "guint8" } ] } } ] },
|
||||
"prerequisites" : [ { "common-ref" : "Success" } ] },
|
||||
{ "name" : "Group Capability",
|
||||
"id" : "0x11",
|
||||
"type" : "TLV",
|
||||
"since" : "1.6",
|
||||
"format" : "array",
|
||||
"size-prefix-format" : "guint8",
|
||||
"array-element" : { "name" : "Element",
|
||||
"format" : "struct",
|
||||
"contents" : [ { "name" : "Session Type",
|
||||
"format" : "guint8",
|
||||
"public-format" : "QmiPbmSessionType" },
|
||||
{ "name" : "Maximum Groups",
|
||||
"format" : "guint8" },
|
||||
{ "name" : "Maximum Group Tag Length",
|
||||
"format" : "guint8" } ] },
|
||||
"prerequisites" : [ { "common-ref" : "Success" } ] },
|
||||
{ "name" : "Additional Number Capability",
|
||||
"id" : "0x12",
|
||||
"type" : "TLV",
|
||||
"since" : "1.6",
|
||||
"format" : "array",
|
||||
"size-prefix-format" : "guint8",
|
||||
"array-element" : { "name" : "Element",
|
||||
"format" : "struct",
|
||||
"contents" : [ { "name" : "Session Type",
|
||||
"format" : "guint8",
|
||||
"public-format" : "QmiPbmSessionType" },
|
||||
{ "name" : "Maximum Additional Numbers",
|
||||
"format" : "guint8" },
|
||||
{ "name" : "Maximum Additional Number Length",
|
||||
"format" : "guint8" },
|
||||
{ "name" : "Maximum Additional Number Tag Length",
|
||||
"format" : "guint8" } ] },
|
||||
"prerequisites" : [ { "common-ref" : "Success" } ] },
|
||||
{ "name" : "Email Capability",
|
||||
"id" : "0x13",
|
||||
"type" : "TLV",
|
||||
"since" : "1.6",
|
||||
"format" : "array",
|
||||
"size-prefix-format" : "guint8",
|
||||
"array-element" : { "name" : "Element",
|
||||
"format" : "struct",
|
||||
"contents" : [ { "name" : "Session Type",
|
||||
"format" : "guint8",
|
||||
"public-format" : "QmiPbmSessionType" },
|
||||
{ "name" : "Maximum Emails",
|
||||
"format" : "guint8" },
|
||||
{ "name" : "Maximum Email Address Length",
|
||||
"format" : "guint8" } ] },
|
||||
"prerequisites" : [ { "common-ref" : "Success" } ] },
|
||||
{ "name" : "Second Name Capability",
|
||||
"id" : "0x14",
|
||||
"type" : "TLV",
|
||||
"since" : "1.6",
|
||||
"format" : "array",
|
||||
"size-prefix-format" : "guint8",
|
||||
"array-element" : { "name" : "Element",
|
||||
"format" : "struct",
|
||||
"contents" : [ { "name" : "Session Type",
|
||||
"format" : "guint8",
|
||||
"public-format" : "QmiPbmSessionType" },
|
||||
{ "name" : "Maximum Second Name Length",
|
||||
"format" : "guint8" } ] },
|
||||
"prerequisites" : [ { "common-ref" : "Success" } ] },
|
||||
{ "name" : "Hidden Records Capability",
|
||||
"id" : "0x15",
|
||||
"type" : "TLV",
|
||||
"since" : "1.6",
|
||||
"format" : "array",
|
||||
"size-prefix-format" : "guint8",
|
||||
"array-element" : { "name" : "Element",
|
||||
"format" : "struct",
|
||||
"contents" : [ { "name" : "Session Type",
|
||||
"format" : "guint8",
|
||||
"public-format" : "QmiPbmSessionType" },
|
||||
{ "name" : "Supported",
|
||||
"format" : "guint8",
|
||||
"public-format" : "gboolean" } ] },
|
||||
"prerequisites" : [ { "common-ref" : "Success" } ] },
|
||||
{ "name" : "Grouping Information Alpha String Capability",
|
||||
"id" : "0x16",
|
||||
"type" : "TLV",
|
||||
"since" : "1.6",
|
||||
"format" : "array",
|
||||
"size-prefix-format" : "guint8",
|
||||
"array-element" : { "name" : "Element",
|
||||
"format" : "struct",
|
||||
"contents" : [ { "name" : "Session Type",
|
||||
"format" : "guint8",
|
||||
"public-format" : "QmiPbmSessionType" },
|
||||
{ "name" : "Maximum Records",
|
||||
"format" : "guint8" },
|
||||
{ "name" : "Used Records",
|
||||
"format" : "guint8" },
|
||||
{ "name" : "Maximum String Length",
|
||||
"format" : "guint8" } ] },
|
||||
"prerequisites" : [ { "common-ref" : "Success" } ] },
|
||||
{ "name" : "Additional Number Alpha String Capability",
|
||||
"id" : "0x17",
|
||||
"type" : "TLV",
|
||||
"since" : "1.6",
|
||||
"format" : "array",
|
||||
"size-prefix-format" : "guint8",
|
||||
"array-element" : { "name" : "Element",
|
||||
"format" : "struct",
|
||||
"contents" : [ { "name" : "Session Type",
|
||||
"format" : "guint8",
|
||||
"public-format" : "QmiPbmSessionType" },
|
||||
{ "name" : "Maximum Records",
|
||||
"format" : "guint8" },
|
||||
{ "name" : "Used Records",
|
||||
"format" : "guint8" },
|
||||
{ "name" : "Maximum String Length",
|
||||
"format" : "guint8" } ] },
|
||||
"prerequisites" : [ { "common-ref" : "Success" } ] } ] }
|
||||
]
|
@ -0,0 +1,447 @@
|
||||
|
||||
[
|
||||
// *********************************************************************************
|
||||
{ "name" : "PDS",
|
||||
"type" : "Service" },
|
||||
|
||||
// *********************************************************************************
|
||||
{ "name" : "QMI Client PDS",
|
||||
"type" : "Client",
|
||||
"since" : "1.0" },
|
||||
|
||||
// *********************************************************************************
|
||||
{ "name" : "QMI Message PDS",
|
||||
"type" : "Message-ID-Enum" },
|
||||
|
||||
// *********************************************************************************
|
||||
{ "name" : "QMI Indication PDS",
|
||||
"type" : "Indication-ID-Enum" },
|
||||
|
||||
// *********************************************************************************
|
||||
{ "name" : "Reset",
|
||||
"type" : "Message",
|
||||
"service" : "PDS",
|
||||
"id" : "0x0000",
|
||||
"since" : "1.0",
|
||||
"output" : [ { "common-ref" : "Operation Result" } ] },
|
||||
|
||||
// *********************************************************************************
|
||||
{ "name" : "Set Event Report",
|
||||
"type" : "Message",
|
||||
"service" : "PDS",
|
||||
"id" : "0x0001",
|
||||
"since" : "1.0",
|
||||
"input" : [ { "name" : "NMEA Position Reporting",
|
||||
"id" : "0x10",
|
||||
"type" : "TLV",
|
||||
"since" : "1.0",
|
||||
"format" : "guint8",
|
||||
"public-format" : "gboolean" },
|
||||
{ "name" : "Extended NMEA Position Reporting",
|
||||
"id" : "0x11",
|
||||
"type" : "TLV",
|
||||
"since" : "1.0",
|
||||
"format" : "guint8",
|
||||
"public-format" : "gboolean" },
|
||||
{ "name" : "Parsed Position Reporting",
|
||||
"id" : "0x12",
|
||||
"type" : "TLV",
|
||||
"since" : "1.0",
|
||||
"format" : "guint8",
|
||||
"public-format" : "gboolean" },
|
||||
{ "name" : "External XTRA Data Request Reporting",
|
||||
"id" : "0x13",
|
||||
"type" : "TLV",
|
||||
"since" : "1.0",
|
||||
"format" : "guint8",
|
||||
"public-format" : "gboolean" },
|
||||
{ "name" : "External Time Injection Request Reporting",
|
||||
"id" : "0x14",
|
||||
"type" : "TLV",
|
||||
"since" : "1.0",
|
||||
"format" : "guint8",
|
||||
"public-format" : "gboolean" },
|
||||
{ "name" : "External WIFI Position Request Reporting",
|
||||
"id" : "0x15",
|
||||
"type" : "TLV",
|
||||
"since" : "1.0",
|
||||
"format" : "guint8",
|
||||
"public-format" : "gboolean" },
|
||||
{ "name" : "Satellite Information Reporting",
|
||||
"id" : "0x16",
|
||||
"type" : "TLV",
|
||||
"since" : "1.0",
|
||||
"format" : "guint8",
|
||||
"public-format" : "gboolean" },
|
||||
{ "name" : "VX Network Initiated Request Reporting",
|
||||
"id" : "0x17",
|
||||
"type" : "TLV",
|
||||
"since" : "1.0",
|
||||
"format" : "guint8",
|
||||
"public-format" : "gboolean" },
|
||||
{ "name" : "SUPL Network Initiated Prompt Reporting",
|
||||
"id" : "0x18",
|
||||
"type" : "TLV",
|
||||
"since" : "1.0",
|
||||
"format" : "guint8",
|
||||
"public-format" : "gboolean" },
|
||||
{ "name" : "UMTS CP Network Initiated Prompt Reporting",
|
||||
"id" : "0x19",
|
||||
"type" : "TLV",
|
||||
"since" : "1.0",
|
||||
"format" : "guint8",
|
||||
"public-format" : "gboolean" },
|
||||
{ "name" : "PDS Comm Event Reporting",
|
||||
"id" : "0x1A",
|
||||
"type" : "TLV",
|
||||
"since" : "1.0",
|
||||
"format" : "guint8",
|
||||
"public-format" : "gboolean" },
|
||||
{ "name" : "Accelerometer Data Streaming Ready Reporting",
|
||||
"id" : "0x1B",
|
||||
"type" : "TLV",
|
||||
"since" : "1.0",
|
||||
"format" : "guint8",
|
||||
"public-format" : "gboolean" },
|
||||
{ "name" : "Gyro Data Streaming Ready Reporting",
|
||||
"id" : "0x1C",
|
||||
"type" : "TLV",
|
||||
"since" : "1.0",
|
||||
"format" : "guint8",
|
||||
"public-format" : "gboolean" },
|
||||
{ "name" : "Time Sync Request Reporting",
|
||||
"id" : "0x1D",
|
||||
"type" : "TLV",
|
||||
"since" : "1.0",
|
||||
"format" : "guint8",
|
||||
"public-format" : "gboolean" },
|
||||
{ "name" : "Position Reliability Indicator Reporting",
|
||||
"id" : "0x1E",
|
||||
"type" : "TLV",
|
||||
"since" : "1.0",
|
||||
"format" : "guint8",
|
||||
"public-format" : "gboolean" },
|
||||
{ "name" : "Sensor Data Usage Indicator Reporting",
|
||||
"id" : "0x1F",
|
||||
"type" : "TLV",
|
||||
"since" : "1.0",
|
||||
"format" : "guint8",
|
||||
"public-format" : "gboolean" },
|
||||
{ "name" : "Time Source Information Reporting",
|
||||
"id" : "0x20",
|
||||
"type" : "TLV",
|
||||
"since" : "1.0",
|
||||
"format" : "guint8",
|
||||
"public-format" : "gboolean" },
|
||||
{ "name" : "Heading Uncertainty Reporting",
|
||||
"id" : "0x21",
|
||||
"type" : "TLV",
|
||||
"since" : "1.0",
|
||||
"format" : "guint8",
|
||||
"public-format" : "gboolean" },
|
||||
{ "name" : "NMEA Debug Strings Reporting",
|
||||
"id" : "0x22",
|
||||
"type" : "TLV",
|
||||
"since" : "1.0",
|
||||
"format" : "guint8",
|
||||
"public-format" : "gboolean" },
|
||||
{ "name" : "Extended External XTRA Data Request Reporting",
|
||||
"id" : "0x23",
|
||||
"type" : "TLV",
|
||||
"since" : "1.0",
|
||||
"format" : "guint8",
|
||||
"public-format" : "gboolean" } ],
|
||||
"output" : [ { "common-ref" : "Operation Result" } ] },
|
||||
|
||||
{ "name" : "Event Report",
|
||||
"type" : "Indication",
|
||||
"service" : "PDS",
|
||||
"id" : "0x0001",
|
||||
"since" : "1.0",
|
||||
"output" : [ { "name" : "NMEA Position",
|
||||
"id" : "0x10",
|
||||
"type" : "TLV",
|
||||
"since" : "1.0",
|
||||
"format" : "string",
|
||||
"max-size" : "200" },
|
||||
{ "name" : "Extended NMEA Position",
|
||||
"id" : "0x11",
|
||||
"type" : "TLV",
|
||||
"since" : "1.0",
|
||||
"format" : "sequence",
|
||||
"contents" : [ { "name" : "Operation Mode",
|
||||
"format" : "gint8",
|
||||
"public-format" : "QmiPdsOperationMode" },
|
||||
{ "name" : "NMEA",
|
||||
"format" : "string",
|
||||
// This was supposed to be only 1 byte for length, but it seems it's not
|
||||
"size-prefix-format" : "guint16",
|
||||
"max-size" : "200" } ] },
|
||||
{ "name" : "Position Session Status",
|
||||
"id" : "0x12",
|
||||
"type" : "TLV",
|
||||
"since" : "1.0",
|
||||
"format" : "guint8",
|
||||
"public-format" : "QmiPdsPositionSessionStatus" } ] },
|
||||
|
||||
// TODO: parse all TLVs of this indication
|
||||
// Reading gfloat/gdouble is still missing
|
||||
//{ "name" : "Parsed Position",
|
||||
// "id" : "0x13",
|
||||
// "type" : "TLV",
|
||||
// "format" : "sequence",
|
||||
// "contents" : [ { "name" : "Valid Mask",
|
||||
// "format" : "gint8" },
|
||||
// { "name" : "Timestamp Calendar",
|
||||
// "format" : "struct",
|
||||
// "contents" : [ { "name" : "Year",
|
||||
// "format" : "guint16" },
|
||||
// { "name" : "Month",
|
||||
// "format" : "guint8" },
|
||||
// { "name" : "Day Of Week",
|
||||
// "format" : "guint8" },
|
||||
// { "name" : "Day of Month",
|
||||
// "format" : "guint8" },
|
||||
// { "name" : "Hour",
|
||||
// "format" : "guint8" },
|
||||
// { "name" : "Minute",
|
||||
// "format" : "guint8" },
|
||||
// { "name" : "Second",
|
||||
// "format" : "guint8" },
|
||||
// { "name" : "Millisecond",
|
||||
// "format" : "guint16" } ] },
|
||||
// { "name" : "Leap Seconds",
|
||||
// "format" : "guint8" },
|
||||
// { "name" : "Timestamp UTC",
|
||||
// "format" : "guint64" },
|
||||
// { "name" : "Time Uncertainty",
|
||||
// "format" : "guint32" },
|
||||
// { "name" : "Latitude",
|
||||
// "format" : "gdouble" },
|
||||
// { "name" : "Longitude",
|
||||
// "format" : "gdouble" },
|
||||
// { "name" : "Altitude Ellipsoid",
|
||||
// "format" : "gfloat" },
|
||||
// { "name" : "Altitude Sea Level",
|
||||
// "format" : "gfloat" },
|
||||
// { "name" : "Horizontal Speed",
|
||||
// "format" : "gfloat" },
|
||||
// { "name" : "Vertical Speed",
|
||||
// "format" : "gfloat" },
|
||||
// { "name" : "Heading",
|
||||
// "format" : "gfloat" },
|
||||
// { "name" : "Horizontal Uncertainty Circular",
|
||||
// "format" : "gfloat" },
|
||||
// { "name" : "Horizontal Uncertainty Ellipse Semi Major",
|
||||
// "format" : "gfloat" },
|
||||
// { "name" : "Horizontal Uncertainty Ellipse Semi Minor",
|
||||
// "format" : "gfloat" },
|
||||
// { "name" : "Horizontal Uncertainty Ellipse Orient Azimuth",
|
||||
// "format" : "gfloat" },
|
||||
// { "name" : "Vertical Uncertainty",
|
||||
// "format" : "gfloat" },
|
||||
// { "name" : "Horizontal Velocity Uncertainty",
|
||||
// "format" : "gfloat" },
|
||||
// { "name" : "Vertical Velocity Uncertainty",
|
||||
// "format" : "gfloat" },
|
||||
// { "name" : "Horizontal confidence",
|
||||
// "format" : "guint8" },
|
||||
// { "name" : "Position DOP",
|
||||
// "format" : "gfloat" },
|
||||
// { "name" : "Horizontal DOP",
|
||||
// "format" : "gfloat" },
|
||||
// { "name" : "Vertical DOP",
|
||||
// "format" : "gfloat" },
|
||||
// { "name" : "Operation Mode",
|
||||
// "format" : "gint8",
|
||||
// "public-format" : "QmiPdsOperationMode" } ],
|
||||
// "prerequisites": [ { "field" : "Position Session Status",
|
||||
// "operation" : "<=",
|
||||
// "value" : "QMI_PDS_POSITION_SESSION_STATUS_IN_PROGRESS" } ] } ] }
|
||||
|
||||
// *********************************************************************************
|
||||
{ "name" : "Get GPS Service State",
|
||||
"type" : "Message",
|
||||
"service" : "PDS",
|
||||
"id" : "0x0020",
|
||||
"since" : "1.0",
|
||||
"output" : [ { "common-ref" : "Operation Result" },
|
||||
{ "name" : "State",
|
||||
"id" : "0x01",
|
||||
"type" : "TLV",
|
||||
"since" : "1.0",
|
||||
"format" : "sequence",
|
||||
"contents" : [ { "name" : "GPS Service State",
|
||||
"format" : "guint8",
|
||||
"public-format" : "gboolean" },
|
||||
{ "name" : "Tracking Session State",
|
||||
"format" : "guint8",
|
||||
"public-format" : "QmiPdsTrackingSessionState" } ],
|
||||
"prerequisites" : [ { "common-ref" : "Success" } ] } ] },
|
||||
|
||||
// *********************************************************************************
|
||||
{ "name" : "Set GPS Service State",
|
||||
"type" : "Message",
|
||||
"service" : "PDS",
|
||||
"id" : "0x0021",
|
||||
"since" : "1.0",
|
||||
"input" : [ { "name" : "State",
|
||||
"id" : "0x01",
|
||||
"type" : "TLV",
|
||||
"since" : "1.0",
|
||||
"format" : "sequence",
|
||||
"contents" : [ { "name" : "GPS Service State",
|
||||
"format" : "guint8",
|
||||
"public-format" : "gboolean" } ] } ],
|
||||
"output" : [ { "common-ref" : "Operation Result" } ] },
|
||||
|
||||
// *********************************************************************************
|
||||
{ "name" : "Get Default Tracking Session",
|
||||
"type" : "Message",
|
||||
"service" : "PDS",
|
||||
"id" : "0x0029",
|
||||
"since" : "1.12",
|
||||
"output" : [ { "common-ref" : "Operation Result" },
|
||||
{ "name" : "Info",
|
||||
"id" : "0x01",
|
||||
"type" : "TLV",
|
||||
"since" : "1.12",
|
||||
"format" : "sequence",
|
||||
"contents" : [ { "name" : "Session Operation",
|
||||
"format" : "guint8",
|
||||
"public-format" : "QmiPdsOperatingMode" },
|
||||
{ "name" : "Position Data Timeout",
|
||||
"format" : "guint8" },
|
||||
{ "name" : "Interval",
|
||||
"format" : "guint32" },
|
||||
{ "name" : "Accuracy Threshold",
|
||||
"format" : "guint32" } ],
|
||||
"prerequisites" : [ { "common-ref" : "Success" } ] } ] },
|
||||
|
||||
// *********************************************************************************
|
||||
{ "name" : "Set Default Tracking Session",
|
||||
"type" : "Message",
|
||||
"service" : "PDS",
|
||||
"id" : "0x002A",
|
||||
"since" : "1.12",
|
||||
"input" : [ { "name" : "Info",
|
||||
"id" : "0x01",
|
||||
"type" : "TLV",
|
||||
"since" : "1.12",
|
||||
"format" : "sequence",
|
||||
"contents" : [ { "name" : "Session Operation",
|
||||
"format" : "guint8",
|
||||
"public-format" : "QmiPdsOperatingMode" },
|
||||
{ "name" : "Position Data Timeout",
|
||||
"format" : "guint8" },
|
||||
{ "name" : "Interval",
|
||||
"format" : "guint32" },
|
||||
{ "name" : "Accuracy Threshold",
|
||||
"format" : "guint32" } ] } ],
|
||||
"output" : [ { "common-ref" : "Operation Result" } ] },
|
||||
|
||||
// *********************************************************************************
|
||||
{ "name" : "Get AGPS Config",
|
||||
"type" : "Message",
|
||||
"service" : "PDS",
|
||||
"id" : "0x002E",
|
||||
"since" : "1.12",
|
||||
"input" : [ { "name" : "Network Mode",
|
||||
"id" : "0x12",
|
||||
"type" : "TLV",
|
||||
"since" : "1.12",
|
||||
"format" : "guint8",
|
||||
"public-format" : "QmiPdsNetworkMode" } ],
|
||||
"output" : [ { "common-ref" : "Operation Result" },
|
||||
{ "name" : "Location Server Address",
|
||||
"id" : "0x10",
|
||||
"type" : "TLV",
|
||||
"since" : "1.12",
|
||||
"format" : "sequence",
|
||||
"contents" : [ { "name" : "IP",
|
||||
"format" : "guint32",
|
||||
"endian" : "little" },
|
||||
{ "name" : "Port",
|
||||
"format" : "guint32" } ],
|
||||
"prerequisites" : [ { "common-ref" : "Success" } ] },
|
||||
{ "name" : "Location Server URL",
|
||||
"id" : "0x11",
|
||||
"type" : "TLV",
|
||||
"since" : "1.12",
|
||||
"format" : "array",
|
||||
"size-prefix-format" : "guint8",
|
||||
"array-element" : { "format" : "guint8" },
|
||||
"prerequisites" : [ { "common-ref" : "Success" } ] } ] },
|
||||
|
||||
// *********************************************************************************
|
||||
{ "name" : "Set AGPS Config",
|
||||
"type" : "Message",
|
||||
"service" : "PDS",
|
||||
"id" : "0x002F",
|
||||
"since" : "1.12",
|
||||
"input" : [ { "name" : "Location Server Address",
|
||||
"id" : "0x10",
|
||||
"type" : "TLV",
|
||||
"since" : "1.12",
|
||||
"format" : "sequence",
|
||||
"contents" : [ { "name" : "IP",
|
||||
"format" : "guint32",
|
||||
"format" : "guint32" },
|
||||
{ "name" : "Port",
|
||||
"format" : "guint32" } ] },
|
||||
{ "name" : "Location Server URL",
|
||||
"id" : "0x11",
|
||||
"type" : "TLV",
|
||||
"since" : "1.12",
|
||||
"format" : "array",
|
||||
"size-prefix-format" : "guint8",
|
||||
"array-element" : { "format" : "guint8" } },
|
||||
{ "name" : "Network Mode",
|
||||
"id" : "0x14",
|
||||
"type" : "TLV",
|
||||
"since" : "1.12",
|
||||
"format" : "guint8",
|
||||
"public-format" : "QmiPdsNetworkMode" } ],
|
||||
"output" : [ { "common-ref" : "Operation Result" } ] },
|
||||
|
||||
// *********************************************************************************
|
||||
{ "name" : "Get Auto Tracking State",
|
||||
"type" : "Message",
|
||||
"service" : "PDS",
|
||||
"id" : "0x0030",
|
||||
"since" : "1.0",
|
||||
"output" : [ { "common-ref" : "Operation Result" },
|
||||
{ "name" : "State",
|
||||
"id" : "0x01",
|
||||
"type" : "TLV",
|
||||
"since" : "1.0",
|
||||
"format" : "sequence",
|
||||
"contents" : [ { "name" : "Auto Tracking State",
|
||||
"format" : "guint8",
|
||||
"public-format" : "gboolean" } ],
|
||||
"prerequisites" : [ { "common-ref" : "Success" } ] } ] },
|
||||
|
||||
// *********************************************************************************
|
||||
{ "name" : "Set Auto Tracking State",
|
||||
"type" : "Message",
|
||||
"service" : "PDS",
|
||||
"id" : "0x0031",
|
||||
"since" : "1.0",
|
||||
"input" : [ { "name" : "State",
|
||||
"id" : "0x01",
|
||||
"type" : "TLV",
|
||||
"since" : "1.0",
|
||||
"format" : "sequence",
|
||||
"contents" : [ { "name" : "Auto Tracking State",
|
||||
"format" : "guint8",
|
||||
"public-format" : "gboolean" } ] } ],
|
||||
"output" : [ { "common-ref" : "Operation Result" } ] },
|
||||
|
||||
// *********************************************************************************
|
||||
{ "name" : "GPS Ready",
|
||||
"type" : "Indication",
|
||||
"service" : "PDS",
|
||||
"id" : "0x0060",
|
||||
"since" : "1.14" }
|
||||
|
||||
]
|
@ -0,0 +1,965 @@
|
||||
[
|
||||
// *********************************************************************************
|
||||
{ "name" : "UIM",
|
||||
"type" : "Service" },
|
||||
|
||||
// *********************************************************************************
|
||||
{ "name" : "QMI Client UIM",
|
||||
"type" : "Client",
|
||||
"since" : "1.6" },
|
||||
|
||||
// *********************************************************************************
|
||||
{ "name" : "QMI Message UIM",
|
||||
"type" : "Message-ID-Enum" },
|
||||
|
||||
// *********************************************************************************
|
||||
{ "name" : "QMI Indication UIM",
|
||||
"type" : "Indication-ID-Enum" },
|
||||
|
||||
// *********************************************************************************
|
||||
{ "common-ref" : "UIM Card Status",
|
||||
"name" : "Card Status",
|
||||
"id" : "0x10",
|
||||
"type" : "TLV",
|
||||
"format" : "sequence",
|
||||
"contents" : [ { "name" : "Index GW Primary",
|
||||
"format" : "guint16" },
|
||||
{ "name" : "Index 1x Primary",
|
||||
"format" : "guint16" },
|
||||
{ "name" : "Index GW Secondary",
|
||||
"format" : "guint16" },
|
||||
{ "name" : "Index 1x Secondary",
|
||||
"format" : "guint16" },
|
||||
{ "name" : "Cards",
|
||||
"format" : "array",
|
||||
"size-prefix-format" : "guint8",
|
||||
"array-element" : { "name" : "Element",
|
||||
"format" : "struct",
|
||||
"contents" : [ { "name" : "Card State",
|
||||
"format" : "guint8",
|
||||
"public-format" : "QmiUimCardState" },
|
||||
{ "name" : "UPIN State",
|
||||
"format" : "guint8",
|
||||
"public-format" : "QmiUimPinState" },
|
||||
{ "name" : "UPIN Retries",
|
||||
"format" : "guint8" },
|
||||
{ "name" : "UPUK Retries",
|
||||
"format" : "guint8" },
|
||||
{ "name" : "Error code",
|
||||
"format" : "guint8",
|
||||
"public-format" : "QmiUimCardError" },
|
||||
{ "name" : "Applications",
|
||||
"format" : "array",
|
||||
"size-prefix-format" : "guint8",
|
||||
"array-element" : { "name" : "Element",
|
||||
"format" : "struct",
|
||||
"contents" : [ { "name" : "Type",
|
||||
"format" : "guint8",
|
||||
"public-format" : "QmiUimCardApplicationType" },
|
||||
{ "name" : "State",
|
||||
"format" : "guint8",
|
||||
"public-format" : "QmiUimCardApplicationState" },
|
||||
{ "name" : "Personalization State",
|
||||
"format" : "guint8",
|
||||
"public-format" : "QmiUimCardApplicationPersonalizationState" },
|
||||
{ "name" : "Personalization Feature",
|
||||
"format" : "guint8",
|
||||
"public-format" : "QmiUimCardApplicationPersonalizationFeature" },
|
||||
{ "name" : "Personalization Retries",
|
||||
"format" : "guint8" },
|
||||
{ "name" : "Personalization Unblock Retries",
|
||||
"format" : "guint8" },
|
||||
{ "name" : "Application Identifier Value",
|
||||
"format" : "array",
|
||||
"size-prefix-format" : "guint8",
|
||||
"array-element" : { "format" : "guint8" } },
|
||||
{ "name" : "UPIN replaces PIN1",
|
||||
"format" : "guint8",
|
||||
"public-format" : "gboolean" },
|
||||
{ "name" : "PIN1 State",
|
||||
"format" : "guint8",
|
||||
"public-format" : "QmiUimPinState" },
|
||||
{ "name" : "PIN1 Retries",
|
||||
"format" : "guint8" },
|
||||
{ "name" : "PUK1 Retries",
|
||||
"format" : "guint8" },
|
||||
{ "name" : "PIN2 State",
|
||||
"format" : "guint8",
|
||||
"public-format" : "QmiUimPinState" },
|
||||
{ "name" : "PIN2 Retries",
|
||||
"format" : "guint8" },
|
||||
{ "name" : "PUK2 Retries",
|
||||
"format" : "guint8" } ] } } ] } } ] },
|
||||
|
||||
// *********************************************************************************
|
||||
{ "common-ref" : "UIM Session",
|
||||
"name" : "Session",
|
||||
"fullname" : "Qmi UIM Session",
|
||||
"id" : "0x01",
|
||||
"type" : "TLV",
|
||||
"format" : "sequence",
|
||||
"contents" : [ { "name" : "Session Type",
|
||||
"format" : "guint8",
|
||||
"public-format" : "QmiUimSessionType" },
|
||||
{ "name" : "Application Identifier",
|
||||
"format" : "array",
|
||||
"size-prefix-format" : "guint8",
|
||||
"array-element" : { "format" : "guint8" } } ] },
|
||||
|
||||
// *********************************************************************************
|
||||
{ "common-ref" : "Physical Slot Status",
|
||||
"name" : "Physical Slot Status",
|
||||
"fullname" : "Qmi Physical Slot Status",
|
||||
"id" : "0x10",
|
||||
"type" : "TLV",
|
||||
"format" : "array",
|
||||
"size-prefix-format" : "guint8",
|
||||
"array-element" : { "name" : "Slot",
|
||||
"format" : "struct",
|
||||
"contents" : [ { "name" : "Physical Card Status",
|
||||
"format" : "guint32",
|
||||
"public-format" : "QmiUimPhysicalCardState" },
|
||||
{ "name" : "Physical Slot Status",
|
||||
"format" : "guint32",
|
||||
"public-format" : "QmiUimSlotState" },
|
||||
{ "name" : "Logical Slot",
|
||||
"format" : "guint8" },
|
||||
{ "name" : "ICCID",
|
||||
"format" : "array",
|
||||
"size-prefix-format" : "guint8",
|
||||
"array-element" : { "format" : "guint8" } } ] } },
|
||||
|
||||
// *********************************************************************************
|
||||
{ "common-ref" : "Physical Slot Information",
|
||||
"name" : "Physical Slot Information",
|
||||
"fullname" : "Qmi Physical Slot Information",
|
||||
"id" : "0x11",
|
||||
"type" : "TLV",
|
||||
"format" : "array",
|
||||
"size-prefix-format" : "guint8",
|
||||
"array-element" : { "name" : "Slot",
|
||||
"format" : "struct",
|
||||
"contents" : [ { "name" : "Card Protocol",
|
||||
"format" : "guint32",
|
||||
"public-format" : "QmiUimCardProtocol" },
|
||||
{ "name" : "Valid Applications",
|
||||
"format" : "guint8" },
|
||||
{ "name" : "ATR Value",
|
||||
"format" : "array",
|
||||
"size-prefix-format" : "guint8",
|
||||
"array-element" : { "format" : "guint8" } },
|
||||
{ "name" : "Is EUICC",
|
||||
"format" : "guint8",
|
||||
"public-format" : "gboolean" } ] } },
|
||||
|
||||
// *********************************************************************************
|
||||
{ "common-ref" : "Slot EID Information",
|
||||
"name" : "Slot EID Information",
|
||||
"fullname" : "Qmi Slot EID Information",
|
||||
"id" : "0x12",
|
||||
"type" : "TLV",
|
||||
"format" : "array",
|
||||
"size-prefix-format" : "guint8",
|
||||
"array-element" : { "name" : "EID",
|
||||
"format" : "array",
|
||||
"size-prefix-format" : "guint8",
|
||||
"array-element" : { "format" : "guint8" } } },
|
||||
|
||||
// *********************************************************************************
|
||||
{ "name" : "Reset",
|
||||
"type" : "Message",
|
||||
"service" : "UIM",
|
||||
"id" : "0x0000",
|
||||
"since" : "1.6",
|
||||
"output" : [ { "common-ref" : "Operation Result" } ] },
|
||||
|
||||
// *********************************************************************************
|
||||
{ "name" : "Get Supported Messages",
|
||||
"type" : "Message",
|
||||
"service" : "UIM",
|
||||
"id" : "0x001E",
|
||||
"since" : "1.14",
|
||||
"output" : [ { "common-ref" : "Operation Result" },
|
||||
{ "name" : "List",
|
||||
"id" : "0x10",
|
||||
"type" : "TLV",
|
||||
"since" : "1.14",
|
||||
"format" : "array",
|
||||
"size-prefix-format" : "guint16",
|
||||
"array-element" : { "format" : "guint8" },
|
||||
"prerequisites" : [ { "common-ref" : "Success" } ] } ] },
|
||||
|
||||
// *********************************************************************************
|
||||
{ "name" : "Read Transparent",
|
||||
"type" : "Message",
|
||||
"service" : "UIM",
|
||||
"id" : "0x0020",
|
||||
"since" : "1.6",
|
||||
"input" : [ { "common-ref" : "UIM Session",
|
||||
"since" : "1.22" },
|
||||
{ "name" : "File",
|
||||
"id" : "0x02",
|
||||
"type" : "TLV",
|
||||
"since" : "1.6",
|
||||
"format" : "sequence",
|
||||
"contents" : [ { "name" : "File ID",
|
||||
"format" : "guint16" },
|
||||
{ "name" : "File Path",
|
||||
"format" : "array",
|
||||
"array-element" : { "format" : "guint8" } } ] },
|
||||
{ "name" : "Read Information",
|
||||
"id" : "0x03",
|
||||
"type" : "TLV",
|
||||
"since" : "1.6",
|
||||
"format" : "sequence",
|
||||
"contents" : [ { "name" : "Offset",
|
||||
"format" : "guint16" },
|
||||
{ "name" : "Length",
|
||||
"format" : "guint16" } ] },
|
||||
{ "name" : "Response In Indication Token",
|
||||
"id" : "0x10",
|
||||
"type" : "TLV",
|
||||
"since" : "1.6",
|
||||
"format" : "guint32" },
|
||||
{ "name" : "Encrypt Data",
|
||||
"id" : "0x11",
|
||||
"type" : "TLV",
|
||||
"since" : "1.6",
|
||||
"format" : "guint8",
|
||||
"public-format" : "gboolean" } ],
|
||||
"output" : [ { "common-ref" : "Operation Result" },
|
||||
{ "name" : "Card result",
|
||||
"id" : "0x10",
|
||||
"type" : "TLV",
|
||||
"since" : "1.6",
|
||||
"format" : "sequence",
|
||||
"contents" : [ { "name" : "SW1",
|
||||
"format" : "guint8" },
|
||||
{ "name" : "SW2",
|
||||
"format" : "guint8" } ] },
|
||||
{ "name" : "Read result",
|
||||
"id" : "0x11",
|
||||
"type" : "TLV",
|
||||
"since" : "1.6",
|
||||
"format" : "array",
|
||||
"size-prefix-format" : "guint16",
|
||||
"array-element" : { "format" : "guint8" },
|
||||
"prerequisites" : [ { "common-ref" : "Success" } ] },
|
||||
{ "name" : "Response In Indication Token",
|
||||
"id" : "0x12",
|
||||
"type" : "TLV",
|
||||
"since" : "1.6",
|
||||
"format" : "guint32",
|
||||
"prerequisites" : [ { "common-ref" : "Success" } ] },
|
||||
{ "name" : "Encrypted Data",
|
||||
"id" : "0x13",
|
||||
"type" : "TLV",
|
||||
"since" : "1.6",
|
||||
"format" : "guint8",
|
||||
"public-format" : "gboolean",
|
||||
"prerequisites" : [ { "common-ref" : "Success" } ] } ] },
|
||||
|
||||
// *********************************************************************************
|
||||
{ "name" : "Read Record",
|
||||
"type" : "Message",
|
||||
"service" : "UIM",
|
||||
"id" : "0x0021",
|
||||
"since" : "1.6",
|
||||
"input" : [ { "common-ref" : "UIM Session",
|
||||
"since" : "1.22" },
|
||||
{ "name" : "File",
|
||||
"id" : "0x02",
|
||||
"type" : "TLV",
|
||||
"since" : "1.6",
|
||||
"format" : "sequence",
|
||||
"contents" : [ { "name" : "File ID",
|
||||
"format" : "guint16" },
|
||||
{ "name" : "File Path",
|
||||
"format" : "array",
|
||||
"array-element" : { "format" : "guint8" } } ] },
|
||||
{ "name" : "Record",
|
||||
"id" : "0x03",
|
||||
"type" : "TLV",
|
||||
"since" : "1.6",
|
||||
"format" : "sequence",
|
||||
"contents" : [ { "name" : "Record Number",
|
||||
"format" : "guint16" },
|
||||
{ "name" : "Record Length",
|
||||
"format" : "guint16" } ] },
|
||||
{ "name" : "Last Record",
|
||||
"id" : "0x10",
|
||||
"type" : "TLV",
|
||||
"since" : "1.6",
|
||||
"format" : "guint16" },
|
||||
{ "name" : "Response In Indication Token",
|
||||
"id" : "0x11",
|
||||
"type" : "TLV",
|
||||
"since" : "1.6",
|
||||
"format" : "guint32" } ],
|
||||
"output" : [ { "common-ref" : "Operation Result" },
|
||||
{ "name" : "Card result",
|
||||
"id" : "0x10",
|
||||
"type" : "TLV",
|
||||
"since" : "1.6",
|
||||
"format" : "sequence",
|
||||
"contents" : [ { "name" : "SW1",
|
||||
"format" : "guint8" },
|
||||
{ "name" : "SW2",
|
||||
"format" : "guint8" } ] },
|
||||
{ "name" : "Read Result",
|
||||
"id" : "0x11",
|
||||
"type" : "TLV",
|
||||
"since" : "1.6",
|
||||
"format" : "array",
|
||||
"size-prefix-format" : "guint16",
|
||||
"array-element" : { "format" : "guint8" },
|
||||
"prerequisites" : [ { "common-ref" : "Success" } ] },
|
||||
{ "name" : "Additional Read Result",
|
||||
"id" : "0x12",
|
||||
"type" : "TLV",
|
||||
"since" : "1.6",
|
||||
"format" : "array",
|
||||
"size-prefix-format" : "guint16",
|
||||
"array-element" : { "format" : "guint8" },
|
||||
"prerequisites" : [ { "common-ref" : "Success" } ] },
|
||||
{ "name" : "Response In Indication Token",
|
||||
"id" : "0x13",
|
||||
"type" : "TLV",
|
||||
"since" : "1.6",
|
||||
"format" : "guint32",
|
||||
"prerequisites" : [ { "common-ref" : "Success" } ] } ] },
|
||||
|
||||
// *********************************************************************************
|
||||
{ "name" : "Get File Attributes",
|
||||
"type" : "Message",
|
||||
"service" : "UIM",
|
||||
"id" : "0x0024",
|
||||
"since" : "1.6",
|
||||
"input" : [ { "common-ref" : "UIM Session",
|
||||
"since" : "1.22" },
|
||||
{ "name" : "File",
|
||||
"id" : "0x02",
|
||||
"type" : "TLV",
|
||||
"since" : "1.6",
|
||||
"format" : "sequence",
|
||||
"contents" : [ { "name" : "File ID",
|
||||
"format" : "guint16" },
|
||||
{ "name" : "File Path",
|
||||
"format" : "array",
|
||||
"array-element" : { "format" : "guint8" } } ] },
|
||||
{ "name" : "Response In Indication Token",
|
||||
"id" : "0x10",
|
||||
"type" : "TLV",
|
||||
"since" : "1.6",
|
||||
"format" : "guint32" } ],
|
||||
"output" : [ { "common-ref" : "Operation Result" },
|
||||
{ "name" : "Card result",
|
||||
"id" : "0x10",
|
||||
"type" : "TLV",
|
||||
"since" : "1.6",
|
||||
"format" : "sequence",
|
||||
"contents" : [ { "name" : "SW1",
|
||||
"format" : "guint8" },
|
||||
{ "name" : "SW2",
|
||||
"format" : "guint8" } ] },
|
||||
{ "name" : "File Attributes",
|
||||
"id" : "0x11",
|
||||
"type" : "TLV",
|
||||
"since" : "1.6",
|
||||
"format" : "sequence",
|
||||
"contents" : [ { "name" : "File Size",
|
||||
"format" : "guint16" },
|
||||
{ "name" : "File ID",
|
||||
"format" : "guint16" },
|
||||
{ "name" : "File Type",
|
||||
"format" : "guint8",
|
||||
"public-format" : "QmiUimFileType" },
|
||||
{ "name" : "Record Size",
|
||||
"format" : "guint16" },
|
||||
{ "name" : "Record Count",
|
||||
"format" : "guint16" },
|
||||
{ "name" : "Read Security Attributes Logic",
|
||||
"format" : "guint8",
|
||||
"public-format" : "QmiUimSecurityAttributeLogic" },
|
||||
{ "name" : "Read Security Attributes",
|
||||
"format" : "guint16",
|
||||
"public-format" : "QmiUimSecurityAttribute" },
|
||||
{ "name" : "Write Security Attributes Logic",
|
||||
"format" : "guint8",
|
||||
"public-format" : "QmiUimSecurityAttributeLogic" },
|
||||
{ "name" : "Write Security Attributes",
|
||||
"format" : "guint16",
|
||||
"public-format" : "QmiUimSecurityAttribute" },
|
||||
{ "name" : "Increase Security Attributes Logic",
|
||||
"format" : "guint8",
|
||||
"public-format" : "QmiUimSecurityAttributeLogic" },
|
||||
{ "name" : "Increase Security Attributes",
|
||||
"format" : "guint16",
|
||||
"public-format" : "QmiUimSecurityAttribute" },
|
||||
{ "name" : "Deactivate Security Attributes Logic",
|
||||
"format" : "guint8",
|
||||
"public-format" : "QmiUimSecurityAttributeLogic" },
|
||||
{ "name" : "Deactivate Security Attributes",
|
||||
"format" : "guint16",
|
||||
"public-format" : "QmiUimSecurityAttribute" },
|
||||
{ "name" : "Activate Security Attributes Logic",
|
||||
"format" : "guint8",
|
||||
"public-format" : "QmiUimSecurityAttributeLogic" },
|
||||
{ "name" : "Activate Security Attributes",
|
||||
"format" : "guint16",
|
||||
"public-format" : "QmiUimSecurityAttribute" },
|
||||
{ "name" : "Raw Data",
|
||||
"format" : "array",
|
||||
"size-prefix-format" : "guint16",
|
||||
"array-element" : { "format" : "guint8" } } ],
|
||||
"prerequisites" : [ { "common-ref" : "Success" } ] },
|
||||
{ "name" : "Response In Indication Token",
|
||||
"id" : "0x12",
|
||||
"type" : "TLV",
|
||||
"since" : "1.6",
|
||||
"format" : "guint32",
|
||||
"prerequisites" : [ { "common-ref" : "Success" } ] } ] },
|
||||
|
||||
// *********************************************************************************
|
||||
{ "name" : "Set PIN Protection",
|
||||
"type" : "Message",
|
||||
"service" : "UIM",
|
||||
"id" : "0x0025",
|
||||
"since" : "1.14",
|
||||
"input" : [ { "common-ref" : "UIM Session",
|
||||
"since" : "1.22" },
|
||||
{ "name" : "Info",
|
||||
"id" : "0x02",
|
||||
"type" : "TLV",
|
||||
"since" : "1.14",
|
||||
"format" : "sequence",
|
||||
"contents" : [ { "name" : "PIN ID",
|
||||
"format" : "guint8",
|
||||
"public-format" : "QmiUimPinId" },
|
||||
{ "name" : "PIN enabled",
|
||||
"format" : "guint8",
|
||||
"public-format" : "gboolean" },
|
||||
{ "name" : "PIN Value",
|
||||
"format" : "string" } ] },
|
||||
{ "name" : "Response In Indication Token",
|
||||
"id" : "0x11",
|
||||
"type" : "TLV",
|
||||
"since" : "1.14",
|
||||
"format" : "guint32" } ],
|
||||
"output" : [ { "common-ref" : "Operation Result" },
|
||||
{ "name" : "Retries Remaining",
|
||||
"id" : "0x10",
|
||||
"type" : "TLV",
|
||||
"since" : "1.14",
|
||||
"format" : "sequence",
|
||||
"contents" : [ { "name" : "Verify Retries Left",
|
||||
"format" : "guint8" },
|
||||
{ "name" : "Unblock Retries Left",
|
||||
"format" : "guint8" } ],
|
||||
"prerequisites": [ { "common-ref" : "No Success" } ] },
|
||||
{ "name" : "Response In Indication Token",
|
||||
"id" : "0x12",
|
||||
"type" : "TLV",
|
||||
"since" : "1.14",
|
||||
"format" : "guint32",
|
||||
"prerequisites" : [ { "common-ref" : "Success" } ] } ] },
|
||||
|
||||
// *********************************************************************************
|
||||
{ "name" : "Verify PIN",
|
||||
"type" : "Message",
|
||||
"service" : "UIM",
|
||||
"id" : "0x0026",
|
||||
"since" : "1.14",
|
||||
"input" : [ { "common-ref" : "UIM Session",
|
||||
"since" : "1.22" },
|
||||
{ "name" : "Info",
|
||||
"id" : "0x02",
|
||||
"type" : "TLV",
|
||||
"since" : "1.14",
|
||||
"format" : "sequence",
|
||||
"contents" : [ { "name" : "PIN ID",
|
||||
"format" : "guint8",
|
||||
"public-format" : "QmiUimPinId" },
|
||||
{ "name" : "PIN Value",
|
||||
"format" : "string" } ] },
|
||||
{ "name" : "Response In Indication Token",
|
||||
"id" : "0x12",
|
||||
"type" : "TLV",
|
||||
"since" : "1.14",
|
||||
"format" : "guint32" } ],
|
||||
"output" : [ { "common-ref" : "Operation Result" },
|
||||
{ "name" : "Retries Remaining",
|
||||
"id" : "0x10",
|
||||
"type" : "TLV",
|
||||
"since" : "1.14",
|
||||
"format" : "sequence",
|
||||
"contents" : [ { "name" : "Verify Retries Left",
|
||||
"format" : "guint8" },
|
||||
{ "name" : "Unblock Retries Left",
|
||||
"format" : "guint8" } ],
|
||||
"prerequisites": [ { "common-ref" : "No Success" } ] },
|
||||
{ "name" : "Response In Indication Token",
|
||||
"id" : "0x12",
|
||||
"type" : "TLV",
|
||||
"since" : "1.14",
|
||||
"format" : "guint32",
|
||||
"prerequisites" : [ { "common-ref" : "Success" } ] },
|
||||
{ "name" : "Card Result",
|
||||
"id" : "0x13",
|
||||
"type" : "TLV",
|
||||
"since" : "1.14",
|
||||
"format" : "sequence",
|
||||
"contents" : [ { "name" : "SW1",
|
||||
"format" : "guint8" },
|
||||
{ "name" : "SW2",
|
||||
"format" : "guint8" } ] } ] },
|
||||
|
||||
// *********************************************************************************
|
||||
{ "name" : "Unblock PIN",
|
||||
"type" : "Message",
|
||||
"service" : "UIM",
|
||||
"id" : "0x0027",
|
||||
"since" : "1.14",
|
||||
"input" : [ { "common-ref" : "UIM Session",
|
||||
"since" : "1.22" },
|
||||
{ "name" : "Info",
|
||||
"id" : "0x02",
|
||||
"type" : "TLV",
|
||||
"since" : "1.14",
|
||||
"format" : "sequence",
|
||||
"contents" : [ { "name" : "PIN ID",
|
||||
"format" : "guint8",
|
||||
"public-format" : "QmiUimPinId" },
|
||||
{ "name" : "PUK",
|
||||
"format" : "string" },
|
||||
{ "name" : "New PIN",
|
||||
"format" : "string" } ] },
|
||||
{ "name" : "Response In Indication Token",
|
||||
"id" : "0x11",
|
||||
"type" : "TLV",
|
||||
"since" : "1.14",
|
||||
"format" : "guint32" } ],
|
||||
"output" : [ { "common-ref" : "Operation Result" },
|
||||
{ "name" : "Retries Remaining",
|
||||
"id" : "0x10",
|
||||
"type" : "TLV",
|
||||
"since" : "1.14",
|
||||
"format" : "sequence",
|
||||
"contents" : [ { "name" : "Verify Retries Left",
|
||||
"format" : "guint8" },
|
||||
{ "name" : "Unblock Retries Left",
|
||||
"format" : "guint8" } ],
|
||||
"prerequisites": [ { "common-ref" : "No Success" } ] },
|
||||
{ "name" : "Response In Indication Token",
|
||||
"id" : "0x12",
|
||||
"type" : "TLV",
|
||||
"since" : "1.14",
|
||||
"format" : "guint32",
|
||||
"prerequisites" : [ { "common-ref" : "Success" } ] },
|
||||
{ "name" : "Card Result",
|
||||
"id" : "0x13",
|
||||
"type" : "TLV",
|
||||
"since" : "1.14",
|
||||
"format" : "sequence",
|
||||
"contents" : [ { "name" : "SW1",
|
||||
"format" : "guint8" },
|
||||
{ "name" : "SW2",
|
||||
"format" : "guint8" } ] } ] },
|
||||
|
||||
// *********************************************************************************
|
||||
{ "name" : "Change PIN",
|
||||
"type" : "Message",
|
||||
"service" : "UIM",
|
||||
"id" : "0x0028",
|
||||
"since" : "1.14",
|
||||
"input" : [ { "common-ref" : "UIM Session",
|
||||
"since" : "1.22" },
|
||||
{ "name" : "Info",
|
||||
"id" : "0x02",
|
||||
"type" : "TLV",
|
||||
"since" : "1.14",
|
||||
"format" : "sequence",
|
||||
"contents" : [ { "name" : "PIN ID",
|
||||
"format" : "guint8",
|
||||
"public-format" : "QmiUimPinId" },
|
||||
{ "name" : "Old PIN",
|
||||
"format" : "string" },
|
||||
{ "name" : "New PIN",
|
||||
"format" : "string" } ] },
|
||||
{ "name" : "Response In Indication Token",
|
||||
"id" : "0x11",
|
||||
"type" : "TLV",
|
||||
"since" : "1.14",
|
||||
"format" : "guint32" } ],
|
||||
"output" : [ { "common-ref" : "Operation Result" },
|
||||
{ "name" : "Retries Remaining",
|
||||
"id" : "0x10",
|
||||
"type" : "TLV",
|
||||
"since" : "1.14",
|
||||
"format" : "sequence",
|
||||
"contents" : [ { "name" : "Verify Retries Left",
|
||||
"format" : "guint8" },
|
||||
{ "name" : "Unblock Retries Left",
|
||||
"format" : "guint8" } ],
|
||||
"prerequisites": [ { "common-ref" : "No Success" } ] },
|
||||
{ "name" : "Response In Indication Token",
|
||||
"id" : "0x12",
|
||||
"type" : "TLV",
|
||||
"since" : "1.14",
|
||||
"format" : "guint32",
|
||||
"prerequisites" : [ { "common-ref" : "Success" } ] },
|
||||
{ "name" : "Card Result",
|
||||
"id" : "0x13",
|
||||
"type" : "TLV",
|
||||
"since" : "1.14",
|
||||
"format" : "sequence",
|
||||
"contents" : [ { "name" : "SW1",
|
||||
"format" : "guint8" },
|
||||
{ "name" : "SW2",
|
||||
"format" : "guint8" } ] } ] },
|
||||
|
||||
// *********************************************************************************
|
||||
{ "name" : "Refresh Register",
|
||||
"type" : "Message",
|
||||
"service" : "UIM",
|
||||
"id" : "0x002A",
|
||||
"since" : "1.28",
|
||||
"input" : [ { "common-ref" : "UIM Session",
|
||||
"since" : "1.28" },
|
||||
{ "name" : "Info",
|
||||
"id" : "0x02",
|
||||
"type" : "TLV",
|
||||
"since" : "1.28",
|
||||
"format" : "sequence",
|
||||
"contents" : [ { "name" : "Register Flag",
|
||||
"format" : "guint8",
|
||||
"public-format" : "gboolean" },
|
||||
{ "name" : "Vote For Init",
|
||||
"format" : "guint8",
|
||||
"public-format" : "gboolean" },
|
||||
{ "name" : "Files",
|
||||
"format" : "array",
|
||||
"size-prefix-format" : "guint16",
|
||||
"array-element" : { "name" : "Element",
|
||||
"format" : "struct",
|
||||
"contents" : [ { "name" : "File ID",
|
||||
"format" : "guint16" },
|
||||
{ "name" : "Path",
|
||||
"format" : "array",
|
||||
"size-prefix-format" : "guint8",
|
||||
"array-element" : { "format" : "guint8" } } ] } } ] } ],
|
||||
"output" : [ { "common-ref" : "Operation Result" } ] },
|
||||
|
||||
// *********************************************************************************
|
||||
{ "name" : "Refresh Complete",
|
||||
"type" : "Message",
|
||||
"service" : "UIM",
|
||||
"id" : "0x002C",
|
||||
"since" : "1.28",
|
||||
"input" : [ { "common-ref" : "UIM Session",
|
||||
"since" : "1.28" },
|
||||
{ "name" : "Info",
|
||||
"id" : "0x02",
|
||||
"type" : "TLV",
|
||||
"since" : "1.28",
|
||||
"format" : "sequence",
|
||||
"contents" : [ { "name" : "Refresh Success",
|
||||
"format" : "guint8",
|
||||
"public-format" : "gboolean" } ] } ],
|
||||
"output" : [ { "common-ref" : "Operation Result" } ] },
|
||||
|
||||
// *********************************************************************************
|
||||
{ "name" : "Register Events",
|
||||
"type" : "Message",
|
||||
"service" : "UIM",
|
||||
"id" : "0x002E",
|
||||
"since" : "1.22.4",
|
||||
"input" : [ { "name" : "Event Registration Mask",
|
||||
"id" : "0x01",
|
||||
"type" : "TLV",
|
||||
"since" : "1.22.4",
|
||||
"format" : "guint32",
|
||||
"public-format" : "QmiUimEventRegistrationFlag" } ],
|
||||
"output" : [ { "common-ref" : "Operation Result" },
|
||||
{ "name" : "Event Registration Mask",
|
||||
"id" : "0x10",
|
||||
"type" : "TLV",
|
||||
"since" : "1.22.4",
|
||||
"format" : "guint32",
|
||||
"public-format" : "QmiUimEventRegistrationFlag",
|
||||
"prerequisites" : [ { "common-ref" : "Success" } ] } ] },
|
||||
|
||||
// *********************************************************************************
|
||||
{ "name" : "Get Card Status",
|
||||
"type" : "Message",
|
||||
"service" : "UIM",
|
||||
"id" : "0x002F",
|
||||
"since" : "1.10",
|
||||
"output" : [ { "common-ref" : "Operation Result" },
|
||||
{ "common-ref" : "UIM Card Status",
|
||||
"since" : "1.10" } ] },
|
||||
|
||||
// *********************************************************************************
|
||||
{ "name" : "Power Off SIM",
|
||||
"type" : "Message",
|
||||
"service" : "UIM",
|
||||
"id" : "0x0030",
|
||||
"since" : "1.18",
|
||||
"input" : [ { "name" : "Slot",
|
||||
"id" : "0x01",
|
||||
"type" : "TLV",
|
||||
"since" : "1.18",
|
||||
"format" : "guint8" } ],
|
||||
"output" : [ { "common-ref" : "Operation Result" } ] },
|
||||
|
||||
// *********************************************************************************
|
||||
{ "name" : "Power On SIM",
|
||||
"type" : "Message",
|
||||
"service" : "UIM",
|
||||
"id" : "0x0031",
|
||||
"since" : "1.18",
|
||||
"input" : [ { "name" : "Slot",
|
||||
"id" : "0x01",
|
||||
"type" : "TLV",
|
||||
"since" : "1.18",
|
||||
"format" : "guint8" } ],
|
||||
"output" : [ { "common-ref" : "Operation Result" } ] },
|
||||
|
||||
// *********************************************************************************
|
||||
{ "name" : "Card Status",
|
||||
"type" : "Indication",
|
||||
"service" : "UIM",
|
||||
"id" : "0x0032",
|
||||
"since" : "1.22",
|
||||
"output" : [ { "common-ref" : "UIM Card Status",
|
||||
"since" : "1.22" } ] },
|
||||
|
||||
// *********************************************************************************
|
||||
{ "name" : "Refresh",
|
||||
"type" : "Indication",
|
||||
"service" : "UIM",
|
||||
"id" : "0x0033",
|
||||
"since" : "1.28",
|
||||
"output" : [ { "name" : "Event",
|
||||
"id" : "0x10",
|
||||
"type" : "TLV",
|
||||
"since" : "1.28",
|
||||
"format" : "sequence",
|
||||
"contents" : [ { "name" : "Stage",
|
||||
"format" : "guint8",
|
||||
"public-format" : "QmiUimRefreshStage" },
|
||||
{ "name" : "Mode",
|
||||
"format" : "guint8",
|
||||
"public-format" : "QmiUimRefreshMode" },
|
||||
{ "name" : "Session Type",
|
||||
"format" : "guint8",
|
||||
"public-format" : "QmiUimSessionType" },
|
||||
{ "name" : "Application Identifier",
|
||||
"format" : "array",
|
||||
"size-prefix-format" : "guint8",
|
||||
"array-element" : { "format" : "guint8" } },
|
||||
{ "name" : "Files",
|
||||
"format" : "array",
|
||||
"size-prefix-format" : "guint16",
|
||||
"array-element" : { "name" : "Element",
|
||||
"format" : "struct",
|
||||
"contents" : [ { "name" : "File ID",
|
||||
"format" : "guint16" },
|
||||
{ "name" : "Path",
|
||||
"format" : "array",
|
||||
"size-prefix-format" : "guint8",
|
||||
"array-element" : { "format" : "guint8" } } ] } } ] } ] },
|
||||
|
||||
// *********************************************************************************
|
||||
{ "name" : "Change Provisioning Session",
|
||||
"type" : "Message",
|
||||
"service" : "UIM",
|
||||
"id" : "0x0038",
|
||||
"since" : "1.24",
|
||||
"input" : [ { "name" : "Session Change",
|
||||
"id" : "0x01",
|
||||
"type" : "TLV",
|
||||
"since" : "1.24",
|
||||
"format" : "sequence",
|
||||
"contents" : [ { "name" : "Session Type",
|
||||
"format" : "guint8",
|
||||
"public-format" : "QmiUimSessionType" },
|
||||
{ "name" : "Activate",
|
||||
"format" : "guint8",
|
||||
"public-format" : "gboolean" } ] },
|
||||
{ "name" : "Application Information",
|
||||
"id" : "0x10",
|
||||
"type" : "TLV",
|
||||
"since" : "1.24",
|
||||
"format" : "sequence",
|
||||
"contents" : [ { "name" : "Slot",
|
||||
"format" : "guint8" },
|
||||
{ "name" : "Application Identifier",
|
||||
"format" : "array",
|
||||
"size-prefix-format" : "guint8",
|
||||
"array-element" : { "format" : "guint8" } } ] } ],
|
||||
"output" : [ { "common-ref" : "Operation Result" } ] },
|
||||
|
||||
// *********************************************************************************
|
||||
{ "name" : "Depersonalization",
|
||||
"type" : "Message",
|
||||
"service" : "UIM",
|
||||
"id" : "0x0029",
|
||||
"since" : "1.30",
|
||||
"input" : [ { "name" : "Info",
|
||||
"id" : "0x01",
|
||||
"type" : "TLV",
|
||||
"since" : "1.30",
|
||||
"format" : "sequence",
|
||||
"contents" : [ { "name" : "Feature",
|
||||
"format" : "guint8",
|
||||
"public-format" : "QmiUimCardApplicationPersonalizationFeature" },
|
||||
{ "name" : "Operation",
|
||||
"format" : "guint8",
|
||||
"public-format" : "QmiUimDepersonalizationOperation" },
|
||||
{ "name" : "Control Key",
|
||||
"format" : "string" } ] },
|
||||
{ "name" : "Slot",
|
||||
"id" : "0x10",
|
||||
"type" : "TLV",
|
||||
"since" : "1.30",
|
||||
"format" : "guint8" } ],
|
||||
"output" : [ { "common-ref" : "Operation Result" },
|
||||
{ "name" : "Retries Remaining",
|
||||
"id" : "0x10",
|
||||
"type" : "TLV",
|
||||
"since" : "1.30",
|
||||
"format" : "sequence",
|
||||
"contents" : [ { "name" : "Verify Left",
|
||||
"format" : "guint8" },
|
||||
{ "name" : "Unblock Left",
|
||||
"format" : "guint8" } ],
|
||||
"prerequisites" : [ { "common-ref" : "No Success" } ] } ] },
|
||||
|
||||
// *********************************************************************************
|
||||
{ "name" : "Get Configuration",
|
||||
"type" : "Message",
|
||||
"service" : "UIM",
|
||||
"id" : "0x003A",
|
||||
"since" : "1.30",
|
||||
"input" : [ { "name" : "Configuration Mask",
|
||||
"id" : "0x10",
|
||||
"type" : "TLV",
|
||||
"since" : "1.30",
|
||||
"format" : "guint32",
|
||||
"public-format" : "QmiUimConfiguration" } ],
|
||||
"output" : [ { "common-ref" : "Operation Result" },
|
||||
{ "name" : "Automatic Selection",
|
||||
"id" : "0x10",
|
||||
"type" : "TLV",
|
||||
"since" : "1.30",
|
||||
"format" : "guint8",
|
||||
"public-format" : "gboolean",
|
||||
"prerequisites" : [ { "common-ref" : "Success" } ] },
|
||||
{ "name" : "Personalization Status",
|
||||
"id" : "0x11",
|
||||
"type" : "TLV",
|
||||
"since" : "1.30",
|
||||
"format" : "array",
|
||||
"size-prefix-format" : "guint8",
|
||||
"array-element" : { "name" : "Element",
|
||||
"format" : "struct",
|
||||
"contents" : [ { "name" : "Feature",
|
||||
"format" : "guint8",
|
||||
"public-format" : "QmiUimCardApplicationPersonalizationFeature" },
|
||||
{ "name" : "Verify Left",
|
||||
"format" : "guint8" },
|
||||
{ "name" : "Unblock Left",
|
||||
"format" : "guint8" } ] },
|
||||
"prerequisites" : [ { "common-ref" : "Success" } ] },
|
||||
{ "name" : "Halt Subscription",
|
||||
"id" : "0x12",
|
||||
"type" : "TLV",
|
||||
"since" : "1.30",
|
||||
"format" : "guint8",
|
||||
"public-format" : "gboolean",
|
||||
"prerequisites" : [ { "common-ref" : "Success" } ] },
|
||||
{ "name" : "Personalization Status Other Slots",
|
||||
"id" : "0x13",
|
||||
"type" : "TLV",
|
||||
"since" : "1.30",
|
||||
"format" : "array",
|
||||
"size-prefix-format" : "guint8",
|
||||
"array-element" : { "name" : "Slots",
|
||||
"format" : "array",
|
||||
"size-prefix-format" : "guint8",
|
||||
"array-element" : { "name" : "Element",
|
||||
"format" : "struct",
|
||||
"contents" : [ { "name" : "Feature",
|
||||
"format" : "guint8",
|
||||
"public-format" : "QmiUimCardApplicationPersonalizationFeature" },
|
||||
{ "name" : "Verify Left",
|
||||
"format" : "guint8" },
|
||||
{ "name" : "Unblock Left",
|
||||
"format" : "guint8" } ] } },
|
||||
"prerequisites" : [ { "common-ref" : "Success" } ] } ] },
|
||||
|
||||
// *********************************************************************************
|
||||
{ "name" : "Refresh Register All",
|
||||
"type" : "Message",
|
||||
"service" : "UIM",
|
||||
"id" : "0x0044",
|
||||
"since" : "1.28",
|
||||
"input" : [ { "common-ref" : "UIM Session",
|
||||
"since" : "1.28" },
|
||||
{ "name" : "Info",
|
||||
"id" : "0x02",
|
||||
"type" : "TLV",
|
||||
"since" : "1.28",
|
||||
"format" : "sequence",
|
||||
"contents" : [ { "name" : "Register Flag",
|
||||
"format" : "guint8",
|
||||
"public-format" : "gboolean" } ] } ],
|
||||
"output" : [ { "common-ref" : "Operation Result" } ] },
|
||||
|
||||
// *********************************************************************************
|
||||
{ "name" : "Switch Slot",
|
||||
"type" : "Message",
|
||||
"service" : "UIM",
|
||||
"id" : "0x0046",
|
||||
"since" : "1.26",
|
||||
"input" : [ { "name" : "Logical Slot",
|
||||
"id" : "0x01",
|
||||
"type" : "TLV",
|
||||
"since" : "1.26",
|
||||
"format" : "guint8" },
|
||||
{ "name" : "Physical Slot",
|
||||
"id" : "0x02",
|
||||
"type" : "TLV",
|
||||
"since" : "1.26",
|
||||
"format" : "guint32" } ],
|
||||
"output" : [ { "common-ref" : "Operation Result" } ] },
|
||||
|
||||
// *********************************************************************************
|
||||
{ "name" : "Get Slot Status",
|
||||
"type" : "Message",
|
||||
"service" : "UIM",
|
||||
"id" : "0x0047",
|
||||
"since" : "1.26",
|
||||
"output" : [ { "common-ref" : "Operation Result" },
|
||||
{ "common-ref" : "Physical Slot Status",
|
||||
"since" : "1.26" },
|
||||
{ "common-ref" : "Physical Slot Information",
|
||||
"since" : "1.26" },
|
||||
{ "common-ref" : "Slot EID Information",
|
||||
"since" : "1.26" } ] },
|
||||
|
||||
// *********************************************************************************
|
||||
{ "name" : "Slot Status",
|
||||
"type" : "Indication",
|
||||
"service" : "UIM",
|
||||
"id" : "0x0048",
|
||||
"since" : "1.26",
|
||||
"output" : [ { "common-ref" : "Physical Slot Status",
|
||||
"since" : "1.26" },
|
||||
{ "common-ref" : "Physical Slot Information",
|
||||
"since" : "1.26" },
|
||||
{ "common-ref" : "Slot EID Information",
|
||||
"since" : "1.26" } ] }
|
||||
|
||||
]
|
@ -0,0 +1,252 @@
|
||||
|
||||
[
|
||||
// *********************************************************************************
|
||||
{ "name" : "WDA",
|
||||
"type" : "Service" },
|
||||
|
||||
// *********************************************************************************
|
||||
{ "name" : "QMI Client WDA",
|
||||
"type" : "Client",
|
||||
"since" : "1.10" },
|
||||
|
||||
// *********************************************************************************
|
||||
{ "name" : "QMI Message WDA",
|
||||
"type" : "Message-ID-Enum" },
|
||||
|
||||
// *********************************************************************************
|
||||
{ "name" : "Get Supported Messages",
|
||||
"type" : "Message",
|
||||
"service" : "WDA",
|
||||
"id" : "0x001E",
|
||||
"since" : "1.14",
|
||||
"output" : [ { "common-ref" : "Operation Result" },
|
||||
{ "name" : "List",
|
||||
"id" : "0x10",
|
||||
"type" : "TLV",
|
||||
"since" : "1.14",
|
||||
"format" : "array",
|
||||
"size-prefix-format" : "guint16",
|
||||
"array-element" : { "format" : "guint8" },
|
||||
"prerequisites" : [ { "common-ref" : "Success" } ] } ] },
|
||||
|
||||
// *********************************************************************************
|
||||
{ "name" : "Set Data Format",
|
||||
"type" : "Message",
|
||||
"service" : "WDA",
|
||||
"id" : "0x0020",
|
||||
"since" : "1.10",
|
||||
"input" : [ { "name" : "QoS Format",
|
||||
"id" : "0x10",
|
||||
"type" : "TLV",
|
||||
"since" : "1.10",
|
||||
"format" : "guint8",
|
||||
"public-format" : "gboolean" },
|
||||
{ "name" : "Link Layer Protocol",
|
||||
"id" : "0x11",
|
||||
"type" : "TLV",
|
||||
"since" : "1.10",
|
||||
"format" : "guint32",
|
||||
"public-format" : "QmiWdaLinkLayerProtocol" },
|
||||
{ "name" : "Uplink Data Aggregation Protocol",
|
||||
"id" : "0x12",
|
||||
"type" : "TLV",
|
||||
"since" : "1.10",
|
||||
"format" : "guint32",
|
||||
"public-format" : "QmiWdaDataAggregationProtocol" },
|
||||
{ "name" : "Downlink Data Aggregation Protocol",
|
||||
"id" : "0x13",
|
||||
"type" : "TLV",
|
||||
"since" : "1.10",
|
||||
"format" : "guint32",
|
||||
"public-format" : "QmiWdaDataAggregationProtocol" },
|
||||
{ "name" : "NDP Signature",
|
||||
"id" : "0x14",
|
||||
"type" : "TLV",
|
||||
"since" : "1.10",
|
||||
"format" : "guint32" },
|
||||
{ "name" : "Downlink Data Aggregation Max Datagrams",
|
||||
"id" : "0x15",
|
||||
"type" : "TLV",
|
||||
"since" : "1.10",
|
||||
"format" : "guint32" },
|
||||
{ "name" : "Downlink Data Aggregation Max Size",
|
||||
"id" : "0x16",
|
||||
"type" : "TLV",
|
||||
"since" : "1.10",
|
||||
"format" : "guint32" },
|
||||
{ "name" : "Endpoint Info",
|
||||
"id" : "0x17",
|
||||
"type" : "TLV",
|
||||
"since" : "1.18",
|
||||
"format" : "sequence",
|
||||
"contents" : [ { "name" : "Endpoint Type",
|
||||
"format" : "guint32",
|
||||
"public-format" : "QmiDataEndpointType"},
|
||||
{ "name" : "Interface Number",
|
||||
"format" : "guint32"}] }],
|
||||
"output" : [ { "common-ref" : "Operation Result" },
|
||||
{ "name" : "QoS Format",
|
||||
"id" : "0x10",
|
||||
"type" : "TLV",
|
||||
"since" : "1.10",
|
||||
"format" : "guint8",
|
||||
"public-format" : "gboolean",
|
||||
"prerequisites": [ { "common-ref" : "Success" } ] },
|
||||
{ "name" : "Link Layer Protocol",
|
||||
"id" : "0x11",
|
||||
"type" : "TLV",
|
||||
"since" : "1.10",
|
||||
"format" : "guint32",
|
||||
"public-format" : "QmiWdaLinkLayerProtocol",
|
||||
"prerequisites" : [ { "common-ref" : "Success" } ] },
|
||||
{ "name" : "Uplink Data Aggregation Protocol",
|
||||
"id" : "0x12",
|
||||
"type" : "TLV",
|
||||
"since" : "1.10",
|
||||
"format" : "guint32",
|
||||
"public-format" : "QmiWdaDataAggregationProtocol",
|
||||
"prerequisites" : [ { "common-ref" : "Success" } ] },
|
||||
{ "name" : "Downlink Data Aggregation Protocol",
|
||||
"id" : "0x13",
|
||||
"type" : "TLV",
|
||||
"since" : "1.10",
|
||||
"format" : "guint32",
|
||||
"public-format" : "QmiWdaDataAggregationProtocol",
|
||||
"prerequisites" : [ { "common-ref" : "Success" } ] },
|
||||
{ "name" : "NDP Signature",
|
||||
"id" : "0x14",
|
||||
"type" : "TLV",
|
||||
"since" : "1.10",
|
||||
"format" : "guint32",
|
||||
"prerequisites" : [ { "common-ref" : "Success" } ] },
|
||||
{ "name" : "Downlink Data Aggregation Max Datagrams",
|
||||
"id" : "0x15",
|
||||
"type" : "TLV",
|
||||
"since" : "1.10",
|
||||
"format" : "guint32",
|
||||
"prerequisites" : [ { "common-ref" : "Success" } ] },
|
||||
{ "name" : "Downlink Data Aggregation Max Size",
|
||||
"id" : "0x16",
|
||||
"type" : "TLV",
|
||||
"since" : "1.10",
|
||||
"format" : "guint32",
|
||||
"prerequisites" : [ { "common-ref" : "Success" } ] },
|
||||
{ "name" : "Uplink Data Aggregation Max Datagrams",
|
||||
"id" : "0x17",
|
||||
"type" : "TLV",
|
||||
"since" : "1.30",
|
||||
"format" : "guint32",
|
||||
"prerequisites" : [ { "common-ref" : "Success" } ] },
|
||||
{ "name" : "Uplink Data Aggregation Max Size",
|
||||
"id" : "0x18",
|
||||
"type" : "TLV",
|
||||
"since" : "1.30",
|
||||
"format" : "guint32",
|
||||
"prerequisites" : [ { "common-ref" : "Success" } ] },
|
||||
{ "name" : "Download Minimum Padding",
|
||||
"id" : "0x1A",
|
||||
"type" : "TLV",
|
||||
"since" : "1.30",
|
||||
"format" : "guint32",
|
||||
"prerequisites" : [ { "common-ref" : "Success" } ] },
|
||||
{ "name" : "Flow Control",
|
||||
"id" : "0x1B",
|
||||
"type" : "TLV",
|
||||
"since" : "1.30",
|
||||
"format" : "guint8",
|
||||
"prerequisites" : [ { "common-ref" : "Success" } ] } ] },
|
||||
|
||||
// *********************************************************************************
|
||||
{ "name" : "Get Data Format",
|
||||
"type" : "Message",
|
||||
"service" : "WDA",
|
||||
"id" : "0x0021",
|
||||
"since" : "1.10",
|
||||
"input" : [ { "name" : "Endpoint Info",
|
||||
"id" : "0x10",
|
||||
"mandatory" : "no",
|
||||
"type" : "TLV",
|
||||
"since" : "1.26",
|
||||
"format" : "sequence",
|
||||
"contents" : [ { "name" : "Endpoint Type",
|
||||
"format" : "guint32",
|
||||
"public-format" : "QmiDataEndpointType"},
|
||||
{ "name" : "Interface Number",
|
||||
"format" : "guint32"} ] } ],
|
||||
"output" : [ { "common-ref" : "Operation Result" },
|
||||
{ "name" : "QoS Format",
|
||||
"id" : "0x10",
|
||||
"type" : "TLV",
|
||||
"since" : "1.10",
|
||||
"format" : "guint8",
|
||||
"public-format" : "gboolean",
|
||||
"prerequisites": [ { "common-ref" : "Success" } ] },
|
||||
{ "name" : "Link Layer Protocol",
|
||||
"id" : "0x11",
|
||||
"type" : "TLV",
|
||||
"since" : "1.10",
|
||||
"format" : "guint32",
|
||||
"public-format" : "QmiWdaLinkLayerProtocol",
|
||||
"prerequisites" : [ { "common-ref" : "Success" } ] },
|
||||
{ "name" : "Uplink Data Aggregation Protocol",
|
||||
"id" : "0x12",
|
||||
"type" : "TLV",
|
||||
"since" : "1.10",
|
||||
"format" : "guint32",
|
||||
"public-format" : "QmiWdaDataAggregationProtocol",
|
||||
"prerequisites" : [ { "common-ref" : "Success" } ] },
|
||||
{ "name" : "Downlink Data Aggregation Protocol",
|
||||
"id" : "0x13",
|
||||
"type" : "TLV",
|
||||
"since" : "1.10",
|
||||
"format" : "guint32",
|
||||
"public-format" : "QmiWdaDataAggregationProtocol",
|
||||
"prerequisites" : [ { "common-ref" : "Success" } ] },
|
||||
{ "name" : "NDP Signature",
|
||||
"id" : "0x14",
|
||||
"type" : "TLV",
|
||||
"since" : "1.10",
|
||||
"format" : "guint32",
|
||||
"prerequisites" : [ { "common-ref" : "Success" } ] },
|
||||
{ "name" : "Downlink Data Aggregation Max Datagrams",
|
||||
"id" : "0x15",
|
||||
"type" : "TLV",
|
||||
"since" : "1.24.6",
|
||||
"format" : "guint32",
|
||||
"prerequisites" : [ { "common-ref" : "Success" } ] },
|
||||
{ "name" : "Downlink Data Aggregation Max Size",
|
||||
"id" : "0x16",
|
||||
"type" : "TLV",
|
||||
"since" : "1.10",
|
||||
"format" : "guint32",
|
||||
"prerequisites" : [ { "common-ref" : "Success" } ] },
|
||||
{ "name" : "Uplink Data Aggregation Max Datagrams",
|
||||
"id" : "0x17",
|
||||
"type" : "TLV",
|
||||
"since" : "1.30",
|
||||
"format" : "guint32",
|
||||
"prerequisites" : [ { "common-ref" : "Success" } ] },
|
||||
// We mistakenly had a different TLV named as "Uplink Data
|
||||
// Aggregation Max Size" since 1.10, and since then we kept
|
||||
// compat support to avoid breaking API/ABI. We now introduce
|
||||
// the correct TLV named in the same way, and so we keep the
|
||||
// original "since" tag and we remove the compat symbols.
|
||||
{ "name" : "Uplink Data Aggregation Max Size",
|
||||
"id" : "0x18",
|
||||
"type" : "TLV",
|
||||
"since" : "1.10",
|
||||
"format" : "guint32",
|
||||
"prerequisites" : [ { "common-ref" : "Success" } ] },
|
||||
{ "name" : "Download Minimum Padding",
|
||||
"id" : "0x1A",
|
||||
"type" : "TLV",
|
||||
"since" : "1.30",
|
||||
"format" : "guint32",
|
||||
"prerequisites" : [ { "common-ref" : "Success" } ] },
|
||||
{ "name" : "Flow Control",
|
||||
"id" : "0x1B",
|
||||
"type" : "TLV",
|
||||
"since" : "1.30",
|
||||
"format" : "guint8",
|
||||
"prerequisites" : [ { "common-ref" : "Success" } ] } ] }
|
||||
]
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,665 @@
|
||||
|
||||
[
|
||||
// *********************************************************************************
|
||||
{ "name" : "WMS",
|
||||
"type" : "Service" },
|
||||
|
||||
// *********************************************************************************
|
||||
{ "name" : "QMI Client WMS",
|
||||
"type" : "Client",
|
||||
"since" : "1.0" },
|
||||
|
||||
// *********************************************************************************
|
||||
{ "name" : "QMI Message WMS",
|
||||
"type" : "Message-ID-Enum" },
|
||||
|
||||
// *********************************************************************************
|
||||
{ "name" : "QMI Indication WMS",
|
||||
"type" : "Indication-ID-Enum" },
|
||||
|
||||
// *********************************************************************************
|
||||
{ "name" : "Reset",
|
||||
"type" : "Message",
|
||||
"service" : "WMS",
|
||||
"id" : "0x0000",
|
||||
"since" : "1.0",
|
||||
"output" : [ { "common-ref" : "Operation Result" } ] },
|
||||
|
||||
// *********************************************************************************
|
||||
{ "name" : "Set Event Report",
|
||||
"type" : "Message",
|
||||
"service" : "WMS",
|
||||
"id" : "0x0001",
|
||||
"since" : "1.0",
|
||||
"input" : [ { "name" : "New MT Message Indicator",
|
||||
"id" : "0x10",
|
||||
"type" : "TLV",
|
||||
"since" : "1.0",
|
||||
"format" : "sequence",
|
||||
"contents" : [ { "name" : "Report",
|
||||
"format" : "guint8",
|
||||
"public-format" : "gboolean" } ] } ],
|
||||
"output" : [ { "common-ref" : "Operation Result" } ] },
|
||||
|
||||
{ "name" : "Event Report",
|
||||
"type" : "Indication",
|
||||
"service" : "WMS",
|
||||
"id" : "0x0001",
|
||||
"since" : "1.0",
|
||||
"output" : [ { "name" : "MT Message",
|
||||
"id" : "0x10",
|
||||
"type" : "TLV",
|
||||
"since" : "1.0",
|
||||
"format" : "sequence",
|
||||
"contents" : [ { "name" : "Storage Type",
|
||||
"format" : "guint8",
|
||||
"public-format" : "QmiWmsStorageType" },
|
||||
{ "name" : "Memory Index",
|
||||
"format" : "guint32" } ] },
|
||||
{ "name" : "Transfer Route MT Message",
|
||||
"id" : "0x11",
|
||||
"type" : "TLV",
|
||||
"since" : "1.0",
|
||||
"format" : "sequence",
|
||||
"contents" : [ { "name" : "Ack Indicator",
|
||||
"format" : "guint8",
|
||||
"public-format" : "QmiWmsAckIndicator" },
|
||||
{ "name" : "Transaction ID",
|
||||
"format" : "guint32" },
|
||||
{ "name" : "Format",
|
||||
"format" : "guint8",
|
||||
"public-format" : "QmiWmsMessageFormat" },
|
||||
{ "name" : "Raw Data",
|
||||
"format" : "array",
|
||||
"size-prefix-format" : "guint16",
|
||||
"array-element" : { "format" : "guint8" } } ] },
|
||||
{ "name" : "Message Mode",
|
||||
"id" : "0x12",
|
||||
"type" : "TLV",
|
||||
"since" : "1.0",
|
||||
"format" : "guint8",
|
||||
"public-format" : "QmiWmsMessageMode" },
|
||||
{ "name" : "ETWS Message",
|
||||
"id" : "0x13",
|
||||
"type" : "TLV",
|
||||
"since" : "1.0",
|
||||
"format" : "sequence",
|
||||
"contents" : [ { "name" : "Notification Type",
|
||||
"format" : "guint8",
|
||||
"public-format" : "QmiWmsNotificationType" },
|
||||
{ "name" : "Raw Data",
|
||||
"format" : "array",
|
||||
"size-prefix-format" : "guint16",
|
||||
"array-element" : { "format" : "guint8" } } ] },
|
||||
{ "name" : "ETWS PLMN Information",
|
||||
"id" : "0x14",
|
||||
"type" : "TLV",
|
||||
"since" : "1.0",
|
||||
"format" : "sequence",
|
||||
"contents" : [ { "name" : "MCC",
|
||||
"format" : "guint16" },
|
||||
{ "name" : "MNC",
|
||||
"format" : "guint16" } ] },
|
||||
{ "name" : "SMSC Address",
|
||||
"id" : "0x15",
|
||||
"type" : "TLV",
|
||||
"since" : "1.0",
|
||||
"format" : "string" },
|
||||
{ "name" : "SMS on IMS",
|
||||
"id" : "0x16",
|
||||
"type" : "TLV",
|
||||
"since" : "1.0",
|
||||
"format" : "guint8",
|
||||
"public-format" : "gboolean" } ] },
|
||||
|
||||
// *********************************************************************************
|
||||
{ "name" : "Get Supported Messages",
|
||||
"type" : "Message",
|
||||
"service" : "WMS",
|
||||
"id" : "0x001E",
|
||||
"since" : "1.14",
|
||||
"output" : [ { "common-ref" : "Operation Result" },
|
||||
{ "name" : "List",
|
||||
"id" : "0x10",
|
||||
"type" : "TLV",
|
||||
"since" : "1.14",
|
||||
"format" : "array",
|
||||
"size-prefix-format" : "guint16",
|
||||
"array-element" : { "format" : "guint8" },
|
||||
"prerequisites" : [ { "common-ref" : "Success" } ] } ] },
|
||||
|
||||
// *********************************************************************************
|
||||
{ "name" : "Raw Send",
|
||||
"type" : "Message",
|
||||
"service" : "WMS",
|
||||
"id" : "0x0020",
|
||||
"since" : "1.0",
|
||||
"input" : [ { "name" : "Raw Message Data",
|
||||
"id" : "0x01",
|
||||
"type" : "TLV",
|
||||
"since" : "1.0",
|
||||
"format" : "sequence",
|
||||
"contents" : [ { "name" : "Format",
|
||||
"format" : "guint8",
|
||||
"public-format" : "QmiWmsMessageFormat" },
|
||||
{ "name" : "Raw Data",
|
||||
"format" : "array",
|
||||
"size-prefix-format" : "guint16",
|
||||
"array-element" : { "format" : "guint8" } } ] },
|
||||
{ "name" : "CDMA Force On DC",
|
||||
"id" : "0x10",
|
||||
"type" : "TLV",
|
||||
"since" : "1.0",
|
||||
"format" : "sequence",
|
||||
"contents" : [ { "name" : "Force",
|
||||
"format" : "guint8",
|
||||
"public-format" : "gboolean" },
|
||||
{ "name" : "Service Option",
|
||||
"format" : "guint8",
|
||||
"public-format" : "QmiWmsCdmaServiceOption" } ] },
|
||||
{ "name" : "CDMA Follow On DC",
|
||||
"id" : "0x11",
|
||||
"type" : "TLV",
|
||||
"since" : "1.0",
|
||||
"format" : "sequence",
|
||||
"contents" : [ { "name" : "Follow",
|
||||
"format" : "guint8",
|
||||
"public-format" : "gboolean" } ] },
|
||||
{ "name" : "GSM WCDMA Link Timer",
|
||||
"id" : "0x12",
|
||||
"type" : "TLV",
|
||||
"since" : "1.0",
|
||||
"format" : "guint8" },
|
||||
{ "name" : "SMS on IMS",
|
||||
"id" : "0x13",
|
||||
"type" : "TLV",
|
||||
"since" : "1.0",
|
||||
"format" : "guint8",
|
||||
"public-format" : "gboolean" } ],
|
||||
"output" : [ { "common-ref" : "Operation Result" },
|
||||
{ "name" : "Message ID",
|
||||
"id" : "0x01",
|
||||
// Even if we have this TLV as mandatory, it seems it really isn't
|
||||
"type" : "TLV",
|
||||
"since" : "1.0",
|
||||
"format" : "guint16",
|
||||
"prerequisites" : [ { "common-ref" : "Success" } ] },
|
||||
{ "name" : "CDMA Cause Code",
|
||||
"id" : "0x10",
|
||||
"type" : "TLV",
|
||||
"since" : "1.0",
|
||||
"format" : "guint16",
|
||||
"public-format" : "QmiWmsCdmaCauseCode",
|
||||
"prerequisites" : [ { "field" : "Result.Error Status",
|
||||
"operation" : "!=",
|
||||
"value" : "QMI_STATUS_SUCCESS" },
|
||||
{ "field" : "Result.Error Code",
|
||||
"operation" : "==",
|
||||
"value" : "QMI_PROTOCOL_ERROR_WMS_CAUSE_CODE" } ] },
|
||||
{ "name" : "CDMA Error Class",
|
||||
"id" : "0x11",
|
||||
"type" : "TLV",
|
||||
"since" : "1.0",
|
||||
"format" : "guint8",
|
||||
"public-format" : "QmiWmsCdmaErrorClass",
|
||||
"prerequisites" : [ { "field" : "Result.Error Status",
|
||||
"operation" : "!=",
|
||||
"value" : "QMI_STATUS_SUCCESS" },
|
||||
{ "field" : "Result.Error Code",
|
||||
"operation" : "==",
|
||||
"value" : "QMI_PROTOCOL_ERROR_WMS_CAUSE_CODE" } ] },
|
||||
{ "name" : "GSM WCDMA Cause Info",
|
||||
"id" : "0x12",
|
||||
"type" : "TLV",
|
||||
"since" : "1.0",
|
||||
"format" : "sequence",
|
||||
"contents" : [ { "name" : "RP Cause",
|
||||
"format" : "guint16",
|
||||
"public-format" : "QmiWmsGsmUmtsRpCause" },
|
||||
{ "name" : "TP Cause",
|
||||
"format" : "guint8",
|
||||
"public-format" : "QmiWmsGsmUmtsTpCause" } ],
|
||||
"prerequisites" : [ { "field" : "Result.Error Status",
|
||||
"operation" : "!=",
|
||||
"value" : "QMI_STATUS_SUCCESS" },
|
||||
{ "field" : "Result.Error Code",
|
||||
"operation" : "==",
|
||||
"value" : "QMI_PROTOCOL_ERROR_WMS_CAUSE_CODE" } ] },
|
||||
{ "name" : "Message Delivery Failure Type",
|
||||
"id" : "0x13",
|
||||
"type" : "TLV",
|
||||
"since" : "1.0",
|
||||
"format" : "guint8",
|
||||
"public-format" : "QmiWmsMessageDeliveryFailureType",
|
||||
"prerequisites" : [ { "field" : "Result.Error Status",
|
||||
"operation" : "!=",
|
||||
"value" : "QMI_STATUS_SUCCESS" },
|
||||
{ "field" : "Result.Error Code",
|
||||
"operation" : "==",
|
||||
"value" : "QMI_PROTOCOL_ERROR_WMS_CAUSE_CODE" } ] } ] },
|
||||
|
||||
// *********************************************************************************
|
||||
{ "name" : "Raw Write",
|
||||
"type" : "Message",
|
||||
"service" : "WMS",
|
||||
"id" : "0x0021",
|
||||
"since" : "1.0",
|
||||
"input" : [ { "name" : "Raw Message Data",
|
||||
"id" : "0x01",
|
||||
"type" : "TLV",
|
||||
"since" : "1.0",
|
||||
"format" : "sequence",
|
||||
"contents" : [ { "name" : "Storage Type",
|
||||
"format" : "guint8",
|
||||
"public-format" : "QmiWmsStorageType" },
|
||||
{ "name" : "Format",
|
||||
"format" : "guint8",
|
||||
"public-format" : "QmiWmsMessageFormat" },
|
||||
{ "name" : "Raw Data",
|
||||
"format" : "array",
|
||||
"size-prefix-format" : "guint16",
|
||||
"array-element" : { "format" : "guint8" } } ] } ],
|
||||
"output" : [ { "common-ref" : "Operation Result" },
|
||||
{ "name" : "Memory Index",
|
||||
"id" : "0x01",
|
||||
"type" : "TLV",
|
||||
"since" : "1.0",
|
||||
"format" : "guint32",
|
||||
"prerequisites" : [ { "common-ref" : "Success" } ] } ] },
|
||||
|
||||
// *********************************************************************************
|
||||
{ "name" : "Raw Read",
|
||||
"type" : "Message",
|
||||
"service" : "WMS",
|
||||
"id" : "0x0022",
|
||||
"since" : "1.0",
|
||||
"input" : [ { "name" : "Message Memory Storage ID",
|
||||
"id" : "0x01",
|
||||
"type" : "TLV",
|
||||
"since" : "1.0",
|
||||
"format" : "sequence",
|
||||
"contents" : [ { "name" : "Storage Type",
|
||||
"format" : "guint8",
|
||||
"public-format" : "QmiWmsStorageType" },
|
||||
{ "name" : "Memory Index",
|
||||
"format" : "guint32" } ] },
|
||||
{ "name" : "Message Mode",
|
||||
"id" : "0x10",
|
||||
"type" : "TLV",
|
||||
"since" : "1.0",
|
||||
"format" : "guint8",
|
||||
"public-format" : "QmiWmsMessageMode" },
|
||||
{ "name" : "SMS on IMS",
|
||||
"id" : "0x11",
|
||||
"type" : "TLV",
|
||||
"since" : "1.0",
|
||||
"format" : "guint8",
|
||||
"public-format" : "gboolean" } ],
|
||||
"output" : [ { "common-ref" : "Operation Result" },
|
||||
{ "name" : "Raw Message Data",
|
||||
"id" : "0x01",
|
||||
"type" : "TLV",
|
||||
"since" : "1.0",
|
||||
"format" : "sequence",
|
||||
"contents" : [ { "name" : "Message Tag",
|
||||
"format" : "guint8",
|
||||
"public-format" : "QmiWmsMessageTagType" },
|
||||
{ "name" : "Format",
|
||||
"format" : "guint8",
|
||||
"public-format" : "QmiWmsMessageFormat" },
|
||||
{ "name" : "Raw Data",
|
||||
"format" : "array",
|
||||
"size-prefix-format" : "guint16",
|
||||
"array-element" : { "format" : "guint8" } } ],
|
||||
"prerequisites" : [ { "common-ref" : "Success" } ] } ] },
|
||||
|
||||
// *********************************************************************************
|
||||
{ "name" : "Modify Tag",
|
||||
"type" : "Message",
|
||||
"service" : "WMS",
|
||||
"id" : "0x0023",
|
||||
"since" : "1.0",
|
||||
"input" : [ { "name" : "Message Tag",
|
||||
"id" : "0x01",
|
||||
"type" : "TLV",
|
||||
"since" : "1.0",
|
||||
"format" : "sequence",
|
||||
"contents" : [ { "name" : "Storage Type",
|
||||
"format" : "guint8",
|
||||
"public-format" : "QmiWmsStorageType" },
|
||||
{ "name" : "Memory Index",
|
||||
"format" : "guint32" },
|
||||
{ "name" : "Message Tag",
|
||||
"format" : "guint8",
|
||||
"public-format" : "QmiWmsMessageTagType" } ] },
|
||||
{ "name" : "Message Mode",
|
||||
"id" : "0x10",
|
||||
"type" : "TLV",
|
||||
"since" : "1.0",
|
||||
"format" : "guint8",
|
||||
"public-format" : "QmiWmsMessageMode" } ],
|
||||
"output" : [ { "common-ref" : "Operation Result" } ] },
|
||||
|
||||
// *********************************************************************************
|
||||
{ "name" : "Delete",
|
||||
"type" : "Message",
|
||||
"service" : "WMS",
|
||||
"id" : "0x0024",
|
||||
"since" : "1.0",
|
||||
"input" : [ { "name" : "Memory Storage",
|
||||
"id" : "0x01",
|
||||
"type" : "TLV",
|
||||
"since" : "1.0",
|
||||
"format" : "guint8",
|
||||
"public-format" : "QmiWmsStorageType" },
|
||||
{ "name" : "Memory Index",
|
||||
"id" : "0x10",
|
||||
"type" : "TLV",
|
||||
"since" : "1.0",
|
||||
"format" : "guint32" },
|
||||
{ "name" : "Message Tag",
|
||||
"id" : "0x11",
|
||||
"type" : "TLV",
|
||||
"since" : "1.0",
|
||||
"format" : "guint8",
|
||||
"public-format" : "QmiWmsMessageTagType" },
|
||||
{ "name" : "Message Mode",
|
||||
"id" : "0x12",
|
||||
"type" : "TLV",
|
||||
"since" : "1.0",
|
||||
"format" : "guint8",
|
||||
"public-format" : "QmiWmsMessageMode" } ],
|
||||
"output" : [ { "common-ref" : "Operation Result" } ] },
|
||||
|
||||
// *********************************************************************************
|
||||
{ "name" : "Get Message Protocol",
|
||||
"type" : "Message",
|
||||
"service" : "WMS",
|
||||
"id" : "0x0030",
|
||||
"since" : "1.0",
|
||||
"output" : [ { "common-ref" : "Operation Result" },
|
||||
{ "name" : "Message Protocol",
|
||||
"id" : "0x01",
|
||||
"type" : "TLV",
|
||||
"since" : "1.0",
|
||||
"format" : "guint8",
|
||||
"public-format" : "QmiWmsMessageProtocol",
|
||||
"prerequisites" : [ { "common-ref" : "Success" } ] } ] },
|
||||
|
||||
// *********************************************************************************
|
||||
{ "name" : "List Messages",
|
||||
"type" : "Message",
|
||||
"service" : "WMS",
|
||||
"id" : "0x0031",
|
||||
"since" : "1.0",
|
||||
"input" : [ { "name" : "Storage Type",
|
||||
"id" : "0x01",
|
||||
"type" : "TLV",
|
||||
"since" : "1.0",
|
||||
"format" : "guint8",
|
||||
"public-format" : "QmiWmsStorageType" },
|
||||
{ "name" : "Message Tag",
|
||||
"id" : "0x11",
|
||||
"type" : "TLV",
|
||||
"since" : "1.0",
|
||||
"format" : "guint8",
|
||||
"public-format" : "QmiWmsMessageTagType" },
|
||||
{ "name" : "Message Mode",
|
||||
"id" : "0x12",
|
||||
"type" : "TLV",
|
||||
"since" : "1.0",
|
||||
"format" : "guint8",
|
||||
"public-format" : "QmiWmsMessageMode" } ],
|
||||
"output" : [ { "common-ref" : "Operation Result" },
|
||||
{ "name" : "Message List",
|
||||
"id" : "0x01",
|
||||
"type" : "TLV",
|
||||
"since" : "1.0",
|
||||
"format" : "array",
|
||||
"size-prefix-format" : "guint32" ,
|
||||
"array-element" : { "name" : "Element",
|
||||
"format" : "struct",
|
||||
"contents" : [ { "name" : "Memory Index",
|
||||
"format" : "guint32" },
|
||||
{ "name" : "Message Tag",
|
||||
"format" : "guint8",
|
||||
"public-format" : "QmiWmsMessageTagType" } ] },
|
||||
"prerequisites" : [ { "common-ref" : "Success" } ] } ] },
|
||||
|
||||
// *********************************************************************************
|
||||
{ "name" : "Set Routes",
|
||||
"type" : "Message",
|
||||
"service" : "WMS",
|
||||
"id" : "0x0032",
|
||||
"since" : "1.0",
|
||||
"input" : [ { "name" : "Route List",
|
||||
"id" : "0x01",
|
||||
"type" : "TLV",
|
||||
"since" : "1.0",
|
||||
"format" : "array",
|
||||
"size-prefix-format" : "guint16",
|
||||
"array-element" : { "name" : "Element",
|
||||
"format" : "struct",
|
||||
"contents" : [ { "name" : "Message Type",
|
||||
"format" : "guint8",
|
||||
"public-format" : "QmiWmsMessageType" },
|
||||
{ "name" : "Message Class",
|
||||
"format" : "guint8",
|
||||
"public-format" : "QmiWmsMessageClass" },
|
||||
{ "name" : "Storage",
|
||||
"format" : "guint8",
|
||||
"public-format" : "QmiWmsStorageType" },
|
||||
{ "name" : "Receipt Action",
|
||||
"format" : "guint8",
|
||||
"public-format" : "QmiWmsReceiptAction" } ] } },
|
||||
{ "name" : "Transfer Status Report",
|
||||
"id" : "0x10",
|
||||
"type" : "TLV",
|
||||
"since" : "1.0",
|
||||
"format" : "guint8",
|
||||
"public-format" : "QmiWmsTransferIndication" } ],
|
||||
"output" : [ { "common-ref" : "Operation Result" } ] },
|
||||
|
||||
// *********************************************************************************
|
||||
{ "name" : "Get Routes",
|
||||
"type" : "Message",
|
||||
"service" : "WMS",
|
||||
"id" : "0x0033",
|
||||
"since" : "1.0",
|
||||
"output" : [ { "common-ref" : "Operation Result" },
|
||||
{ "name" : "Route List",
|
||||
"id" : "0x01",
|
||||
"type" : "TLV",
|
||||
"since" : "1.0",
|
||||
"format" : "array",
|
||||
"size-prefix-format" : "guint16",
|
||||
"array-element" : { "name" : "Element",
|
||||
"format" : "struct",
|
||||
"contents" : [ { "name" : "Message Type",
|
||||
"format" : "guint8",
|
||||
"public-format" : "QmiWmsMessageType" },
|
||||
{ "name" : "Message Class",
|
||||
"format" : "guint8",
|
||||
"public-format" : "QmiWmsMessageClass" },
|
||||
{ "name" : "Storage",
|
||||
"format" : "guint8",
|
||||
"public-format" : "QmiWmsStorageType" },
|
||||
{ "name" : "Receipt Action",
|
||||
"format" : "guint8",
|
||||
"public-format" : "QmiWmsReceiptAction" } ] },
|
||||
"prerequisites" : [ { "common-ref" : "Success" } ] },
|
||||
{ "name" : "Transfer Status Report",
|
||||
"id" : "0x10",
|
||||
"type" : "TLV",
|
||||
"since" : "1.0",
|
||||
"format" : "guint8",
|
||||
"public-format" : "QmiWmsTransferIndication",
|
||||
"prerequisites" : [ { "common-ref" : "Success" } ] } ] },
|
||||
|
||||
// *********************************************************************************
|
||||
{ "name" : "Send Ack",
|
||||
"type" : "Message",
|
||||
"service" : "WMS",
|
||||
"id" : "0x0037",
|
||||
"since" : "1.28",
|
||||
"input" : [ { "name" : "Information",
|
||||
"id" : "0x01",
|
||||
"type" : "TLV",
|
||||
"since" : "1.28",
|
||||
"format" : "sequence",
|
||||
"contents" : [ { "name" : "Transaction ID",
|
||||
"format" : "guint32" },
|
||||
{ "name" : "Message Protocol",
|
||||
"format" : "guint8",
|
||||
"public-format" : "QmiWmsMessageProtocol" },
|
||||
{ "name" : "Success",
|
||||
"format" : "guint8",
|
||||
"public-format" : "gboolean" } ] },
|
||||
{ "name" : "Failure Information 3GPP2",
|
||||
"id" : "0x10",
|
||||
"type" : "TLV",
|
||||
"since" : "1.28",
|
||||
"format" : "sequence",
|
||||
"contents" : [ { "name" : "Error Class",
|
||||
"format" : "guint8",
|
||||
"public-format" : "QmiWmsCdmaErrorClass" },
|
||||
{ "name" : "Cause Code",
|
||||
"format" : "guint8",
|
||||
"public-format" : "QmiWmsCdmaCauseCode" } ] },
|
||||
{ "name" : "Failure Information 3GPP",
|
||||
"id" : "0x11",
|
||||
"type" : "TLV",
|
||||
"since" : "1.28",
|
||||
"format" : "sequence",
|
||||
"contents" : [ { "name" : "RP Cause",
|
||||
"format" : "guint8",
|
||||
"public-format" : "QmiWmsGsmUmtsRpCause" },
|
||||
{ "name" : "TP Cause",
|
||||
"format" : "guint8",
|
||||
"public-format" : "QmiWmsGsmUmtsTpCause" } ] },
|
||||
{ "name" : "SMS on IMS",
|
||||
"id" : "0x12",
|
||||
"type" : "TLV",
|
||||
"since" : "1.28",
|
||||
"format" : "guint8",
|
||||
"public-format" : "gboolean" } ],
|
||||
"output" : [ { "common-ref" : "Operation Result" },
|
||||
{ "name" : "Failure Cause",
|
||||
"id" : "0x10",
|
||||
"type" : "TLV",
|
||||
"since" : "1.28",
|
||||
"format" : "guint8",
|
||||
"public-format" : "QmiWmsAckFailureCause",
|
||||
"prerequisites" : [ { "field" : "Result.Error Status",
|
||||
"operation" : "!=",
|
||||
"value" : "QMI_STATUS_SUCCESS" },
|
||||
{ "field" : "Result.Error Code",
|
||||
"operation" : "==",
|
||||
"value" : "QMI_PROTOCOL_ERROR_ACK_NOT_SENT" } ] } ] },
|
||||
|
||||
// *********************************************************************************
|
||||
{ "name" : "Send From Memory Storage",
|
||||
"type" : "Message",
|
||||
"service" : "WMS",
|
||||
"id" : "0x0042",
|
||||
"since" : "1.0",
|
||||
"input" : [ { "name" : "Information",
|
||||
"id" : "0x01",
|
||||
"type" : "TLV",
|
||||
"since" : "1.0",
|
||||
"format" : "sequence",
|
||||
"contents" : [ { "name" : "Storage Type",
|
||||
"format" : "guint8",
|
||||
"public-format" : "QmiWmsStorageType" },
|
||||
{ "name" : "Memory Index",
|
||||
"format" : "guint32" },
|
||||
{ "name" : "Message Mode",
|
||||
"format" : "guint8",
|
||||
"public-format" : "QmiWmsMessageMode" } ] },
|
||||
{ "name" : "SMS on IMS",
|
||||
"id" : "0x10",
|
||||
"type" : "TLV",
|
||||
"since" : "1.0",
|
||||
"format" : "guint8",
|
||||
"public-format" : "gboolean" } ],
|
||||
"output" : [ { "common-ref" : "Operation Result" },
|
||||
{ "name" : "Message ID",
|
||||
"id" : "0x10",
|
||||
"type" : "TLV",
|
||||
"since" : "1.0",
|
||||
"format" : "guint16",
|
||||
"prerequisites" : [ { "common-ref" : "Success" } ] },
|
||||
{ "name" : "CDMA Cause Code",
|
||||
"id" : "0x11",
|
||||
"type" : "TLV",
|
||||
"since" : "1.0",
|
||||
"format" : "guint16",
|
||||
"public-format" : "QmiWmsCdmaCauseCode",
|
||||
"prerequisites" : [ { "field" : "Result.Error Status",
|
||||
"operation" : "!=",
|
||||
"value" : "QMI_STATUS_SUCCESS" },
|
||||
{ "field" : "Result.Error Code",
|
||||
"operation" : "==",
|
||||
"value" : "QMI_PROTOCOL_ERROR_WMS_CAUSE_CODE" } ] },
|
||||
{ "name" : "CDMA Error Class",
|
||||
"id" : "0x12",
|
||||
"type" : "TLV",
|
||||
"since" : "1.0",
|
||||
"format" : "guint8",
|
||||
"public-format" : "QmiWmsCdmaErrorClass",
|
||||
"prerequisites" : [ { "field" : "Result.Error Status",
|
||||
"operation" : "!=",
|
||||
"value" : "QMI_STATUS_SUCCESS" },
|
||||
{ "field" : "Result.Error Code",
|
||||
"operation" : "==",
|
||||
"value" : "QMI_PROTOCOL_ERROR_WMS_CAUSE_CODE" } ] },
|
||||
{ "name" : "GSM WCDMA Cause Info",
|
||||
"id" : "0x13",
|
||||
"type" : "TLV",
|
||||
"since" : "1.0",
|
||||
"format" : "sequence",
|
||||
"contents" : [ { "name" : "RP Cause",
|
||||
"format" : "guint16",
|
||||
"public-format" : "QmiWmsGsmUmtsRpCause" },
|
||||
{ "name" : "TP Cause",
|
||||
"format" : "guint8",
|
||||
"public-format" : "QmiWmsGsmUmtsTpCause" } ],
|
||||
"prerequisites" : [ { "field" : "Result.Error Status",
|
||||
"operation" : "!=",
|
||||
"value" : "QMI_STATUS_SUCCESS" },
|
||||
{ "field" : "Result.Error Code",
|
||||
"operation" : "==",
|
||||
"value" : "QMI_PROTOCOL_ERROR_WMS_CAUSE_CODE" } ] },
|
||||
{ "name" : "Message Delivery Failure Type",
|
||||
"id" : "0x14",
|
||||
"type" : "TLV",
|
||||
"since" : "1.0",
|
||||
"format" : "guint8",
|
||||
"public-format" : "QmiWmsMessageDeliveryFailureType",
|
||||
"prerequisites" : [ { "field" : "Result.Error Status",
|
||||
"operation" : "!=",
|
||||
"value" : "QMI_STATUS_SUCCESS" },
|
||||
{ "field" : "Result.Error Code",
|
||||
"operation" : "==",
|
||||
"value" : "QMI_PROTOCOL_ERROR_WMS_CAUSE_CODE" } ] } ] },
|
||||
|
||||
// *********************************************************************************
|
||||
{ "name" : "SMSC Address",
|
||||
"type" : "Indication",
|
||||
"service" : "WMS",
|
||||
"id" : "0x0046",
|
||||
"since" : "1.14",
|
||||
"output" : [ { "name" : "Address",
|
||||
"id" : "0x01",
|
||||
"type" : "TLV",
|
||||
"since" : "1.14",
|
||||
"format" : "sequence",
|
||||
"contents" : [ { "name" : "Type",
|
||||
"format" : "string",
|
||||
"fixed-size" : "3" },
|
||||
{ "name" : "Digits",
|
||||
"format" : "string",
|
||||
"size-prefix-format" : "guint8" } ] } ] }
|
||||
|
||||
|
||||
]
|
@ -0,0 +1,419 @@
|
||||
/*
|
||||
* uqmi -- tiny QMI support implementation
|
||||
*
|
||||
* Copyright (C) 2014-2015 Felix Fietkau <nbd@openwrt.org>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include "uqmi.h"
|
||||
#include "qmi-errors.h"
|
||||
#include "qmi-errors.c"
|
||||
#include "mbim.h"
|
||||
|
||||
bool cancel_all_requests = false;
|
||||
|
||||
#define __qmi_service(_n) [__##_n] = _n
|
||||
static const uint8_t qmi_services[__QMI_SERVICE_LAST] = {
|
||||
__qmi_services
|
||||
};
|
||||
#undef __qmi_service
|
||||
|
||||
#ifdef DEBUG_PACKET
|
||||
void dump_packet(const char *prefix, void *ptr, int len)
|
||||
{
|
||||
unsigned char *data = ptr;
|
||||
int i;
|
||||
|
||||
fprintf(stderr, "%s:", prefix);
|
||||
for (i = 0; i < len; i++)
|
||||
fprintf(stderr, " %02x", data[i]);
|
||||
fprintf(stderr, "\n");
|
||||
}
|
||||
#endif
|
||||
|
||||
static int
|
||||
qmi_get_service_idx(QmiService svc)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(qmi_services); i++)
|
||||
if (qmi_services[i] == svc)
|
||||
return i;
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
static void __qmi_request_complete(struct qmi_dev *qmi, struct qmi_request *req, struct qmi_msg *msg)
|
||||
{
|
||||
void *tlv_buf;
|
||||
int tlv_len;
|
||||
|
||||
if (!req->pending)
|
||||
return;
|
||||
|
||||
req->pending = false;
|
||||
list_del(&req->list);
|
||||
|
||||
if (msg) {
|
||||
tlv_buf = qmi_msg_get_tlv_buf(msg, &tlv_len);
|
||||
req->ret = qmi_check_message_status(tlv_buf, tlv_len);
|
||||
if (req->ret)
|
||||
msg = NULL;
|
||||
} else {
|
||||
req->ret = QMI_ERROR_CANCELLED;
|
||||
}
|
||||
|
||||
if (req->cb && (msg || !req->no_error_cb))
|
||||
req->cb(qmi, req, msg);
|
||||
|
||||
if (req->complete) {
|
||||
*req->complete = true;
|
||||
uloop_cancelled = true;
|
||||
}
|
||||
}
|
||||
|
||||
static void qmi_process_msg(struct qmi_dev *qmi, struct qmi_msg *msg)
|
||||
{
|
||||
struct qmi_request *req;
|
||||
uint16_t tid;
|
||||
|
||||
if (msg->flags != QMI_CTL_FLAG_RESPONSE && msg->flags != QMI_SERVICE_FLAG_RESPONSE)
|
||||
return;
|
||||
|
||||
if (msg->qmux.service == QMI_SERVICE_CTL)
|
||||
tid = msg->ctl.transaction;
|
||||
else
|
||||
tid = le16_to_cpu(msg->svc.transaction);
|
||||
|
||||
list_for_each_entry(req, &qmi->req, list) {
|
||||
if (req->service != msg->qmux.service)
|
||||
continue;
|
||||
|
||||
if (req->tid != tid)
|
||||
continue;
|
||||
|
||||
__qmi_request_complete(qmi, req, msg);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
static void qmi_notify_read(struct ustream *us, int bytes)
|
||||
{
|
||||
struct qmi_dev *qmi = container_of(us, struct qmi_dev, sf.stream);
|
||||
struct qmi_msg *msg;
|
||||
char *buf;
|
||||
int len, msg_len;
|
||||
|
||||
|
||||
while (1) {
|
||||
buf = ustream_get_read_buf(us, &len);
|
||||
if (!buf || !len)
|
||||
return;
|
||||
|
||||
dump_packet("Received packet", buf, len);
|
||||
if (qmi->is_mbim) {
|
||||
struct mbim_command_message *mbim = (void *) buf;
|
||||
|
||||
if (len < sizeof(*mbim))
|
||||
return;
|
||||
msg = (struct qmi_msg *) (buf + sizeof(*mbim));
|
||||
msg_len = le32_to_cpu(mbim->header.length);
|
||||
if (!is_mbim_qmi(mbim)) {
|
||||
/* must consume other MBIM packets */
|
||||
ustream_consume(us, msg_len);
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
if (len < offsetof(struct qmi_msg, flags))
|
||||
return;
|
||||
msg = (struct qmi_msg *) buf;
|
||||
msg_len = le16_to_cpu(msg->qmux.len) + 1;
|
||||
}
|
||||
|
||||
if (len < msg_len)
|
||||
return;
|
||||
|
||||
qmi_process_msg(qmi, msg);
|
||||
ustream_consume(us, msg_len);
|
||||
}
|
||||
}
|
||||
|
||||
int qmi_request_start(struct qmi_dev *qmi, struct qmi_request *req, request_cb cb)
|
||||
{
|
||||
struct qmi_msg *msg = qmi->buf;
|
||||
int len = qmi_complete_request_message(msg);
|
||||
uint16_t tid;
|
||||
void *buf = (void *) qmi->buf;
|
||||
|
||||
memset(req, 0, sizeof(*req));
|
||||
req->ret = -1;
|
||||
req->service = msg->qmux.service;
|
||||
if (req->service == QMI_SERVICE_CTL) {
|
||||
tid = qmi->ctl_tid++;
|
||||
msg->ctl.transaction = tid;
|
||||
} else {
|
||||
int idx = qmi_get_service_idx(req->service);
|
||||
|
||||
if (idx < 0)
|
||||
return -1;
|
||||
|
||||
tid = qmi->service_data[idx].tid++;
|
||||
msg->svc.transaction = cpu_to_le16(tid);
|
||||
msg->qmux.client = qmi->service_data[idx].client_id;
|
||||
}
|
||||
|
||||
req->tid = tid;
|
||||
req->cb = cb;
|
||||
req->pending = true;
|
||||
list_add(&req->list, &qmi->req);
|
||||
|
||||
if (qmi->is_mbim) {
|
||||
buf -= sizeof(struct mbim_command_message);
|
||||
mbim_qmi_cmd((struct mbim_command_message *) buf, len, tid);
|
||||
len += sizeof(struct mbim_command_message);
|
||||
}
|
||||
|
||||
dump_packet("Send packet", buf, len);
|
||||
ustream_write(&qmi->sf.stream, buf, len, false);
|
||||
return 0;
|
||||
}
|
||||
|
||||
void qmi_request_cancel(struct qmi_dev *qmi, struct qmi_request *req)
|
||||
{
|
||||
req->cb = NULL;
|
||||
__qmi_request_complete(qmi, req, NULL);
|
||||
}
|
||||
|
||||
int qmi_request_wait(struct qmi_dev *qmi, struct qmi_request *req)
|
||||
{
|
||||
bool complete = false;
|
||||
bool cancelled;
|
||||
|
||||
if (!req->pending)
|
||||
return req->ret;
|
||||
|
||||
if (req->complete)
|
||||
*req->complete = true;
|
||||
|
||||
req->complete = &complete;
|
||||
while (!complete) {
|
||||
cancelled = uloop_cancelled;
|
||||
uloop_cancelled = false;
|
||||
uloop_run();
|
||||
|
||||
if (cancel_all_requests)
|
||||
qmi_request_cancel(qmi, req);
|
||||
|
||||
uloop_cancelled = cancelled;
|
||||
}
|
||||
|
||||
if (req->complete == &complete)
|
||||
req->complete = NULL;
|
||||
|
||||
return req->ret;
|
||||
}
|
||||
|
||||
struct qmi_connect_request {
|
||||
struct qmi_request req;
|
||||
int cid;
|
||||
};
|
||||
|
||||
static void qmi_connect_service_cb(struct qmi_dev *qmi, struct qmi_request *req, struct qmi_msg *msg)
|
||||
{
|
||||
struct qmi_ctl_allocate_cid_response res;
|
||||
struct qmi_connect_request *creq = container_of(req, struct qmi_connect_request, req);
|
||||
|
||||
if (!msg)
|
||||
return;
|
||||
|
||||
qmi_parse_ctl_allocate_cid_response(msg, &res);
|
||||
creq->cid = res.data.allocation_info.cid;
|
||||
}
|
||||
|
||||
int qmi_service_connect(struct qmi_dev *qmi, QmiService svc, int client_id)
|
||||
{
|
||||
struct qmi_ctl_allocate_cid_request creq = {
|
||||
QMI_INIT(service, svc)
|
||||
};
|
||||
struct qmi_connect_request req;
|
||||
int idx = qmi_get_service_idx(svc);
|
||||
struct qmi_msg *msg = qmi->buf;
|
||||
|
||||
if (idx < 0)
|
||||
return -1;
|
||||
|
||||
if (qmi->service_connected & (1 << idx))
|
||||
return 0;
|
||||
|
||||
if (client_id < 0) {
|
||||
qmi_set_ctl_allocate_cid_request(msg, &creq);
|
||||
qmi_request_start(qmi, &req.req, qmi_connect_service_cb);
|
||||
qmi_request_wait(qmi, &req.req);
|
||||
|
||||
if (req.req.ret)
|
||||
return req.req.ret;
|
||||
|
||||
client_id = req.cid;
|
||||
} else {
|
||||
qmi->service_keep_cid |= (1 << idx);
|
||||
}
|
||||
|
||||
qmi->service_data[idx].connected = true;
|
||||
qmi->service_data[idx].client_id = client_id;
|
||||
qmi->service_data[idx].tid = 1;
|
||||
qmi->service_connected |= (1 << idx);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void __qmi_service_disconnect(struct qmi_dev *qmi, int idx)
|
||||
{
|
||||
int client_id = qmi->service_data[idx].client_id;
|
||||
struct qmi_ctl_release_cid_request creq = {
|
||||
QMI_INIT_SEQUENCE(release_info,
|
||||
.service = qmi_services[idx],
|
||||
.cid = client_id,
|
||||
)
|
||||
};
|
||||
struct qmi_request req;
|
||||
struct qmi_msg *msg = qmi->buf;
|
||||
|
||||
qmi->service_connected &= ~(1 << idx);
|
||||
qmi->service_data[idx].client_id = -1;
|
||||
qmi->service_data[idx].tid = 0;
|
||||
|
||||
qmi_set_ctl_release_cid_request(msg, &creq);
|
||||
qmi_request_start(qmi, &req, NULL);
|
||||
qmi_request_wait(qmi, &req);
|
||||
}
|
||||
|
||||
int qmi_service_release_client_id(struct qmi_dev *qmi, QmiService svc)
|
||||
{
|
||||
int idx = qmi_get_service_idx(svc);
|
||||
qmi->service_release_cid |= 1 << idx;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void qmi_close_all_services(struct qmi_dev *qmi)
|
||||
{
|
||||
uint32_t connected = qmi->service_connected;
|
||||
int idx;
|
||||
|
||||
qmi->service_keep_cid &= ~qmi->service_release_cid;
|
||||
for (idx = 0; connected; idx++, connected >>= 1) {
|
||||
if (!(connected & 1))
|
||||
continue;
|
||||
|
||||
if (qmi->service_keep_cid & (1 << idx))
|
||||
continue;
|
||||
|
||||
__qmi_service_disconnect(qmi, idx);
|
||||
}
|
||||
}
|
||||
|
||||
int qmi_service_get_client_id(struct qmi_dev *qmi, QmiService svc)
|
||||
{
|
||||
int idx = qmi_get_service_idx(svc);
|
||||
|
||||
if (idx < 0)
|
||||
return -1;
|
||||
|
||||
qmi->service_keep_cid |= (1 << idx);
|
||||
return qmi->service_data[idx].client_id;
|
||||
}
|
||||
|
||||
int qmi_device_open(struct qmi_dev *qmi, const char *path)
|
||||
{
|
||||
static struct {
|
||||
struct mbim_command_message mbim;
|
||||
union {
|
||||
char buf[2048];
|
||||
struct qmi_msg msg;
|
||||
} u;
|
||||
} __packed msgbuf;
|
||||
struct ustream *us = &qmi->sf.stream;
|
||||
int fd;
|
||||
|
||||
uloop_init();
|
||||
|
||||
fd = open(path, O_RDWR | O_EXCL | O_NONBLOCK | O_NOCTTY);
|
||||
if (fd < 0)
|
||||
return -1;
|
||||
|
||||
us->notify_read = qmi_notify_read;
|
||||
ustream_fd_init(&qmi->sf, fd);
|
||||
INIT_LIST_HEAD(&qmi->req);
|
||||
qmi->ctl_tid = 1;
|
||||
qmi->buf = msgbuf.u.buf;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void qmi_device_close(struct qmi_dev *qmi)
|
||||
{
|
||||
struct qmi_request *req;
|
||||
|
||||
qmi_close_all_services(qmi);
|
||||
ustream_free(&qmi->sf.stream);
|
||||
close(qmi->sf.fd.fd);
|
||||
|
||||
while (!list_empty(&qmi->req)) {
|
||||
req = list_first_entry(&qmi->req, struct qmi_request, list);
|
||||
qmi_request_cancel(qmi, req);
|
||||
}
|
||||
}
|
||||
|
||||
QmiService qmi_service_get_by_name(const char *str)
|
||||
{
|
||||
static const struct {
|
||||
const char *name;
|
||||
QmiService svc;
|
||||
} services[] = {
|
||||
{ "dms", QMI_SERVICE_DMS },
|
||||
{ "nas", QMI_SERVICE_NAS },
|
||||
{ "pds", QMI_SERVICE_PDS },
|
||||
{ "wds", QMI_SERVICE_WDS },
|
||||
{ "wms", QMI_SERVICE_WMS },
|
||||
{ "wda", QMI_SERVICE_WDA },
|
||||
{ "uim", QMI_SERVICE_UIM },
|
||||
};
|
||||
int i;
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(services); i++) {
|
||||
if (!strcasecmp(str, services[i].name))
|
||||
return services[i].svc;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
const char *qmi_get_error_str(int code)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(qmi_errors); i++) {
|
||||
if (qmi_errors[i].code == code)
|
||||
return qmi_errors[i].text;
|
||||
}
|
||||
|
||||
return "Unknown error";
|
||||
}
|
@ -0,0 +1,172 @@
|
||||
/*
|
||||
* uqmi -- tiny QMI support implementation
|
||||
*
|
||||
* Copyright (C) 2014-2015 Felix Fietkau <nbd@openwrt.org>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
#include <libubox/uloop.h>
|
||||
#include <libubox/utils.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
#include <errno.h>
|
||||
#include <getopt.h>
|
||||
#include <signal.h>
|
||||
|
||||
#include "uqmi.h"
|
||||
#include "commands.h"
|
||||
|
||||
static const char *device;
|
||||
|
||||
#define CMD_OPT(_arg) (-2 - _arg)
|
||||
|
||||
#define __uqmi_command(_name, _optname, _arg, _option) { #_optname, _arg##_argument, NULL, CMD_OPT(__UQMI_COMMAND_##_name) }
|
||||
static const struct option uqmi_getopt[] = {
|
||||
__uqmi_commands,
|
||||
{ "single", no_argument, NULL, 's' },
|
||||
{ "device", required_argument, NULL, 'd' },
|
||||
{ "keep-client-id", required_argument, NULL, 'k' },
|
||||
{ "release-client-id", required_argument, NULL, 'r' },
|
||||
{ "mbim", no_argument, NULL, 'm' },
|
||||
{ "timeout", required_argument, NULL, 't' },
|
||||
{ NULL, 0, NULL, 0 }
|
||||
};
|
||||
#undef __uqmi_command
|
||||
|
||||
static int usage(const char *progname)
|
||||
{
|
||||
fprintf(stderr, "Usage: %s <options|actions>\n"
|
||||
"Options:\n"
|
||||
" --single, -s: Print output as a single line (for scripts)\n"
|
||||
" --device=NAME, -d NAME: Set device name to NAME (required)\n"
|
||||
" --keep-client-id <name>: Keep Client ID for service <name>\n"
|
||||
" --release-client-id <name>: Release Client ID after exiting\n"
|
||||
" --mbim, -m NAME is an MBIM device with EXT_QMUX support\n"
|
||||
" --timeout, -t response timeout in msecs\n"
|
||||
"\n"
|
||||
"Services: dms, nas, pds, wds, wms\n"
|
||||
"\n"
|
||||
"Actions:\n"
|
||||
" --get-versions: Get service versions\n"
|
||||
" --set-client-id <name>,<id>: Set Client ID for service <name> to <id>\n"
|
||||
" (implies --keep-client-id)\n"
|
||||
" --get-client-id <name>: Connect and get Client ID for service <name>\n"
|
||||
" (implies --keep-client-id)\n"
|
||||
" --sync: Release all Client IDs\n"
|
||||
wds_helptext
|
||||
dms_helptext
|
||||
uim_helptext
|
||||
nas_helptext
|
||||
wms_helptext
|
||||
wda_helptext
|
||||
"\n", progname);
|
||||
return 1;
|
||||
}
|
||||
|
||||
static void keep_client_id(struct qmi_dev *qmi, const char *optarg)
|
||||
{
|
||||
QmiService svc = qmi_service_get_by_name(optarg);
|
||||
if (svc < 0) {
|
||||
fprintf(stderr, "Invalid service %s\n", optarg);
|
||||
exit(1);
|
||||
}
|
||||
qmi_service_get_client_id(qmi, svc);
|
||||
}
|
||||
|
||||
static void release_client_id(struct qmi_dev *qmi, const char *optarg)
|
||||
{
|
||||
QmiService svc = qmi_service_get_by_name(optarg);
|
||||
if (svc < 0) {
|
||||
fprintf(stderr, "Invalid service %s\n", optarg);
|
||||
exit(1);
|
||||
}
|
||||
qmi_service_release_client_id(qmi, svc);
|
||||
}
|
||||
|
||||
static void handle_exit_signal(int signal)
|
||||
{
|
||||
cancel_all_requests = true;
|
||||
uloop_end();
|
||||
}
|
||||
|
||||
static void _request_timeout_handler(struct uloop_timeout *timeout)
|
||||
{
|
||||
fprintf(stderr, "Request timed out\n");
|
||||
handle_exit_signal(0);
|
||||
}
|
||||
|
||||
struct uloop_timeout request_timeout = { .cb = _request_timeout_handler, };
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
static struct qmi_dev dev;
|
||||
int ch, ret;
|
||||
|
||||
uloop_init();
|
||||
signal(SIGINT, handle_exit_signal);
|
||||
signal(SIGTERM, handle_exit_signal);
|
||||
|
||||
while ((ch = getopt_long(argc, argv, "d:k:smt:", uqmi_getopt, NULL)) != -1) {
|
||||
int cmd_opt = CMD_OPT(ch);
|
||||
|
||||
if (ch < 0 && cmd_opt >= 0 && cmd_opt < __UQMI_COMMAND_LAST) {
|
||||
uqmi_add_command(optarg, cmd_opt);
|
||||
continue;
|
||||
}
|
||||
|
||||
switch(ch) {
|
||||
case 'r':
|
||||
release_client_id(&dev, optarg);
|
||||
break;
|
||||
case 'k':
|
||||
keep_client_id(&dev, optarg);
|
||||
break;
|
||||
case 'd':
|
||||
device = optarg;
|
||||
break;
|
||||
case 's':
|
||||
single_line = true;
|
||||
break;
|
||||
case 'm':
|
||||
dev.is_mbim = true;
|
||||
break;
|
||||
case 't':
|
||||
uloop_timeout_set(&request_timeout, atol(optarg));
|
||||
break;
|
||||
default:
|
||||
return usage(argv[0]);
|
||||
}
|
||||
}
|
||||
|
||||
if (!device) {
|
||||
fprintf(stderr, "No device given\n");
|
||||
return usage(argv[0]);
|
||||
}
|
||||
|
||||
if (qmi_device_open(&dev, device)) {
|
||||
fprintf(stderr, "Failed to open device\n");
|
||||
return 2;
|
||||
}
|
||||
|
||||
ret = uqmi_run_commands(&dev) ? 0 : -1;
|
||||
|
||||
qmi_device_close(&dev);
|
||||
|
||||
return ret;
|
||||
}
|
@ -0,0 +1,50 @@
|
||||
/*
|
||||
* Copyright (C) 2016 Bjørn Mork <bjorn@mork.no>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include "mbim.h"
|
||||
|
||||
static const uint8_t qmiuuid[16] = { 0xd1, 0xa3, 0x0b, 0xc2, 0xf9, 0x7a, 0x6e, 0x43,
|
||||
0xbf, 0x65, 0xc7, 0xe2, 0x4f, 0xb0, 0xf0, 0xd3 };
|
||||
|
||||
bool is_mbim_qmi(struct mbim_command_message *msg)
|
||||
{
|
||||
return msg->header.type == cpu_to_le32(MBIM_MESSAGE_TYPE_COMMAND_DONE) &&
|
||||
msg->command_id == cpu_to_le32(MBIM_CID_QMI_MSG) &&
|
||||
!msg->command_type && /* actually 'status' here */
|
||||
!memcmp(msg->service_id, qmiuuid, 16);
|
||||
}
|
||||
|
||||
void mbim_qmi_cmd(struct mbim_command_message *msg, int len, uint16_t tid)
|
||||
{
|
||||
msg->header.type = cpu_to_le32(MBIM_MESSAGE_TYPE_COMMAND);
|
||||
msg->header.length = cpu_to_le32(sizeof(*msg) + len);
|
||||
msg->header.transaction_id = cpu_to_le32(tid);
|
||||
msg->fragment_header.total = cpu_to_le32(1);
|
||||
msg->fragment_header.current = 0;
|
||||
memcpy(msg->service_id, qmiuuid, 16);
|
||||
msg->command_id = cpu_to_le32(MBIM_CID_QMI_MSG);
|
||||
msg->command_type = cpu_to_le32(MBIM_MESSAGE_COMMAND_TYPE_SET);
|
||||
msg->buffer_length = cpu_to_le32(len);
|
||||
}
|
@ -0,0 +1,56 @@
|
||||
/*
|
||||
* Copyright (C) 2014 John Crispin <blogic@openwrt.org>
|
||||
* Copyright (C) 2016 Bjørn Mork <bjorn@mork.no>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
#ifndef _MBIM_H__
|
||||
#define _MBIM_H__
|
||||
|
||||
#include <libubox/utils.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#define MBIM_MESSAGE_TYPE_COMMAND 0x00000003
|
||||
#define MBIM_MESSAGE_TYPE_COMMAND_DONE 0x80000003
|
||||
#define MBIM_MESSAGE_COMMAND_TYPE_SET 1
|
||||
#define MBIM_CID_QMI_MSG 1
|
||||
|
||||
struct mbim_message_header {
|
||||
uint32_t type;
|
||||
uint32_t length;
|
||||
uint32_t transaction_id;
|
||||
} __packed;
|
||||
|
||||
struct mbim_fragment_header {
|
||||
uint32_t total;
|
||||
uint32_t current;
|
||||
} __packed;
|
||||
|
||||
struct mbim_command_message {
|
||||
struct mbim_message_header header;
|
||||
struct mbim_fragment_header fragment_header;
|
||||
uint8_t service_id[16];
|
||||
uint32_t command_id;
|
||||
uint32_t command_type;
|
||||
uint32_t buffer_length;
|
||||
} __packed;
|
||||
|
||||
bool is_mbim_qmi(struct mbim_command_message *msg);
|
||||
void mbim_qmi_cmd(struct mbim_command_message *msg, int len, uint16_t tid);
|
||||
|
||||
#endif
|
@ -0,0 +1,529 @@
|
||||
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/*
|
||||
* uqmi -- tiny QMI support implementation
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Copyright (C) 2012 Lanedo GmbH.
|
||||
* Copyright (C) 2012-2017 Aleksander Morgado <aleksander@aleksander.es>
|
||||
*/
|
||||
|
||||
#ifndef _LIBQMI_GLIB_QMI_ENUMS_DMS_H_
|
||||
#define _LIBQMI_GLIB_QMI_ENUMS_DMS_H_
|
||||
|
||||
/**
|
||||
* SECTION: qmi-enums-dms
|
||||
*
|
||||
* This section defines enumerations and flags used in the DMS service
|
||||
* interface.
|
||||
*/
|
||||
|
||||
/*****************************************************************************/
|
||||
/* Helper enums for the 'QMI DMS Get Capabilities' message */
|
||||
|
||||
/**
|
||||
* QmiDmsDataServiceCapability:
|
||||
* @QMI_DMS_DATA_SERVICE_CAPABILITY_NONE: No data services supported.
|
||||
* @QMI_DMS_DATA_SERVICE_CAPABILITY_CS: Only CS supported.
|
||||
* @QMI_DMS_DATA_SERVICE_CAPABILITY_PS: Only PS supported.
|
||||
* @QMI_DMS_DATA_SERVICE_CAPABILITY_SIMULTANEOUS_CS_PS: Simultaneous CS and PS supported.
|
||||
* @QMI_DMS_DATA_SERVICE_CAPABILITY_NON_SIMULTANEOUS_CS_PS: Non simultaneous CS and PS supported.
|
||||
*
|
||||
* Data service capability.
|
||||
*
|
||||
* Since: 1.0
|
||||
*/
|
||||
typedef enum { /*< since=1.0 >*/
|
||||
QMI_DMS_DATA_SERVICE_CAPABILITY_NONE = 0,
|
||||
QMI_DMS_DATA_SERVICE_CAPABILITY_CS = 1,
|
||||
QMI_DMS_DATA_SERVICE_CAPABILITY_PS = 2,
|
||||
QMI_DMS_DATA_SERVICE_CAPABILITY_SIMULTANEOUS_CS_PS = 3,
|
||||
QMI_DMS_DATA_SERVICE_CAPABILITY_NON_SIMULTANEOUS_CS_PS = 4
|
||||
} QmiDmsDataServiceCapability;
|
||||
|
||||
/**
|
||||
* QmiDmsSimCapability:
|
||||
* @QMI_DMS_SIM_CAPABILITY_NOT_SUPPORTED: SIM not supported.
|
||||
* @QMI_DMS_SIM_CAPABILITY_SUPPORTED: SIM is supported.
|
||||
*
|
||||
* SIM capability.
|
||||
*
|
||||
* Since: 1.0
|
||||
*/
|
||||
typedef enum { /*< since=1.0 >*/
|
||||
QMI_DMS_SIM_CAPABILITY_NOT_SUPPORTED = 1,
|
||||
QMI_DMS_SIM_CAPABILITY_SUPPORTED = 2
|
||||
} QmiDmsSimCapability;
|
||||
|
||||
/**
|
||||
* QmiDmsRadioInterface:
|
||||
* @QMI_DMS_RADIO_INTERFACE_CDMA20001X: CDMA2000 1x.
|
||||
* @QMI_DMS_RADIO_INTERFACE_EVDO: CDMA2000 HRPD (1xEV-DO)
|
||||
* @QMI_DMS_RADIO_INTERFACE_GSM: GSM.
|
||||
* @QMI_DMS_RADIO_INTERFACE_UMTS: UMTS.
|
||||
* @QMI_DMS_RADIO_INTERFACE_LTE: LTE.
|
||||
* @QMI_DMS_RADIO_INTERFACE_TDS: TDS. Since 1.32.
|
||||
* @QMI_DMS_RADIO_INTERFACE_5GNR: 5G NR. Since 1.26.
|
||||
*
|
||||
* Radio interface type.
|
||||
*
|
||||
* Since: 1.0
|
||||
*/
|
||||
typedef enum { /*< since=1.0 >*/
|
||||
QMI_DMS_RADIO_INTERFACE_CDMA20001X = 1,
|
||||
QMI_DMS_RADIO_INTERFACE_EVDO = 2,
|
||||
QMI_DMS_RADIO_INTERFACE_GSM = 4,
|
||||
QMI_DMS_RADIO_INTERFACE_UMTS = 5,
|
||||
QMI_DMS_RADIO_INTERFACE_LTE = 8,
|
||||
QMI_DMS_RADIO_INTERFACE_TDS = 9,
|
||||
QMI_DMS_RADIO_INTERFACE_5GNR = 10,
|
||||
} QmiDmsRadioInterface;
|
||||
|
||||
/*****************************************************************************/
|
||||
/* Helper enums for the 'QMI DMS Get Power State' message */
|
||||
|
||||
/**
|
||||
* QmiDmsPowerState:
|
||||
* @QMI_DMS_POWER_STATE_EXTERNAL_SOURCE: Powered by an external source.
|
||||
* @QMI_DMS_POWER_STATE_BATTERY_CONNECTED: Battery is connected.
|
||||
* @QMI_DMS_POWER_STATE_BATTERY_CHARGING: Battery is currently being charged.
|
||||
* @QMI_DMS_POWER_STATE_FAULT: Recognized power fault.
|
||||
*
|
||||
* Flags specifying the current power state.
|
||||
*
|
||||
* If @QMI_DMS_POWER_STATE_EXTERNAL_SOURCE is set, the device is powerered by an
|
||||
* external source; otherwise it is powered by a battery.
|
||||
*
|
||||
* If @QMI_DMS_POWER_STATE_BATTERY_CONNECTED is set, the battery is connected;
|
||||
* otherwise the battery is not connected.
|
||||
*
|
||||
* If @QMI_DMS_POWER_STATE_BATTERY_CHARGING is set, the battery is being charged;
|
||||
* otherwise the battery is not being charged.
|
||||
*
|
||||
* If @QMI_DMS_POWER_STATE_FAULT is set, a power fault has been detected.
|
||||
*
|
||||
* Since: 1.0
|
||||
*/
|
||||
typedef enum { /*< since=1.0 >*/
|
||||
QMI_DMS_POWER_STATE_EXTERNAL_SOURCE = 1 << 0,
|
||||
QMI_DMS_POWER_STATE_BATTERY_CONNECTED = 1 << 1,
|
||||
QMI_DMS_POWER_STATE_BATTERY_CHARGING = 1 << 2,
|
||||
QMI_DMS_POWER_STATE_FAULT = 1 << 3,
|
||||
} QmiDmsPowerState;
|
||||
|
||||
/*****************************************************************************/
|
||||
/* Helper enums for the 'QMI DMS UIM Set PIN Protection' message */
|
||||
|
||||
/**
|
||||
* QmiDmsUimPinId:
|
||||
* @QMI_DMS_UIM_PIN_ID_PIN: PIN.
|
||||
* @QMI_DMS_UIM_PIN_ID_PIN2: PIN2.
|
||||
*
|
||||
* The PIN identifier.
|
||||
*
|
||||
* Since: 1.0
|
||||
*/
|
||||
typedef enum { /*< since=1.0 >*/
|
||||
QMI_DMS_UIM_PIN_ID_PIN = 1,
|
||||
QMI_DMS_UIM_PIN_ID_PIN2 = 2
|
||||
} QmiDmsUimPinId;
|
||||
|
||||
/*****************************************************************************/
|
||||
/* Helper enums for the 'QMI DMS UIM Get PIN Status' message */
|
||||
|
||||
/**
|
||||
* QmiDmsUimPinStatus:
|
||||
* @QMI_DMS_UIM_PIN_STATUS_NOT_INITIALIZED: Not initialized.
|
||||
* @QMI_DMS_UIM_PIN_STATUS_ENABLED_NOT_VERIFIED: Enabled, not verified.
|
||||
* @QMI_DMS_UIM_PIN_STATUS_ENABLED_VERIFIED: Enabled, verified.
|
||||
* @QMI_DMS_UIM_PIN_STATUS_DISABLED: Disabled.
|
||||
* @QMI_DMS_UIM_PIN_STATUS_BLOCKED: Blocked.
|
||||
* @QMI_DMS_UIM_PIN_STATUS_PERMANENTLY_BLOCKED: Permanently Blocked.
|
||||
* @QMI_DMS_UIM_PIN_STATUS_UNBLOCKED: Unblocked.
|
||||
* @QMI_DMS_UIM_PIN_STATUS_CHANGED: Changed.
|
||||
*
|
||||
* The PIN status.
|
||||
*
|
||||
* Since: 1.0
|
||||
*/
|
||||
typedef enum { /*< since=1.0 >*/
|
||||
QMI_DMS_UIM_PIN_STATUS_NOT_INITIALIZED = 0,
|
||||
QMI_DMS_UIM_PIN_STATUS_ENABLED_NOT_VERIFIED = 1,
|
||||
QMI_DMS_UIM_PIN_STATUS_ENABLED_VERIFIED = 2,
|
||||
QMI_DMS_UIM_PIN_STATUS_DISABLED = 3,
|
||||
QMI_DMS_UIM_PIN_STATUS_BLOCKED = 4,
|
||||
QMI_DMS_UIM_PIN_STATUS_PERMANENTLY_BLOCKED = 5,
|
||||
QMI_DMS_UIM_PIN_STATUS_UNBLOCKED = 6,
|
||||
QMI_DMS_UIM_PIN_STATUS_CHANGED = 7,
|
||||
} QmiDmsUimPinStatus;
|
||||
|
||||
/*****************************************************************************/
|
||||
/* Helper enums for the 'QMI DMS Get Operating Mode' message */
|
||||
|
||||
/**
|
||||
* QmiDmsOperatingMode:
|
||||
* @QMI_DMS_OPERATING_MODE_ONLINE: Device can acquire a system and make calls.
|
||||
* @QMI_DMS_OPERATING_MODE_LOW_POWER: Device has temporarily disabled RF.
|
||||
* @QMI_DMS_OPERATING_MODE_PERSISTENT_LOW_POWER: Device has disabled RF and state persists even after a reset.
|
||||
* @QMI_DMS_OPERATING_MODE_FACTORY_TEST: Special mode for manufacturer tests.
|
||||
* @QMI_DMS_OPERATING_MODE_OFFLINE: Device has deactivated RF and is partially shutdown.
|
||||
* @QMI_DMS_OPERATING_MODE_RESET: Device is in the process of power cycling.
|
||||
* @QMI_DMS_OPERATING_MODE_SHUTTING_DOWN: Device is in the process of shutting down.
|
||||
* @QMI_DMS_OPERATING_MODE_MODE_ONLY_LOW_POWER: Mode-only Low Power.
|
||||
* @QMI_DMS_OPERATING_MODE_UNKNOWN: Unknown.
|
||||
*
|
||||
* Operating mode of the device.
|
||||
*
|
||||
* Since: 1.0
|
||||
*/
|
||||
typedef enum { /*< since=1.0 >*/
|
||||
QMI_DMS_OPERATING_MODE_ONLINE = 0,
|
||||
QMI_DMS_OPERATING_MODE_LOW_POWER = 1,
|
||||
QMI_DMS_OPERATING_MODE_FACTORY_TEST = 2,
|
||||
QMI_DMS_OPERATING_MODE_OFFLINE = 3,
|
||||
QMI_DMS_OPERATING_MODE_RESET = 4,
|
||||
QMI_DMS_OPERATING_MODE_SHUTTING_DOWN = 5,
|
||||
QMI_DMS_OPERATING_MODE_PERSISTENT_LOW_POWER = 6,
|
||||
QMI_DMS_OPERATING_MODE_MODE_ONLY_LOW_POWER = 7,
|
||||
QMI_DMS_OPERATING_MODE_UNKNOWN = 0xFF
|
||||
} QmiDmsOperatingMode;
|
||||
|
||||
/**
|
||||
* QmiDmsOfflineReason:
|
||||
* @QMI_DMS_OFFLINE_REASON_HOST_IMAGE_MISCONFIGURATION: Host image misconfiguration.
|
||||
* @QMI_DMS_OFFLINE_REASON_PRI_IMAGE_MISCONFIGURATION: PRI image misconfiguration.
|
||||
* @QMI_DMS_OFFLINE_REASON_PRI_VERSION_INCOMPATIBLE: PRI version incompatible.
|
||||
* @QMI_DMS_OFFLINE_REASON_DEVICE_MEMORY_FULL: Memory full, cannot copy PRI information.
|
||||
*
|
||||
* Reasons for being in Offline (@QMI_DMS_OPERATING_MODE_OFFLINE) state.
|
||||
*
|
||||
* Since: 1.0
|
||||
*/
|
||||
typedef enum { /*< since=1.0 >*/
|
||||
QMI_DMS_OFFLINE_REASON_HOST_IMAGE_MISCONFIGURATION = 1 << 0,
|
||||
QMI_DMS_OFFLINE_REASON_PRI_IMAGE_MISCONFIGURATION = 1 << 1,
|
||||
QMI_DMS_OFFLINE_REASON_PRI_VERSION_INCOMPATIBLE = 1 << 2,
|
||||
QMI_DMS_OFFLINE_REASON_DEVICE_MEMORY_FULL = 1 << 3
|
||||
} QmiDmsOfflineReason;
|
||||
|
||||
/*****************************************************************************/
|
||||
/* Helper enums for the 'QMI DMS Get Time' message */
|
||||
|
||||
/**
|
||||
* QmiDmsTimeSource:
|
||||
* @QMI_DMS_TIME_SOURCE_DEVICE: 32 kHz device clock.
|
||||
* @QMI_DMS_TIME_SOURCE_CDMA_NETWORK: CDMA network.
|
||||
* @QMI_DMS_TIME_SOURCE_HDR_NETWORK: HDR network.
|
||||
*
|
||||
* Source of the timestamp.
|
||||
*
|
||||
* Since: 1.0
|
||||
*/
|
||||
typedef enum { /*< since=1.0 >*/
|
||||
QMI_DMS_TIME_SOURCE_DEVICE = 0,
|
||||
QMI_DMS_TIME_SOURCE_CDMA_NETWORK = 1,
|
||||
QMI_DMS_TIME_SOURCE_HDR_NETWORK = 2,
|
||||
} QmiDmsTimeSource;
|
||||
|
||||
/*****************************************************************************/
|
||||
/* Helper enums for the 'QMI DMS Get Activation State' message */
|
||||
|
||||
/**
|
||||
* QmiDmsActivationState:
|
||||
* @QMI_DMS_ACTIVATION_STATE_NOT_ACTIVATED: Service not activated.
|
||||
* @QMI_DMS_ACTIVATION_STATE_ACTIVATED: Service is activated.
|
||||
* @QMI_DMS_ACTIVATION_STATE_CONNECTING: Connection in progress for automatic activation.
|
||||
* @QMI_DMS_ACTIVATION_STATE_CONNECTED: Connection connected for automatic activation.
|
||||
* @QMI_DMS_ACTIVATION_STATE_OTASP_AUTHENTICATED: OTASP security authenticated.
|
||||
* @QMI_DMS_ACTIVATION_STATE_OTASP_NAM: OTASP NAM downloaded.
|
||||
* @QMI_DMS_ACTIVATION_STATE_OTASP_MDN: OTASP MDN downloaded.
|
||||
* @QMI_DMS_ACTIVATION_STATE_OTASP_IMSI: OTASP IMSI downloaded.
|
||||
* @QMI_DMS_ACTIVATION_STATE_OTASP_PRL: OTASP PRL downloaded.
|
||||
* @QMI_DMS_ACTIVATION_STATE_OTASP_SPC: OTASP SPC downloaded.
|
||||
* @QMI_DMS_ACTIVATION_STATE_OTASP_COMMITED: OTASP settings committed.
|
||||
*
|
||||
* State of the service activation.
|
||||
*
|
||||
* Since: 1.0
|
||||
*/
|
||||
typedef enum { /*< since=1.0 >*/
|
||||
QMI_DMS_ACTIVATION_STATE_NOT_ACTIVATED = 0x00,
|
||||
QMI_DMS_ACTIVATION_STATE_ACTIVATED = 0x01,
|
||||
QMI_DMS_ACTIVATION_STATE_CONNECTING = 0x02,
|
||||
QMI_DMS_ACTIVATION_STATE_CONNECTED = 0x03,
|
||||
QMI_DMS_ACTIVATION_STATE_OTASP_AUTHENTICATED = 0x04,
|
||||
QMI_DMS_ACTIVATION_STATE_OTASP_NAM = 0x05,
|
||||
QMI_DMS_ACTIVATION_STATE_OTASP_MDN = 0x06,
|
||||
QMI_DMS_ACTIVATION_STATE_OTASP_IMSI = 0x07,
|
||||
QMI_DMS_ACTIVATION_STATE_OTASP_PRL = 0x08,
|
||||
QMI_DMS_ACTIVATION_STATE_OTASP_SPC = 0x09,
|
||||
QMI_DMS_ACTIVATION_STATE_OTASP_COMMITED = 0x0A
|
||||
} QmiDmsActivationState;
|
||||
|
||||
/*****************************************************************************/
|
||||
/* Helper enums for the 'QMI DMS UIM Get CK Status' message */
|
||||
|
||||
/**
|
||||
* QmiDmsUimFacility:
|
||||
* @QMI_DMS_UIM_FACILITY_PN: Network personalization facility.
|
||||
* @QMI_DMS_UIM_FACILITY_PU: Network subset personalization facility.
|
||||
* @QMI_DMS_UIM_FACILITY_PP: Service provider facility.
|
||||
* @QMI_DMS_UIM_FACILITY_PC: Corporate personalization facility.
|
||||
* @QMI_DMS_UIM_FACILITY_PF: UIM personalization facility.
|
||||
*
|
||||
* UIM personalization facilities.
|
||||
*
|
||||
* Since: 1.0
|
||||
*/
|
||||
typedef enum { /*< since=1.0 >*/
|
||||
QMI_DMS_UIM_FACILITY_PN = 0,
|
||||
QMI_DMS_UIM_FACILITY_PU = 1,
|
||||
QMI_DMS_UIM_FACILITY_PP = 2,
|
||||
QMI_DMS_UIM_FACILITY_PC = 3,
|
||||
QMI_DMS_UIM_FACILITY_PF = 4
|
||||
} QmiDmsUimFacility;
|
||||
|
||||
/**
|
||||
* QmiDmsUimFacilityState:
|
||||
* @QMI_DMS_UIM_FACILITY_STATE_DEACTIVATED: Facility is deactivated.
|
||||
* @QMI_DMS_UIM_FACILITY_STATE_ACTIVATED: Facility is activated.
|
||||
* @QMI_DMS_UIM_FACILITY_STATE_BLOCKED: Facility is blocked.
|
||||
*
|
||||
* State of the UIM facility.
|
||||
*
|
||||
* Since: 1.0
|
||||
*/
|
||||
typedef enum { /*< since=1.0 >*/
|
||||
QMI_DMS_UIM_FACILITY_STATE_DEACTIVATED = 0,
|
||||
QMI_DMS_UIM_FACILITY_STATE_ACTIVATED = 1,
|
||||
QMI_DMS_UIM_FACILITY_STATE_BLOCKED = 2
|
||||
} QmiDmsUimFacilityState;
|
||||
|
||||
/*****************************************************************************/
|
||||
/* Helper enums for the 'QMI DMS UIM Get State' message */
|
||||
|
||||
/**
|
||||
* QmiDmsUimState:
|
||||
* @QMI_DMS_UIM_STATE_INITIALIZATION_COMPLETED: UIM initialization completed.
|
||||
* @QMI_DMS_UIM_STATE_LOCKED_OR_FAILED: UIM is locked or failed.
|
||||
* @QMI_DMS_UIM_STATE_NOT_PRESENT: No UIM in the device.
|
||||
* @QMI_DMS_UIM_STATE_RESERVED: Reserved, unknown.
|
||||
* @QMI_DMS_UIM_STATE_UNKNOWN: UIM state currently unavailable.
|
||||
*
|
||||
* State of the UIM.
|
||||
*
|
||||
* Since: 1.0
|
||||
*/
|
||||
typedef enum { /*< since=1.0 >*/
|
||||
QMI_DMS_UIM_STATE_INITIALIZATION_COMPLETED = 0x00,
|
||||
QMI_DMS_UIM_STATE_LOCKED_OR_FAILED = 0x01,
|
||||
QMI_DMS_UIM_STATE_NOT_PRESENT = 0x02,
|
||||
QMI_DMS_UIM_STATE_RESERVED = 0x03,
|
||||
QMI_DMS_UIM_STATE_UNKNOWN = 0xFF
|
||||
} QmiDmsUimState;
|
||||
|
||||
/*****************************************************************************/
|
||||
/* Helper enums for the 'QMI DMS Set Time' message */
|
||||
|
||||
/**
|
||||
* QmiDmsTimeReferenceType:
|
||||
* @QMI_DMS_TIME_REFERENCE_TYPE_USER: User time.
|
||||
*
|
||||
* Time reference type.
|
||||
*
|
||||
* Since: 1.0
|
||||
*/
|
||||
typedef enum { /*< since=1.0 >*/
|
||||
QMI_DMS_TIME_REFERENCE_TYPE_USER = 0
|
||||
} QmiDmsTimeReferenceType;
|
||||
|
||||
/*****************************************************************************/
|
||||
/* Helper enums for the 'QMI DMS Get Firmware Preference' message */
|
||||
|
||||
/**
|
||||
* QmiDmsFirmwareImageType:
|
||||
* @QMI_DMS_FIRMWARE_IMAGE_TYPE_MODEM: Modem image.
|
||||
* @QMI_DMS_FIRMWARE_IMAGE_TYPE_PRI: PRI image.
|
||||
*
|
||||
* Type of firmware image.
|
||||
*
|
||||
* Since: 1.0
|
||||
*/
|
||||
typedef enum { /*< since=1.0 >*/
|
||||
QMI_DMS_FIRMWARE_IMAGE_TYPE_MODEM = 0,
|
||||
QMI_DMS_FIRMWARE_IMAGE_TYPE_PRI = 1
|
||||
} QmiDmsFirmwareImageType;
|
||||
|
||||
/*****************************************************************************/
|
||||
/* Helper enums for the 'QMI DMS Get Boot Image Download Mode' message */
|
||||
|
||||
/**
|
||||
* QmiDmsBootImageDownloadMode:
|
||||
* @QMI_DMS_BOOT_IMAGE_DOWNLOAD_MODE_NORMAL: Normal operation.
|
||||
* @QMI_DMS_BOOT_IMAGE_DOWNLOAD_MODE_BOOT_AND_RECOVERY: Boot and recovery image download mode.
|
||||
*
|
||||
* Specifies the mode for the next boot.
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
typedef enum { /*< since=1.18 >*/
|
||||
QMI_DMS_BOOT_IMAGE_DOWNLOAD_MODE_NORMAL = 0,
|
||||
QMI_DMS_BOOT_IMAGE_DOWNLOAD_MODE_BOOT_AND_RECOVERY = 1,
|
||||
} QmiDmsBootImageDownloadMode;
|
||||
|
||||
/*****************************************************************************/
|
||||
/* Helper enums for the 'QMI DMS Get MAC Address' message */
|
||||
|
||||
/**
|
||||
* QmiDmsMacType:
|
||||
* @QMI_DMS_MAC_TYPE_WLAN: WLAN MAC address.
|
||||
* @QMI_DMS_MAC_TYPE_BT: Bluetooth MAC address.
|
||||
*
|
||||
* Specifies the device from which the MAC address should be queried.
|
||||
*
|
||||
* Since: 1.26
|
||||
*/
|
||||
typedef enum { /*< since=1.26 >*/
|
||||
QMI_DMS_MAC_TYPE_WLAN = 0,
|
||||
QMI_DMS_MAC_TYPE_BT = 1,
|
||||
} QmiDmsMacType;
|
||||
|
||||
/*****************************************************************************/
|
||||
/* Helper enums for the 'QMI DMS HP Change Device Mode' message */
|
||||
|
||||
/**
|
||||
* QmiDmsHpDeviceMode:
|
||||
* @QMI_DMS_HP_DEVICE_MODE_FASTBOOT: Fastboot download mode.
|
||||
*
|
||||
* HP specific device modes.
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
typedef enum { /*< since=1.18 >*/
|
||||
QMI_DMS_HP_DEVICE_MODE_FASTBOOT = 5,
|
||||
} QmiDmsHpDeviceMode;
|
||||
|
||||
/*****************************************************************************/
|
||||
/* Helper enums for the 'QMI DMS Swi Get USB Composition' message */
|
||||
|
||||
/**
|
||||
* QmiDmsSwiUsbComposition:
|
||||
* @QMI_DMS_SWI_USB_COMPOSITION_UNKNOWN: Unknown.
|
||||
* @QMI_DMS_SWI_USB_COMPOSITION_0: HIP, DM, NMEA, AT, MDM1, MDM2, MDM3, MS.
|
||||
* @QMI_DMS_SWI_USB_COMPOSITION_1: HIP, DM, NMEA, AT, MDM1, MS.
|
||||
* @QMI_DMS_SWI_USB_COMPOSITION_2: HIP, DM, NMEA, AT, NIC1, MS.
|
||||
* @QMI_DMS_SWI_USB_COMPOSITION_3: HIP, DM, NMEA, AT, MDM1, NIC1, MS.
|
||||
* @QMI_DMS_SWI_USB_COMPOSITION_4: HIP, DM, NMEA, AT, NIC1, NIC2, NIC3, MS.
|
||||
* @QMI_DMS_SWI_USB_COMPOSITION_5: HIP, DM, NMEA, AT, ECM1, MS.
|
||||
* @QMI_DMS_SWI_USB_COMPOSITION_6: DM, NMEA, AT, QMI.
|
||||
* @QMI_DMS_SWI_USB_COMPOSITION_7: DM, NMEA, AT, RMNET1, RMNET2, RMNET3.
|
||||
* @QMI_DMS_SWI_USB_COMPOSITION_8: DM, NMEA, AT, MBIM.
|
||||
* @QMI_DMS_SWI_USB_COMPOSITION_9: MBIM.
|
||||
* @QMI_DMS_SWI_USB_COMPOSITION_10: NMEA, MBIM.
|
||||
* @QMI_DMS_SWI_USB_COMPOSITION_11: DM, MBIM.
|
||||
* @QMI_DMS_SWI_USB_COMPOSITION_12: DM, NMEA, MBIM.
|
||||
* @QMI_DMS_SWI_USB_COMPOSITION_13: Dual configuration: USB composition 6 and USB composition 8.
|
||||
* @QMI_DMS_SWI_USB_COMPOSITION_14: Dual configuration: USB composition 6 and USB composition 9.
|
||||
* @QMI_DMS_SWI_USB_COMPOSITION_15: Dual configuration: USB composition 6 and USB composition 10.
|
||||
* @QMI_DMS_SWI_USB_COMPOSITION_16: Dual configuration: USB composition 6 and USB composition 11.
|
||||
* @QMI_DMS_SWI_USB_COMPOSITION_17: Dual configuration: USB composition 6 and USB composition 12.
|
||||
* @QMI_DMS_SWI_USB_COMPOSITION_18: Dual configuration: USB composition 7 and USB composition 8.
|
||||
* @QMI_DMS_SWI_USB_COMPOSITION_19: Dual configuration: USB composition 7 and USB composition 9.
|
||||
* @QMI_DMS_SWI_USB_COMPOSITION_20: Dual configuration: USB composition 7 and USB composition 10.
|
||||
* @QMI_DMS_SWI_USB_COMPOSITION_21: Dual configuration: USB composition 7 and USB composition 11.
|
||||
* @QMI_DMS_SWI_USB_COMPOSITION_22: Dual configuration: USB composition 7 and USB composition 12.
|
||||
*
|
||||
* Sierra Wireless USB composition modes.
|
||||
*
|
||||
* Since: 1.20
|
||||
*/
|
||||
typedef enum { /*< since=1.20 >*/
|
||||
QMI_DMS_SWI_USB_COMPOSITION_UNKNOWN = -1,
|
||||
QMI_DMS_SWI_USB_COMPOSITION_0 = 0,
|
||||
QMI_DMS_SWI_USB_COMPOSITION_1 = 1,
|
||||
QMI_DMS_SWI_USB_COMPOSITION_2 = 2,
|
||||
QMI_DMS_SWI_USB_COMPOSITION_3 = 3,
|
||||
QMI_DMS_SWI_USB_COMPOSITION_4 = 4,
|
||||
QMI_DMS_SWI_USB_COMPOSITION_5 = 5,
|
||||
QMI_DMS_SWI_USB_COMPOSITION_6 = 6,
|
||||
QMI_DMS_SWI_USB_COMPOSITION_7 = 7,
|
||||
QMI_DMS_SWI_USB_COMPOSITION_8 = 8,
|
||||
QMI_DMS_SWI_USB_COMPOSITION_9 = 9,
|
||||
QMI_DMS_SWI_USB_COMPOSITION_10 = 10,
|
||||
QMI_DMS_SWI_USB_COMPOSITION_11 = 11,
|
||||
QMI_DMS_SWI_USB_COMPOSITION_12 = 12,
|
||||
QMI_DMS_SWI_USB_COMPOSITION_13 = 13,
|
||||
QMI_DMS_SWI_USB_COMPOSITION_14 = 14,
|
||||
QMI_DMS_SWI_USB_COMPOSITION_15 = 15,
|
||||
QMI_DMS_SWI_USB_COMPOSITION_16 = 16,
|
||||
QMI_DMS_SWI_USB_COMPOSITION_17 = 17,
|
||||
QMI_DMS_SWI_USB_COMPOSITION_18 = 18,
|
||||
QMI_DMS_SWI_USB_COMPOSITION_19 = 19,
|
||||
QMI_DMS_SWI_USB_COMPOSITION_20 = 20,
|
||||
QMI_DMS_SWI_USB_COMPOSITION_21 = 21,
|
||||
QMI_DMS_SWI_USB_COMPOSITION_22 = 22,
|
||||
} QmiDmsSwiUsbComposition;
|
||||
|
||||
/**
|
||||
* qmi_dms_swi_usb_composition_get_description:
|
||||
* @value: a #QmiDmsSwiUsbComposition.
|
||||
*
|
||||
* Gets a text description of the Sierra Wireless USB composition.
|
||||
*
|
||||
* Since: 1.20
|
||||
* Returns: a string.
|
||||
*/
|
||||
const char *qmi_dms_swi_usb_composition_get_description (QmiDmsSwiUsbComposition value);
|
||||
|
||||
/*****************************************************************************/
|
||||
/* Helper enums for the 'QMI DMS Foxconn Change Device Mode' message */
|
||||
|
||||
/**
|
||||
* QmiDmsFoxconnDeviceMode:
|
||||
* @QMI_DMS_FOXCONN_DEVICE_MODE_UNKNOWN: Unknown mode.
|
||||
* @QMI_DMS_FOXCONN_DEVICE_MODE_FASTBOOT_ONLINE: Fastboot download mode for full partition files.
|
||||
* @QMI_DMS_FOXCONN_DEVICE_MODE_FASTBOOT_OTA: Fastboot download mode for OTA files.
|
||||
*
|
||||
* Foxconn specific device modes.
|
||||
*
|
||||
* Since: 1.26
|
||||
*/
|
||||
typedef enum { /*< since=1.26 >*/
|
||||
QMI_DMS_FOXCONN_DEVICE_MODE_UNKNOWN = 0,
|
||||
QMI_DMS_FOXCONN_DEVICE_MODE_FASTBOOT_ONLINE = 0x05,
|
||||
QMI_DMS_FOXCONN_DEVICE_MODE_FASTBOOT_OTA = 0x0A,
|
||||
} QmiDmsFoxconnDeviceMode;
|
||||
|
||||
/*****************************************************************************/
|
||||
/* Helper enums for the 'QMI DMS Foxconn Get Firmware Version' message */
|
||||
|
||||
/**
|
||||
* QmiDmsFoxconnFirmwareVersionType:
|
||||
* @QMI_DMS_FOXCONN_FIRMWARE_VERSION_TYPE_FIRMWARE_MCFG: E.g. T77W968.F0.0.0.2.3.GC.004.
|
||||
* @QMI_DMS_FOXCONN_FIRMWARE_VERSION_TYPE_FIRMWARE_MCFG_APPS: E.g. T77W968.F0.0.0.2.3.GC.004.011.
|
||||
* @QMI_DMS_FOXCONN_FIRMWARE_VERSION_TYPE_APPS: E.g. 011.
|
||||
*
|
||||
* Foxconn specific firmware version types.
|
||||
*
|
||||
* Since: 1.26
|
||||
*/
|
||||
typedef enum { /*< since=1.26 >*/
|
||||
QMI_DMS_FOXCONN_FIRMWARE_VERSION_TYPE_FIRMWARE_MCFG = 0x00,
|
||||
QMI_DMS_FOXCONN_FIRMWARE_VERSION_TYPE_FIRMWARE_MCFG_APPS = 0x01,
|
||||
QMI_DMS_FOXCONN_FIRMWARE_VERSION_TYPE_APPS = 0x02,
|
||||
} QmiDmsFoxconnFirmwareVersionType;
|
||||
|
||||
#endif /* _LIBQMI_GLIB_QMI_ENUMS_DMS_H_ */
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,194 @@
|
||||
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/*
|
||||
* uqmi -- tiny QMI support implementation
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Copyright (C) 2012 Google Inc.
|
||||
* Copyright (C) 2012-2017 Aleksander Morgado <aleksander@aleksander.es>
|
||||
*/
|
||||
|
||||
#ifndef _LIBQMI_GLIB_QMI_ENUMS_PDS_H_
|
||||
#define _LIBQMI_GLIB_QMI_ENUMS_PDS_H_
|
||||
|
||||
/**
|
||||
* SECTION: qmi-enums-pds
|
||||
*
|
||||
* This section defines enumerations and flags used in the PDS service
|
||||
* interface.
|
||||
*/
|
||||
|
||||
/*****************************************************************************/
|
||||
/* Helper enums for the 'QMI PDS Event Report' indication */
|
||||
|
||||
/**
|
||||
* QmiPdsOperationMode:
|
||||
* @QMI_PDS_OPERATION_MODE_UNKNOWN: Unknown (position not fixed yet).
|
||||
* @QMI_PDS_OPERATION_MODE_STANDALONE: Standalone.
|
||||
* @QMI_PDS_OPERATION_MODE_MS_BASED: Mobile Station Based (MSB) A-GPS.
|
||||
* @QMI_PDS_OPERATION_MODE_MS_ASSISTED: Mobile Station Assisted (MSA) A-GPS.
|
||||
*
|
||||
* Operation mode used to compute the position.
|
||||
*
|
||||
* Since: 1.0
|
||||
*/
|
||||
typedef enum { /*< since=1.0 >*/
|
||||
QMI_PDS_OPERATION_MODE_UNKNOWN = -1,
|
||||
QMI_PDS_OPERATION_MODE_STANDALONE = 0,
|
||||
QMI_PDS_OPERATION_MODE_MS_BASED = 1,
|
||||
QMI_PDS_OPERATION_MODE_MS_ASSISTED = 2
|
||||
} QmiPdsOperationMode;
|
||||
|
||||
/**
|
||||
* QmiPdsPositionSessionStatus:
|
||||
* @QMI_PDS_POSITION_SESSION_STATUS_SUCCESS: Success.
|
||||
* @QMI_PDS_POSITION_SESSION_STATUS_IN_PROGRESS: In progress.
|
||||
* @QMI_PDS_POSITION_SESSION_STATUS_GENERAL_FAILURE: General failure.
|
||||
* @QMI_PDS_POSITION_SESSION_STATUS_TIMEOUT: Timeout.
|
||||
* @QMI_PDS_POSITION_SESSION_STATUS_USER_ENDED_SESSION: User ended session.
|
||||
* @QMI_PDS_POSITION_SESSION_STATUS_BAD_PARAMETER: Bad parameter.
|
||||
* @QMI_PDS_POSITION_SESSION_STATUS_PHONE_OFFLINE: Phone is offline.
|
||||
* @QMI_PDS_POSITION_SESSION_STATUS_ENGINE_LOCKED: Engine locked.
|
||||
* @QMI_PDS_POSITION_SESSION_STATUS_E911_SESSION_IN_PROGRESS: Emergency call in progress.
|
||||
*
|
||||
* Status of the positioning session.
|
||||
*
|
||||
* Since: 1.0
|
||||
*/
|
||||
typedef enum { /*< since=1.0 >*/
|
||||
QMI_PDS_POSITION_SESSION_STATUS_SUCCESS = 0x00,
|
||||
QMI_PDS_POSITION_SESSION_STATUS_IN_PROGRESS = 0x01,
|
||||
QMI_PDS_POSITION_SESSION_STATUS_GENERAL_FAILURE = 0x02,
|
||||
QMI_PDS_POSITION_SESSION_STATUS_TIMEOUT = 0x03,
|
||||
QMI_PDS_POSITION_SESSION_STATUS_USER_ENDED_SESSION = 0x04,
|
||||
QMI_PDS_POSITION_SESSION_STATUS_BAD_PARAMETER = 0x05,
|
||||
QMI_PDS_POSITION_SESSION_STATUS_PHONE_OFFLINE = 0x06,
|
||||
QMI_PDS_POSITION_SESSION_STATUS_ENGINE_LOCKED = 0x07,
|
||||
QMI_PDS_POSITION_SESSION_STATUS_E911_SESSION_IN_PROGRESS = 0x08
|
||||
} QmiPdsPositionSessionStatus;
|
||||
|
||||
/**
|
||||
* QmiPdsDataValid:
|
||||
* @QMI_PDS_DATA_VALID_TIMESTAMP_CALENDAR: Timestamp calendar (GPS time).
|
||||
* @QMI_PDS_DATA_VALID_TIMESTAMP_UTC: Timestamp (UTC).
|
||||
* @QMI_PDS_DATA_VALID_LEAP_SECONDS: Leap seconds.
|
||||
* @QMI_PDS_DATA_VALID_TIME_UNCERTAINTY: Time uncertainty.
|
||||
* @QMI_PDS_DATA_VALID_LATITUDE: Latitude.
|
||||
* @QMI_PDS_DATA_VALID_LONGITUDE: Longitude.
|
||||
* @QMI_PDS_DATA_VALID_ELLIPSOID_ALTITUDE: Ellipsoid altitude.
|
||||
* @QMI_PDS_DATA_VALID_MEAN_SEA_LEVEL_ALTITUDE: Mean sea level altitude.
|
||||
* @QMI_PDS_DATA_VALID_HORIZONTAL_SPEED: Horizontal speed.
|
||||
* @QMI_PDS_DATA_VALID_VERTICAL_SPEED: Vertical speed.
|
||||
* @QMI_PDS_DATA_VALID_HEADING: Heading.
|
||||
* @QMI_PDS_DATA_VALID_HORIZONTAL_UNCERTAINTY_CIRCULAR: Horizontal uncertainty circular.
|
||||
* @QMI_PDS_DATA_VALID_HORIZONTAL_UNCERTAINTY_ELLIPSE_SEMI_MAJOR: Horizontal uncertainty ellipse semi-major.
|
||||
* @QMI_PDS_DATA_VALID_HORIZONTAL_UNCERTAINTY_ELLIPSE_SEMI_MINOR: Horizontal uncertainty ellipse semi-minor.
|
||||
* @QMI_PDS_DATA_VALID_HORIZONTAL_UNCERTAINTY_ELLIPSE_ORIENT_AZIMUTH: Horizontal uncertainty ellipse orient azimuth.
|
||||
* @QMI_PDS_DATA_VALID_VERTICAL_UNCERTAINTY: Vertical uncertainty.
|
||||
* @QMI_PDS_DATA_VALID_HORIZONTAL_VELOCITY_UNCERTAINTY: Horizontal velocity uncertainty.
|
||||
* @QMI_PDS_DATA_VALID_VERTICAL_VELOCITY_UNCERTAINTY: Vertical velocity uncertainty.
|
||||
* @QMI_PDS_DATA_VALID_HORIZONTAL_CONFIDENCE: Horizontal confidence.
|
||||
* @QMI_PDS_DATA_VALID_POSITION_DOP: Position dillution of precision.
|
||||
* @QMI_PDS_DATA_VALID_HORIZONTAL_DOP: Horizontal dillution of precision.
|
||||
* @QMI_PDS_DATA_VALID_VERTICAL_DOP: Vertical dillution of precision.
|
||||
* @QMI_PDS_DATA_VALID_OPERATING_MODE: Operating mode.
|
||||
*
|
||||
* Flags to indicate which position data parameters are valid.
|
||||
*
|
||||
* Since: 1.0
|
||||
*/
|
||||
typedef enum { /*< since=1.0 >*/
|
||||
QMI_PDS_DATA_VALID_TIMESTAMP_CALENDAR = 1 << 0,
|
||||
QMI_PDS_DATA_VALID_TIMESTAMP_UTC = 1 << 1,
|
||||
QMI_PDS_DATA_VALID_LEAP_SECONDS = 1 << 2,
|
||||
QMI_PDS_DATA_VALID_TIME_UNCERTAINTY = 1 << 3,
|
||||
QMI_PDS_DATA_VALID_LATITUDE = 1 << 4,
|
||||
QMI_PDS_DATA_VALID_LONGITUDE = 1 << 5,
|
||||
QMI_PDS_DATA_VALID_ELLIPSOID_ALTITUDE = 1 << 6,
|
||||
QMI_PDS_DATA_VALID_MEAN_SEA_LEVEL_ALTITUDE = 1 << 7,
|
||||
QMI_PDS_DATA_VALID_HORIZONTAL_SPEED = 1 << 8,
|
||||
QMI_PDS_DATA_VALID_VERTICAL_SPEED = 1 << 9,
|
||||
QMI_PDS_DATA_VALID_HEADING = 1 << 10,
|
||||
QMI_PDS_DATA_VALID_HORIZONTAL_UNCERTAINTY_CIRCULAR = 1 << 11,
|
||||
QMI_PDS_DATA_VALID_HORIZONTAL_UNCERTAINTY_ELLIPSE_SEMI_MAJOR = 1 << 12,
|
||||
QMI_PDS_DATA_VALID_HORIZONTAL_UNCERTAINTY_ELLIPSE_SEMI_MINOR = 1 << 13,
|
||||
QMI_PDS_DATA_VALID_HORIZONTAL_UNCERTAINTY_ELLIPSE_ORIENT_AZIMUTH = 1 << 14,
|
||||
QMI_PDS_DATA_VALID_VERTICAL_UNCERTAINTY = 1 << 15,
|
||||
QMI_PDS_DATA_VALID_HORIZONTAL_VELOCITY_UNCERTAINTY = 1 << 16,
|
||||
QMI_PDS_DATA_VALID_VERTICAL_VELOCITY_UNCERTAINTY = 1 << 17,
|
||||
QMI_PDS_DATA_VALID_HORIZONTAL_CONFIDENCE = 1 << 18,
|
||||
QMI_PDS_DATA_VALID_POSITION_DOP = 1 << 19,
|
||||
QMI_PDS_DATA_VALID_HORIZONTAL_DOP = 1 << 20,
|
||||
QMI_PDS_DATA_VALID_VERTICAL_DOP = 1 << 21,
|
||||
QMI_PDS_DATA_VALID_OPERATING_MODE = 1 << 22
|
||||
} QmiPdsDataValid;
|
||||
|
||||
/*****************************************************************************/
|
||||
/* Helper enums for the 'QMI PDS Get GPS Service State' request/response */
|
||||
|
||||
/**
|
||||
* QmiPdsTrackingSessionState:
|
||||
* @QMI_PDS_TRACKING_SESSION_STATE_UNKNOWN: Unknown state.
|
||||
* @QMI_PDS_TRACKING_SESSION_STATE_INACTIVE: Session inactive.
|
||||
* @QMI_PDS_TRACKING_SESSION_STATE_ACTIVE: Session active.
|
||||
*
|
||||
* State of the tracking session.
|
||||
*
|
||||
* Since: 1.0
|
||||
*/
|
||||
typedef enum { /*< since=1.0 >*/
|
||||
QMI_PDS_TRACKING_SESSION_STATE_UNKNOWN = 0,
|
||||
QMI_PDS_TRACKING_SESSION_STATE_INACTIVE = 1,
|
||||
QMI_PDS_TRACKING_SESSION_STATE_ACTIVE = 2
|
||||
} QmiPdsTrackingSessionState;
|
||||
|
||||
/*****************************************************************************/
|
||||
/* Helper enums for the 'QMI PDS Get Default Tracking Session' request/response */
|
||||
|
||||
/**
|
||||
* QmiPdsOperatingMode:
|
||||
* @QMI_PDS_OPERATING_MODE_STANDALONE: Standalone (GPS only).
|
||||
* @QMI_PDS_OPERATING_MODE_MS_BASED: Mobile Station Based (MSB) A-GPS
|
||||
* @QMI_PDS_OPERATING_MODE_MS_ASSISTED: Mobile Station Assisted (MSA) A-GPS.
|
||||
*
|
||||
* GPS operating mode.
|
||||
*
|
||||
* Since: 1.12
|
||||
*/
|
||||
typedef enum { /*< since=1.12 >*/
|
||||
QMI_PDS_OPERATING_MODE_STANDALONE = 0,
|
||||
QMI_PDS_OPERATING_MODE_MS_BASED = 1,
|
||||
QMI_PDS_OPERATING_MODE_MS_ASSISTED = 2,
|
||||
} QmiPdsOperatingMode;
|
||||
|
||||
/*****************************************************************************/
|
||||
/* Helper enums for the 'QMI PDS Get AGPS Config' request/response */
|
||||
|
||||
/**
|
||||
* QmiPdsNetworkMode:
|
||||
* @QMI_PDS_NETWORK_MODE_UMTS: UMTS.
|
||||
* @QMI_PDS_NETWORK_MODE_CDMA: CDMA.
|
||||
*
|
||||
* Network mode used during the A-GPS setup.
|
||||
*
|
||||
* Since: 1.12
|
||||
*/
|
||||
typedef enum { /*< since=1.12 >*/
|
||||
QMI_PDS_NETWORK_MODE_UMTS = 0,
|
||||
QMI_PDS_NETWORK_MODE_CDMA = 1,
|
||||
} QmiPdsNetworkMode;
|
||||
|
||||
#endif /* _LIBQMI_GLIB_QMI_ENUMS_PDS_H_ */
|
@ -0,0 +1,88 @@
|
||||
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/*
|
||||
* uqmi -- tiny QMI support implementation
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Copyright (C) 2012 Google Inc.
|
||||
* Copyright (C) 2012-2017 Aleksander Morgado <aleksander@aleksander.es>
|
||||
*/
|
||||
|
||||
#ifndef _LIBQMI_GLIB_QMI_ENUMS_PRIVATE_H_
|
||||
#define _LIBQMI_GLIB_QMI_ENUMS_PRIVATE_H_
|
||||
|
||||
/*****************************************************************************/
|
||||
/* QMI Control */
|
||||
|
||||
/**
|
||||
* QmiCtlDataFormat:
|
||||
* @QMI_CTL_DATA_FORMAT_QOS_FLOW_HEADER_ABSENT: QoS header absent
|
||||
* @QMI_CTL_DATA_FORMAT_QOS_FLOW_HEADER_PRESENT: QoS header present
|
||||
*
|
||||
* Controls whether the network port data format includes a QoS header or not.
|
||||
* Should normally be set to ABSENT.
|
||||
*/
|
||||
typedef enum {
|
||||
QMI_CTL_DATA_FORMAT_QOS_FLOW_HEADER_ABSENT = 0,
|
||||
QMI_CTL_DATA_FORMAT_QOS_FLOW_HEADER_PRESENT = 1,
|
||||
} QmiCtlDataFormat;
|
||||
|
||||
/**
|
||||
* QmiCtlDataLinkProtocol:
|
||||
* @QMI_CTL_DATA_LINK_PROTOCOL_802_3: data frames formatted as 802.3 Ethernet
|
||||
* @QMI_CTL_DATA_LINK_PROTOCOL_RAW_IP: data frames are raw IP packets
|
||||
*
|
||||
* Determines the network port data format.
|
||||
*/
|
||||
typedef enum {
|
||||
QMI_CTL_DATA_LINK_PROTOCOL_UNKNOWN = 0,
|
||||
QMI_CTL_DATA_LINK_PROTOCOL_802_3 = 1,
|
||||
QMI_CTL_DATA_LINK_PROTOCOL_RAW_IP = 2,
|
||||
} QmiCtlDataLinkProtocol;
|
||||
|
||||
/**
|
||||
* QmiCtlFlag:
|
||||
* @QMI_CTL_FLAG_NONE: None.
|
||||
* @QMI_CTL_FLAG_RESPONSE: Message is a response.
|
||||
* @QMI_CTL_FLAG_INDICATION: Message is an indication.
|
||||
*
|
||||
* QMI flags in messages of the %QMI_SERVICE_CTL service.
|
||||
*/
|
||||
typedef enum {
|
||||
QMI_CTL_FLAG_NONE = 0,
|
||||
QMI_CTL_FLAG_RESPONSE = 1 << 0,
|
||||
QMI_CTL_FLAG_INDICATION = 1 << 1
|
||||
} QmiCtlFlag;
|
||||
|
||||
/**
|
||||
* QmiServiceFlag:
|
||||
* @QMI_SERVICE_FLAG_NONE: None.
|
||||
* @QMI_SERVICE_FLAG_COMPOUND: Message is compound.
|
||||
* @QMI_SERVICE_FLAG_RESPONSE: Message is a response.
|
||||
* @QMI_SERVICE_FLAG_INDICATION: Message is an indication.
|
||||
*
|
||||
* QMI flags in messages which are not of the %QMI_SERVICE_CTL service.
|
||||
*/
|
||||
typedef enum {
|
||||
QMI_SERVICE_FLAG_NONE = 0,
|
||||
QMI_SERVICE_FLAG_COMPOUND = 1 << 0,
|
||||
QMI_SERVICE_FLAG_RESPONSE = 1 << 1,
|
||||
QMI_SERVICE_FLAG_INDICATION = 1 << 2
|
||||
} QmiServiceFlag;
|
||||
|
||||
|
||||
|
||||
#endif /* _LIBQMI_GLIB_QMI_ENUMS_PRIVATE_H_ */
|
@ -0,0 +1,498 @@
|
||||
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/*
|
||||
* libqmi-glib -- GLib/GIO based library to control QMI devices
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Copyright (C) 2012 Google Inc.
|
||||
* Copyright (C) 2012-2017 Aleksander Morgado <aleksander@aleksander.es>
|
||||
*/
|
||||
|
||||
#ifndef _LIBQMI_GLIB_QMI_ENUMS_UIM_H_
|
||||
#define _LIBQMI_GLIB_QMI_ENUMS_UIM_H_
|
||||
|
||||
/**
|
||||
* SECTION: qmi-enums-uim
|
||||
*
|
||||
* This section defines enumerations and flags used in the UIM service
|
||||
* interface.
|
||||
*/
|
||||
|
||||
/*****************************************************************************/
|
||||
/* Helper enums for the 'QMI UIM Indication Register' indication */
|
||||
|
||||
/**
|
||||
* QmiUimEventRegistrationFlag:
|
||||
* @QMI_UIM_EVENT_REGISTRATION_FLAG_CARD_STATUS: Card status.
|
||||
* @QMI_UIM_EVENT_REGISTRATION_FLAG_SAP_CONNECTION: SAP connection.
|
||||
* @QMI_UIM_EVENT_REGISTRATION_FLAG_EXTENDED_CARD_STATUS: Extended card status.
|
||||
* @QMI_UIM_EVENT_REGISTRATION_FLAG_PHYSICAL_SLOT_STATUS: Physical slot status. Since 1.26.
|
||||
*
|
||||
* Flags to use to register to UIM indications.
|
||||
*
|
||||
* Since: 1.22.4
|
||||
*/
|
||||
typedef enum { /*< since=1.22.4 >*/
|
||||
QMI_UIM_EVENT_REGISTRATION_FLAG_CARD_STATUS = 1 << 0,
|
||||
QMI_UIM_EVENT_REGISTRATION_FLAG_SAP_CONNECTION = 1 << 1,
|
||||
QMI_UIM_EVENT_REGISTRATION_FLAG_EXTENDED_CARD_STATUS = 1 << 2,
|
||||
QMI_UIM_EVENT_REGISTRATION_FLAG_PHYSICAL_SLOT_STATUS = 1 << 4,
|
||||
} QmiUimEventRegistrationFlag;
|
||||
|
||||
/*****************************************************************************/
|
||||
/* Helper enums for the 'QMI UIM Read Record' request/response */
|
||||
|
||||
/**
|
||||
* QmiUimSessionType:
|
||||
* @QMI_UIM_SESSION_TYPE_PRIMARY_GW_PROVISIONING: Primary GSM/WCDMA provisioning.
|
||||
* @QMI_UIM_SESSION_TYPE_PRIMARY_1X_PROVISIONING: Primary CDMA1x provisioning.
|
||||
* @QMI_UIM_SESSION_TYPE_SECONDARY_GW_PROVISIONING: Secondary GSM/WCDMA provisioning.
|
||||
* @QMI_UIM_SESSION_TYPE_SECONDARY_1X_PROVISIONING: Secondary CDMA1x provisioning.
|
||||
* @QMI_UIM_SESSION_TYPE_NONPROVISIONING_SLOT_1: Nonprovisioning on slot 1.
|
||||
* @QMI_UIM_SESSION_TYPE_NONPROVISIONING_SLOT_2: Nonprovisioning on slot 2.
|
||||
* @QMI_UIM_SESSION_TYPE_CARD_SLOT_1: Card on slot 1.
|
||||
* @QMI_UIM_SESSION_TYPE_CARD_SLOT_2: Card on slot 2.
|
||||
* @QMI_UIM_SESSION_TYPE_LOGICAL_CHANNEL_SLOT_1: Logical channel on slot 1.
|
||||
* @QMI_UIM_SESSION_TYPE_LOGICAL_CHANNEL_SLOT_2: Logical channel on slot 2.
|
||||
* @QMI_UIM_SESSION_TYPE_TERTIARY_GW_PROVISIONING: Tertiary GSM/WCDMA provisioning. Since 1.28.
|
||||
* @QMI_UIM_SESSION_TYPE_TERTIARY_1X_PROVISIONING: Tertiary CDMA1x provisioning. Since 1.28.
|
||||
* @QMI_UIM_SESSION_TYPE_QUATERNARY_GW_PROVISIONING: Quaternary GSM/WCDMA provisioning. Since 1.28.
|
||||
* @QMI_UIM_SESSION_TYPE_QUATERNARY_1X_PROVISIONING: Quaternary CDMA1x provisioning. Since 1.28.
|
||||
* @QMI_UIM_SESSION_TYPE_QUINARY_GW_PROVISIONING: Quinary GSM/WCDMA provisioning. Since 1.28.
|
||||
* @QMI_UIM_SESSION_TYPE_QUINARY_1X_PROVISIONING: Quinary CDMA1x provisioning. Since 1.28.
|
||||
* @QMI_UIM_SESSION_TYPE_NONPROVISIONING_SLOT_3: Nonprovisioning on slot 3. Since 1.28.
|
||||
* @QMI_UIM_SESSION_TYPE_NONPROVISIONING_SLOT_4: Nonprovisioning on slot 4. Since 1.28.
|
||||
* @QMI_UIM_SESSION_TYPE_NONPROVISIONING_SLOT_5: Nonprovisioning on slot 5. Since 1.28.
|
||||
* @QMI_UIM_SESSION_TYPE_CARD_SLOT_3: Card on slot 3. Since 1.28.
|
||||
* @QMI_UIM_SESSION_TYPE_CARD_SLOT_4: Card on slot 4. Since 1.28.
|
||||
* @QMI_UIM_SESSION_TYPE_CARD_SLOT_5: Card on slot 5. Since 1.28.
|
||||
* @QMI_UIM_SESSION_TYPE_LOGICAL_CHANNEL_SLOT_3: Logical channel on slot 3. Since 1.28.
|
||||
* @QMI_UIM_SESSION_TYPE_LOGICAL_CHANNEL_SLOT_4: Logical channel on slot 4. Since 1.28.
|
||||
* @QMI_UIM_SESSION_TYPE_LOGICAL_CHANNEL_SLOT_5: Logical channel on slot 5. Since 1.28.
|
||||
*
|
||||
* Type of UIM session.
|
||||
*
|
||||
* Since: 1.6
|
||||
*/
|
||||
typedef enum { /*< since=1.6 >*/
|
||||
QMI_UIM_SESSION_TYPE_PRIMARY_GW_PROVISIONING = 0,
|
||||
QMI_UIM_SESSION_TYPE_PRIMARY_1X_PROVISIONING = 1,
|
||||
QMI_UIM_SESSION_TYPE_SECONDARY_GW_PROVISIONING = 2,
|
||||
QMI_UIM_SESSION_TYPE_SECONDARY_1X_PROVISIONING = 3,
|
||||
QMI_UIM_SESSION_TYPE_NONPROVISIONING_SLOT_1 = 4,
|
||||
QMI_UIM_SESSION_TYPE_NONPROVISIONING_SLOT_2 = 5,
|
||||
QMI_UIM_SESSION_TYPE_CARD_SLOT_1 = 6,
|
||||
QMI_UIM_SESSION_TYPE_CARD_SLOT_2 = 7,
|
||||
QMI_UIM_SESSION_TYPE_LOGICAL_CHANNEL_SLOT_1 = 8,
|
||||
QMI_UIM_SESSION_TYPE_LOGICAL_CHANNEL_SLOT_2 = 9,
|
||||
QMI_UIM_SESSION_TYPE_TERTIARY_GW_PROVISIONING = 10,
|
||||
QMI_UIM_SESSION_TYPE_TERTIARY_1X_PROVISIONING = 11,
|
||||
QMI_UIM_SESSION_TYPE_QUATERNARY_GW_PROVISIONING = 12,
|
||||
QMI_UIM_SESSION_TYPE_QUATERNARY_1X_PROVISIONING = 13,
|
||||
QMI_UIM_SESSION_TYPE_QUINARY_GW_PROVISIONING = 14,
|
||||
QMI_UIM_SESSION_TYPE_QUINARY_1X_PROVISIONING = 15,
|
||||
QMI_UIM_SESSION_TYPE_NONPROVISIONING_SLOT_3 = 16,
|
||||
QMI_UIM_SESSION_TYPE_NONPROVISIONING_SLOT_4 = 17,
|
||||
QMI_UIM_SESSION_TYPE_NONPROVISIONING_SLOT_5 = 18,
|
||||
QMI_UIM_SESSION_TYPE_CARD_SLOT_3 = 19,
|
||||
QMI_UIM_SESSION_TYPE_CARD_SLOT_4 = 20,
|
||||
QMI_UIM_SESSION_TYPE_CARD_SLOT_5 = 21,
|
||||
QMI_UIM_SESSION_TYPE_LOGICAL_CHANNEL_SLOT_3 = 22,
|
||||
QMI_UIM_SESSION_TYPE_LOGICAL_CHANNEL_SLOT_4 = 23,
|
||||
QMI_UIM_SESSION_TYPE_LOGICAL_CHANNEL_SLOT_5 = 24,
|
||||
} QmiUimSessionType;
|
||||
|
||||
/*****************************************************************************/
|
||||
/* Helper enums for the 'QMI UIM Get File Attributes' request/response */
|
||||
|
||||
/**
|
||||
* QmiUimFileType:
|
||||
* @QMI_UIM_FILE_TYPE_TRANSPARENT: Transparent.
|
||||
* @QMI_UIM_FILE_TYPE_CYCLIC: Cyclic.
|
||||
* @QMI_UIM_FILE_TYPE_LINEAR_FIXED: Linear fixed.
|
||||
* @QMI_UIM_FILE_TYPE_DEDICATED_FILE: Dedicated file.
|
||||
* @QMI_UIM_FILE_TYPE_MASTER_FILE: Master file.
|
||||
*
|
||||
* Type of UIM file.
|
||||
*
|
||||
* Since: 1.6
|
||||
*/
|
||||
typedef enum { /*< since=1.6 >*/
|
||||
QMI_UIM_FILE_TYPE_TRANSPARENT = 0,
|
||||
QMI_UIM_FILE_TYPE_CYCLIC = 1,
|
||||
QMI_UIM_FILE_TYPE_LINEAR_FIXED = 2,
|
||||
QMI_UIM_FILE_TYPE_DEDICATED_FILE = 3,
|
||||
QMI_UIM_FILE_TYPE_MASTER_FILE = 4
|
||||
} QmiUimFileType;
|
||||
|
||||
/**
|
||||
* QmiUimSecurityAttributeLogic:
|
||||
* @QMI_UIM_SECURITY_ATTRIBUTE_LOGIC_ALWAYS: Always.
|
||||
* @QMI_UIM_SECURITY_ATTRIBUTE_LOGIC_NEVER: Never.
|
||||
* @QMI_UIM_SECURITY_ATTRIBUTE_LOGIC_AND: And.
|
||||
* @QMI_UIM_SECURITY_ATTRIBUTE_LOGIC_OR: Or.
|
||||
* @QMI_UIM_SECURITY_ATTRIBUTE_LOGIC_SINGLE: Single.
|
||||
*
|
||||
* Logic applicable to security attributes.
|
||||
*
|
||||
* Since: 1.6
|
||||
*/
|
||||
typedef enum { /*< since=1.6 >*/
|
||||
QMI_UIM_SECURITY_ATTRIBUTE_LOGIC_ALWAYS = 0,
|
||||
QMI_UIM_SECURITY_ATTRIBUTE_LOGIC_NEVER = 1,
|
||||
QMI_UIM_SECURITY_ATTRIBUTE_LOGIC_AND = 2,
|
||||
QMI_UIM_SECURITY_ATTRIBUTE_LOGIC_OR = 3,
|
||||
QMI_UIM_SECURITY_ATTRIBUTE_LOGIC_SINGLE = 4
|
||||
} QmiUimSecurityAttributeLogic;
|
||||
|
||||
/**
|
||||
* QmiUimSecurityAttribute:
|
||||
* @QMI_UIM_SECURITY_ATTRIBUTE_PIN1: PIN1.
|
||||
* @QMI_UIM_SECURITY_ATTRIBUTE_PIN2: PIN2.
|
||||
* @QMI_UIM_SECURITY_ATTRIBUTE_UPIN: UPIN.
|
||||
* @QMI_UIM_SECURITY_ATTRIBUTE_ADM: ADM.
|
||||
*
|
||||
* Security Attributes.
|
||||
*
|
||||
* Since: 1.6
|
||||
*/
|
||||
typedef enum { /*< since=1.6 >*/
|
||||
QMI_UIM_SECURITY_ATTRIBUTE_PIN1 = 1 << 0,
|
||||
QMI_UIM_SECURITY_ATTRIBUTE_PIN2 = 1 << 1,
|
||||
QMI_UIM_SECURITY_ATTRIBUTE_UPIN = 1 << 2,
|
||||
QMI_UIM_SECURITY_ATTRIBUTE_ADM = 1 << 3
|
||||
} QmiUimSecurityAttribute;
|
||||
|
||||
/*****************************************************************************/
|
||||
/* Helper enums for the 'QMI UIM Set PIN Protection' */
|
||||
|
||||
/**
|
||||
* QmiUimPinId:
|
||||
* @QMI_UIM_PIN_ID_UNKNOWN: Unknown.
|
||||
* @QMI_UIM_PIN_ID_PIN1: PIN1.
|
||||
* @QMI_UIM_PIN_ID_PIN2: PIN2.
|
||||
* @QMI_UIM_PIN_ID_UPIN: UPIN.
|
||||
* @QMI_UIM_PIN_ID_HIDDEN_KEY: Hidden key.
|
||||
*
|
||||
* PIN ID.
|
||||
*
|
||||
* Since: 1.14
|
||||
*/
|
||||
typedef enum { /*< since=1.14 >*/
|
||||
QMI_UIM_PIN_ID_UNKNOWN = 0,
|
||||
QMI_UIM_PIN_ID_PIN1 = 1,
|
||||
QMI_UIM_PIN_ID_PIN2 = 2,
|
||||
QMI_UIM_PIN_ID_UPIN = 3,
|
||||
QMI_UIM_PIN_ID_HIDDEN_KEY = 4
|
||||
} QmiUimPinId;
|
||||
|
||||
/*****************************************************************************/
|
||||
/* Helper enums for the 'QMI UIM Get Card Status' request/response */
|
||||
|
||||
/**
|
||||
* QmiUimCardState:
|
||||
* @QMI_UIM_CARD_STATE_ABSENT: Absent.
|
||||
* @QMI_UIM_CARD_STATE_PRESENT: Present.
|
||||
* @QMI_UIM_CARD_STATE_ERROR: Error.
|
||||
*
|
||||
* State of the card.
|
||||
*
|
||||
* Since: 1.10
|
||||
*/
|
||||
typedef enum { /*< since=1.10 >*/
|
||||
QMI_UIM_CARD_STATE_ABSENT = 0,
|
||||
QMI_UIM_CARD_STATE_PRESENT = 1,
|
||||
QMI_UIM_CARD_STATE_ERROR = 2
|
||||
} QmiUimCardState;
|
||||
|
||||
/**
|
||||
* QmiUimPinState:
|
||||
* @QMI_UIM_PIN_STATE_NOT_INITIALIZED: Not initialized.
|
||||
* @QMI_UIM_PIN_STATE_ENABLED_NOT_VERIFIED: Enabled, not verified.
|
||||
* @QMI_UIM_PIN_STATE_ENABLED_VERIFIED: Enabled, verified.
|
||||
* @QMI_UIM_PIN_STATE_DISABLED: Disabled.
|
||||
* @QMI_UIM_PIN_STATE_BLOCKED: Blocked.
|
||||
* @QMI_UIM_PIN_STATE_PERMANENTLY_BLOCKED: Permanently Blocked.
|
||||
*
|
||||
* The PIN state.
|
||||
*
|
||||
* Since: 1.10
|
||||
*/
|
||||
typedef enum { /*< since=1.10 >*/
|
||||
QMI_UIM_PIN_STATE_NOT_INITIALIZED = 0,
|
||||
QMI_UIM_PIN_STATE_ENABLED_NOT_VERIFIED = 1,
|
||||
QMI_UIM_PIN_STATE_ENABLED_VERIFIED = 2,
|
||||
QMI_UIM_PIN_STATE_DISABLED = 3,
|
||||
QMI_UIM_PIN_STATE_BLOCKED = 4,
|
||||
QMI_UIM_PIN_STATE_PERMANENTLY_BLOCKED = 5,
|
||||
} QmiUimPinState;
|
||||
|
||||
/**
|
||||
* QmiUimCardError:
|
||||
* @QMI_UIM_CARD_ERROR_UNKNOWN: Unknown error.
|
||||
* @QMI_UIM_CARD_ERROR_POWER_DOWN: Power down.
|
||||
* @QMI_UIM_CARD_ERROR_POLL: Poll error.
|
||||
* @QMI_UIM_CARD_ERROR_NO_ATR_RECEIVED: No ATR received.
|
||||
* @QMI_UIM_CARD_ERROR_VOLTAGE_MISMATCH: Voltage mismatch.
|
||||
* @QMI_UIM_CARD_ERROR_PARITY: Parity error.
|
||||
* @QMI_UIM_CARD_ERROR_POSSIBLY_REMOVED: Unknown error, possibly removed.
|
||||
* @QMI_UIM_CARD_ERROR_TECHNICAL: Technical problem.
|
||||
*
|
||||
* Card error.
|
||||
*
|
||||
* Since: 1.10
|
||||
*/
|
||||
typedef enum { /*< since=1.10 >*/
|
||||
QMI_UIM_CARD_ERROR_UNKNOWN = 0,
|
||||
QMI_UIM_CARD_ERROR_POWER_DOWN = 1,
|
||||
QMI_UIM_CARD_ERROR_POLL = 2,
|
||||
QMI_UIM_CARD_ERROR_NO_ATR_RECEIVED = 3,
|
||||
QMI_UIM_CARD_ERROR_VOLTAGE_MISMATCH = 4,
|
||||
QMI_UIM_CARD_ERROR_PARITY = 5,
|
||||
QMI_UIM_CARD_ERROR_POSSIBLY_REMOVED = 6,
|
||||
QMI_UIM_CARD_ERROR_TECHNICAL = 7
|
||||
} QmiUimCardError;
|
||||
|
||||
/**
|
||||
* QmiUimCardApplicationType:
|
||||
* @QMI_UIM_CARD_APPLICATION_TYPE_UNKNOWN: Unknown.
|
||||
* @QMI_UIM_CARD_APPLICATION_TYPE_SIM: SIM.
|
||||
* @QMI_UIM_CARD_APPLICATION_TYPE_USIM: USIM.
|
||||
* @QMI_UIM_CARD_APPLICATION_TYPE_RUIM: RUIM.
|
||||
* @QMI_UIM_CARD_APPLICATION_TYPE_CSIM: CSIM.
|
||||
* @QMI_UIM_CARD_APPLICATION_TYPE_ISIM: ISIM.
|
||||
*
|
||||
* Card application type.
|
||||
*
|
||||
* Since: 1.10
|
||||
*/
|
||||
typedef enum { /*< since=1.10 >*/
|
||||
QMI_UIM_CARD_APPLICATION_TYPE_UNKNOWN = 0,
|
||||
QMI_UIM_CARD_APPLICATION_TYPE_SIM = 1,
|
||||
QMI_UIM_CARD_APPLICATION_TYPE_USIM = 2,
|
||||
QMI_UIM_CARD_APPLICATION_TYPE_RUIM = 3,
|
||||
QMI_UIM_CARD_APPLICATION_TYPE_CSIM = 4,
|
||||
QMI_UIM_CARD_APPLICATION_TYPE_ISIM = 5,
|
||||
} QmiUimCardApplicationType;
|
||||
|
||||
/**
|
||||
* QmiUimCardApplicationState:
|
||||
* @QMI_UIM_CARD_APPLICATION_STATE_UNKNOWN: Unknown.
|
||||
* @QMI_UIM_CARD_APPLICATION_STATE_DETECTED: Detected.
|
||||
* @QMI_UIM_CARD_APPLICATION_STATE_PIN1_OR_UPIN_PIN_REQUIRED: PIN1 or UPIN PIN required.
|
||||
* @QMI_UIM_CARD_APPLICATION_STATE_PUK1_OR_UPIN_PUK_REQUIRED: PUK1 or UPIN PUK required.
|
||||
* @QMI_UIM_CARD_APPLICATION_STATE_CHECK_PERSONALIZATION_STATE: Personalization state must be checked.
|
||||
* @QMI_UIM_CARD_APPLICATION_STATE_PIN1_BLOCKED: PIN1 blocked.
|
||||
* @QMI_UIM_CARD_APPLICATION_STATE_ILLEGAL: Illegal.
|
||||
* @QMI_UIM_CARD_APPLICATION_STATE_READY: Ready
|
||||
*
|
||||
* Card application state.
|
||||
*
|
||||
* Since: 1.10
|
||||
*/
|
||||
typedef enum { /*< since=1.10 >*/
|
||||
QMI_UIM_CARD_APPLICATION_STATE_UNKNOWN = 0,
|
||||
QMI_UIM_CARD_APPLICATION_STATE_DETECTED = 1,
|
||||
QMI_UIM_CARD_APPLICATION_STATE_PIN1_OR_UPIN_PIN_REQUIRED = 2,
|
||||
QMI_UIM_CARD_APPLICATION_STATE_PUK1_OR_UPIN_PUK_REQUIRED = 3,
|
||||
QMI_UIM_CARD_APPLICATION_STATE_CHECK_PERSONALIZATION_STATE = 4,
|
||||
QMI_UIM_CARD_APPLICATION_STATE_PIN1_BLOCKED = 5,
|
||||
QMI_UIM_CARD_APPLICATION_STATE_ILLEGAL = 6,
|
||||
QMI_UIM_CARD_APPLICATION_STATE_READY = 7,
|
||||
} QmiUimCardApplicationState;
|
||||
|
||||
/**
|
||||
* QmiUimCardApplicationPersonalizationState:
|
||||
* @QMI_UIM_CARD_APPLICATION_PERSONALIZATION_STATE_UNKNOWN: Unknown.
|
||||
* @QMI_UIM_CARD_APPLICATION_PERSONALIZATION_STATE_IN_PROGRESS: Operation in progress.
|
||||
* @QMI_UIM_CARD_APPLICATION_PERSONALIZATION_STATE_READY: Ready.
|
||||
* @QMI_UIM_CARD_APPLICATION_PERSONALIZATION_STATE_CODE_REQUIRED: Code required.
|
||||
* @QMI_UIM_CARD_APPLICATION_PERSONALIZATION_STATE_PUK_CODE_REQUIRED: PUK code required.
|
||||
* @QMI_UIM_CARD_APPLICATION_PERSONALIZATION_STATE_PERMANENTLY_BLOCKED: Permanently blocked-
|
||||
*
|
||||
* Card application personalization state.
|
||||
*
|
||||
* Since: 1.10
|
||||
*/
|
||||
typedef enum { /*< since=1.10 >*/
|
||||
QMI_UIM_CARD_APPLICATION_PERSONALIZATION_STATE_UNKNOWN = 0,
|
||||
QMI_UIM_CARD_APPLICATION_PERSONALIZATION_STATE_IN_PROGRESS = 1,
|
||||
QMI_UIM_CARD_APPLICATION_PERSONALIZATION_STATE_READY = 2,
|
||||
QMI_UIM_CARD_APPLICATION_PERSONALIZATION_STATE_CODE_REQUIRED = 3,
|
||||
QMI_UIM_CARD_APPLICATION_PERSONALIZATION_STATE_PUK_CODE_REQUIRED = 4,
|
||||
QMI_UIM_CARD_APPLICATION_PERSONALIZATION_STATE_PERMANENTLY_BLOCKED = 5,
|
||||
} QmiUimCardApplicationPersonalizationState;
|
||||
|
||||
/**
|
||||
* QmiUimCardApplicationPersonalizationFeature:
|
||||
* @QMI_UIM_CARD_APPLICATION_PERSONALIZATION_FEATURE_GW_NETWORK: GW network.
|
||||
* @QMI_UIM_CARD_APPLICATION_PERSONALIZATION_FEATURE_GW_NETWORK_SUBSET: GW network subset.
|
||||
* @QMI_UIM_CARD_APPLICATION_PERSONALIZATION_FEATURE_GW_SERVICE_PROVIDER: GW service provider.
|
||||
* @QMI_UIM_CARD_APPLICATION_PERSONALIZATION_FEATURE_GW_CORPORATE: GW corporate.
|
||||
* @QMI_UIM_CARD_APPLICATION_PERSONALIZATION_FEATURE_GW_UIM: UIM.
|
||||
* @QMI_UIM_CARD_APPLICATION_PERSONALIZATION_FEATURE_1X_NETWORK_TYPE_1: 1X network type 1.
|
||||
* @QMI_UIM_CARD_APPLICATION_PERSONALIZATION_FEATURE_1X_NETWORK_TYPE_2: 1X network type 2.
|
||||
* @QMI_UIM_CARD_APPLICATION_PERSONALIZATION_FEATURE_1X_HRPD: 1X HRPD.
|
||||
* @QMI_UIM_CARD_APPLICATION_PERSONALIZATION_FEATURE_1X_SERVICE_PROVIDER: 1X service provider.
|
||||
* @QMI_UIM_CARD_APPLICATION_PERSONALIZATION_FEATURE_1X_CORPORATE: 1X corporate.
|
||||
* @QMI_UIM_CARD_APPLICATION_PERSONALIZATION_FEATURE_1X_RUIM: 1X R-UIM.
|
||||
* @QMI_UIM_CARD_APPLICATION_PERSONALIZATION_FEATURE_UNKNOWN: Unknown.
|
||||
*
|
||||
* Card application personalization feature, when a code is required.
|
||||
*
|
||||
* Since: 1.10
|
||||
*/
|
||||
typedef enum { /*< since=1.10 >*/
|
||||
QMI_UIM_CARD_APPLICATION_PERSONALIZATION_FEATURE_GW_NETWORK = 0,
|
||||
QMI_UIM_CARD_APPLICATION_PERSONALIZATION_FEATURE_GW_NETWORK_SUBSET = 1,
|
||||
QMI_UIM_CARD_APPLICATION_PERSONALIZATION_FEATURE_GW_SERVICE_PROVIDER = 2,
|
||||
QMI_UIM_CARD_APPLICATION_PERSONALIZATION_FEATURE_GW_CORPORATE = 3,
|
||||
QMI_UIM_CARD_APPLICATION_PERSONALIZATION_FEATURE_GW_UIM = 4,
|
||||
QMI_UIM_CARD_APPLICATION_PERSONALIZATION_FEATURE_1X_NETWORK_TYPE_1 = 5,
|
||||
QMI_UIM_CARD_APPLICATION_PERSONALIZATION_FEATURE_1X_NETWORK_TYPE_2 = 6,
|
||||
QMI_UIM_CARD_APPLICATION_PERSONALIZATION_FEATURE_1X_HRPD = 7,
|
||||
QMI_UIM_CARD_APPLICATION_PERSONALIZATION_FEATURE_1X_SERVICE_PROVIDER = 8,
|
||||
QMI_UIM_CARD_APPLICATION_PERSONALIZATION_FEATURE_1X_CORPORATE = 9,
|
||||
QMI_UIM_CARD_APPLICATION_PERSONALIZATION_FEATURE_1X_RUIM = 10,
|
||||
QMI_UIM_CARD_APPLICATION_PERSONALIZATION_FEATURE_UNKNOWN = 11
|
||||
} QmiUimCardApplicationPersonalizationFeature;
|
||||
|
||||
/*****************************************************************************/
|
||||
/* Helper enums for the 'QMI UIM Refresh' indication */
|
||||
|
||||
/**
|
||||
* QmiUimRefreshStage:
|
||||
* @QMI_UIM_REFRESH_STAGE_WAIT_FOR_OK: Waiting for REFRESH OK message.
|
||||
* @QMI_UIM_REFRESH_STAGE_START: Refresh started.
|
||||
* @QMI_UIM_REFRESH_STAGE_END_WITH_SUCCESS: Refresh completed successfully.
|
||||
* @QMI_UIM_REFRESH_STAGE_END_WITH_FAILURE: Refresh has failed.
|
||||
*
|
||||
* Current stage of the refresh procedure.
|
||||
*
|
||||
* Since: 1.28
|
||||
*/
|
||||
typedef enum { /*< since=1.28 >*/
|
||||
QMI_UIM_REFRESH_STAGE_WAIT_FOR_OK = 0,
|
||||
QMI_UIM_REFRESH_STAGE_START = 1,
|
||||
QMI_UIM_REFRESH_STAGE_END_WITH_SUCCESS = 2,
|
||||
QMI_UIM_REFRESH_STAGE_END_WITH_FAILURE = 3
|
||||
} QmiUimRefreshStage;
|
||||
|
||||
/**
|
||||
* QmiUimRefreshMode:
|
||||
* @QMI_UIM_REFRESH_MODE_RESET: Reset.
|
||||
* @QMI_UIM_REFRESH_MODE_INIT: Init.
|
||||
* @QMI_UIM_REFRESH_MODE_INIT_FCN: Init & FCN.
|
||||
* @QMI_UIM_REFRESH_MODE_FCN: FCN.
|
||||
* @QMI_UIM_REFRESH_MODE_INIT_FULL_FCN: Init & full FCN.
|
||||
* @QMI_UIM_REFRESH_MODE_APP_RESET: Application reset.
|
||||
* @QMI_UIM_REFRESH_MODE_3G_RESET: 3G session reset.
|
||||
*
|
||||
* Refresh mode
|
||||
*
|
||||
* Since: 1.28
|
||||
*/
|
||||
typedef enum { /*< since=1.28 >*/
|
||||
QMI_UIM_REFRESH_MODE_RESET = 0,
|
||||
QMI_UIM_REFRESH_MODE_INIT = 1,
|
||||
QMI_UIM_REFRESH_MODE_INIT_FCN = 2,
|
||||
QMI_UIM_REFRESH_MODE_FCN = 3,
|
||||
QMI_UIM_REFRESH_MODE_INIT_FULL_FCN = 4,
|
||||
QMI_UIM_REFRESH_MODE_APP_RESET = 5,
|
||||
QMI_UIM_REFRESH_MODE_3G_RESET = 6
|
||||
} QmiUimRefreshMode;
|
||||
|
||||
/*****************************************************************************/
|
||||
/* Helper enums for the 'QMI UIM Get Slot Status' request/response */
|
||||
|
||||
/**
|
||||
* QmiUimPhysicalCardState:
|
||||
* @QMI_UIM_PHYSICAL_CARD_STATE_UNKNOWN: Unknown.
|
||||
* @QMI_UIM_PHYSICAL_CARD_STATE_ABSENT: Absent.
|
||||
* @QMI_UIM_PHYSICAL_CARD_STATE_PRESENT: Present.
|
||||
*
|
||||
* State of the physical card.
|
||||
*
|
||||
* Since: 1.26
|
||||
*/
|
||||
typedef enum { /*< since=1.26 >*/
|
||||
QMI_UIM_PHYSICAL_CARD_STATE_UNKNOWN = 0,
|
||||
QMI_UIM_PHYSICAL_CARD_STATE_ABSENT = 1,
|
||||
QMI_UIM_PHYSICAL_CARD_STATE_PRESENT = 2,
|
||||
} QmiUimPhysicalCardState;
|
||||
|
||||
/**
|
||||
* QmiUimSlotState:
|
||||
* @QMI_UIM_SLOT_STATE_INACTIVE: Inactive.
|
||||
* @QMI_UIM_SLOT_STATE_ACTIVE: Active.
|
||||
*
|
||||
* State of the slot.
|
||||
*
|
||||
* Since: 1.26
|
||||
*/
|
||||
typedef enum { /*< since=1.26 >*/
|
||||
QMI_UIM_SLOT_STATE_INACTIVE = 0,
|
||||
QMI_UIM_SLOT_STATE_ACTIVE = 1,
|
||||
} QmiUimSlotState;
|
||||
|
||||
/**
|
||||
* QmiUimCardProtocol:
|
||||
* @QMI_UIM_CARD_PROTOCOL_UNKNOWN: Unknown.
|
||||
* @QMI_UIM_CARD_PROTOCOL_ICC: ICC protocol.
|
||||
* @QMI_UIM_CARD_PROTOCOL_UICC: UICC protocol.
|
||||
*
|
||||
* Protocol for the card.
|
||||
*
|
||||
* Since: 1.26
|
||||
*/
|
||||
typedef enum { /*< since=1.26 >*/
|
||||
QMI_UIM_CARD_PROTOCOL_UNKNOWN = 0,
|
||||
QMI_UIM_CARD_PROTOCOL_ICC = 1,
|
||||
QMI_UIM_CARD_PROTOCOL_UICC = 2,
|
||||
} QmiUimCardProtocol;
|
||||
|
||||
/**
|
||||
* QmiUimConfiguration:
|
||||
* @QMI_UIM_CONFIGURATION_AUTOMATIC_SELECTION: Automatic selection.
|
||||
* @QMI_UIM_CONFIGURATION_PERSONALIZATION_STATUS: Personalization status.
|
||||
* @QMI_UIM_CONFIGURATION_HALT_SUBSCRIPTION: Halt publication of subscription.
|
||||
*
|
||||
* Requested configurations. If none explicitly requested, all configuration
|
||||
* items are returned.
|
||||
*
|
||||
* Since: 1.30
|
||||
*/
|
||||
typedef enum { /*< since=1.30 >*/
|
||||
QMI_UIM_CONFIGURATION_AUTOMATIC_SELECTION = 1 << 0,
|
||||
QMI_UIM_CONFIGURATION_PERSONALIZATION_STATUS = 1 << 1,
|
||||
QMI_UIM_CONFIGURATION_HALT_SUBSCRIPTION = 1 << 2,
|
||||
} QmiUimConfiguration;
|
||||
|
||||
/**
|
||||
* QmiUimDepersonalizationOperation:
|
||||
* @QMI_UIM_DEPERSONALIZATION_OPERATION_DEACTIVATE: Deactivate personalization
|
||||
* @QMI_UIM_DEPERSONALIZATION_OPERATION_UNBLOCK: Unblock personalization
|
||||
*
|
||||
* Depersonalization operation to perform.
|
||||
*
|
||||
* Since: 1.30
|
||||
*/
|
||||
typedef enum { /*< since=1.30 >*/
|
||||
QMI_UIM_DEPERSONALIZATION_OPERATION_DEACTIVATE = 0,
|
||||
QMI_UIM_DEPERSONALIZATION_OPERATION_UNBLOCK = 1,
|
||||
} QmiUimDepersonalizationOperation;
|
||||
|
||||
#endif /* _LIBQMI_GLIB_QMI_ENUMS_UIM_H_ */
|
@ -0,0 +1,79 @@
|
||||
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/*
|
||||
* libqmi-glib -- GLib/GIO based library to control QMI devices
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Copyright (C) 2014-2017 Aleksander Morgado <aleksander@aleksander.es>
|
||||
*/
|
||||
|
||||
#ifndef _LIBQMI_GLIB_QMI_ENUMS_WDA_H_
|
||||
#define _LIBQMI_GLIB_QMI_ENUMS_WDA_H_
|
||||
|
||||
/**
|
||||
* SECTION: qmi-enums-wda
|
||||
*
|
||||
* This section defines enumerations and flags used in the WDA service
|
||||
* interface.
|
||||
*/
|
||||
|
||||
/**
|
||||
* QmiWdaLinkLayerProtocol:
|
||||
* @QMI_WDA_LINK_LAYER_PROTOCOL_UNKNOWN: Unknown.
|
||||
* @QMI_WDA_LINK_LAYER_PROTOCOL_802_3: 802.3 ethernet mode.
|
||||
* @QMI_WDA_LINK_LAYER_PROTOCOL_RAW_IP: Raw IP mode.
|
||||
*
|
||||
* Link layer protocol.
|
||||
*
|
||||
* Since: 1.10
|
||||
*/
|
||||
typedef enum { /*< since=1.10 >*/
|
||||
QMI_WDA_LINK_LAYER_PROTOCOL_UNKNOWN = 0x00,
|
||||
QMI_WDA_LINK_LAYER_PROTOCOL_802_3 = 0x01,
|
||||
QMI_WDA_LINK_LAYER_PROTOCOL_RAW_IP = 0x02,
|
||||
} QmiWdaLinkLayerProtocol;
|
||||
|
||||
/**
|
||||
* QmiWdaDataAggregationProtocol:
|
||||
* @QMI_WDA_DATA_AGGREGATION_PROTOCOL_DISABLED: Disabled.
|
||||
* @QMI_WDA_DATA_AGGREGATION_PROTOCOL_TLP: TLP enabled.
|
||||
* @QMI_WDA_DATA_AGGREGATION_PROTOCOL_QC_NCM: QC NCM enabled.
|
||||
* @QMI_WDA_DATA_AGGREGATION_PROTOCOL_MBIM: MBIM enabled.
|
||||
* @QMI_WDA_DATA_AGGREGATION_PROTOCOL_RNDIS: RNDIS enabled.
|
||||
* @QMI_WDA_DATA_AGGREGATION_PROTOCOL_QMAP: QMAP enabled.
|
||||
* @QMI_WDA_DATA_AGGREGATION_PROTOCOL_QMAPV2: QMAPV2 enabled. Since: 1.30.
|
||||
* @QMI_WDA_DATA_AGGREGATION_PROTOCOL_QMAPV3: QMAPV3 enabled. Since: 1.30.
|
||||
* @QMI_WDA_DATA_AGGREGATION_PROTOCOL_QMAPV4: QMAPV4 enabled. Since: 1.30.
|
||||
* @QMI_WDA_DATA_AGGREGATION_PROTOCOL_QMAPV5: QMAPV5 enabled. Since: 1.28.
|
||||
*
|
||||
* Data aggregation protocol in uplink or downlink.
|
||||
*
|
||||
* Since: 1.10
|
||||
*/
|
||||
typedef enum { /*< since=1.10 >*/
|
||||
QMI_WDA_DATA_AGGREGATION_PROTOCOL_DISABLED = 0x00,
|
||||
QMI_WDA_DATA_AGGREGATION_PROTOCOL_TLP = 0x01,
|
||||
QMI_WDA_DATA_AGGREGATION_PROTOCOL_QC_NCM = 0x02,
|
||||
QMI_WDA_DATA_AGGREGATION_PROTOCOL_MBIM = 0x03,
|
||||
QMI_WDA_DATA_AGGREGATION_PROTOCOL_RNDIS = 0x04,
|
||||
QMI_WDA_DATA_AGGREGATION_PROTOCOL_QMAP = 0x05,
|
||||
QMI_WDA_DATA_AGGREGATION_PROTOCOL_QMAPV2 = 0x06,
|
||||
QMI_WDA_DATA_AGGREGATION_PROTOCOL_QMAPV3 = 0x07,
|
||||
QMI_WDA_DATA_AGGREGATION_PROTOCOL_QMAPV4 = 0x08,
|
||||
QMI_WDA_DATA_AGGREGATION_PROTOCOL_QMAPV5 = 0x09,
|
||||
} QmiWdaDataAggregationProtocol;
|
||||
|
||||
#endif /* _LIBQMI_GLIB_QMI_ENUMS_WDA_H_ */
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,480 @@
|
||||
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/*
|
||||
* uqmi -- tiny QMI support implementation
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Copyright (C) 2012 Google Inc.
|
||||
* Copyright (C) 2012-2017 Aleksander Morgado <aleksander@aleksander.es>
|
||||
*/
|
||||
|
||||
#ifndef _LIBQMI_GLIB_QMI_ENUMS_WMS_H_
|
||||
#define _LIBQMI_GLIB_QMI_ENUMS_WMS_H_
|
||||
|
||||
/**
|
||||
* SECTION: qmi-enums-wms
|
||||
*
|
||||
* This section defines enumerations and flags used in the WMS service
|
||||
* interface.
|
||||
*/
|
||||
|
||||
/*****************************************************************************/
|
||||
/* Helper enums for the 'QMI WMS Event Report' indication */
|
||||
|
||||
/**
|
||||
* QmiWmsStorageType:
|
||||
* @QMI_WMS_STORAGE_TYPE_UIM: Message stored in UIM.
|
||||
* @QMI_WMS_STORAGE_TYPE_NV: Message stored in non-volatile memory.
|
||||
* @QMI_WMS_STORAGE_TYPE_NONE: None.
|
||||
*
|
||||
* Type of messaging storage.
|
||||
*
|
||||
* Since: 1.0
|
||||
*/
|
||||
typedef enum { /*< since=1.0 >*/
|
||||
QMI_WMS_STORAGE_TYPE_UIM = 0x00,
|
||||
QMI_WMS_STORAGE_TYPE_NV = 0x01,
|
||||
QMI_WMS_STORAGE_TYPE_NONE = 0xFF
|
||||
} QmiWmsStorageType;
|
||||
|
||||
/**
|
||||
* QmiWmsAckIndicator:
|
||||
* @QMI_WMS_ACK_INDICATOR_SEND: ACK needs to be sent.
|
||||
* @QMI_WMS_ACK_INDICATOR_DO_NOT_SEND: ACK doesn't need to be sent.
|
||||
*
|
||||
* Indication of whether ACK needs to be sent or not.
|
||||
*
|
||||
* Since: 1.0
|
||||
*/
|
||||
typedef enum { /*< since=1.0 >*/
|
||||
QMI_WMS_ACK_INDICATOR_SEND = 0x00,
|
||||
QMI_WMS_ACK_INDICATOR_DO_NOT_SEND = 0x01
|
||||
} QmiWmsAckIndicator;
|
||||
|
||||
/**
|
||||
* QmiWmsMessageFormat:
|
||||
* @QMI_WMS_MESSAGE_FORMAT_CDMA: CDMA message.
|
||||
* @QMI_WMS_MESSAGE_FORMAT_GSM_WCDMA_POINT_TO_POINT: Point-to-point 3GPP message.
|
||||
* @QMI_WMS_MESSAGE_FORMAT_GSM_WCDMA_BROADCAST: Broadcast 3GPP message.
|
||||
* @QMI_WMS_MESSAGE_FORMAT_MWI: Message Waiting Indicator.
|
||||
*
|
||||
* Type of message.
|
||||
*
|
||||
* Since: 1.0
|
||||
*/
|
||||
typedef enum { /*< since=1.0 >*/
|
||||
QMI_WMS_MESSAGE_FORMAT_CDMA = 0x00,
|
||||
QMI_WMS_MESSAGE_FORMAT_GSM_WCDMA_POINT_TO_POINT = 0x06,
|
||||
QMI_WMS_MESSAGE_FORMAT_GSM_WCDMA_BROADCAST = 0x07,
|
||||
QMI_WMS_MESSAGE_FORMAT_MWI = 0x08
|
||||
} QmiWmsMessageFormat;
|
||||
|
||||
/**
|
||||
* QmiWmsMessageMode:
|
||||
* @QMI_WMS_MESSAGE_MODE_CDMA: Message sent using 3GPP2 technologies.
|
||||
* @QMI_WMS_MESSAGE_MODE_GSM_WCDMA: Message sent using 3GPP technologies.
|
||||
*
|
||||
* Message mode.
|
||||
*
|
||||
* Since: 1.0
|
||||
*/
|
||||
typedef enum { /*< since=1.0 >*/
|
||||
QMI_WMS_MESSAGE_MODE_CDMA = 0x00,
|
||||
QMI_WMS_MESSAGE_MODE_GSM_WCDMA = 0x01
|
||||
} QmiWmsMessageMode;
|
||||
|
||||
/**
|
||||
* QmiWmsNotificationType:
|
||||
* @QMI_WMS_NOTIFICATION_TYPE_PRIMARY: Primary.
|
||||
* @QMI_WMS_NOTIFICATION_TYPE_SECONDARY_GSM: Secondary GSM.
|
||||
* @QMI_WMS_NOTIFICATION_TYPE_SECONDARY_UMTS: Secondary UMTS.
|
||||
*
|
||||
* Type of notification.
|
||||
*
|
||||
* Since: 1.0
|
||||
*/
|
||||
typedef enum { /*< since=1.0 >*/
|
||||
QMI_WMS_NOTIFICATION_TYPE_PRIMARY = 0x00,
|
||||
QMI_WMS_NOTIFICATION_TYPE_SECONDARY_GSM = 0x01,
|
||||
QMI_WMS_NOTIFICATION_TYPE_SECONDARY_UMTS = 0x02
|
||||
} QmiWmsNotificationType;
|
||||
|
||||
/*****************************************************************************/
|
||||
/* Helper enums for the 'QMI WMS Raw Send' request/response */
|
||||
|
||||
/**
|
||||
* QmiWmsCdmaServiceOption:
|
||||
* @QMI_WMS_CDMA_SERVICE_OPTION_AUTO: Automatic selection of service option.
|
||||
* @QMI_WMS_CDMA_SERVICE_OPTION_6: Use service option 6.
|
||||
* @QMI_WMS_CDMA_SERVICE_OPTION_14: Use service option 14.
|
||||
*
|
||||
* CDMA service option selection.
|
||||
*
|
||||
* Since: 1.0
|
||||
*/
|
||||
typedef enum { /*< since=1.0 >*/
|
||||
QMI_WMS_CDMA_SERVICE_OPTION_AUTO = 0x00,
|
||||
QMI_WMS_CDMA_SERVICE_OPTION_6 = 0x06,
|
||||
QMI_WMS_CDMA_SERVICE_OPTION_14 = 0x0E
|
||||
} QmiWmsCdmaServiceOption;
|
||||
|
||||
/**
|
||||
* QmiWmsCdmaCauseCode:
|
||||
* @QMI_WMS_CDMA_CAUSE_CODE_NETWORK_ADDRESS_VACANT: Address is valid but not yet allocated. Since 1.18.
|
||||
* @QMI_WMS_CDMA_CAUSE_CODE_NETWORK_ADDRESS_TRANSLATION_FAILURE: Address is invalid. Since 1.18.
|
||||
* @QMI_WMS_CDMA_CAUSE_CODE_NETWORK_RESOURCE_SHORTAGE: Network resource shortage. Since 1.18.
|
||||
* @QMI_WMS_CDMA_CAUSE_CODE_NETWORK_FAILURE: Network failed. Since 1.18.
|
||||
* @QMI_WMS_CDMA_CAUSE_CODE_NETWORK_INVALID_TELESERVICE_ID: SMS teleservice ID is invalid. Since 1.18.
|
||||
* @QMI_WMS_CDMA_CAUSE_CODE_NETWORK_OTHER: Other network error. Since 1.18.
|
||||
* @QMI_WMS_CDMA_CAUSE_CODE_DESTINATION_NO_PAGE_RESPONSE: No page response from destination. Since 1.18.
|
||||
* @QMI_WMS_CDMA_CAUSE_CODE_DESTINATION_BUSY: Destination is busy. Since 1.18.
|
||||
* @QMI_WMS_CDMA_CAUSE_CODE_DESTINATION_NO_ACK: No acknowledge from destination. Since 1.18.
|
||||
* @QMI_WMS_CDMA_CAUSE_CODE_DESTINATION_RESOURCE_SHORTAGE: Destination resource shortage. Since 1.18.
|
||||
* @QMI_WMS_CDMA_CAUSE_CODE_DESTINATION_SMS_DELIVERY_POSTPONED: SMS delivery postponed. Since 1.18.
|
||||
* @QMI_WMS_CDMA_CAUSE_CODE_DESTINATION_OUT_OF_SERVICE: Destination out of service. Since 1.18.
|
||||
* @QMI_WMS_CDMA_CAUSE_CODE_DESTINATION_NOT_AT_ADDRESS: Destination not at address. Since 1.18.
|
||||
* @QMI_WMS_CDMA_CAUSE_CODE_DESTINATION_OTHER: Other destination error. Since 1.18.
|
||||
* @QMI_WMS_CDMA_CAUSE_CODE_RADIO_INTERFACE_RESOURCE_SHORTAGE: Radio interface resource shortage. Since 1.18.
|
||||
* @QMI_WMS_CDMA_CAUSE_CODE_RADIO_INTERFACE_INCOMPATIBILITY: Radio interface incompatibility. Since 1.18.
|
||||
* @QMI_WMS_CDMA_CAUSE_CODE_RADIO_INTERFACE_OTHER: Other radio interface error. Since 1.18.
|
||||
* @QMI_WMS_CDMA_CAUSE_CODE_GENERAL_ENCODING: Encoding error. Since 1.18.
|
||||
* @QMI_WMS_CDMA_CAUSE_CODE_GENERAL_SMS_ORIGIN_DENIED: SMS origin denied. Since 1.18.
|
||||
* @QMI_WMS_CDMA_CAUSE_CODE_GENERAL_SMS_DESTINATION_DENIED: SMS destination denied. Since 1.18.
|
||||
* @QMI_WMS_CDMA_CAUSE_CODE_GENERAL_SUPPLEMENTARY_SERVICE_NOT_SUPPORTED: Supplementary service not supported. Since 1.18.
|
||||
* @QMI_WMS_CDMA_CAUSE_CODE_GENERAL_SMS_NOT_SUPPORTED: SMS not supported. Since 1.18.
|
||||
* @QMI_WMS_CDMA_CAUSE_CODE_GENERAL_MISSING_EXPECTED_PARAMETER: Missing optional expected parameter. Since 1.18.
|
||||
* @QMI_WMS_CDMA_CAUSE_CODE_GENERAL_MISSING_MANDATORY_PARAMETER: Missing mandatory parameter. Since 1.18.
|
||||
* @QMI_WMS_CDMA_CAUSE_CODE_GENERAL_UNRECOGNIZED_PARAMETER_VALUE: Unrecognized parameter value. Since 1.18.
|
||||
* @QMI_WMS_CDMA_CAUSE_CODE_GENERAL_UNEXPECTED_PARAMETER_VALUE: Unexpected parameter value. Since 1.18.
|
||||
* @QMI_WMS_CDMA_CAUSE_CODE_GENERAL_USER_DATA_SIZE_ERROR: User data size error. Since 1.18.
|
||||
* @QMI_WMS_CDMA_CAUSE_CODE_GENERAL_OTHER: Other general error. Since 1.18.
|
||||
*
|
||||
* Cause codes when failed to send an SMS in CDMA.
|
||||
*
|
||||
* Since: 1.0
|
||||
*/
|
||||
typedef enum { /*< since=1.0 >*/
|
||||
/* Network errors */
|
||||
QMI_WMS_CDMA_CAUSE_CODE_NETWORK_ADDRESS_VACANT = 0x00,
|
||||
QMI_WMS_CDMA_CAUSE_CODE_NETWORK_ADDRESS_TRANSLATION_FAILURE = 0x01,
|
||||
QMI_WMS_CDMA_CAUSE_CODE_NETWORK_RESOURCE_SHORTAGE = 0x02,
|
||||
QMI_WMS_CDMA_CAUSE_CODE_NETWORK_FAILURE = 0x03,
|
||||
QMI_WMS_CDMA_CAUSE_CODE_NETWORK_INVALID_TELESERVICE_ID = 0x04,
|
||||
QMI_WMS_CDMA_CAUSE_CODE_NETWORK_OTHER = 0x05,
|
||||
|
||||
/* Destination errors */
|
||||
QMI_WMS_CDMA_CAUSE_CODE_DESTINATION_NO_PAGE_RESPONSE = 0x20,
|
||||
QMI_WMS_CDMA_CAUSE_CODE_DESTINATION_BUSY = 0x21,
|
||||
QMI_WMS_CDMA_CAUSE_CODE_DESTINATION_NO_ACK = 0x22,
|
||||
QMI_WMS_CDMA_CAUSE_CODE_DESTINATION_RESOURCE_SHORTAGE = 0x23,
|
||||
QMI_WMS_CDMA_CAUSE_CODE_DESTINATION_SMS_DELIVERY_POSTPONED = 0x24,
|
||||
QMI_WMS_CDMA_CAUSE_CODE_DESTINATION_OUT_OF_SERVICE = 0x25,
|
||||
QMI_WMS_CDMA_CAUSE_CODE_DESTINATION_NOT_AT_ADDRESS = 0x26,
|
||||
QMI_WMS_CDMA_CAUSE_CODE_DESTINATION_OTHER = 0x27,
|
||||
|
||||
/* Radio Interface errors */
|
||||
QMI_WMS_CDMA_CAUSE_CODE_RADIO_INTERFACE_RESOURCE_SHORTAGE = 0x40,
|
||||
QMI_WMS_CDMA_CAUSE_CODE_RADIO_INTERFACE_INCOMPATIBILITY = 0x41,
|
||||
QMI_WMS_CDMA_CAUSE_CODE_RADIO_INTERFACE_OTHER = 0x42,
|
||||
|
||||
/* General errors */
|
||||
QMI_WMS_CDMA_CAUSE_CODE_GENERAL_ENCODING = 0x60,
|
||||
QMI_WMS_CDMA_CAUSE_CODE_GENERAL_SMS_ORIGIN_DENIED = 0x61,
|
||||
QMI_WMS_CDMA_CAUSE_CODE_GENERAL_SMS_DESTINATION_DENIED = 0x62,
|
||||
QMI_WMS_CDMA_CAUSE_CODE_GENERAL_SUPPLEMENTARY_SERVICE_NOT_SUPPORTED = 0x63,
|
||||
QMI_WMS_CDMA_CAUSE_CODE_GENERAL_SMS_NOT_SUPPORTED = 0x64,
|
||||
QMI_WMS_CDMA_CAUSE_CODE_GENERAL_MISSING_EXPECTED_PARAMETER = 0x65,
|
||||
QMI_WMS_CDMA_CAUSE_CODE_GENERAL_MISSING_MANDATORY_PARAMETER = 0x66,
|
||||
QMI_WMS_CDMA_CAUSE_CODE_GENERAL_UNRECOGNIZED_PARAMETER_VALUE = 0x67,
|
||||
QMI_WMS_CDMA_CAUSE_CODE_GENERAL_UNEXPECTED_PARAMETER_VALUE = 0x68,
|
||||
QMI_WMS_CDMA_CAUSE_CODE_GENERAL_USER_DATA_SIZE_ERROR = 0x69,
|
||||
QMI_WMS_CDMA_CAUSE_CODE_GENERAL_OTHER = 0x6A
|
||||
} QmiWmsCdmaCauseCode;
|
||||
|
||||
/**
|
||||
* QmiWmsCdmaErrorClass:
|
||||
* @QMI_WMS_CDMA_ERROR_CLASS_TEMPORARY: Temporary error reported by network.
|
||||
* @QMI_WMS_CDMA_ERROR_CLASS_PERMANENT: Permanent error reported by network.
|
||||
* @QMI_WMS_CDMA_ERROR_CLASS_TEMPORARY_DEVICE: Temporary error reported by device. Since 1.28.
|
||||
* @QMI_WMS_CDMA_ERROR_CLASS_PERMANENT_DEVICE: Permanent error reported by device. Since 1.28.
|
||||
*
|
||||
* Error class reported from the network when failed to send an SMS in CDMA,
|
||||
* or reported by the device when failed to process a transfer-only CDMA message.
|
||||
*
|
||||
* Since: 1.0
|
||||
*/
|
||||
typedef enum { /*< since=1.0 >*/
|
||||
QMI_WMS_CDMA_ERROR_CLASS_TEMPORARY = 0x00,
|
||||
QMI_WMS_CDMA_ERROR_CLASS_PERMANENT = 0x01,
|
||||
QMI_WMS_CDMA_ERROR_CLASS_TEMPORARY_DEVICE = 0x02,
|
||||
QMI_WMS_CDMA_ERROR_CLASS_PERMANENT_DEVICE = 0x03,
|
||||
} QmiWmsCdmaErrorClass;
|
||||
|
||||
/**
|
||||
* QmiWmsGsmUmtsRpCause:
|
||||
* @QMI_WMS_GSM_UMTS_RP_CAUSE_UNASSIGNED_NUMBER: Unassigned number.
|
||||
* @QMI_WMS_GSM_UMTS_RP_CAUSE_OPERATOR_DETERMINED_BARRING: Operator determined barring.
|
||||
* @QMI_WMS_GSM_UMTS_RP_CAUSE_CALL_BARRED: Call barred.
|
||||
* @QMI_WMS_GSM_UMTS_RP_CAUSE_RESERVED: Reserved.
|
||||
* @QMI_WMS_GSM_UMTS_RP_CAUSE_SMS_TRANSFER_REJECTED: SMS transfer rejected.
|
||||
* @QMI_WMS_GSM_UMTS_RP_CAUSE_MEMORY_CAPACITY_EXCEEDED: Memory capacity exceeded.
|
||||
* @QMI_WMS_GSM_UMTS_RP_CAUSE_DESTINATION_OUT_OF_ORDER: Destination out of order.
|
||||
* @QMI_WMS_GSM_UMTS_RP_CAUSE_UNIDENTIFIED_SUBSCRIBER: Unidentified subscriber.
|
||||
* @QMI_WMS_GSM_UMTS_RP_CAUSE_FACILITY_REJECTED: Facility rejected.
|
||||
* @QMI_WMS_GSM_UMTS_RP_CAUSE_UNKNOWN_SUBSCRIBER: Unknown subscriber.
|
||||
* @QMI_WMS_GSM_UMTS_RP_CAUSE_NETWORK_OUF_OF_ORDER: Network out of order.
|
||||
* @QMI_WMS_GSM_UMTS_RP_CAUSE_TEMPORARY_FAILURE: Temporary failure.
|
||||
* @QMI_WMS_GSM_UMTS_RP_CAUSE_CONGESTION: Congestion.
|
||||
* @QMI_WMS_GSM_UMTS_RP_CAUSE_RESOURCES_UNAVAILABLE: Resources unavailable.
|
||||
* @QMI_WMS_GSM_UMTS_RP_CAUSE_FACILITY_NOT_SUBSCRIBED: Facility not subscribed.
|
||||
* @QMI_WMS_GSM_UMTS_RP_CAUSE_FACILITY_NOT_IMPLEMENTED: Facility not implemented.
|
||||
* @QMI_WMS_GSM_UMTS_RP_CAUSE_INVALID_SMS_TRANSFER_REFERENCE_VALUE: Invalid SMS transfer reference value.
|
||||
* @QMI_WMS_GSM_UMTS_RP_CAUSE_SEMANTICALLY_INCORRECT_MESSAGE: Semantically incorrect message.
|
||||
* @QMI_WMS_GSM_UMTS_RP_CAUSE_INVALID_MANDATORY_INFO: Invalid mandatory info.
|
||||
* @QMI_WMS_GSM_UMTS_RP_CAUSE_MESSAGE_TYPE_NOT_IMPLEMENTED: Message type not implemented.
|
||||
* @QMI_WMS_GSM_UMTS_RP_CAUSE_MESSAGE_NOT_COMPATIBLE_WITH_SMS: Message not compatible with SMS.
|
||||
* @QMI_WMS_GSM_UMTS_RP_CAUSE_INFORMATION_ELEMENT_NOT_IMPLEMENTED: Information element not implemented.
|
||||
* @QMI_WMS_GSM_UMTS_RP_CAUSE_PROTOCOL_ERROR: Protocol error.
|
||||
* @QMI_WMS_GSM_UMTS_RP_CAUSE_INTERWORKING: Interworking error.
|
||||
*
|
||||
* RP cause codes when failed to send an SMS in GSM/WCDMA.
|
||||
*
|
||||
* Since: 1.0
|
||||
*/
|
||||
typedef enum { /*< since=1.0 >*/
|
||||
QMI_WMS_GSM_UMTS_RP_CAUSE_UNASSIGNED_NUMBER = 0x01,
|
||||
QMI_WMS_GSM_UMTS_RP_CAUSE_OPERATOR_DETERMINED_BARRING = 0x08,
|
||||
QMI_WMS_GSM_UMTS_RP_CAUSE_CALL_BARRED = 0x0A,
|
||||
QMI_WMS_GSM_UMTS_RP_CAUSE_RESERVED = 0x0B,
|
||||
QMI_WMS_GSM_UMTS_RP_CAUSE_SMS_TRANSFER_REJECTED = 0x15,
|
||||
QMI_WMS_GSM_UMTS_RP_CAUSE_MEMORY_CAPACITY_EXCEEDED = 0x16,
|
||||
QMI_WMS_GSM_UMTS_RP_CAUSE_DESTINATION_OUT_OF_ORDER = 0x1B,
|
||||
QMI_WMS_GSM_UMTS_RP_CAUSE_UNIDENTIFIED_SUBSCRIBER = 0x1C,
|
||||
QMI_WMS_GSM_UMTS_RP_CAUSE_FACILITY_REJECTED = 0x1D,
|
||||
QMI_WMS_GSM_UMTS_RP_CAUSE_UNKNOWN_SUBSCRIBER = 0x1E,
|
||||
QMI_WMS_GSM_UMTS_RP_CAUSE_NETWORK_OUF_OF_ORDER = 0x20,
|
||||
QMI_WMS_GSM_UMTS_RP_CAUSE_TEMPORARY_FAILURE = 0x21,
|
||||
QMI_WMS_GSM_UMTS_RP_CAUSE_CONGESTION = 0x2A,
|
||||
QMI_WMS_GSM_UMTS_RP_CAUSE_RESOURCES_UNAVAILABLE = 0x2F,
|
||||
QMI_WMS_GSM_UMTS_RP_CAUSE_FACILITY_NOT_SUBSCRIBED = 0x32,
|
||||
QMI_WMS_GSM_UMTS_RP_CAUSE_FACILITY_NOT_IMPLEMENTED = 0x45,
|
||||
QMI_WMS_GSM_UMTS_RP_CAUSE_INVALID_SMS_TRANSFER_REFERENCE_VALUE = 0x51,
|
||||
QMI_WMS_GSM_UMTS_RP_CAUSE_SEMANTICALLY_INCORRECT_MESSAGE = 0x5F,
|
||||
QMI_WMS_GSM_UMTS_RP_CAUSE_INVALID_MANDATORY_INFO = 0x60,
|
||||
QMI_WMS_GSM_UMTS_RP_CAUSE_MESSAGE_TYPE_NOT_IMPLEMENTED = 0x61,
|
||||
QMI_WMS_GSM_UMTS_RP_CAUSE_MESSAGE_NOT_COMPATIBLE_WITH_SMS = 0x62,
|
||||
QMI_WMS_GSM_UMTS_RP_CAUSE_INFORMATION_ELEMENT_NOT_IMPLEMENTED = 0x63,
|
||||
QMI_WMS_GSM_UMTS_RP_CAUSE_PROTOCOL_ERROR = 0x6F,
|
||||
QMI_WMS_GSM_UMTS_RP_CAUSE_INTERWORKING = 0x7F
|
||||
} QmiWmsGsmUmtsRpCause;
|
||||
|
||||
/**
|
||||
* QmiWmsGsmUmtsTpCause:
|
||||
* @QMI_WMS_GSM_UMTS_TP_CAUSE_TELE_INTERWORKING_NOT_SUPPORTED: Tele interworking not supported.
|
||||
* @QMI_WMS_GSM_UMTS_TP_CAUSE_SHORT_MESSAGE_TYPE_0_NOT_SUPPORTED: Short message type 0 not supported.
|
||||
* @QMI_WMS_GSM_UMTS_TP_CAUSE_SHORT_MESSAGE_CANNOT_BE_REPLACED: Short message cannot be replaced.
|
||||
* @QMI_WMS_GSM_UMTS_TP_CAUSE_UNSPECIFIED_PID_ERROR: Unspecified TP-PID error.
|
||||
* @QMI_WMS_GSM_UMTS_TP_CAUSE_DCS_NOT_SUPPORTED: Data coding scheme not supported.
|
||||
* @QMI_WMS_GSM_UMTS_TP_CAUSE_MESSAGE_CLASS_NOT_SUPPORTED: Message class not supported.
|
||||
* @QMI_WMS_GSM_UMTS_TP_CAUSE_UNSPECIFIED_DCS_ERROR: Unspecified data coding scheme error.
|
||||
* @QMI_WMS_GSM_UMTS_TP_CAUSE_COMMAND_CANNOT_BE_ACTIONED: Command cannot be actioned.
|
||||
* @QMI_WMS_GSM_UMTS_TP_CAUSE_COMMAND_UNSUPPORTED: Command unsupported.
|
||||
* @QMI_WMS_GSM_UMTS_TP_CAUSE_UNSPECIFIED_COMMAND_ERROR: Unspecified command error.
|
||||
* @QMI_WMS_GSM_UMTS_TP_CAUSE_TPDU_NOT_SUPPORTED: TPDU not supported.
|
||||
* @QMI_WMS_GSM_UMTS_TP_CAUSE_SC_BUSY: SC busy.
|
||||
* @QMI_WMS_GSM_UMTS_TP_CAUSE_NO_SC_SUBSCRIPTION: No SC subscription.
|
||||
* @QMI_WMS_GSM_UMTS_TP_CAUSE_SC_SYSTEM_FAILURE: SC system failure.
|
||||
* @QMI_WMS_GSM_UMTS_TP_CAUSE_INVALID_SME_ADDRESS: Invalid SME address.
|
||||
* @QMI_WMS_GSM_UMTS_TP_CAUSE_DESTINATION_SME_BARRED: Destination SME barred.
|
||||
* @QMI_WMS_GSM_UMTS_TP_CAUSE_SM_REJECTED_OR_DUPLICATE: SM rejected or duplicate.
|
||||
* @QMI_WMS_GSM_UMTS_TP_CAUSE_VPF_NOT_SUPPORTED: TP-VPF not supported.
|
||||
* @QMI_WMS_GSM_UMTS_TP_CAUSE_VP_NOT_SUPPORTED: TP-VP not supported.
|
||||
* @QMI_WMS_GSM_UMTS_TP_CAUSE_SIM_SMS_STORAGE_FULL: SIM SMS storage full.
|
||||
* @QMI_WMS_GSM_UMTS_TP_CAUSE_NO_SMS_STORAGE_CAPABILITY_IN_SIM: No SMS storage capability in SIM.
|
||||
* @QMI_WMS_GSM_UMTS_TP_CAUSE_MS_ERROR: MS error.
|
||||
* @QMI_WMS_GSM_UMTS_TP_CAUSE_MEMORY_CAPACITY_EXCEEDED: Memory capacity exceeded.
|
||||
* @QMI_WMS_GSM_UMTS_TP_CAUSE_SIM_APPLICATION_TOOLKIT_BUSY: SIM application toolkit busy.
|
||||
* @QMI_WMS_GSM_UMTS_TP_CAUSE_SIM_DATA_DOWNLOAD_ERROR: SIM data download error.
|
||||
* @QMI_WMS_GSM_UMTS_TP_CAUSE_UNSPECIFIED_ERROR: Unspecified error.
|
||||
*
|
||||
* RT cause codes when failed to send an SMS in GSM/WCDMA.
|
||||
*
|
||||
* Since: 1.0
|
||||
*/
|
||||
typedef enum { /*< since=1.0 >*/
|
||||
QMI_WMS_GSM_UMTS_TP_CAUSE_TELE_INTERWORKING_NOT_SUPPORTED = 0x80,
|
||||
QMI_WMS_GSM_UMTS_TP_CAUSE_SHORT_MESSAGE_TYPE_0_NOT_SUPPORTED = 0x81,
|
||||
QMI_WMS_GSM_UMTS_TP_CAUSE_SHORT_MESSAGE_CANNOT_BE_REPLACED = 0x82,
|
||||
QMI_WMS_GSM_UMTS_TP_CAUSE_UNSPECIFIED_PID_ERROR = 0x8F,
|
||||
QMI_WMS_GSM_UMTS_TP_CAUSE_DCS_NOT_SUPPORTED = 0x90,
|
||||
QMI_WMS_GSM_UMTS_TP_CAUSE_MESSAGE_CLASS_NOT_SUPPORTED = 0x91,
|
||||
QMI_WMS_GSM_UMTS_TP_CAUSE_UNSPECIFIED_DCS_ERROR = 0x9F,
|
||||
QMI_WMS_GSM_UMTS_TP_CAUSE_COMMAND_CANNOT_BE_ACTIONED = 0xA0,
|
||||
QMI_WMS_GSM_UMTS_TP_CAUSE_COMMAND_UNSUPPORTED = 0xA1,
|
||||
QMI_WMS_GSM_UMTS_TP_CAUSE_UNSPECIFIED_COMMAND_ERROR = 0xAF,
|
||||
QMI_WMS_GSM_UMTS_TP_CAUSE_TPDU_NOT_SUPPORTED = 0xB0,
|
||||
QMI_WMS_GSM_UMTS_TP_CAUSE_SC_BUSY = 0xC0,
|
||||
QMI_WMS_GSM_UMTS_TP_CAUSE_NO_SC_SUBSCRIPTION = 0xC1,
|
||||
QMI_WMS_GSM_UMTS_TP_CAUSE_SC_SYSTEM_FAILURE = 0xC2,
|
||||
QMI_WMS_GSM_UMTS_TP_CAUSE_INVALID_SME_ADDRESS = 0xC3,
|
||||
QMI_WMS_GSM_UMTS_TP_CAUSE_DESTINATION_SME_BARRED = 0xC4,
|
||||
QMI_WMS_GSM_UMTS_TP_CAUSE_SM_REJECTED_OR_DUPLICATE = 0xC5,
|
||||
QMI_WMS_GSM_UMTS_TP_CAUSE_VPF_NOT_SUPPORTED = 0xC6,
|
||||
QMI_WMS_GSM_UMTS_TP_CAUSE_VP_NOT_SUPPORTED = 0xC7,
|
||||
QMI_WMS_GSM_UMTS_TP_CAUSE_SIM_SMS_STORAGE_FULL = 0xD0,
|
||||
QMI_WMS_GSM_UMTS_TP_CAUSE_NO_SMS_STORAGE_CAPABILITY_IN_SIM = 0xD1,
|
||||
QMI_WMS_GSM_UMTS_TP_CAUSE_MS_ERROR = 0xD2,
|
||||
QMI_WMS_GSM_UMTS_TP_CAUSE_MEMORY_CAPACITY_EXCEEDED = 0xD3,
|
||||
QMI_WMS_GSM_UMTS_TP_CAUSE_SIM_APPLICATION_TOOLKIT_BUSY = 0xD4,
|
||||
QMI_WMS_GSM_UMTS_TP_CAUSE_SIM_DATA_DOWNLOAD_ERROR = 0xD5,
|
||||
QMI_WMS_GSM_UMTS_TP_CAUSE_UNSPECIFIED_ERROR = 0xFF
|
||||
} QmiWmsGsmUmtsTpCause;
|
||||
|
||||
/**
|
||||
* QmiWmsMessageDeliveryFailureType:
|
||||
* @QMI_WMS_MESSAGE_DELIVERY_FAILURE_TYPE_TEMPORARY: Temporary failure.
|
||||
* @QMI_WMS_MESSAGE_DELIVERY_FAILURE_TYPE_PERMANENT: Permanent failure.
|
||||
*
|
||||
* Type of message delivery failure.
|
||||
*
|
||||
* Since: 1.0
|
||||
*/
|
||||
typedef enum { /*< since=1.0 >*/
|
||||
QMI_WMS_MESSAGE_DELIVERY_FAILURE_TYPE_TEMPORARY = 0x00,
|
||||
QMI_WMS_MESSAGE_DELIVERY_FAILURE_TYPE_PERMANENT = 0x01
|
||||
} QmiWmsMessageDeliveryFailureType;
|
||||
|
||||
/*****************************************************************************/
|
||||
/* Helper enums for the 'QMI WMS Read Raw' request/response */
|
||||
|
||||
/**
|
||||
* QmiWmsMessageTagType:
|
||||
* @QMI_WMS_MESSAGE_TAG_TYPE_MT_READ: Received SMS, already read.
|
||||
* @QMI_WMS_MESSAGE_TAG_TYPE_MT_NOT_READ: Received SMS, not read.
|
||||
* @QMI_WMS_MESSAGE_TAG_TYPE_MO_SENT: Sent SMS.
|
||||
* @QMI_WMS_MESSAGE_TAG_TYPE_MO_NOT_SENT: Not yet sent SMS.
|
||||
*
|
||||
* Type of message tag.
|
||||
*
|
||||
* Since: 1.0
|
||||
*/
|
||||
typedef enum { /*< since=1.0 >*/
|
||||
QMI_WMS_MESSAGE_TAG_TYPE_MT_READ = 0x00,
|
||||
QMI_WMS_MESSAGE_TAG_TYPE_MT_NOT_READ = 0x01,
|
||||
QMI_WMS_MESSAGE_TAG_TYPE_MO_SENT = 0x02,
|
||||
QMI_WMS_MESSAGE_TAG_TYPE_MO_NOT_SENT = 0x03
|
||||
} QmiWmsMessageTagType;
|
||||
|
||||
/**
|
||||
* QmiWmsMessageProtocol:
|
||||
* @QMI_WMS_MESSAGE_PROTOCOL_CDMA: CDMA.
|
||||
* @QMI_WMS_MESSAGE_PROTOCOL_WCDMA: WCDMA.
|
||||
*
|
||||
* Type of message protocol.
|
||||
*
|
||||
* Since: 1.0
|
||||
*/
|
||||
typedef enum { /*< since=1.0 >*/
|
||||
QMI_WMS_MESSAGE_PROTOCOL_CDMA = 0x00,
|
||||
QMI_WMS_MESSAGE_PROTOCOL_WCDMA = 0x01
|
||||
} QmiWmsMessageProtocol;
|
||||
|
||||
/*****************************************************************************/
|
||||
/* Helper enums for the 'QMI WMS Set Routes' request/response */
|
||||
|
||||
/**
|
||||
* QmiWmsMessageType:
|
||||
* @QMI_WMS_MESSAGE_TYPE_POINT_TO_POINT: Point to point message.
|
||||
*
|
||||
* Type of message.
|
||||
*
|
||||
* Since: 1.0
|
||||
*/
|
||||
typedef enum { /*< since=1.0 >*/
|
||||
QMI_WMS_MESSAGE_TYPE_POINT_TO_POINT = 0x00
|
||||
} QmiWmsMessageType;
|
||||
|
||||
/**
|
||||
* QmiWmsMessageClass:
|
||||
* @QMI_WMS_MESSAGE_CLASS_0: Class 0.
|
||||
* @QMI_WMS_MESSAGE_CLASS_1: Class 1.
|
||||
* @QMI_WMS_MESSAGE_CLASS_2: Class 2.
|
||||
* @QMI_WMS_MESSAGE_CLASS_3: Class 3.
|
||||
* @QMI_WMS_MESSAGE_CLASS_NONE: Class none.
|
||||
* @QMI_WMS_MESSAGE_CLASS_CDMA: Class CDMA.
|
||||
*
|
||||
* Message class.
|
||||
*
|
||||
* Since: 1.0
|
||||
*/
|
||||
typedef enum { /*< since=1.0 >*/
|
||||
QMI_WMS_MESSAGE_CLASS_0 = 0x00,
|
||||
QMI_WMS_MESSAGE_CLASS_1 = 0x01,
|
||||
QMI_WMS_MESSAGE_CLASS_2 = 0x02,
|
||||
QMI_WMS_MESSAGE_CLASS_3 = 0x03,
|
||||
QMI_WMS_MESSAGE_CLASS_NONE = 0x04,
|
||||
QMI_WMS_MESSAGE_CLASS_CDMA = 0x05
|
||||
} QmiWmsMessageClass;
|
||||
|
||||
/**
|
||||
* QmiWmsReceiptAction:
|
||||
* @QMI_WMS_RECEIPT_ACTION_DISCARD: Discard message.
|
||||
* @QMI_WMS_RECEIPT_ACTION_STORE_AND_NOTIFY: Store and notify to client.
|
||||
* @QMI_WMS_RECEIPT_ACTION_TRANSFER_ONLY: Notify to client, which should send back ACK.
|
||||
* @QMI_WMS_RECEIPT_ACTION_TRANSFER_AND_ACK: Notify to client and send back ACK.
|
||||
* @QMI_WMS_RECEIPT_ACTION_UNKNOWN: Unknown action.
|
||||
*
|
||||
* Action to perform when a message is received.
|
||||
*
|
||||
* Since: 1.0
|
||||
*/
|
||||
typedef enum { /*< since=1.0 >*/
|
||||
QMI_WMS_RECEIPT_ACTION_DISCARD = 0x00,
|
||||
QMI_WMS_RECEIPT_ACTION_STORE_AND_NOTIFY = 0x01,
|
||||
QMI_WMS_RECEIPT_ACTION_TRANSFER_ONLY = 0x02,
|
||||
QMI_WMS_RECEIPT_ACTION_TRANSFER_AND_ACK = 0x03,
|
||||
QMI_WMS_RECEIPT_ACTION_UNKNOWN = 0xFF
|
||||
} QmiWmsReceiptAction;
|
||||
|
||||
/**
|
||||
* QmiWmsTransferIndication:
|
||||
* @QMI_WMS_TRANSFER_INDICATION_CLIENT: Status reports transferred to the client.
|
||||
*
|
||||
* Transfer indication actions.
|
||||
*
|
||||
* Since: 1.0
|
||||
*/
|
||||
typedef enum { /*< since=1.0 >*/
|
||||
QMI_WMS_TRANSFER_INDICATION_CLIENT = 0x01
|
||||
} QmiWmsTransferIndication;
|
||||
|
||||
/**
|
||||
* QmiWmsAckFailureCause:
|
||||
* @QMI_WMS_ACK_FAILURE_CAUSE_NO_NETWORK_RESPONSE: No network response.
|
||||
* @QMI_WMS_ACK_FAILURE_CAUSE_NETWORK_RELEASED_LINK: Network released link.
|
||||
* @QMI_WMS_ACK_FAILURE_CAUSE_NOT_SENT: Not sent.
|
||||
*
|
||||
* Ack failure cause.
|
||||
*
|
||||
* Since: 1.28
|
||||
*/
|
||||
typedef enum { /*< since=1.28 >*/
|
||||
QMI_WMS_ACK_FAILURE_CAUSE_NO_NETWORK_RESPONSE = 0x00,
|
||||
QMI_WMS_ACK_FAILURE_CAUSE_NETWORK_RELEASED_LINK = 0x01,
|
||||
QMI_WMS_ACK_FAILURE_CAUSE_NOT_SENT = 0x02,
|
||||
} QmiWmsAckFailureCause;
|
||||
|
||||
#endif /* _LIBQMI_GLIB_QMI_ENUMS_WMS_H_ */
|
@ -0,0 +1,213 @@
|
||||
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/*
|
||||
* uqmi -- tiny QMI support implementation
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Copyright (C) 2012 Google, Inc.
|
||||
* Copyright (C) 2012-2017 Aleksander Morgado <aleksander@aleksander.es>
|
||||
*/
|
||||
|
||||
#ifndef _LIBQMI_GLIB_QMI_ENUMS_H_
|
||||
#define _LIBQMI_GLIB_QMI_ENUMS_H_
|
||||
|
||||
/**
|
||||
* SECTION: qmi-enums
|
||||
*
|
||||
* This section defines common enumerations and flags used in the interface.
|
||||
*/
|
||||
|
||||
/**
|
||||
* QmiService:
|
||||
* @QMI_SERVICE_UNKNOWN: Unknown service.
|
||||
* @QMI_SERVICE_CTL: Control service.
|
||||
* @QMI_SERVICE_WDS: Wireless Data Service.
|
||||
* @QMI_SERVICE_DMS: Device Management Service.
|
||||
* @QMI_SERVICE_NAS: Network Access Service.
|
||||
* @QMI_SERVICE_QOS: Quality Of Service service.
|
||||
* @QMI_SERVICE_WMS: Wireless Messaging Service.
|
||||
* @QMI_SERVICE_PDS: Position Determination Service.
|
||||
* @QMI_SERVICE_AUTH: Authentication service.
|
||||
* @QMI_SERVICE_AT: AT service.
|
||||
* @QMI_SERVICE_VOICE: Voice service.
|
||||
* @QMI_SERVICE_CAT2: Card Application Toolkit service (v2).
|
||||
* @QMI_SERVICE_UIM: User Identity Module service.
|
||||
* @QMI_SERVICE_PBM: Phonebook Management service.
|
||||
* @QMI_SERVICE_QCHAT: QCHAT service. Since: 1.8.
|
||||
* @QMI_SERVICE_RMTFS: Remote file system service.
|
||||
* @QMI_SERVICE_TEST: Test service. Since: 1.8.
|
||||
* @QMI_SERVICE_LOC: Location service (~ PDS v2).
|
||||
* @QMI_SERVICE_SAR: Service access proxy service.
|
||||
* @QMI_SERVICE_IMS: IMS settings service. Since: 1.8.
|
||||
* @QMI_SERVICE_ADC: Analog to digital converter driver service. Since: 1.8.
|
||||
* @QMI_SERVICE_CSD: Core sound driver service. Since: 1.8.
|
||||
* @QMI_SERVICE_MFS: Modem embedded file system service. Since: 1.8.
|
||||
* @QMI_SERVICE_TIME: Time service. Since: 1.8.
|
||||
* @QMI_SERVICE_TS: Thermal sensors service. Since: 1.8.
|
||||
* @QMI_SERVICE_TMD: Thermal mitigation device service. Since: 1.8.
|
||||
* @QMI_SERVICE_SAP: Service access proxy service. Since: 1.8.
|
||||
* @QMI_SERVICE_WDA: Wireless data administrative service. Since: 1.8.
|
||||
* @QMI_SERVICE_TSYNC: TSYNC control service. Since: 1.8.
|
||||
* @QMI_SERVICE_RFSA: Remote file system access service. Since: 1.8.
|
||||
* @QMI_SERVICE_CSVT: Circuit switched videotelephony service. Since: 1.8.
|
||||
* @QMI_SERVICE_QCMAP: Qualcomm mobile access point service. Since: 1.8.
|
||||
* @QMI_SERVICE_IMSP: IMS presence service. Since: 1.8.
|
||||
* @QMI_SERVICE_IMSVT: IMS videotelephony service. Since: 1.8.
|
||||
* @QMI_SERVICE_IMSA: IMS application service. Since: 1.8.
|
||||
* @QMI_SERVICE_COEX: Coexistence service. Since: 1.8.
|
||||
* @QMI_SERVICE_PDC: Persistent device configuration service. Since: 1.8.
|
||||
* @QMI_SERVICE_STX: Simultaneous transmit service. Since: 1.8.
|
||||
* @QMI_SERVICE_BIT: Bearer independent transport service. Since: 1.8.
|
||||
* @QMI_SERVICE_IMSRTP: IMS RTP service. Since: 1.8.
|
||||
* @QMI_SERVICE_RFRPE: RF radiated performance enhancement service. Since: 1.8.
|
||||
* @QMI_SERVICE_DSD: Data system determination service. Since: 1.8.
|
||||
* @QMI_SERVICE_SSCTL: Subsystem control service. Since: 1.8.
|
||||
* @QMI_SERVICE_DPM: Data Port Mapper service. Since: 1.30.
|
||||
* @QMI_SERVICE_CAT: Card Application Toolkit service (v1).
|
||||
* @QMI_SERVICE_RMS: Remote Management Service.
|
||||
* @QMI_SERVICE_OMA: Open Mobile Alliance device management service.
|
||||
* @QMI_SERVICE_FOTA: Firmware Over The Air service. Since: 1.24.
|
||||
* @QMI_SERVICE_GMS: Telit General Modem Service. Since: 1.24.
|
||||
* @QMI_SERVICE_GAS: Telit General Application Service. Since: 1.24.
|
||||
*
|
||||
* QMI services.
|
||||
*
|
||||
* Since: 1.0
|
||||
*/
|
||||
typedef enum { /*< since=1.0 >*/
|
||||
QMI_SERVICE_UNKNOWN = -1,
|
||||
QMI_SERVICE_CTL = 0x00,
|
||||
QMI_SERVICE_WDS = 0x01,
|
||||
QMI_SERVICE_DMS = 0x02,
|
||||
QMI_SERVICE_NAS = 0x03,
|
||||
QMI_SERVICE_QOS = 0x04,
|
||||
QMI_SERVICE_WMS = 0x05,
|
||||
QMI_SERVICE_PDS = 0x06,
|
||||
QMI_SERVICE_AUTH = 0x07,
|
||||
QMI_SERVICE_AT = 0x08,
|
||||
QMI_SERVICE_VOICE = 0x09,
|
||||
QMI_SERVICE_CAT2 = 0x0A,
|
||||
QMI_SERVICE_UIM = 0x0B,
|
||||
QMI_SERVICE_PBM = 0x0C,
|
||||
QMI_SERVICE_QCHAT = 0x0D,
|
||||
QMI_SERVICE_RMTFS = 0x0E,
|
||||
QMI_SERVICE_TEST = 0x0F,
|
||||
QMI_SERVICE_LOC = 0x10,
|
||||
QMI_SERVICE_SAR = 0x11,
|
||||
QMI_SERVICE_IMS = 0x12,
|
||||
QMI_SERVICE_ADC = 0x13,
|
||||
QMI_SERVICE_CSD = 0x14,
|
||||
QMI_SERVICE_MFS = 0x15,
|
||||
QMI_SERVICE_TIME = 0x16,
|
||||
QMI_SERVICE_TS = 0x17,
|
||||
QMI_SERVICE_TMD = 0x18,
|
||||
QMI_SERVICE_SAP = 0x19,
|
||||
QMI_SERVICE_WDA = 0x1A,
|
||||
QMI_SERVICE_TSYNC = 0x1B,
|
||||
QMI_SERVICE_RFSA = 0x1C,
|
||||
QMI_SERVICE_CSVT = 0x1D,
|
||||
QMI_SERVICE_QCMAP = 0x1E,
|
||||
QMI_SERVICE_IMSP = 0x1F,
|
||||
QMI_SERVICE_IMSVT = 0x20,
|
||||
QMI_SERVICE_IMSA = 0x21,
|
||||
QMI_SERVICE_COEX = 0x22,
|
||||
/* 0x23, reserved */
|
||||
QMI_SERVICE_PDC = 0x24,
|
||||
/* 0x25, reserved */
|
||||
QMI_SERVICE_STX = 0x26,
|
||||
QMI_SERVICE_BIT = 0x27,
|
||||
QMI_SERVICE_IMSRTP = 0x28,
|
||||
QMI_SERVICE_RFRPE = 0x29,
|
||||
QMI_SERVICE_DSD = 0x2A,
|
||||
QMI_SERVICE_SSCTL = 0x2B,
|
||||
QMI_SERVICE_DPM = 0x2F,
|
||||
QMI_SERVICE_CAT = 0xE0,
|
||||
QMI_SERVICE_RMS = 0xE1,
|
||||
QMI_SERVICE_OMA = 0xE2,
|
||||
QMI_SERVICE_FOTA = 0xE6,
|
||||
QMI_SERVICE_GMS = 0xE7,
|
||||
QMI_SERVICE_GAS = 0xE8,
|
||||
} QmiService;
|
||||
|
||||
/**
|
||||
* QmiEndian:
|
||||
* @QMI_ENDIAN_LITTLE: Little endian.
|
||||
* @QMI_ENDIAN_BIG: Big endian.
|
||||
*
|
||||
* Type of endianness.
|
||||
*
|
||||
* Since: 1.0
|
||||
*/
|
||||
typedef enum { /*< since=1.28 >*/ /* the get_string() helper and QmiEndian type added in 1.28 */
|
||||
QMI_ENDIAN_LITTLE = 0,
|
||||
QMI_ENDIAN_BIG = 1
|
||||
} QmiEndian;
|
||||
|
||||
/**
|
||||
* QmiDataEndpointType:
|
||||
* @QMI_DATA_ENDPOINT_TYPE_UNKNOWN: Unknown. Since 1.30.
|
||||
* @QMI_DATA_ENDPOINT_TYPE_HSIC: High-speed inter-chip interface. Since 1.30.
|
||||
* @QMI_DATA_ENDPOINT_TYPE_HSUSB: High-speed USB.
|
||||
* @QMI_DATA_ENDPOINT_TYPE_PCIE: PCIe. Since: 1.28.
|
||||
* @QMI_DATA_ENDPOINT_TYPE_EMBEDDED: Embedded. Since 1.28.
|
||||
* @QMI_DATA_ENDPOINT_TYPE_BAM_DMUX: BAM/DMUX. Since 1.30.
|
||||
* @QMI_DATA_ENDPOINT_TYPE_UNDEFINED: Undefined.
|
||||
*
|
||||
* Data Endpoint Type.
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
typedef enum { /*< since=1.18 >*/
|
||||
QMI_DATA_ENDPOINT_TYPE_UNKNOWN = 0x00,
|
||||
QMI_DATA_ENDPOINT_TYPE_HSIC = 0x01,
|
||||
QMI_DATA_ENDPOINT_TYPE_HSUSB = 0x02,
|
||||
QMI_DATA_ENDPOINT_TYPE_PCIE = 0x03,
|
||||
QMI_DATA_ENDPOINT_TYPE_EMBEDDED = 0x04,
|
||||
QMI_DATA_ENDPOINT_TYPE_BAM_DMUX = 0x05,
|
||||
QMI_DATA_ENDPOINT_TYPE_UNDEFINED = 0xFF,
|
||||
} QmiDataEndpointType;
|
||||
|
||||
/**
|
||||
* QmiSioPort:
|
||||
* @QMI_SIO_PORT_NONE: Invalid port number.
|
||||
* @QMI_SIO_PORT_A2_MUX_RMNET0: A2 MUX (BAM-DMUX) port for rmnet0.
|
||||
* @QMI_SIO_PORT_A2_MUX_RMNET1: A2 MUX (BAM-DMUX) port for rmnet1.
|
||||
* @QMI_SIO_PORT_A2_MUX_RMNET2: A2 MUX (BAM-DMUX) port for rmnet2.
|
||||
* @QMI_SIO_PORT_A2_MUX_RMNET3: A2 MUX (BAM-DMUX) port for rmnet3.
|
||||
* @QMI_SIO_PORT_A2_MUX_RMNET4: A2 MUX (BAM-DMUX) port for rmnet4.
|
||||
* @QMI_SIO_PORT_A2_MUX_RMNET5: A2 MUX (BAM-DMUX) port for rmnet5.
|
||||
* @QMI_SIO_PORT_A2_MUX_RMNET6: A2 MUX (BAM-DMUX) port for rmnet6.
|
||||
* @QMI_SIO_PORT_A2_MUX_RMNET7: A2 MUX (BAM-DMUX) port for rmnet7.
|
||||
*
|
||||
* SIO (serial I/O) port numbers. All ports available in the modem have a SIO
|
||||
* port number. This enum is incomplete, only few port numbers are publicly
|
||||
* known.
|
||||
*
|
||||
* Since: 1.28
|
||||
*/
|
||||
typedef enum { /*< since=1.28 >*/
|
||||
QMI_SIO_PORT_NONE = 0x0000,
|
||||
QMI_SIO_PORT_A2_MUX_RMNET0 = 0x0e04,
|
||||
QMI_SIO_PORT_A2_MUX_RMNET1 = 0x0e05,
|
||||
QMI_SIO_PORT_A2_MUX_RMNET2 = 0x0e06,
|
||||
QMI_SIO_PORT_A2_MUX_RMNET3 = 0x0e07,
|
||||
QMI_SIO_PORT_A2_MUX_RMNET4 = 0x0e08,
|
||||
QMI_SIO_PORT_A2_MUX_RMNET5 = 0x0e09,
|
||||
QMI_SIO_PORT_A2_MUX_RMNET6 = 0x0e0a,
|
||||
QMI_SIO_PORT_A2_MUX_RMNET7 = 0x0e0b,
|
||||
} QmiSioPort;
|
||||
|
||||
#endif /* _LIBQMI_GLIB_QMI_ENUMS_H_ */
|
@ -0,0 +1,351 @@
|
||||
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/*
|
||||
* libqmi-glib -- GLib/GIO based library to control QMI devices
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Copyright (C) 2012-2017 Aleksander Morgado <aleksander@aleksander.es>
|
||||
*/
|
||||
|
||||
#ifndef _LIBQMI_GLIB_QMI_ERRORS_H_
|
||||
#define _LIBQMI_GLIB_QMI_ERRORS_H_
|
||||
|
||||
/**
|
||||
* SECTION: qmi-errors
|
||||
*
|
||||
* This section defines common error types used in the interface.
|
||||
*/
|
||||
|
||||
/**
|
||||
* QMI_DBUS_ERROR_PREFIX:
|
||||
*
|
||||
* Symbol defining the common string prefix used for all libqmi errors in DBus.
|
||||
*
|
||||
* Since: 1.0
|
||||
*/
|
||||
#define QMI_DBUS_ERROR_PREFIX "org.freedesktop.libqmi.Error"
|
||||
|
||||
/**
|
||||
* QMI_CORE_ERROR_DBUS_PREFIX:
|
||||
*
|
||||
* Symbol defining the common string prefix used for all #QmiCoreError errors in DBus.
|
||||
*
|
||||
* Since: 1.0
|
||||
*/
|
||||
#define QMI_CORE_ERROR_DBUS_PREFIX QMI_DBUS_ERROR_PREFIX ".Core"
|
||||
|
||||
/**
|
||||
* QMI_PROTOCOL_ERROR_DBUS_PREFIX:
|
||||
*
|
||||
* Symbol defining the common string prefix used for all #QmiProtocolError errors in DBus.
|
||||
*
|
||||
* Since: 1.0
|
||||
*/
|
||||
#define QMI_PROTOCOL_ERROR_DBUS_PREFIX QMI_DBUS_ERROR_PREFIX ".Protocol"
|
||||
|
||||
/**
|
||||
* QmiCoreError:
|
||||
* @QMI_CORE_ERROR_FAILED: Operation failed.
|
||||
* @QMI_CORE_ERROR_WRONG_STATE: Operation cannot be executed in the current state.
|
||||
* @QMI_CORE_ERROR_TIMEOUT: Operation timed out.
|
||||
* @QMI_CORE_ERROR_INVALID_ARGS: Invalid arguments given.
|
||||
* @QMI_CORE_ERROR_INVALID_MESSAGE: QMI message is invalid.
|
||||
* @QMI_CORE_ERROR_TLV_NOT_FOUND: TLV not found.
|
||||
* @QMI_CORE_ERROR_TLV_TOO_LONG: TLV is too long.
|
||||
* @QMI_CORE_ERROR_UNSUPPORTED: Not supported.
|
||||
* @QMI_CORE_ERROR_TLV_EMPTY: TLV has no value. Empty TLVs are not a real error, so this error type is never generated. Since: 1.12. Deprecated: 1.22.
|
||||
* @QMI_CORE_ERROR_UNEXPECTED_MESSAGE: QMI message is unexpected. Since: 1.16.
|
||||
* @QMI_CORE_ERROR_INVALID_DATA: Invalid data found in the message. Since: 1.24.6.
|
||||
*
|
||||
* Common errors that may be reported by libqmi-glib.
|
||||
*
|
||||
* Since: 1.0
|
||||
*/
|
||||
typedef enum { /*< since=1.0 >*/
|
||||
QMI_CORE_ERROR_FAILED = 0, /*< nick=Failed >*/
|
||||
QMI_CORE_ERROR_WRONG_STATE = 1, /*< nick=WrongState >*/
|
||||
QMI_CORE_ERROR_TIMEOUT = 2, /*< nick=Timeout >*/
|
||||
QMI_CORE_ERROR_INVALID_ARGS = 3, /*< nick=InvalidArgs >*/
|
||||
QMI_CORE_ERROR_INVALID_MESSAGE = 4, /*< nick=InvalidMessage >*/
|
||||
QMI_CORE_ERROR_TLV_NOT_FOUND = 5, /*< nick=TlvNotFound >*/
|
||||
QMI_CORE_ERROR_TLV_TOO_LONG = 6, /*< nick=TlvTooLong >*/
|
||||
QMI_CORE_ERROR_UNSUPPORTED = 7, /*< nick=Unsupported >*/
|
||||
QMI_CORE_ERROR_TLV_EMPTY = 8, /*< nick=TlvEmpty >*/
|
||||
QMI_CORE_ERROR_UNEXPECTED_MESSAGE = 9, /*< nick=UnexpectedMessage >*/
|
||||
QMI_CORE_ERROR_INVALID_DATA = 10, /*< nick=InvalidData >*/
|
||||
} QmiCoreError;
|
||||
|
||||
/**
|
||||
* QmiProtocolError:
|
||||
* @QMI_PROTOCOL_ERROR_NONE: No error.
|
||||
* @QMI_PROTOCOL_ERROR_MALFORMED_MESSAGE: Malformed message.
|
||||
* @QMI_PROTOCOL_ERROR_NO_MEMORY: No memory.
|
||||
* @QMI_PROTOCOL_ERROR_INTERNAL: Internal.
|
||||
* @QMI_PROTOCOL_ERROR_ABORTED: Aborted.
|
||||
* @QMI_PROTOCOL_ERROR_CLIENT_IDS_EXHAUSTED: Client IDs exhausted.
|
||||
* @QMI_PROTOCOL_ERROR_UNABORTABLE_TRANSACTION: Unabortable transaction.
|
||||
* @QMI_PROTOCOL_ERROR_INVALID_CLIENT_ID: Invalid client ID.
|
||||
* @QMI_PROTOCOL_ERROR_NO_THRESHOLDS_PROVIDED: No thresholds provided.
|
||||
* @QMI_PROTOCOL_ERROR_INVALID_HANDLE: Invalid handle.
|
||||
* @QMI_PROTOCOL_ERROR_INVALID_PROFILE: Invalid profile.
|
||||
* @QMI_PROTOCOL_ERROR_INVALID_PIN_ID: Invalid PIN ID.
|
||||
* @QMI_PROTOCOL_ERROR_INCORRECT_PIN: Incorrect PIN.
|
||||
* @QMI_PROTOCOL_ERROR_NO_NETWORK_FOUND: No network found.
|
||||
* @QMI_PROTOCOL_ERROR_CALL_FAILED: Call failed.
|
||||
* @QMI_PROTOCOL_ERROR_OUT_OF_CALL: Out of call.
|
||||
* @QMI_PROTOCOL_ERROR_NOT_PROVISIONED: Not provisioned.
|
||||
* @QMI_PROTOCOL_ERROR_MISSING_ARGUMENT: Missing argument.
|
||||
* @QMI_PROTOCOL_ERROR_ARGUMENT_TOO_LONG: Argument too long.
|
||||
* @QMI_PROTOCOL_ERROR_INVALID_TRANSACTION_ID: Invalid transaction ID.
|
||||
* @QMI_PROTOCOL_ERROR_DEVICE_IN_USE: Device in use.
|
||||
* @QMI_PROTOCOL_ERROR_NETWORK_UNSUPPORTED: Network unsupported.
|
||||
* @QMI_PROTOCOL_ERROR_DEVICE_UNSUPPORTED: Device unsupported.
|
||||
* @QMI_PROTOCOL_ERROR_NO_EFFECT: No effect.
|
||||
* @QMI_PROTOCOL_ERROR_NO_FREE_PROFILE: No free profile.
|
||||
* @QMI_PROTOCOL_ERROR_INVALID_PDP_TYPE: Invalid PDP type.
|
||||
* @QMI_PROTOCOL_ERROR_INVALID_TECHNOLOGY_PREFERENCE: Invalid technology preference.
|
||||
* @QMI_PROTOCOL_ERROR_INVALID_PROFILE_TYPE: Invalid profile type.
|
||||
* @QMI_PROTOCOL_ERROR_INVALID_SERVICE_TYPE: Invalid service type.
|
||||
* @QMI_PROTOCOL_ERROR_INVALID_REGISTER_ACTION: Invalid register action.
|
||||
* @QMI_PROTOCOL_ERROR_INVALID_PS_ATTACH_ACTION: Invalid PS attach action.
|
||||
* @QMI_PROTOCOL_ERROR_AUTHENTICATION_FAILED: Authentication failed.
|
||||
* @QMI_PROTOCOL_ERROR_PIN_BLOCKED: PIN blocked.
|
||||
* @QMI_PROTOCOL_ERROR_PIN_ALWAYS_BLOCKED: PIN always blocked.
|
||||
* @QMI_PROTOCOL_ERROR_UIM_UNINITIALIZED: UIM uninitialized.
|
||||
* @QMI_PROTOCOL_ERROR_MAXIMUM_QOS_REQUESTS_IN_USE: Maximum QoS requests in use.
|
||||
* @QMI_PROTOCOL_ERROR_INCORRECT_FLOW_FILTER: Incorrect flow filter.
|
||||
* @QMI_PROTOCOL_ERROR_NETWORK_QOS_UNAWARE: Network QoS unaware.
|
||||
* @QMI_PROTOCOL_ERROR_INVALID_QOS_ID: Invalid QoS ID.
|
||||
* @QMI_PROTOCOL_ERROR_REQUESTED_NUMBER_UNSUPPORTED: Requested number unsupported. Since: 1.22.
|
||||
* @QMI_PROTOCOL_ERROR_INTERFACE_NOT_FOUND: Interface not found. Since: 1.22.
|
||||
* @QMI_PROTOCOL_ERROR_FLOW_SUSPENDED: Flow suspended.
|
||||
* @QMI_PROTOCOL_ERROR_INVALID_DATA_FORMAT: Invalid data format. Since: 1.22.
|
||||
* @QMI_PROTOCOL_ERROR_GENERAL_ERROR: General error.
|
||||
* @QMI_PROTOCOL_ERROR_UNKNOWN_ERROR: Unknown error.
|
||||
* @QMI_PROTOCOL_ERROR_INVALID_ARGUMENT: Invalid argument.
|
||||
* @QMI_PROTOCOL_ERROR_INVALID_INDEX: Invalid index.
|
||||
* @QMI_PROTOCOL_ERROR_NO_ENTRY: No entry.
|
||||
* @QMI_PROTOCOL_ERROR_DEVICE_STORAGE_FULL: Device storage full.
|
||||
* @QMI_PROTOCOL_ERROR_DEVICE_NOT_READY: Device not ready.
|
||||
* @QMI_PROTOCOL_ERROR_NETWORK_NOT_READY: Network not ready.
|
||||
* @QMI_PROTOCOL_ERROR_WMS_CAUSE_CODE: WMS cause code.
|
||||
* @QMI_PROTOCOL_ERROR_WMS_MESSAGE_NOT_SENT: WMS message not sent.
|
||||
* @QMI_PROTOCOL_ERROR_WMS_MESSAGE_DELIVERY_FAILURE: WMS message delivery failure.
|
||||
* @QMI_PROTOCOL_ERROR_WMS_INVALID_MESSAGE_ID: WMS invalid message ID.
|
||||
* @QMI_PROTOCOL_ERROR_WMS_ENCODING: WMS encoding.
|
||||
* @QMI_PROTOCOL_ERROR_AUTHENTICATION_LOCK: Authentication lock.
|
||||
* @QMI_PROTOCOL_ERROR_INVALID_TRANSITION: Invalid transition.
|
||||
* @QMI_PROTOCOL_ERROR_NOT_MCAST_INTERFACE: Not a multicast interface. Since: 1.22.
|
||||
* @QMI_PROTOCOL_ERROR_MAXIMUM_MCAST_REQUESTS_IN_USE: Maximum multicast requests in use. Since: 1.22.
|
||||
* @QMI_PROTOCOL_ERROR_INVALID_MCAST_HANDLE: Invalid mulitcast handle. Since: 1.22.
|
||||
* @QMI_PROTOCOL_ERROR_INVALID_IP_FAMILY_PREFERENCE: Invalid IP family preference. Since: 1.22.
|
||||
* @QMI_PROTOCOL_ERROR_SESSION_INACTIVE: Session inactive.
|
||||
* @QMI_PROTOCOL_ERROR_SESSION_INVALID: Session invalid.
|
||||
* @QMI_PROTOCOL_ERROR_SESSION_OWNERSHIP: Session ownership.
|
||||
* @QMI_PROTOCOL_ERROR_INSUFFICIENT_RESOURCES: Insufficient resources.
|
||||
* @QMI_PROTOCOL_ERROR_DISABLED: Disabled.
|
||||
* @QMI_PROTOCOL_ERROR_INVALID_OPERATION: Invalid operation.
|
||||
* @QMI_PROTOCOL_ERROR_INVALID_QMI_COMMAND: Invalid QMI command.
|
||||
* @QMI_PROTOCOL_ERROR_WMS_T_PDU_TYPE: WMS T-PDU type.
|
||||
* @QMI_PROTOCOL_ERROR_WMS_SMSC_ADDRESS: WMS SMSC address.
|
||||
* @QMI_PROTOCOL_ERROR_INFORMATION_UNAVAILABLE: Information unavailable.
|
||||
* @QMI_PROTOCOL_ERROR_SEGMENT_TOO_LONG: Segment too long.
|
||||
* @QMI_PROTOCOL_ERROR_SEGMENT_ORDER: Segment order.
|
||||
* @QMI_PROTOCOL_ERROR_BUNDLING_NOT_SUPPORTED: Bundling not supported.
|
||||
* @QMI_PROTOCOL_ERROR_OPERATION_PARTIAL_FAILURE: Operation partial failure. Since: 1.22.
|
||||
* @QMI_PROTOCOL_ERROR_POLICY_MISMATCH: Policy mismatch. Since: 1.6.
|
||||
* @QMI_PROTOCOL_ERROR_SIM_FILE_NOT_FOUND: SIM file not found.
|
||||
* @QMI_PROTOCOL_ERROR_EXTENDED_INTERNAL: Extended internal error. Since: 1.6.
|
||||
* @QMI_PROTOCOL_ERROR_ACCESS_DENIED: Access denied.
|
||||
* @QMI_PROTOCOL_ERROR_HARDWARE_RESTRICTED: Hardware restricted.
|
||||
* @QMI_PROTOCOL_ERROR_ACK_NOT_SENT: ACK not sent. Since: 1.6.
|
||||
* @QMI_PROTOCOL_ERROR_INJECT_TIMEOUT: Inject timeout. Since: 1.6.
|
||||
* @QMI_PROTOCOL_ERROR_INCOMPATIBLE_STATE: Incompatible state. Since: 1.6.
|
||||
* @QMI_PROTOCOL_ERROR_FDN_RESTRICT: FDN restrict. Since: 1.6.
|
||||
* @QMI_PROTOCOL_ERROR_SUPS_FAILURE_CASE: SUPS failure case. Since: 1.6.
|
||||
* @QMI_PROTOCOL_ERROR_NO_RADIO: No radio. Since: 1.6.
|
||||
* @QMI_PROTOCOL_ERROR_NOT_SUPPORTED: Not supported. Since: 1.6.
|
||||
* @QMI_PROTOCOL_ERROR_NO_SUBSCRIPTION: No subscription. Since: 1.6.
|
||||
* @QMI_PROTOCOL_ERROR_CARD_CALL_CONTROL_FAILED: Card call control failed. Since: 1.6.
|
||||
* @QMI_PROTOCOL_ERROR_NETWORK_ABORTED: Network aborted. Since: 1.6.
|
||||
* @QMI_PROTOCOL_ERROR_MSG_BLOCKED: Message blocked. Since: 1.6.
|
||||
* @QMI_PROTOCOL_ERROR_INVALID_SESSION_TYPE: Invalid session type. Since: 1.6.
|
||||
* @QMI_PROTOCOL_ERROR_INVALID_PB_TYPE: Invalid PB type. Since: 1.6.
|
||||
* @QMI_PROTOCOL_ERROR_NO_SIM: No SIM. Since: 1.6.
|
||||
* @QMI_PROTOCOL_ERROR_PB_NOT_READY: PB not ready. Since: 1.6.
|
||||
* @QMI_PROTOCOL_ERROR_PIN_RESTRICTION: PIN restriction. Since: 1.6.
|
||||
* @QMI_PROTOCOL_ERROR_PIN2_RESTRICTION: PIN2 restriction. Since: 1.6.
|
||||
* @QMI_PROTOCOL_ERROR_PUK_RESTRICTION: PUK restriction. Since: 1.6.
|
||||
* @QMI_PROTOCOL_ERROR_PUK2_RESTRICTION: PUK2 restriction. Since: 1.6.
|
||||
* @QMI_PROTOCOL_ERROR_PB_ACCESS_RESTRICTED: PB access restricted. Since: 1.6.
|
||||
* @QMI_PROTOCOL_ERROR_PB_DELETE_IN_PROGRESS: PB delete in progress. Since: 1.22.
|
||||
* @QMI_PROTOCOL_ERROR_PB_TEXT_TOO_LONG: PB text too long. Since: 1.6.
|
||||
* @QMI_PROTOCOL_ERROR_PB_NUMBER_TOO_LONG: PB number too long. Since: 1.6.
|
||||
* @QMI_PROTOCOL_ERROR_PB_HIDDEN_KEY_RESTRICTION: PB hidden key restriction. Since: 1.6.
|
||||
* @QMI_PROTOCOL_ERROR_PB_NOT_AVAILABLE: PB not available. Since: 1.22.
|
||||
* @QMI_PROTOCOL_ERROR_DEVICE_MEMORY_ERROR: Device memory error. Since: 1.22.
|
||||
* @QMI_PROTOCOL_ERROR_NO_PERMISSION: No permission. Since: 1.22.
|
||||
* @QMI_PROTOCOL_ERROR_TOO_SOON: Too soon. Since: 1.22.
|
||||
* @QMI_PROTOCOL_ERROR_TIME_NOT_ACQUIRED: Time not acquired. Since: 1.22.
|
||||
* @QMI_PROTOCOL_ERROR_OPERATION_IN_PROGRESS: Operation in progress. Since: 1.22.
|
||||
* @QMI_PROTOCOL_ERROR_FW_WRITE_FAILED: Firmware write failed. Since: 1.22.
|
||||
* @QMI_PROTOCOL_ERROR_FW_INFO_READ_FAILED: Firmware info read failed. Since: 1.22.
|
||||
* @QMI_PROTOCOL_ERROR_FW_FILE_NOT_FOUND: Firmware file not found. Since: 1.22.
|
||||
* @QMI_PROTOCOL_ERROR_FW_DIR_NOT_FOUND: Firmware dir not found. Since: 1.22.
|
||||
* @QMI_PROTOCOL_ERROR_FW_ALREADY_ACTIVATED: Firmware already activated. Since: 1.22.
|
||||
* @QMI_PROTOCOL_ERROR_FW_CANNOT_GENERIC_IMAGE: Firmware cannot generic image. Since: 1.22.
|
||||
* @QMI_PROTOCOL_ERROR_FW_FILE_OPEN_FAILED: Firmware file open failed. Since: 1.22.
|
||||
* @QMI_PROTOCOL_ERROR_FW_UPDATE_DISCONTINUOUS_FRAME: Firmware update discontinuous frame. Since: 1.22.
|
||||
* @QMI_PROTOCOL_ERROR_FW_UPDATE_FAILED: Firmware update failed. Since: 1.22.
|
||||
* @QMI_PROTOCOL_ERROR_CAT_EVENT_REGISTRATION_FAILED: Event registration failed.
|
||||
* @QMI_PROTOCOL_ERROR_CAT_INVALID_TERMINAL_RESPONSE: Invalid terminal response.
|
||||
* @QMI_PROTOCOL_ERROR_CAT_INVALID_ENVELOPE_COMMAND: Invalid envelope command.
|
||||
* @QMI_PROTOCOL_ERROR_CAT_ENVELOPE_COMMAND_BUSY: Envelope command busy.
|
||||
* @QMI_PROTOCOL_ERROR_CAT_ENVELOPE_COMMAND_FAILED: Envelope command failed.
|
||||
*
|
||||
* QMI protocol errors.
|
||||
*
|
||||
* Since: 1.0
|
||||
*/
|
||||
typedef enum { /*< since=1.0 >*/
|
||||
QMI_PROTOCOL_ERROR_NONE = 0, /*< nick=None >*/
|
||||
QMI_PROTOCOL_ERROR_MALFORMED_MESSAGE = 1, /*< nick=MalformedMessage >*/
|
||||
QMI_PROTOCOL_ERROR_NO_MEMORY = 2, /*< nick=NoMemory >*/
|
||||
QMI_PROTOCOL_ERROR_INTERNAL = 3, /*< nick=Internal >*/
|
||||
QMI_PROTOCOL_ERROR_ABORTED = 4, /*< nick=Aborted >*/
|
||||
QMI_PROTOCOL_ERROR_CLIENT_IDS_EXHAUSTED = 5, /*< nick=ClientIdsExhausted >*/
|
||||
QMI_PROTOCOL_ERROR_UNABORTABLE_TRANSACTION = 6, /*< nick=UnabortableTransaction >*/
|
||||
QMI_PROTOCOL_ERROR_INVALID_CLIENT_ID = 7, /*< nick=InvalidClientId >*/
|
||||
QMI_PROTOCOL_ERROR_NO_THRESHOLDS_PROVIDED = 8, /*< nick=NoThresholdsProvided >*/
|
||||
QMI_PROTOCOL_ERROR_INVALID_HANDLE = 9, /*< nick=InvalidHandle >*/
|
||||
QMI_PROTOCOL_ERROR_INVALID_PROFILE = 10, /*< nick=InvalidProfile >*/
|
||||
QMI_PROTOCOL_ERROR_INVALID_PIN_ID = 11, /*< nick=InvalidPinId >*/
|
||||
QMI_PROTOCOL_ERROR_INCORRECT_PIN = 12, /*< nick=IncorrectPin >*/
|
||||
QMI_PROTOCOL_ERROR_NO_NETWORK_FOUND = 13, /*< nick=NoNetworkFound >*/
|
||||
QMI_PROTOCOL_ERROR_CALL_FAILED = 14, /*< nick=CallFailed >*/
|
||||
QMI_PROTOCOL_ERROR_OUT_OF_CALL = 15, /*< nick=OutOfCall >*/
|
||||
QMI_PROTOCOL_ERROR_NOT_PROVISIONED = 16, /*< nick=NotProvisioned >*/
|
||||
QMI_PROTOCOL_ERROR_MISSING_ARGUMENT = 17, /*< nick=MissingArgument >*/
|
||||
QMI_PROTOCOL_ERROR_ARGUMENT_TOO_LONG = 19, /*< nick=ArgumentTooLong >*/
|
||||
QMI_PROTOCOL_ERROR_INVALID_TRANSACTION_ID = 22, /*< nick=InvalidTransactionId >*/
|
||||
QMI_PROTOCOL_ERROR_DEVICE_IN_USE = 23, /*< nick=DeviceInUse >*/
|
||||
QMI_PROTOCOL_ERROR_NETWORK_UNSUPPORTED = 24, /*< nick=NetworkUnsupported >*/
|
||||
QMI_PROTOCOL_ERROR_DEVICE_UNSUPPORTED = 25, /*< nick=DeviceUnsupported >*/
|
||||
QMI_PROTOCOL_ERROR_NO_EFFECT = 26, /*< nick=NoEffect >*/
|
||||
QMI_PROTOCOL_ERROR_NO_FREE_PROFILE = 27, /*< nick=NoFreeProfile >*/
|
||||
QMI_PROTOCOL_ERROR_INVALID_PDP_TYPE = 28, /*< nick=InvalidPdpType >*/
|
||||
QMI_PROTOCOL_ERROR_INVALID_TECHNOLOGY_PREFERENCE = 29, /*< nick=InvalidTechnologyPreference >*/
|
||||
QMI_PROTOCOL_ERROR_INVALID_PROFILE_TYPE = 30, /*< nick=InvalidProfileType >*/
|
||||
QMI_PROTOCOL_ERROR_INVALID_SERVICE_TYPE = 31, /*< nick=InvalidServiceType >*/
|
||||
QMI_PROTOCOL_ERROR_INVALID_REGISTER_ACTION = 32, /*< nick=InvalidRegisterAction >*/
|
||||
QMI_PROTOCOL_ERROR_INVALID_PS_ATTACH_ACTION = 33, /*< nick=InvalidPsAttachAction >*/
|
||||
QMI_PROTOCOL_ERROR_AUTHENTICATION_FAILED = 34, /*< nick=AuthenticationFailed >*/
|
||||
QMI_PROTOCOL_ERROR_PIN_BLOCKED = 35, /*< nick=PinBlocked >*/
|
||||
QMI_PROTOCOL_ERROR_PIN_ALWAYS_BLOCKED = 36, /*< nick=PinAlwaysBlocked >*/
|
||||
QMI_PROTOCOL_ERROR_UIM_UNINITIALIZED = 37, /*< nick=UimUninitialized >*/
|
||||
QMI_PROTOCOL_ERROR_MAXIMUM_QOS_REQUESTS_IN_USE = 38, /*< nick=MaximumQosRequestsInUse >*/
|
||||
QMI_PROTOCOL_ERROR_INCORRECT_FLOW_FILTER = 39, /*< nick=IncorrectFlowFilter >*/
|
||||
QMI_PROTOCOL_ERROR_NETWORK_QOS_UNAWARE = 40, /*< nick=NetworkQosUnaware >*/
|
||||
QMI_PROTOCOL_ERROR_INVALID_QOS_ID = 41, /*< nick=InvalidQosId >*/
|
||||
QMI_PROTOCOL_ERROR_REQUESTED_NUMBER_UNSUPPORTED = 42, /*< nick=RequestedNumberUnsupported >*/
|
||||
QMI_PROTOCOL_ERROR_INTERFACE_NOT_FOUND = 43, /*< nick=InterfaceNotFound >*/
|
||||
QMI_PROTOCOL_ERROR_FLOW_SUSPENDED = 44, /*< nick=FlowSuspended >*/
|
||||
QMI_PROTOCOL_ERROR_INVALID_DATA_FORMAT = 45, /*< nick=InvalidDataFormat >*/
|
||||
QMI_PROTOCOL_ERROR_GENERAL_ERROR = 46, /*< nick=GeneralError >*/
|
||||
QMI_PROTOCOL_ERROR_UNKNOWN_ERROR = 47, /*< nick=UnknownError >*/
|
||||
QMI_PROTOCOL_ERROR_INVALID_ARGUMENT = 48, /*< nick=InvalidArgument >*/
|
||||
QMI_PROTOCOL_ERROR_INVALID_INDEX = 49, /*< nick=InvalidIndex >*/
|
||||
QMI_PROTOCOL_ERROR_NO_ENTRY = 50, /*< nick=NoEntry >*/
|
||||
QMI_PROTOCOL_ERROR_DEVICE_STORAGE_FULL = 51, /*< nick=DeviceStorageFull >*/
|
||||
QMI_PROTOCOL_ERROR_DEVICE_NOT_READY = 52, /*< nick=DeviceNotReady >*/
|
||||
QMI_PROTOCOL_ERROR_NETWORK_NOT_READY = 53, /*< nick=NetworkNotReady >*/
|
||||
QMI_PROTOCOL_ERROR_WMS_CAUSE_CODE = 54, /*< nick=WmsCauseCode >*/
|
||||
QMI_PROTOCOL_ERROR_WMS_MESSAGE_NOT_SENT = 55, /*< nick=WmsMessageNotSent >*/
|
||||
QMI_PROTOCOL_ERROR_WMS_MESSAGE_DELIVERY_FAILURE = 56, /*< nick=WmsMessageDeliveryFailure >*/
|
||||
QMI_PROTOCOL_ERROR_WMS_INVALID_MESSAGE_ID = 57, /*< nick=WmsInvalidMessageId >*/
|
||||
QMI_PROTOCOL_ERROR_WMS_ENCODING = 58, /*< nick=WmsEncoding >*/
|
||||
QMI_PROTOCOL_ERROR_AUTHENTICATION_LOCK = 59, /*< nick=AuthenticationLock >*/
|
||||
QMI_PROTOCOL_ERROR_INVALID_TRANSITION = 60, /*< nick=InvalidTransition >*/
|
||||
QMI_PROTOCOL_ERROR_NOT_MCAST_INTERFACE = 61, /*< nick=NotMcastInterface >*/
|
||||
QMI_PROTOCOL_ERROR_MAXIMUM_MCAST_REQUESTS_IN_USE = 62, /*< nick=MaximumMcastRequestsInUse >*/
|
||||
QMI_PROTOCOL_ERROR_INVALID_MCAST_HANDLE = 63, /*< nick=InvalidMcastHandle >*/
|
||||
QMI_PROTOCOL_ERROR_INVALID_IP_FAMILY_PREFERENCE = 64, /*< nick=InvalidIpFamilyPreference >*/
|
||||
QMI_PROTOCOL_ERROR_SESSION_INACTIVE = 65, /*< nick=SessionInactive >*/
|
||||
QMI_PROTOCOL_ERROR_SESSION_INVALID = 66, /*< nick=SessionInvalid >*/
|
||||
QMI_PROTOCOL_ERROR_SESSION_OWNERSHIP = 67, /*< nick=SessionOwnership >*/
|
||||
QMI_PROTOCOL_ERROR_INSUFFICIENT_RESOURCES = 68, /*< nick=InsufficientResources >*/
|
||||
QMI_PROTOCOL_ERROR_DISABLED = 69, /*< nick=Disabled >*/
|
||||
QMI_PROTOCOL_ERROR_INVALID_OPERATION = 70, /*< nick=InvalidOperation >*/
|
||||
QMI_PROTOCOL_ERROR_INVALID_QMI_COMMAND = 71, /*< nick=InvalidQmiCommand >*/
|
||||
QMI_PROTOCOL_ERROR_WMS_T_PDU_TYPE = 72, /*< nick=WmsTPduType >*/
|
||||
QMI_PROTOCOL_ERROR_WMS_SMSC_ADDRESS = 73, /*< nick=WmsSmscAddress >*/
|
||||
QMI_PROTOCOL_ERROR_INFORMATION_UNAVAILABLE = 74, /*< nick=InformationUnavailable >*/
|
||||
QMI_PROTOCOL_ERROR_SEGMENT_TOO_LONG = 75, /*< nick=SegmentTooLong >*/
|
||||
QMI_PROTOCOL_ERROR_SEGMENT_ORDER = 76, /*< nick=SegmentOrder >*/
|
||||
QMI_PROTOCOL_ERROR_BUNDLING_NOT_SUPPORTED = 77, /*< nick=BundlingNotSupported >*/
|
||||
QMI_PROTOCOL_ERROR_OPERATION_PARTIAL_FAILURE = 78, /*< nick=OperationPartialFailure >*/
|
||||
QMI_PROTOCOL_ERROR_POLICY_MISMATCH = 79, /*< nick=PolicyMismatch >*/
|
||||
QMI_PROTOCOL_ERROR_SIM_FILE_NOT_FOUND = 80, /*< nick=SimFileNotFound >*/
|
||||
QMI_PROTOCOL_ERROR_EXTENDED_INTERNAL = 81, /*< nick=ExtendedInternal >*/
|
||||
QMI_PROTOCOL_ERROR_ACCESS_DENIED = 82, /*< nick=AccessDenied >*/
|
||||
QMI_PROTOCOL_ERROR_HARDWARE_RESTRICTED = 83, /*< nick=HardwareRestricted >*/
|
||||
QMI_PROTOCOL_ERROR_ACK_NOT_SENT = 84, /*< nick=AckNotSent >*/
|
||||
QMI_PROTOCOL_ERROR_INJECT_TIMEOUT = 85, /*< nick=InjectTimeout >*/
|
||||
QMI_PROTOCOL_ERROR_INCOMPATIBLE_STATE = 90, /*< nick=IncompatibleState >*/
|
||||
QMI_PROTOCOL_ERROR_FDN_RESTRICT = 91, /*< nick=FdnRestrict >*/
|
||||
QMI_PROTOCOL_ERROR_SUPS_FAILURE_CASE = 92, /*< nick=SupsFailureCase >*/
|
||||
QMI_PROTOCOL_ERROR_NO_RADIO = 93, /*< nick=NoRadio >*/
|
||||
QMI_PROTOCOL_ERROR_NOT_SUPPORTED = 94, /*< nick=NotSupported >*/
|
||||
QMI_PROTOCOL_ERROR_NO_SUBSCRIPTION = 95, /*< nick=NoSubscription >*/
|
||||
QMI_PROTOCOL_ERROR_CARD_CALL_CONTROL_FAILED = 96, /*< nick=CardCallControlFailed >*/
|
||||
QMI_PROTOCOL_ERROR_NETWORK_ABORTED = 97, /*< nick=NetworkAborted >*/
|
||||
QMI_PROTOCOL_ERROR_MSG_BLOCKED = 98, /*< nick=MsgBlocked >*/
|
||||
QMI_PROTOCOL_ERROR_INVALID_SESSION_TYPE = 100, /*< nick=InvalidSessionType >*/
|
||||
QMI_PROTOCOL_ERROR_INVALID_PB_TYPE = 101, /*< nick=InvalidPbType >*/
|
||||
QMI_PROTOCOL_ERROR_NO_SIM = 102, /*< nick=NoSim >*/
|
||||
QMI_PROTOCOL_ERROR_PB_NOT_READY = 103, /*< nick=PbNotReady >*/
|
||||
QMI_PROTOCOL_ERROR_PIN_RESTRICTION = 104, /*< nick=PinRestriction >*/
|
||||
QMI_PROTOCOL_ERROR_PIN2_RESTRICTION = 105, /*< nick=Pin1Restriction >*/
|
||||
QMI_PROTOCOL_ERROR_PUK_RESTRICTION = 106, /*< nick=PukRestriction >*/
|
||||
QMI_PROTOCOL_ERROR_PUK2_RESTRICTION = 107, /*< nick=Puk2Restriction >*/
|
||||
QMI_PROTOCOL_ERROR_PB_ACCESS_RESTRICTED = 108, /*< nick=PbAccessRestricted >*/
|
||||
QMI_PROTOCOL_ERROR_PB_DELETE_IN_PROGRESS = 109, /*< nick=PbDeleteInProgress >*/
|
||||
QMI_PROTOCOL_ERROR_PB_TEXT_TOO_LONG = 110, /*< nick=PbTextTooLong >*/
|
||||
QMI_PROTOCOL_ERROR_PB_NUMBER_TOO_LONG = 111, /*< nick=PbNumberTooLong >*/
|
||||
QMI_PROTOCOL_ERROR_PB_HIDDEN_KEY_RESTRICTION = 112, /*< nick=PbHiddenKeyRestriction >*/
|
||||
QMI_PROTOCOL_ERROR_PB_NOT_AVAILABLE = 113, /*< nick=PbNotAvailable >*/
|
||||
QMI_PROTOCOL_ERROR_DEVICE_MEMORY_ERROR = 114, /*< nick=DeviceMemoryError >*/
|
||||
QMI_PROTOCOL_ERROR_NO_PERMISSION = 115, /*< nick=NoPermission >*/
|
||||
QMI_PROTOCOL_ERROR_TOO_SOON = 116, /*< nick=TooSoon >*/
|
||||
QMI_PROTOCOL_ERROR_TIME_NOT_ACQUIRED = 117, /*< nick=TimeNotAcquired >*/
|
||||
QMI_PROTOCOL_ERROR_OPERATION_IN_PROGRESS = 118, /*< nick=OperationInProgress >*/
|
||||
QMI_PROTOCOL_ERROR_FW_WRITE_FAILED = 388, /*< nick=FwWriteFailed >*/
|
||||
QMI_PROTOCOL_ERROR_FW_INFO_READ_FAILED = 389, /*< nick=FwInfoReadFailed >*/
|
||||
QMI_PROTOCOL_ERROR_FW_FILE_NOT_FOUND = 390, /*< nick=FwFileNotFound >*/
|
||||
QMI_PROTOCOL_ERROR_FW_DIR_NOT_FOUND = 391, /*< nick=FwDirNotFound >*/
|
||||
QMI_PROTOCOL_ERROR_FW_ALREADY_ACTIVATED = 392, /*< nick=FwAlreadyActivated >*/
|
||||
QMI_PROTOCOL_ERROR_FW_CANNOT_GENERIC_IMAGE = 393, /*< nick=FwCannotGenericImage >*/
|
||||
QMI_PROTOCOL_ERROR_FW_FILE_OPEN_FAILED = 400, /*< nick=FwFileOpenFailed >*/
|
||||
QMI_PROTOCOL_ERROR_FW_UPDATE_DISCONTINUOUS_FRAME = 401, /*< nick=FwUpdateDiscontinuousFrame >*/
|
||||
QMI_PROTOCOL_ERROR_FW_UPDATE_FAILED = 402, /*< nick=FwUpdateFailed >*/
|
||||
QMI_PROTOCOL_ERROR_CAT_EVENT_REGISTRATION_FAILED = 61441, /*< nick=CatEventRegistrationFailed >*/
|
||||
QMI_PROTOCOL_ERROR_CAT_INVALID_TERMINAL_RESPONSE = 61442, /*< nick=CatInvalidTerminalResponse >*/
|
||||
QMI_PROTOCOL_ERROR_CAT_INVALID_ENVELOPE_COMMAND = 61443, /*< nick=CatInvalidEnvelopeCommand >*/
|
||||
QMI_PROTOCOL_ERROR_CAT_ENVELOPE_COMMAND_BUSY = 61444, /*< nick=CatEnvelopeCommandBusy >*/
|
||||
QMI_PROTOCOL_ERROR_CAT_ENVELOPE_COMMAND_FAILED = 61445 /*< nick=CatEnvelopeCommandFailed >*/
|
||||
} QmiProtocolError;
|
||||
|
||||
#endif /* _LIBQMI_GLIB_QMI_ERRORS_H_ */
|
@ -0,0 +1,216 @@
|
||||
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/*
|
||||
* libqmi-glib -- GLib/GIO based library to control QMI devices
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Copyright (C) 2012 Lanedo GmbH.
|
||||
* Copyright (C) 2012 Google, Inc.
|
||||
* Copyright (C) 2012-2017 Aleksander Morgado <aleksander@aleksander.es>
|
||||
*/
|
||||
|
||||
#ifndef _LIBQMI_GLIB_QMI_FLAGS64_DMS_H_
|
||||
#define _LIBQMI_GLIB_QMI_FLAGS64_DMS_H_
|
||||
|
||||
/*****************************************************************************/
|
||||
/* Helper enums for the 'QMI DMS Get Band Capability' message */
|
||||
|
||||
/**
|
||||
* QmiDmsBandCapability:
|
||||
* @QMI_DMS_BAND_CAPABILITY_BC_0_A_SYSTEM: Band class 0, A-system.
|
||||
* @QMI_DMS_BAND_CAPABILITY_BC_0_B_SYSTEM: Band class 0, B-system.
|
||||
* @QMI_DMS_BAND_CAPABILITY_BC_1_ALL_BLOCKS: Band class 1, all blocks.
|
||||
* @QMI_DMS_BAND_CAPABILITY_BC_2: Band class 2.
|
||||
* @QMI_DMS_BAND_CAPABILITY_BC_3_A_SYSTEM: Band class 3, A-system.
|
||||
* @QMI_DMS_BAND_CAPABILITY_BC_4_ALL_BLOCKS: Band class 4, all blocks.
|
||||
* @QMI_DMS_BAND_CAPABILITY_BC_5_ALL_BLOCKS: Band class 5, all blocks.
|
||||
* @QMI_DMS_BAND_CAPABILITY_BC_6: Band class 6.
|
||||
* @QMI_DMS_BAND_CAPABILITY_BC_7: Band class 7.
|
||||
* @QMI_DMS_BAND_CAPABILITY_BC_8: Band class 8.
|
||||
* @QMI_DMS_BAND_CAPABILITY_BC_9: Band class 9.
|
||||
* @QMI_DMS_BAND_CAPABILITY_BC_10: Band class 10.
|
||||
* @QMI_DMS_BAND_CAPABILITY_BC_11: Band class 11.
|
||||
* @QMI_DMS_BAND_CAPABILITY_BC_12: Band class 12.
|
||||
* @QMI_DMS_BAND_CAPABILITY_BC_14: Band class 14.
|
||||
* @QMI_DMS_BAND_CAPABILITY_BC_15: Band class 15.
|
||||
* @QMI_DMS_BAND_CAPABILITY_BC_16: Band class 16.
|
||||
* @QMI_DMS_BAND_CAPABILITY_BC_17: Band class 17.
|
||||
* @QMI_DMS_BAND_CAPABILITY_BC_18: Band class 18.
|
||||
* @QMI_DMS_BAND_CAPABILITY_BC_19: Band class 19.
|
||||
* @QMI_DMS_BAND_CAPABILITY_GSM_DCS_1800: GSM DCS band.
|
||||
* @QMI_DMS_BAND_CAPABILITY_GSM_900_EXTENDED: GSM Extended GSM band (900).
|
||||
* @QMI_DMS_BAND_CAPABILITY_GSM_900_PRIMARY: GSM Primary GSM band (900).
|
||||
* @QMI_DMS_BAND_CAPABILITY_GSM_450: GSM 450 band.
|
||||
* @QMI_DMS_BAND_CAPABILITY_GSM_480: GSM 480 band.
|
||||
* @QMI_DMS_BAND_CAPABILITY_GSM_750: GSM 750 band.
|
||||
* @QMI_DMS_BAND_CAPABILITY_GSM_850: GSM 850 band.
|
||||
* @QMI_DMS_BAND_CAPABILITY_GSM_900_RAILWAYS: GSM railways band (900).
|
||||
* @QMI_DMS_BAND_CAPABILITY_GSM_PCS_1900: GSM PCS band (1900).
|
||||
* @QMI_DMS_BAND_CAPABILITY_WCDMA_2100: WCDMA 2100 band (Europe, Japan, China).
|
||||
* @QMI_DMS_BAND_CAPABILITY_WCDMA_PCS_1900: WCDMA PCS 1900 band (US).
|
||||
* @QMI_DMS_BAND_CAPABILITY_WCDMA_DCS_1800: WCDMA DCS 1800 band (Europe, China).
|
||||
* @QMI_DMS_BAND_CAPABILITY_WCDMA_1700_US: WCDMA 1700 band (US).
|
||||
* @QMI_DMS_BAND_CAPABILITY_WCDMA_850_US: WCDMA 850 band (US).
|
||||
* @QMI_DMS_BAND_CAPABILITY_WCDMA_800: QWCDMA 850 band (Japan).
|
||||
* @QMI_DMS_BAND_CAPABILITY_WCDMA_2600: WCDMA 2600 band (Europe).
|
||||
* @QMI_DMS_BAND_CAPABILITY_WCDMA_900: WCDMA 900 band (Europe, Japan).
|
||||
* @QMI_DMS_BAND_CAPABILITY_WCDMA_1700_JAPAN: WCDMA 1700 band (Japan).
|
||||
* @QMI_DMS_BAND_CAPABILITY_WCDMA_850_JAPAN: WCDMA 850 band (Japan)
|
||||
* @QMI_DMS_BAND_CAPABILITY_WCDMA_1500: WCDMA 1500 band.
|
||||
*
|
||||
* Frequency band capabilities.
|
||||
*
|
||||
* Since: 1.0
|
||||
*/
|
||||
typedef enum { /*< since=1.0 >*/
|
||||
QMI_DMS_BAND_CAPABILITY_BC_0_A_SYSTEM = 1 << 0,
|
||||
QMI_DMS_BAND_CAPABILITY_BC_0_B_SYSTEM = 1 << 1,
|
||||
QMI_DMS_BAND_CAPABILITY_BC_1_ALL_BLOCKS = 1 << 2,
|
||||
QMI_DMS_BAND_CAPABILITY_BC_2 = 1 << 3,
|
||||
QMI_DMS_BAND_CAPABILITY_BC_3_A_SYSTEM = 1 << 4,
|
||||
QMI_DMS_BAND_CAPABILITY_BC_4_ALL_BLOCKS = 1 << 5,
|
||||
QMI_DMS_BAND_CAPABILITY_BC_5_ALL_BLOCKS = 1 << 6,
|
||||
QMI_DMS_BAND_CAPABILITY_GSM_DCS_1800 = 1 << 7,
|
||||
QMI_DMS_BAND_CAPABILITY_GSM_900_EXTENDED = 1 << 8,
|
||||
QMI_DMS_BAND_CAPABILITY_GSM_900_PRIMARY = 1 << 9,
|
||||
QMI_DMS_BAND_CAPABILITY_BC_6 = 1 << 10,
|
||||
QMI_DMS_BAND_CAPABILITY_BC_7 = 1 << 11,
|
||||
QMI_DMS_BAND_CAPABILITY_BC_8 = 1 << 12,
|
||||
QMI_DMS_BAND_CAPABILITY_BC_9 = 1 << 13,
|
||||
QMI_DMS_BAND_CAPABILITY_BC_10 = 1 << 14,
|
||||
QMI_DMS_BAND_CAPABILITY_BC_11 = 1 << 15,
|
||||
QMI_DMS_BAND_CAPABILITY_GSM_450 = 1 << 16,
|
||||
QMI_DMS_BAND_CAPABILITY_GSM_480 = 1 << 17,
|
||||
QMI_DMS_BAND_CAPABILITY_GSM_750 = 1 << 18,
|
||||
QMI_DMS_BAND_CAPABILITY_GSM_850 = 1 << 19,
|
||||
QMI_DMS_BAND_CAPABILITY_GSM_900_RAILWAYS = 1 << 20,
|
||||
QMI_DMS_BAND_CAPABILITY_GSM_PCS_1900 = 1 << 21,
|
||||
QMI_DMS_BAND_CAPABILITY_WCDMA_2100 = 1 << 22,
|
||||
QMI_DMS_BAND_CAPABILITY_WCDMA_PCS_1900 = 1 << 23,
|
||||
QMI_DMS_BAND_CAPABILITY_WCDMA_DCS_1800 = 1 << 24,
|
||||
QMI_DMS_BAND_CAPABILITY_WCDMA_1700_US = 1 << 25,
|
||||
QMI_DMS_BAND_CAPABILITY_WCDMA_850_US = 1 << 26,
|
||||
QMI_DMS_BAND_CAPABILITY_WCDMA_800 = 1 << 27,
|
||||
QMI_DMS_BAND_CAPABILITY_BC_12 = 1 << 28,
|
||||
QMI_DMS_BAND_CAPABILITY_BC_14 = 1 << 29,
|
||||
/* Bit 30 reserved */
|
||||
QMI_DMS_BAND_CAPABILITY_BC_15 = ((uint64_t) 1) << 31,
|
||||
/* Bits 32-47 reserved */
|
||||
QMI_DMS_BAND_CAPABILITY_WCDMA_2600 = ((uint64_t) 1) << 48,
|
||||
QMI_DMS_BAND_CAPABILITY_WCDMA_900 = ((uint64_t) 1) << 49,
|
||||
QMI_DMS_BAND_CAPABILITY_WCDMA_1700_JAPAN = ((uint64_t) 1) << 50,
|
||||
/* Bits 51-55 reserved */
|
||||
QMI_DMS_BAND_CAPABILITY_BC_16 = ((uint64_t) 1) << 56,
|
||||
QMI_DMS_BAND_CAPABILITY_BC_17 = ((uint64_t) 1) << 57,
|
||||
QMI_DMS_BAND_CAPABILITY_BC_18 = ((uint64_t) 1) << 58,
|
||||
QMI_DMS_BAND_CAPABILITY_BC_19 = ((uint64_t) 1) << 59,
|
||||
QMI_DMS_BAND_CAPABILITY_WCDMA_850_JAPAN = ((uint64_t) 1) << 60,
|
||||
QMI_DMS_BAND_CAPABILITY_WCDMA_1500 = ((uint64_t) 1) << 61
|
||||
/* Bits 62-63 reserved */
|
||||
} QmiDmsBandCapability;
|
||||
|
||||
/**
|
||||
* QmiDmsLteBandCapability:
|
||||
* @QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_1: LTE EUTRAN Band 1
|
||||
* @QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_2: LTE EUTRAN Band 2.
|
||||
* @QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_3: LTE EUTRAN Band 3.
|
||||
* @QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_4: LTE EUTRAN Band 4.
|
||||
* @QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_5: LTE EUTRAN Band 5.
|
||||
* @QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_6: LTE EUTRAN Band 6.
|
||||
* @QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_7: LTE EUTRAN Band 7.
|
||||
* @QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_8: LTE EUTRAN Band 8.
|
||||
* @QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_9: LTE EUTRAN Band 9.
|
||||
* @QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_10: LTE EUTRAN Band 10.
|
||||
* @QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_11: LTE EUTRAN Band 11.
|
||||
* @QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_12: LTE EUTRAN Band 12.
|
||||
* @QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_13: LTE EUTRAN Band 13.
|
||||
* @QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_14: LTE EUTRAN Band 14.
|
||||
* @QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_17: LTE EUTRAN Band 17.
|
||||
* @QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_18: LTE EUTRAN Band 18.
|
||||
* @QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_19: LTE EUTRAN Band 19.
|
||||
* @QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_20: LTE EUTRAN Band 20.
|
||||
* @QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_21: LTE EUTRAN Band 21.
|
||||
* @QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_24: LTE EUTRAN Band 24.
|
||||
* @QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_25: LTE EUTRAN Band 25.
|
||||
* @QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_26: LTE EUTRAN Band 26.
|
||||
* @QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_27: LTE EUTRAN Band 27.
|
||||
* @QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_28: LTE EUTRAN Band 28.
|
||||
* @QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_29: LTE EUTRAN Band 29.
|
||||
* @QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_30: LTE EUTRAN Band 30.
|
||||
* @QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_31: LTE EUTRAN Band 31.
|
||||
* @QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_32: LTE EUTRAN Band 32.
|
||||
* @QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_33: LTE EUTRAN Band 33.
|
||||
* @QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_34: LTE EUTRAN Band 34.
|
||||
* @QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_35: LTE EUTRAN Band 35.
|
||||
* @QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_36: LTE EUTRAN Band 36.
|
||||
* @QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_37: LTE EUTRAN Band 37.
|
||||
* @QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_38: LTE EUTRAN Band 38.
|
||||
* @QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_39: LTE EUTRAN Band 39.
|
||||
* @QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_40: LTE EUTRAN Band 40.
|
||||
* @QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_41: LTE EUTRAN Band 41.
|
||||
* @QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_42: LTE EUTRAN Band 42.
|
||||
* @QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_43: LTE EUTRAN Band 43.
|
||||
*
|
||||
* LTE-specific Frequency bands.
|
||||
*
|
||||
* Since: 1.0
|
||||
*/
|
||||
typedef enum { /*< since=1.0 >*/
|
||||
QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_1 = 1 << 0,
|
||||
QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_2 = 1 << 1,
|
||||
QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_3 = 1 << 2,
|
||||
QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_4 = 1 << 3,
|
||||
QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_5 = 1 << 4,
|
||||
QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_6 = 1 << 5,
|
||||
QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_7 = 1 << 6,
|
||||
QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_8 = 1 << 7,
|
||||
QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_9 = 1 << 8,
|
||||
QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_10 = 1 << 9,
|
||||
QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_11 = 1 << 10,
|
||||
QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_12 = 1 << 11,
|
||||
QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_13 = 1 << 12,
|
||||
QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_14 = 1 << 13,
|
||||
/* Bit 14-15 reserved */
|
||||
QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_17 = 1 << 16,
|
||||
QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_18 = 1 << 17,
|
||||
QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_19 = 1 << 18,
|
||||
QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_20 = 1 << 19,
|
||||
QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_21 = 1 << 20,
|
||||
/* Bit 21-22 reserved */
|
||||
QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_24 = 1 << 23,
|
||||
QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_25 = 1 << 24,
|
||||
QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_26 = 1 << 25,
|
||||
QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_27 = 1 << 26,
|
||||
QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_28 = 1 << 27,
|
||||
QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_29 = 1 << 28,
|
||||
QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_30 = 1 << 29,
|
||||
QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_31 = 1 << 30,
|
||||
QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_32 = ((uint64_t) 1) << 31,
|
||||
QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_33 = ((uint64_t) 1) << 32,
|
||||
QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_34 = ((uint64_t) 1) << 33,
|
||||
QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_35 = ((uint64_t) 1) << 34,
|
||||
QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_36 = ((uint64_t) 1) << 35,
|
||||
QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_37 = ((uint64_t) 1) << 36,
|
||||
QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_38 = ((uint64_t) 1) << 37,
|
||||
QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_39 = ((uint64_t) 1) << 38,
|
||||
QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_40 = ((uint64_t) 1) << 39,
|
||||
QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_41 = ((uint64_t) 1) << 40,
|
||||
QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_42 = ((uint64_t) 1) << 41,
|
||||
QMI_DMS_LTE_BAND_CAPABILITY_EUTRAN_43 = ((uint64_t) 1) << 42
|
||||
/* Bit 43-64 reserved */
|
||||
} QmiDmsLteBandCapability;
|
||||
|
||||
#endif /* _LIBQMI_GLIB_QMI_FLAGS64_DMS_H_ */
|
@ -0,0 +1,216 @@
|
||||
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/*
|
||||
* libqmi-glib -- GLib/GIO based library to control QMI devices
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Copyright (C) 2012 Google Inc.
|
||||
* Copyright (C) 2012-2017 Aleksander Morgado <aleksander@aleksander.es>
|
||||
*/
|
||||
|
||||
#ifndef _LIBQMI_GLIB_QMI_FLAGS64_NAS_H_
|
||||
#define _LIBQMI_GLIB_QMI_FLAGS64_NAS_H_
|
||||
|
||||
/*****************************************************************************/
|
||||
/* Helper enums for the 'QMI NAS Get System Selection Preference'
|
||||
* request/response */
|
||||
|
||||
/**
|
||||
* QmiNasBandPreference:
|
||||
* @QMI_NAS_BAND_PREFERENCE_BC_0_A_SYSTEM: Band class 0, A system.
|
||||
* @QMI_NAS_BAND_PREFERENCE_BC_0_B_SYSTEM: Band class 0, B system.
|
||||
* @QMI_NAS_BAND_PREFERENCE_BC_1_ALL_BLOCKS: Band class 1.
|
||||
* @QMI_NAS_BAND_PREFERENCE_BC_2: Band class 2.
|
||||
* @QMI_NAS_BAND_PREFERENCE_BC_3_A_SYSTEM: Band class 3, A system.
|
||||
* @QMI_NAS_BAND_PREFERENCE_BC_4_ALL_BLOCKS: Band class 4, all blocks.
|
||||
* @QMI_NAS_BAND_PREFERENCE_BC_5_ALL_BLOCKS: Band class 5, all blocks.
|
||||
* @QMI_NAS_BAND_PREFERENCE_BC_6: Band class 6.
|
||||
* @QMI_NAS_BAND_PREFERENCE_BC_7: Band class 7.
|
||||
* @QMI_NAS_BAND_PREFERENCE_BC_8: Band class 8.
|
||||
* @QMI_NAS_BAND_PREFERENCE_BC_9: Band class 9.
|
||||
* @QMI_NAS_BAND_PREFERENCE_BC_10: Band class 10.
|
||||
* @QMI_NAS_BAND_PREFERENCE_BC_11: Band class 11.
|
||||
* @QMI_NAS_BAND_PREFERENCE_BC_12: Band class 12.
|
||||
* @QMI_NAS_BAND_PREFERENCE_BC_14: Band class 14.
|
||||
* @QMI_NAS_BAND_PREFERENCE_BC_15: Band class 15.
|
||||
* @QMI_NAS_BAND_PREFERENCE_BC_16: Band class 16.
|
||||
* @QMI_NAS_BAND_PREFERENCE_BC_17: Band class 17.
|
||||
* @QMI_NAS_BAND_PREFERENCE_BC_18: Band class 18.
|
||||
* @QMI_NAS_BAND_PREFERENCE_BC_19: Band class 19.
|
||||
* @QMI_NAS_BAND_PREFERENCE_GSM_DCS_1800: GSM DCS 1800 band.
|
||||
* @QMI_NAS_BAND_PREFERENCE_GSM_900_EXTENDED: Extended GSM 900 band.
|
||||
* @QMI_NAS_BAND_PREFERENCE_GSM_900_PRIMARY: Primary GSM 900 band.
|
||||
* @QMI_NAS_BAND_PREFERENCE_GSM_450: GSM 450.
|
||||
* @QMI_NAS_BAND_PREFERENCE_GSM_480: GSM 480.
|
||||
* @QMI_NAS_BAND_PREFERENCE_GSM_750: GSM 750.
|
||||
* @QMI_NAS_BAND_PREFERENCE_GSM_850: GSM 850.
|
||||
* @QMI_NAS_BAND_PREFERENCE_GSM_900_RAILWAYS: GSM 900 (Railways).
|
||||
* @QMI_NAS_BAND_PREFERENCE_GSM_PCS_1900: GSM 1900.
|
||||
* @QMI_NAS_BAND_PREFERENCE_WCDMA_2100: WCDMA 2100.
|
||||
* @QMI_NAS_BAND_PREFERENCE_WCDMA_PCS_1900: WCDMA PCS 1900.
|
||||
* @QMI_NAS_BAND_PREFERENCE_WCDMA_DCS_1800: WCDMA DCS 1800.
|
||||
* @QMI_NAS_BAND_PREFERENCE_WCDMA_1700_US: WCDMA 1700 (U.S.).
|
||||
* @QMI_NAS_BAND_PREFERENCE_WCDMA_850_US: WCDMA 850.
|
||||
* @QMI_NAS_BAND_PREFERENCE_WCDMA_800: WCDMA 800.
|
||||
* @QMI_NAS_BAND_PREFERENCE_WCDMA_2600: WCDMA 2600.
|
||||
* @QMI_NAS_BAND_PREFERENCE_WCDMA_900: WCDMA 900.
|
||||
* @QMI_NAS_BAND_PREFERENCE_WCDMA_1700_JAPAN: WCDMA 1700 (Japan).
|
||||
* @QMI_NAS_BAND_PREFERENCE_WCDMA_850_JAPAN: WCDMA 850 (Japan). Since: 1.22.
|
||||
* @QMI_NAS_BAND_PREFERENCE_WCDMA_1500: WCDMA 1500. Since: 1.22.
|
||||
*
|
||||
* Flags to specify frequency band preferences.
|
||||
*
|
||||
* Since: 1.0
|
||||
*/
|
||||
typedef enum { /*< since=1.0 >*/
|
||||
QMI_NAS_BAND_PREFERENCE_BC_0_A_SYSTEM = 1 << 0,
|
||||
QMI_NAS_BAND_PREFERENCE_BC_0_B_SYSTEM = 1 << 1,
|
||||
QMI_NAS_BAND_PREFERENCE_BC_1_ALL_BLOCKS = 1 << 2,
|
||||
QMI_NAS_BAND_PREFERENCE_BC_2 = 1 << 3,
|
||||
QMI_NAS_BAND_PREFERENCE_BC_3_A_SYSTEM = 1 << 4,
|
||||
QMI_NAS_BAND_PREFERENCE_BC_4_ALL_BLOCKS = 1 << 5,
|
||||
QMI_NAS_BAND_PREFERENCE_BC_5_ALL_BLOCKS = 1 << 6,
|
||||
QMI_NAS_BAND_PREFERENCE_GSM_DCS_1800 = 1 << 7,
|
||||
QMI_NAS_BAND_PREFERENCE_GSM_900_EXTENDED = 1 << 8,
|
||||
QMI_NAS_BAND_PREFERENCE_GSM_900_PRIMARY = 1 << 9,
|
||||
QMI_NAS_BAND_PREFERENCE_BC_6 = 1 << 10,
|
||||
QMI_NAS_BAND_PREFERENCE_BC_7 = 1 << 11,
|
||||
QMI_NAS_BAND_PREFERENCE_BC_8 = 1 << 12,
|
||||
QMI_NAS_BAND_PREFERENCE_BC_9 = 1 << 13,
|
||||
QMI_NAS_BAND_PREFERENCE_BC_10 = 1 << 14,
|
||||
QMI_NAS_BAND_PREFERENCE_BC_11 = 1 << 15,
|
||||
QMI_NAS_BAND_PREFERENCE_GSM_450 = 1 << 16,
|
||||
QMI_NAS_BAND_PREFERENCE_GSM_480 = 1 << 17,
|
||||
QMI_NAS_BAND_PREFERENCE_GSM_750 = 1 << 18,
|
||||
QMI_NAS_BAND_PREFERENCE_GSM_850 = 1 << 19,
|
||||
QMI_NAS_BAND_PREFERENCE_GSM_900_RAILWAYS = 1 << 20,
|
||||
QMI_NAS_BAND_PREFERENCE_GSM_PCS_1900 = 1 << 21,
|
||||
QMI_NAS_BAND_PREFERENCE_WCDMA_2100 = 1 << 22,
|
||||
QMI_NAS_BAND_PREFERENCE_WCDMA_PCS_1900 = 1 << 23,
|
||||
QMI_NAS_BAND_PREFERENCE_WCDMA_DCS_1800 = 1 << 24,
|
||||
QMI_NAS_BAND_PREFERENCE_WCDMA_1700_US = 1 << 25,
|
||||
QMI_NAS_BAND_PREFERENCE_WCDMA_850_US = 1 << 26,
|
||||
QMI_NAS_BAND_PREFERENCE_WCDMA_800 = 1 << 27,
|
||||
QMI_NAS_BAND_PREFERENCE_BC_12 = 1 << 28,
|
||||
QMI_NAS_BAND_PREFERENCE_BC_14 = 1 << 29,
|
||||
/* Bit 30 reserved */
|
||||
QMI_NAS_BAND_PREFERENCE_BC_15 = ((uint64_t) 1) << 31,
|
||||
/* Bits 32-47 reserved */
|
||||
QMI_NAS_BAND_PREFERENCE_WCDMA_2600 = ((uint64_t) 1) << 48,
|
||||
QMI_NAS_BAND_PREFERENCE_WCDMA_900 = ((uint64_t) 1) << 49,
|
||||
QMI_NAS_BAND_PREFERENCE_WCDMA_1700_JAPAN = ((uint64_t) 1) << 50,
|
||||
/* Bits 51-55 reserved */
|
||||
QMI_NAS_BAND_PREFERENCE_BC_16 = ((uint64_t) 1) << 56,
|
||||
QMI_NAS_BAND_PREFERENCE_BC_17 = ((uint64_t) 1) << 57,
|
||||
QMI_NAS_BAND_PREFERENCE_BC_18 = ((uint64_t) 1) << 58,
|
||||
QMI_NAS_BAND_PREFERENCE_BC_19 = ((uint64_t) 1) << 59,
|
||||
QMI_NAS_BAND_PREFERENCE_WCDMA_850_JAPAN = ((uint64_t) 1) << 60,
|
||||
QMI_NAS_BAND_PREFERENCE_WCDMA_1500 = ((uint64_t) 1) << 61
|
||||
/* Bits 62-63 reserved */
|
||||
} QmiNasBandPreference;
|
||||
|
||||
/**
|
||||
* QmiNasLteBandPreference:
|
||||
* @QMI_NAS_LTE_BAND_PREFERENCE_EUTRAN_1: LTE EUTRAN Band 1
|
||||
* @QMI_NAS_LTE_BAND_PREFERENCE_EUTRAN_2: LTE EUTRAN Band 2.
|
||||
* @QMI_NAS_LTE_BAND_PREFERENCE_EUTRAN_3: LTE EUTRAN Band 3.
|
||||
* @QMI_NAS_LTE_BAND_PREFERENCE_EUTRAN_4: LTE EUTRAN Band 4.
|
||||
* @QMI_NAS_LTE_BAND_PREFERENCE_EUTRAN_5: LTE EUTRAN Band 5.
|
||||
* @QMI_NAS_LTE_BAND_PREFERENCE_EUTRAN_6: LTE EUTRAN Band 6.
|
||||
* @QMI_NAS_LTE_BAND_PREFERENCE_EUTRAN_7: LTE EUTRAN Band 7.
|
||||
* @QMI_NAS_LTE_BAND_PREFERENCE_EUTRAN_8: LTE EUTRAN Band 8.
|
||||
* @QMI_NAS_LTE_BAND_PREFERENCE_EUTRAN_9: LTE EUTRAN Band 9.
|
||||
* @QMI_NAS_LTE_BAND_PREFERENCE_EUTRAN_10: LTE EUTRAN Band 10.
|
||||
* @QMI_NAS_LTE_BAND_PREFERENCE_EUTRAN_11: LTE EUTRAN Band 11.
|
||||
* @QMI_NAS_LTE_BAND_PREFERENCE_EUTRAN_12: LTE EUTRAN Band 12.
|
||||
* @QMI_NAS_LTE_BAND_PREFERENCE_EUTRAN_13: LTE EUTRAN Band 13.
|
||||
* @QMI_NAS_LTE_BAND_PREFERENCE_EUTRAN_14: LTE EUTRAN Band 14.
|
||||
* @QMI_NAS_LTE_BAND_PREFERENCE_EUTRAN_17: LTE EUTRAN Band 17.
|
||||
* @QMI_NAS_LTE_BAND_PREFERENCE_EUTRAN_18: LTE EUTRAN Band 18.
|
||||
* @QMI_NAS_LTE_BAND_PREFERENCE_EUTRAN_19: LTE EUTRAN Band 19.
|
||||
* @QMI_NAS_LTE_BAND_PREFERENCE_EUTRAN_20: LTE EUTRAN Band 20.
|
||||
* @QMI_NAS_LTE_BAND_PREFERENCE_EUTRAN_21: LTE EUTRAN Band 21.
|
||||
* @QMI_NAS_LTE_BAND_PREFERENCE_EUTRAN_24: LTE EUTRAN Band 24.
|
||||
* @QMI_NAS_LTE_BAND_PREFERENCE_EUTRAN_25: LTE EUTRAN Band 25.
|
||||
* @QMI_NAS_LTE_BAND_PREFERENCE_EUTRAN_26: LTE EUTRAN Band 26.
|
||||
* @QMI_NAS_LTE_BAND_PREFERENCE_EUTRAN_27: LTE EUTRAN Band 27.
|
||||
* @QMI_NAS_LTE_BAND_PREFERENCE_EUTRAN_28: LTE EUTRAN Band 28.
|
||||
* @QMI_NAS_LTE_BAND_PREFERENCE_EUTRAN_29: LTE EUTRAN Band 29.
|
||||
* @QMI_NAS_LTE_BAND_PREFERENCE_EUTRAN_30: LTE EUTRAN Band 30.
|
||||
* @QMI_NAS_LTE_BAND_PREFERENCE_EUTRAN_31: LTE EUTRAN Band 31.
|
||||
* @QMI_NAS_LTE_BAND_PREFERENCE_EUTRAN_32: LTE EUTRAN Band 32.
|
||||
* @QMI_NAS_LTE_BAND_PREFERENCE_EUTRAN_33: LTE EUTRAN Band 33.
|
||||
* @QMI_NAS_LTE_BAND_PREFERENCE_EUTRAN_34: LTE EUTRAN Band 34.
|
||||
* @QMI_NAS_LTE_BAND_PREFERENCE_EUTRAN_35: LTE EUTRAN Band 35.
|
||||
* @QMI_NAS_LTE_BAND_PREFERENCE_EUTRAN_36: LTE EUTRAN Band 36.
|
||||
* @QMI_NAS_LTE_BAND_PREFERENCE_EUTRAN_37: LTE EUTRAN Band 37.
|
||||
* @QMI_NAS_LTE_BAND_PREFERENCE_EUTRAN_38: LTE EUTRAN Band 38.
|
||||
* @QMI_NAS_LTE_BAND_PREFERENCE_EUTRAN_39: LTE EUTRAN Band 39.
|
||||
* @QMI_NAS_LTE_BAND_PREFERENCE_EUTRAN_40: LTE EUTRAN Band 40.
|
||||
* @QMI_NAS_LTE_BAND_PREFERENCE_EUTRAN_41: LTE EUTRAN Band 41.
|
||||
* @QMI_NAS_LTE_BAND_PREFERENCE_EUTRAN_42: LTE EUTRAN Band 42.
|
||||
* @QMI_NAS_LTE_BAND_PREFERENCE_EUTRAN_43: LTE EUTRAN Band 43.
|
||||
*
|
||||
* Flags to specify LTE-specific frequency band preferences.
|
||||
*
|
||||
* Since: 1.0
|
||||
*/
|
||||
typedef enum { /*< since=1.0 >*/
|
||||
QMI_NAS_LTE_BAND_PREFERENCE_EUTRAN_1 = 1 << 0,
|
||||
QMI_NAS_LTE_BAND_PREFERENCE_EUTRAN_2 = 1 << 1,
|
||||
QMI_NAS_LTE_BAND_PREFERENCE_EUTRAN_3 = 1 << 2,
|
||||
QMI_NAS_LTE_BAND_PREFERENCE_EUTRAN_4 = 1 << 3,
|
||||
QMI_NAS_LTE_BAND_PREFERENCE_EUTRAN_5 = 1 << 4,
|
||||
QMI_NAS_LTE_BAND_PREFERENCE_EUTRAN_6 = 1 << 5,
|
||||
QMI_NAS_LTE_BAND_PREFERENCE_EUTRAN_7 = 1 << 6,
|
||||
QMI_NAS_LTE_BAND_PREFERENCE_EUTRAN_8 = 1 << 7,
|
||||
QMI_NAS_LTE_BAND_PREFERENCE_EUTRAN_9 = 1 << 8,
|
||||
QMI_NAS_LTE_BAND_PREFERENCE_EUTRAN_10 = 1 << 9,
|
||||
QMI_NAS_LTE_BAND_PREFERENCE_EUTRAN_11 = 1 << 10,
|
||||
QMI_NAS_LTE_BAND_PREFERENCE_EUTRAN_12 = 1 << 11,
|
||||
QMI_NAS_LTE_BAND_PREFERENCE_EUTRAN_13 = 1 << 12,
|
||||
QMI_NAS_LTE_BAND_PREFERENCE_EUTRAN_14 = 1 << 13,
|
||||
/* Bit 14-15 reserved */
|
||||
QMI_NAS_LTE_BAND_PREFERENCE_EUTRAN_17 = 1 << 16,
|
||||
QMI_NAS_LTE_BAND_PREFERENCE_EUTRAN_18 = 1 << 17,
|
||||
QMI_NAS_LTE_BAND_PREFERENCE_EUTRAN_19 = 1 << 18,
|
||||
QMI_NAS_LTE_BAND_PREFERENCE_EUTRAN_20 = 1 << 19,
|
||||
QMI_NAS_LTE_BAND_PREFERENCE_EUTRAN_21 = 1 << 20,
|
||||
/* Bit 21-22 reserved */
|
||||
QMI_NAS_LTE_BAND_PREFERENCE_EUTRAN_24 = 1 << 23,
|
||||
QMI_NAS_LTE_BAND_PREFERENCE_EUTRAN_25 = 1 << 24,
|
||||
QMI_NAS_LTE_BAND_PREFERENCE_EUTRAN_26 = 1 << 25,
|
||||
QMI_NAS_LTE_BAND_PREFERENCE_EUTRAN_27 = 1 << 26,
|
||||
QMI_NAS_LTE_BAND_PREFERENCE_EUTRAN_28 = 1 << 27,
|
||||
QMI_NAS_LTE_BAND_PREFERENCE_EUTRAN_29 = 1 << 28,
|
||||
QMI_NAS_LTE_BAND_PREFERENCE_EUTRAN_30 = 1 << 29,
|
||||
QMI_NAS_LTE_BAND_PREFERENCE_EUTRAN_31 = 1 << 30,
|
||||
QMI_NAS_LTE_BAND_PREFERENCE_EUTRAN_32 = ((uint64_t) 1) << 31,
|
||||
QMI_NAS_LTE_BAND_PREFERENCE_EUTRAN_33 = ((uint64_t) 1) << 32,
|
||||
QMI_NAS_LTE_BAND_PREFERENCE_EUTRAN_34 = ((uint64_t) 1) << 33,
|
||||
QMI_NAS_LTE_BAND_PREFERENCE_EUTRAN_35 = ((uint64_t) 1) << 34,
|
||||
QMI_NAS_LTE_BAND_PREFERENCE_EUTRAN_36 = ((uint64_t) 1) << 35,
|
||||
QMI_NAS_LTE_BAND_PREFERENCE_EUTRAN_37 = ((uint64_t) 1) << 36,
|
||||
QMI_NAS_LTE_BAND_PREFERENCE_EUTRAN_38 = ((uint64_t) 1) << 37,
|
||||
QMI_NAS_LTE_BAND_PREFERENCE_EUTRAN_39 = ((uint64_t) 1) << 38,
|
||||
QMI_NAS_LTE_BAND_PREFERENCE_EUTRAN_40 = ((uint64_t) 1) << 39,
|
||||
QMI_NAS_LTE_BAND_PREFERENCE_EUTRAN_41 = ((uint64_t) 1) << 40,
|
||||
QMI_NAS_LTE_BAND_PREFERENCE_EUTRAN_42 = ((uint64_t) 1) << 41,
|
||||
QMI_NAS_LTE_BAND_PREFERENCE_EUTRAN_43 = ((uint64_t) 1) << 42
|
||||
/* Bit 43-64 reserved */
|
||||
} QmiNasLteBandPreference;
|
||||
|
||||
#endif /* _LIBQMI_GLIB_QMI_FLAGS64_NAS_H_ */
|
@ -0,0 +1,176 @@
|
||||
/*
|
||||
* uqmi -- tiny QMI support implementation
|
||||
*
|
||||
* Copyright (C) 2014-2015 Felix Fietkau <nbd@openwrt.org>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "qmi-message.h"
|
||||
|
||||
static uint8_t buf[QMI_BUFFER_LEN];
|
||||
static unsigned int buf_ofs;
|
||||
|
||||
uint8_t *__qmi_get_buf(unsigned int *ofs)
|
||||
{
|
||||
*ofs = buf_ofs;
|
||||
return buf;
|
||||
}
|
||||
|
||||
void __qmi_alloc_reset(void)
|
||||
{
|
||||
buf_ofs = 0;
|
||||
}
|
||||
|
||||
void *__qmi_alloc_static(unsigned int len)
|
||||
{
|
||||
void *ret;
|
||||
|
||||
if (buf_ofs + len > sizeof(buf)) {
|
||||
fprintf(stderr, "ERROR: static buffer for message data too small\n");
|
||||
abort();
|
||||
}
|
||||
|
||||
ret = &buf[buf_ofs];
|
||||
buf_ofs += len;
|
||||
memset(ret, 0, len);
|
||||
return ret;
|
||||
}
|
||||
|
||||
char *__qmi_copy_string(void *data, unsigned int len)
|
||||
{
|
||||
char *res;
|
||||
|
||||
res = (char *) &buf[buf_ofs];
|
||||
buf_ofs += len + 1;
|
||||
memcpy(res, data, len);
|
||||
res[len] = 0;
|
||||
return res;
|
||||
}
|
||||
|
||||
struct tlv *tlv_get_next(void **buf, unsigned int *buflen)
|
||||
{
|
||||
struct tlv *tlv = NULL;
|
||||
unsigned int tlv_len;
|
||||
|
||||
if (*buflen < sizeof(*tlv))
|
||||
return NULL;
|
||||
|
||||
tlv = *buf;
|
||||
tlv_len = le16_to_cpu(tlv->len) + sizeof(*tlv);
|
||||
if (tlv_len > *buflen)
|
||||
return NULL;
|
||||
|
||||
*buflen -= tlv_len;
|
||||
*buf += tlv_len;
|
||||
return tlv;
|
||||
}
|
||||
|
||||
static struct tlv *qmi_msg_next_tlv(struct qmi_msg *qm, int add)
|
||||
{
|
||||
int tlv_len;
|
||||
void *tlv;
|
||||
|
||||
if (qm->qmux.service == QMI_SERVICE_CTL) {
|
||||
tlv = qm->ctl.tlv;
|
||||
tlv_len = le16_to_cpu(qm->ctl.tlv_len);
|
||||
qm->ctl.tlv_len = cpu_to_le16(tlv_len + add);
|
||||
} else {
|
||||
tlv = qm->svc.tlv;
|
||||
tlv_len = le16_to_cpu(qm->svc.tlv_len);
|
||||
qm->svc.tlv_len = cpu_to_le16(tlv_len + add);
|
||||
}
|
||||
|
||||
tlv += tlv_len;
|
||||
|
||||
return tlv;
|
||||
}
|
||||
|
||||
void tlv_new(struct qmi_msg *qm, uint8_t type, uint16_t len, void *data)
|
||||
{
|
||||
struct tlv *tlv;
|
||||
|
||||
tlv = qmi_msg_next_tlv(qm, sizeof(*tlv) + len);
|
||||
tlv->type = type;
|
||||
tlv->len = cpu_to_le16(len);
|
||||
memcpy(tlv->data, data, len);
|
||||
}
|
||||
|
||||
void qmi_init_request_message(struct qmi_msg *qm, QmiService service)
|
||||
{
|
||||
memset(qm, 0, sizeof(*qm));
|
||||
qm->marker = 1;
|
||||
qm->qmux.service = service;
|
||||
}
|
||||
|
||||
int qmi_complete_request_message(struct qmi_msg *qm)
|
||||
{
|
||||
void *tlv_end = qmi_msg_next_tlv(qm, 0);
|
||||
void *msg_start = &qm->qmux;
|
||||
|
||||
qm->qmux.len = cpu_to_le16(tlv_end - msg_start);
|
||||
return tlv_end - msg_start + 1;
|
||||
}
|
||||
|
||||
int qmi_check_message_status(void *tlv_buf, unsigned int len)
|
||||
{
|
||||
struct tlv *tlv;
|
||||
struct {
|
||||
uint16_t status;
|
||||
uint16_t code;
|
||||
} __packed *status;
|
||||
|
||||
while ((tlv = tlv_get_next(&tlv_buf, &len)) != NULL) {
|
||||
if (tlv->type != 2)
|
||||
continue;
|
||||
|
||||
if (tlv_data_len(tlv) != sizeof(*status))
|
||||
return QMI_ERROR_INVALID_DATA;
|
||||
|
||||
status = (void *) tlv->data;
|
||||
if (!status->status)
|
||||
return 0;
|
||||
|
||||
return le16_to_cpu(status->code);
|
||||
}
|
||||
|
||||
return QMI_ERROR_NO_DATA;
|
||||
}
|
||||
|
||||
void *qmi_msg_get_tlv_buf(struct qmi_msg *qm, int *tlv_len)
|
||||
{
|
||||
void *ptr;
|
||||
int len;
|
||||
|
||||
if (qm->qmux.service == QMI_SERVICE_CTL) {
|
||||
ptr = qm->ctl.tlv;
|
||||
len = qm->ctl.tlv_len;
|
||||
} else {
|
||||
ptr = qm->svc.tlv;
|
||||
len = qm->svc.tlv_len;
|
||||
}
|
||||
|
||||
if (tlv_len)
|
||||
*tlv_len = len;
|
||||
|
||||
return ptr;
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,126 @@
|
||||
/*
|
||||
* uqmi -- tiny QMI support implementation
|
||||
*
|
||||
* Copyright (C) 2014-2015 Felix Fietkau <nbd@openwrt.org>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
#ifndef __UQMI_MESSAGE_H
|
||||
#define __UQMI_MESSAGE_H
|
||||
|
||||
#include <libubox/utils.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#include "qmi-struct.h"
|
||||
#include "qmi-enums.h"
|
||||
|
||||
#include "qmi-enums-private.h"
|
||||
#include "qmi-message-ctl.h"
|
||||
|
||||
#include "qmi-enums-dms.h"
|
||||
#include "qmi-flags64-dms.h"
|
||||
#include "qmi-message-dms.h"
|
||||
|
||||
#include "qmi-enums-nas.h"
|
||||
#include "qmi-flags64-nas.h"
|
||||
#include "qmi-message-nas.h"
|
||||
|
||||
#include "qmi-enums-pds.h"
|
||||
#include "qmi-message-pds.h"
|
||||
|
||||
#include "qmi-enums-wds.h"
|
||||
#include "qmi-message-wds.h"
|
||||
|
||||
#include "qmi-enums-wms.h"
|
||||
#include "qmi-message-wms.h"
|
||||
|
||||
#include "qmi-enums-wda.h"
|
||||
#include "qmi-message-wda.h"
|
||||
|
||||
#include "qmi-enums-uim.h"
|
||||
#include "qmi-message-uim.h"
|
||||
|
||||
#define qmi_set(_data, _field, _val) \
|
||||
do { \
|
||||
(_data)->set._field = 1; \
|
||||
(_data)->data._field = _val; \
|
||||
} while (0)
|
||||
|
||||
#define qmi_set_ptr(_data, _field, _val) \
|
||||
do { \
|
||||
(_data)->data._field = _val; \
|
||||
} while (0)
|
||||
|
||||
#define qmi_set_static_array(_data, _field, _val) \
|
||||
do { \
|
||||
(_data)->data._field##_n = ARRAY_SIZE(_val); \
|
||||
(_data)->data._field = _val; \
|
||||
} while (0);
|
||||
|
||||
#define qmi_set_array(_data, _field, _val, _n) \
|
||||
do { \
|
||||
(_data)->data.n_##_field = _n; \
|
||||
(_data)->data._field = _val; \
|
||||
} while (0);
|
||||
|
||||
#define QMI_INIT(_field, _val) \
|
||||
.set._field = 1, \
|
||||
.data._field = (_val)
|
||||
|
||||
#define QMI_INIT_SEQUENCE(_field, ...) \
|
||||
.set._field = 1, \
|
||||
.data._field = { __VA_ARGS__ }
|
||||
|
||||
#define QMI_INIT_PTR(_field, _val) \
|
||||
.data._field = (_val)
|
||||
|
||||
#define QMI_INIT_STATIC_ARRAY(_field, _val) \
|
||||
.data._field##_n = ARRAY_SIZE(_val), \
|
||||
.data._field = (_val)
|
||||
|
||||
#define QMI_INIT_ARRAY(_field, _val, _n) \
|
||||
.data._field##_n = (_n), \
|
||||
.data._field = (_val)
|
||||
|
||||
|
||||
enum {
|
||||
QMI_ERROR_NO_DATA = -1,
|
||||
QMI_ERROR_INVALID_DATA = -2,
|
||||
QMI_ERROR_CANCELLED = -3,
|
||||
};
|
||||
|
||||
#define QMI_BUFFER_LEN 2048
|
||||
|
||||
void __qmi_alloc_reset(void);
|
||||
void *__qmi_alloc_static(unsigned int len);
|
||||
char *__qmi_copy_string(void *data, unsigned int len);
|
||||
uint8_t *__qmi_get_buf(unsigned int *ofs);
|
||||
|
||||
static inline int tlv_data_len(struct tlv *tlv)
|
||||
{
|
||||
return le16_to_cpu(tlv->len);
|
||||
}
|
||||
|
||||
struct tlv *tlv_get_next(void **buf, unsigned int *buflen);
|
||||
void tlv_new(struct qmi_msg *qm, uint8_t type, uint16_t len, void *data);
|
||||
|
||||
void qmi_init_request_message(struct qmi_msg *qm, QmiService service);
|
||||
int qmi_complete_request_message(struct qmi_msg *qm);
|
||||
int qmi_check_message_status(void *buf, unsigned int len);
|
||||
void *qmi_msg_get_tlv_buf(struct qmi_msg *qm, int *len);
|
||||
|
||||
#endif
|
@ -0,0 +1,62 @@
|
||||
/*
|
||||
* uqmi -- tiny QMI support implementation
|
||||
*
|
||||
* Copyright (C) 2014-2015 Felix Fietkau <nbd@openwrt.org>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
#ifndef __QMI_STRUCT_H
|
||||
#define __QMI_STRUCT_H
|
||||
|
||||
struct qmux {
|
||||
uint16_t len;
|
||||
uint8_t flags;
|
||||
uint8_t service;
|
||||
uint8_t client;
|
||||
} __packed;
|
||||
|
||||
struct tlv {
|
||||
uint8_t type;
|
||||
uint16_t len;
|
||||
uint8_t data[];
|
||||
} __packed;
|
||||
|
||||
struct qmi_ctl {
|
||||
uint8_t transaction;
|
||||
uint16_t message;
|
||||
uint16_t tlv_len;
|
||||
struct tlv tlv[];
|
||||
} __packed;
|
||||
|
||||
struct qmi_svc {
|
||||
uint16_t transaction;
|
||||
uint16_t message;
|
||||
uint16_t tlv_len;
|
||||
struct tlv tlv[];
|
||||
} __packed;
|
||||
|
||||
struct qmi_msg {
|
||||
uint8_t marker;
|
||||
struct qmux qmux;
|
||||
uint8_t flags;
|
||||
union {
|
||||
struct qmi_ctl ctl;
|
||||
struct qmi_svc svc;
|
||||
};
|
||||
} __packed;
|
||||
|
||||
#endif
|
@ -0,0 +1,127 @@
|
||||
/*
|
||||
* uqmi -- tiny QMI support implementation
|
||||
*
|
||||
* Copyright (C) 2014-2015 Felix Fietkau <nbd@openwrt.org>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
#ifndef __UQMI_H
|
||||
#define __UQMI_H
|
||||
|
||||
#include <stdbool.h>
|
||||
|
||||
#include <libubox/uloop.h>
|
||||
#include <libubox/ustream.h>
|
||||
|
||||
#include "qmi-message.h"
|
||||
|
||||
#ifdef DEBUG_PACKET
|
||||
void dump_packet(const char *prefix, void *ptr, int len);
|
||||
#else
|
||||
static inline void dump_packet(const char *prefix, void *ptr, int len)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
#define __qmi_services \
|
||||
__qmi_service(QMI_SERVICE_WDS), \
|
||||
__qmi_service(QMI_SERVICE_DMS), \
|
||||
__qmi_service(QMI_SERVICE_NAS), \
|
||||
__qmi_service(QMI_SERVICE_QOS), \
|
||||
__qmi_service(QMI_SERVICE_WMS), \
|
||||
__qmi_service(QMI_SERVICE_PDS), \
|
||||
__qmi_service(QMI_SERVICE_AUTH), \
|
||||
__qmi_service(QMI_SERVICE_AT), \
|
||||
__qmi_service(QMI_SERVICE_VOICE), \
|
||||
__qmi_service(QMI_SERVICE_CAT2), \
|
||||
__qmi_service(QMI_SERVICE_UIM), \
|
||||
__qmi_service(QMI_SERVICE_PBM), \
|
||||
__qmi_service(QMI_SERVICE_LOC), \
|
||||
__qmi_service(QMI_SERVICE_SAR), \
|
||||
__qmi_service(QMI_SERVICE_RMTFS), \
|
||||
__qmi_service(QMI_SERVICE_CAT), \
|
||||
__qmi_service(QMI_SERVICE_RMS), \
|
||||
__qmi_service(QMI_SERVICE_OMA), \
|
||||
__qmi_service(QMI_SERVICE_WDA)
|
||||
|
||||
#define __qmi_service(_n) __##_n
|
||||
enum {
|
||||
__qmi_services,
|
||||
__QMI_SERVICE_LAST
|
||||
};
|
||||
#undef __qmi_service
|
||||
|
||||
struct qmi_dev;
|
||||
struct qmi_request;
|
||||
struct qmi_msg;
|
||||
|
||||
typedef void (*request_cb)(struct qmi_dev *qmi, struct qmi_request *req, struct qmi_msg *msg);
|
||||
|
||||
struct qmi_dev {
|
||||
struct ustream_fd sf;
|
||||
|
||||
struct list_head req;
|
||||
|
||||
struct {
|
||||
bool connected;
|
||||
uint8_t client_id;
|
||||
uint16_t tid;
|
||||
} service_data[__QMI_SERVICE_LAST];
|
||||
|
||||
uint32_t service_connected;
|
||||
uint32_t service_keep_cid;
|
||||
uint32_t service_release_cid;
|
||||
|
||||
uint8_t ctl_tid;
|
||||
void *buf;
|
||||
|
||||
bool is_mbim;
|
||||
};
|
||||
|
||||
struct qmi_request {
|
||||
struct list_head list;
|
||||
|
||||
request_cb cb;
|
||||
|
||||
bool *complete;
|
||||
bool pending;
|
||||
bool no_error_cb;
|
||||
uint8_t service;
|
||||
uint16_t tid;
|
||||
int ret;
|
||||
};
|
||||
|
||||
extern bool cancel_all_requests;
|
||||
int qmi_device_open(struct qmi_dev *qmi, const char *path);
|
||||
void qmi_device_close(struct qmi_dev *qmi);
|
||||
|
||||
int qmi_request_start(struct qmi_dev *qmi, struct qmi_request *req, request_cb cb);
|
||||
void qmi_request_cancel(struct qmi_dev *qmi, struct qmi_request *req);
|
||||
int qmi_request_wait(struct qmi_dev *qmi, struct qmi_request *req);
|
||||
|
||||
static inline bool qmi_request_pending(struct qmi_request *req)
|
||||
{
|
||||
return req->pending;
|
||||
}
|
||||
|
||||
int qmi_service_connect(struct qmi_dev *qmi, QmiService svc, int client_id);
|
||||
int qmi_service_get_client_id(struct qmi_dev *qmi, QmiService svc);
|
||||
int qmi_service_release_client_id(struct qmi_dev *qmi, QmiService svc);
|
||||
QmiService qmi_service_get_by_name(const char *str);
|
||||
const char *qmi_get_error_str(int code);
|
||||
|
||||
#endif
|
Loading…
Reference in New Issue