Split ISI codepoints to separate files

Also, adding infrastructure for debugging ISI messages, with APIs for
turning most common fields into human readable string format.
This commit is contained in:
Aki Niemi 2010-01-08 10:53:42 +02:00
parent 06afe598f5
commit c03cdaed9a
17 changed files with 1208 additions and 746 deletions

View File

@ -39,13 +39,12 @@
#include <ofono/modem.h>
#include <ofono/call-meter.h>
#include "isi.h"
#define PN_SS 0x06
#include "isimodem.h"
#include "isiutil.h"
#include "ss.h"
struct call_meter_data {
GIsiClient *client;
struct isi_version version;
};
static void isi_call_meter_query(struct ofono_call_meter *cm,

409
drivers/isimodem/call.h Normal file
View File

@ -0,0 +1,409 @@
/*
* This file is part of oFono - Open Source Telephony
*
* Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* version 2 as published by the Free Software Foundation.
*
* This program 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
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA
*
*/
#ifndef __ISIMODEM_CALL_H
#define __ISIMODEM_CALL_H
#ifdef __cplusplus
extern "C" {
#endif
#define PN_CALL 0x01
enum call_message_id {
CALL_CREATE_REQ = 0x01,
CALL_CREATE_RESP = 0x02,
CALL_COMING_IND = 0x03,
CALL_MO_ALERT_IND = 0x04,
CALL_MT_ALERT_IND = 0x05,
CALL_WAITING_IND = 0x06,
CALL_ANSWER_REQ = 0x07,
CALL_ANSWER_RESP = 0x08,
CALL_RELEASE_REQ = 0x09,
CALL_RELEASE_RESP = 0x0A,
CALL_RELEASE_IND = 0x0B,
CALL_TERMINATED_IND = 0x0C,
CALL_STATUS_REQ = 0x0D,
CALL_STATUS_RESP = 0x0E,
CALL_STATUS_IND = 0x0F,
CALL_SERVER_STATUS_IND = 0x10,
CALL_CONTROL_REQ = 0x11,
CALL_CONTROL_RESP = 0x12,
CALL_CONTROL_IND = 0x13,
CALL_MODE_SWITCH_REQ = 0x14,
CALL_MODE_SWITCH_RESP = 0x15,
CALL_MODE_SWITCH_IND = 0x16,
CALL_DTMF_SEND_REQ = 0x17,
CALL_DTMF_SEND_RESP = 0x18,
CALL_DTMF_STOP_REQ = 0x19,
CALL_DTMF_STOP_RESP = 0x1A,
CALL_DTMF_STATUS_IND = 0x1B,
CALL_DTMF_TONE_IND = 0x1C,
CALL_RECONNECT_IND = 0x1E,
CALL_PROPERTY_GET_REQ = 0x1F,
CALL_PROPERTY_GET_RESP = 0x20,
CALL_PROPERTY_SET_REQ = 0x21,
CALL_PROPERTY_SET_RESP = 0x22,
CALL_PROPERTY_SET_IND = 0x23,
CALL_EMERGENCY_NBR_CHECK_REQ = 0x28,
CALL_EMERGENCY_NBR_CHECK_RESP = 0x29,
CALL_EMERGENCY_NBR_GET_REQ = 0x26,
CALL_EMERGENCY_NBR_GET_RESP = 0x27,
CALL_EMERGENCY_NBR_MODIFY_REQ = 0x24,
CALL_EMERGENCY_NBR_MODIFY_RESP = 0x25,
CALL_GSM_NOTIFICATION_IND = 0xA0,
CALL_GSM_USER_TO_USER_REQ = 0xA1,
CALL_GSM_USER_TO_USER_RESP = 0xA2,
CALL_GSM_USER_TO_USER_IND = 0xA3,
CALL_GSM_BLACKLIST_CLEAR_REQ = 0xA4,
CALL_GSM_BLACKLIST_CLEAR_RESP = 0xA5,
CALL_GSM_BLACKLIST_TIMER_IND = 0xA6,
CALL_GSM_DATA_CH_INFO_IND = 0xA7,
CALL_GSM_CCP_GET_REQ = 0xAA,
CALL_GSM_CCP_GET_RESP = 0xAB,
CALL_GSM_CCP_CHECK_REQ = 0xAC,
CALL_GSM_CCP_CHECK_RESP = 0xAD,
CALL_GSM_COMING_REJ_IND = 0xA9,
CALL_GSM_RAB_IND = 0xA8,
CALL_GSM_IMMEDIATE_MODIFY_IND = 0xAE,
CALL_CREATE_NO_SIMATK_REQ = 0x2A,
CALL_GSM_SS_DATA_IND = 0xAF,
CALL_TIMER_REQ = 0x2B,
CALL_TIMER_RESP = 0x2C,
CALL_TIMER_NTF = 0x2D,
CALL_TIMER_IND = 0x2E,
CALL_TIMER_RESET_REQ = 0x2F,
CALL_TIMER_RESET_RESP = 0x30,
CALL_EMERGENCY_NBR_IND = 0x31,
CALL_SERVICE_DENIED_IND = 0x32,
CALL_RELEASE_END_REQ = 0x34,
CALL_RELEASE_END_RESP = 0x35,
CALL_USER_CONNECT_IND = 0x33,
CALL_AUDIO_CONNECT_IND = 0x40,
CALL_KODIAK_ALLOW_CTRL_REQ = 0x36,
CALL_KODIAK_ALLOW_CTRL_RESP = 0x37,
CALL_SERVICE_ACTIVATE_IND = 0x38,
CALL_SERVICE_ACTIVATE_REQ = 0x39,
CALL_SERVICE_ACTIVATE_RESP = 0x3A,
CALL_SIM_ATK_IND = 0x3B,
CALL_CONTROL_OPER_IND = 0x3C,
CALL_TEST_CALL_STATUS_IND = 0x3E,
CALL_SIM_ATK_INFO_IND = 0x3F,
CALL_SECURITY_IND = 0x41,
CALL_MEDIA_HANDLE_REQ = 0x42,
CALL_MEDIA_HANDLE_RESP = 0x43,
CALL_COMMON_MESSAGE = 0xF0
};
enum call_status {
CALL_STATUS_IDLE = 0x00,
CALL_STATUS_CREATE = 0x01,
CALL_STATUS_COMING = 0x02,
CALL_STATUS_PROCEEDING = 0x03,
CALL_STATUS_MO_ALERTING = 0x04,
CALL_STATUS_MT_ALERTING = 0x05,
CALL_STATUS_WAITING = 0x06,
CALL_STATUS_ANSWERED = 0x07,
CALL_STATUS_ACTIVE = 0x08,
CALL_STATUS_MO_RELEASE = 0x09,
CALL_STATUS_MT_RELEASE = 0x0A,
CALL_STATUS_HOLD_INITIATED = 0x0B,
CALL_STATUS_HOLD = 0x0C,
CALL_STATUS_RETRIEVE_INITIATED = 0x0D,
CALL_STATUS_RECONNECT_PENDING = 0x0E,
CALL_STATUS_TERMINATED = 0x0F,
CALL_STATUS_SWAP_INITIATED = 0x10,
};
enum call_isi_cause {
CALL_CAUSE_NO_CAUSE = 0x00,
CALL_CAUSE_NO_CALL = 0x01,
CALL_CAUSE_TIMEOUT = 0x02,
CALL_CAUSE_RELEASE_BY_USER = 0x03,
CALL_CAUSE_BUSY_USER_REQUEST = 0x04,
CALL_CAUSE_ERROR_REQUEST = 0x05,
CALL_CAUSE_COST_LIMIT_REACHED = 0x06,
CALL_CAUSE_CALL_ACTIVE = 0x07,
CALL_CAUSE_NO_CALL_ACTIVE = 0x08,
CALL_CAUSE_INVALID_CALL_MODE = 0x09,
CALL_CAUSE_SIGNALLING_FAILURE = 0x0A,
CALL_CAUSE_TOO_LONG_ADDRESS = 0x0B,
CALL_CAUSE_INVALID_ADDRESS = 0x0C,
CALL_CAUSE_EMERGENCY = 0x0D,
CALL_CAUSE_NO_TRAFFIC_CHANNEL = 0x0E,
CALL_CAUSE_NO_COVERAGE = 0x0F,
CALL_CAUSE_CODE_REQUIRED = 0x10,
CALL_CAUSE_NOT_ALLOWED = 0x11,
CALL_CAUSE_NO_DTMF = 0x12,
CALL_CAUSE_CHANNEL_LOSS = 0x13,
CALL_CAUSE_FDN_NOT_OK = 0x14,
CALL_CAUSE_USER_TERMINATED = 0x15,
CALL_CAUSE_BLACKLIST_BLOCKED = 0x16,
CALL_CAUSE_BLACKLIST_DELAYED = 0x17,
CALL_CAUSE_NUMBER_NOT_FOUND = 0x18,
CALL_CAUSE_NUMBER_CANNOT_REMOVE = 0x19,
CALL_CAUSE_EMERGENCY_FAILURE = 0x1A,
CALL_CAUSE_CS_SUSPENDED = 0x1B,
CALL_CAUSE_DCM_DRIVE_MODE = 0x1C,
CALL_CAUSE_MULTIMEDIA_NOT_ALLOWED = 0x1D,
CALL_CAUSE_SIM_REJECTED = 0x1E,
CALL_CAUSE_NO_SIM = 0x1F,
CALL_CAUSE_SIM_LOCK_OPERATIVE = 0x20,
CALL_CAUSE_SIMATKCC_REJECTED = 0x21,
CALL_CAUSE_SIMATKCC_MODIFIED = 0x22,
CALL_CAUSE_DTMF_INVALID_DIGIT = 0x23,
CALL_CAUSE_DTMF_SEND_ONGOING = 0x24,
CALL_CAUSE_CS_INACTIVE = 0x25,
CALL_CAUSE_SECURITY_MODE = 0x26,
CALL_CAUSE_TRACFONE_FAILED = 0x27,
CALL_CAUSE_TRACFONE_WAIT_FAILED = 0x28,
CALL_CAUSE_TRACFONE_CONF_FAILED = 0x29,
CALL_CAUSE_TEMPERATURE_LIMIT = 0x2A,
CALL_CAUSE_KODIAK_POC_FAILED = 0x2B,
CALL_CAUSE_NOT_REGISTERED = 0x2C,
CALL_CAUSE_CS_CALLS_ONLY = 0x2D,
CALL_CAUSE_VOIP_CALLS_ONLY = 0x2E,
CALL_CAUSE_LIMITED_CALL_ACTIVE = 0x2F,
CALL_CAUSE_LIMITED_CALL_NOT_ALLOWED = 0x30,
CALL_CAUSE_SECURE_CALL_NOT_POSSIBLE = 0x31,
CALL_CAUSE_INTERCEPT = 0x32,
};
enum call_gsm_cause {
CALL_GSM_CAUSE_UNASSIGNED_NUMBER = 0x01,
CALL_GSM_CAUSE_NO_ROUTE = 0x03,
CALL_GSM_CAUSE_CH_UNACCEPTABLE = 0x06,
CALL_GSM_CAUSE_OPER_BARRING = 0x08,
CALL_GSM_CAUSE_NORMAL = 0x10,
CALL_GSM_CAUSE_USER_BUSY = 0x11,
CALL_GSM_CAUSE_NO_USER_RESPONSE = 0x12,
CALL_GSM_CAUSE_ALERT_NO_ANSWER = 0x13,
CALL_GSM_CAUSE_CALL_REJECTED = 0x15,
CALL_GSM_CAUSE_NUMBER_CHANGED = 0x16,
CALL_GSM_CAUSE_NON_SELECT_CLEAR = 0x1A,
CALL_GSM_CAUSE_DEST_OUT_OF_ORDER = 0x1B,
CALL_GSM_CAUSE_INVALID_NUMBER = 0x1C,
CALL_GSM_CAUSE_FACILITY_REJECTED = 0x1D,
CALL_GSM_CAUSE_RESP_TO_STATUS = 0x1E,
CALL_GSM_CAUSE_NORMAL_UNSPECIFIED = 0x1F,
CALL_GSM_CAUSE_NO_CHANNEL = 0x22,
CALL_GSM_CAUSE_NETW_OUT_OF_ORDER = 0x26,
CALL_GSM_CAUSE_TEMPORARY_FAILURE = 0x29,
CALL_GSM_CAUSE_CONGESTION = 0x2A,
CALL_GSM_CAUSE_ACCESS_INFO_DISC = 0x2B,
CALL_GSM_CAUSE_CHANNEL_NA = 0x2C,
CALL_GSM_CAUSE_RESOURCES_NA = 0x2F,
CALL_GSM_CAUSE_QOS_NA = 0x31,
CALL_GSM_CAUSE_FACILITY_UNSUBS = 0x32,
CALL_GSM_CAUSE_COMING_BARRED_CUG = 0x37,
CALL_GSM_CAUSE_BC_UNAUTHORIZED = 0x39,
CALL_GSM_CAUSE_BC_NA = 0x3A,
CALL_GSM_CAUSE_SERVICE_NA = 0x3F,
CALL_GSM_CAUSE_BEARER_NOT_IMPL = 0x41,
CALL_GSM_CAUSE_ACM_MAX = 0x44,
CALL_GSM_CAUSE_FACILITY_NOT_IMPL = 0x45,
CALL_GSM_CAUSE_ONLY_RDI_BC = 0x46,
CALL_GSM_CAUSE_SERVICE_NOT_IMPL = 0x4F,
CALL_GSM_CAUSE_INVALID_TI = 0x51,
CALL_GSM_CAUSE_NOT_IN_CUG = 0x57,
CALL_GSM_CAUSE_INCOMPATIBLE_DEST = 0x58,
CALL_GSM_CAUSE_INV_TRANS_NET_SEL = 0x5B,
CALL_GSM_CAUSE_SEMANTICAL_ERR = 0x5F,
CALL_GSM_CAUSE_INVALID_MANDATORY = 0x60,
CALL_GSM_CAUSE_MSG_TYPE_INEXIST = 0x61,
CALL_GSM_CAUSE_MSG_TYPE_INCOMPAT = 0x62,
CALL_GSM_CAUSE_IE_NON_EXISTENT = 0x63,
CALL_GSM_CAUSE_COND_IE_ERROR = 0x64,
CALL_GSM_CAUSE_MSG_INCOMPATIBLE = 0x65,
CALL_GSM_CAUSE_TIMER_EXPIRY = 0x66,
CALL_GSM_CAUSE_PROTOCOL_ERROR = 0x6F,
CALL_GSM_CAUSE_INTERWORKING = 0x7F
};
enum call_cause_type {
CALL_CAUSE_TYPE_DEFAULT = 0x00,
CALL_CAUSE_TYPE_CLIENT = 0x01,
CALL_CAUSE_TYPE_SERVER = 0x02,
CALL_CAUSE_TYPE_NETWORK = 0x03,
};
enum call_subblock {
CALL_ORIGIN_ADDRESS = 0x01,
CALL_ORIGIN_SUBADDRESS = 0x02,
CALL_DESTINATION_ADDRESS = 0x03,
CALL_DESTINATION_SUBADDRESS = 0x04,
CALL_DESTINATION_PRE_ADDRESS = 0x05,
CALL_DESTINATION_POST_ADDRESS = 0x06,
CALL_MODE = 0x07,
CALL_CAUSE = 0x08,
CALL_OPERATION = 0x09,
CALL_STATUS = 0x0A,
CALL_STATUS_INFO = 0x0B,
CALL_ALERTING_INFO = 0x0C,
CALL_RELEASE_INFO = 0x0D,
CALL_ORIGIN_INFO = 0x0E,
CALL_DTMF_DIGIT = 0x0F,
CALL_DTMF_STRING = 0x10,
CALL_DTMF_BCD_STRING = 0x19,
CALL_DTMF_INFO = 0x1A,
CALL_PROPERTY_INFO = 0x13,
CALL_EMERGENCY_NUMBER = 0x14,
CALL_DTMF_STATUS = 0x11,
CALL_DTMF_TONE = 0x12,
CALL_GSM_CUG_INFO = 0xA0,
CALL_GSM_ALERTING_PATTERN = 0xA1,
CALL_GSM_DEFLECTION_ADDRESS = 0xA2,
CALL_GSM_DEFLECTION_SUBADDRESS = 0xA3,
CALL_GSM_REDIRECTING_ADDRESS = 0xA4,
CALL_GSM_REDIRECTING_SUBADDRESS = 0xA5,
CALL_GSM_REMOTE_ADDRESS = 0xA6,
CALL_GSM_REMOTE_SUBADDRESS = 0xA7,
CALL_GSM_USER_TO_USER_INFO = 0xA8,
CALL_GSM_DIAGNOSTICS = 0xA9,
CALL_GSM_SS_DIAGNOSTICS = 0xAA,
CALL_GSM_NEW_DESTINATION = 0xAB,
CALL_GSM_CCBS_INFO = 0xAC,
CALL_GSM_ADDRESS_OF_B = 0xAD,
CALL_GSM_SUBADDRESS_OF_B = 0xB0,
CALL_GSM_NOTIFY = 0xB1,
CALL_GSM_SS_NOTIFY = 0xB2,
CALL_GSM_SS_CODE = 0xB3,
CALL_GSM_SS_STATUS = 0xB4,
CALL_GSM_SS_NOTIFY_INDICATOR = 0xB5,
CALL_GSM_SS_HOLD_INDICATOR = 0xB6,
CALL_GSM_SS_ECT_INDICATOR = 0xB7,
CALL_GSM_DATA_CH_INFO = 0xB8,
CALL_DESTINATION_CS_ADDRESS = 0x16,
CALL_GSM_CCP = 0xBA,
CALL_GSM_RAB_INFO = 0xB9,
CALL_GSM_FNUR_INFO = 0xBB,
CALL_GSM_CAUSE_OF_NO_CLI = 0xBC,
CALL_GSM_MM_CAUSE = 0xBD,
CALL_GSM_EVENT_INFO = 0xBE,
CALL_GSM_DETAILED_CAUSE = 0xBF,
CALL_GSM_SS_DATA = 0xC0,
CALL_TIMER = 0x17,
CALL_GSM_ALS_INFO = 0xC1,
CALL_STATE_AUTO_CHANGE = 0x18,
CALL_EMERGENCY_NUMBER_INFO = 0x1B,
CALL_STATUS_MODE = 0x1C,
CALL_ADDR_AND_STATUS_INFO = 0x1D,
CALL_DTMF_TIMERS = 0x1E,
CALL_NAS_SYNC_INDICATOR = 0x1F,
CALL_NW_CAUSE = 0x20,
CALL_TRACFONE_RESULT = 0x21,
CALL_KODIAK_POC = 0x22,
CALL_DISPLAY_NUMBER = 0x23,
CALL_DESTINATION_URI = 0x24,
CALL_ORIGIN_URI = 0x25,
CALL_URI = 0x26,
CALL_SYSTEM_INFO = 0x27,
CALL_SYSTEMS = 0x28,
CALL_VOIP_TIMER = 0x29,
CALL_REDIRECTING_URI = 0x2A,
CALL_REMOTE_URI = 0x2B,
CALL_DEFLECTION_URI = 0x2C,
CALL_TRANSFER_INFO = 0x2D,
CALL_FORWARDING_INFO = 0x2E,
CALL_ID_INFO = 0x2F,
CALL_TEST_CALL = 0x30,
CALL_AUDIO_CONF_INFO = 0x31,
CALL_SECURITY_INFO = 0x33,
CALL_SINGLE_TIMERS = 0x32,
CALL_MEDIA_INFO = 0x35,
CALL_MEDIA_HANDLE = 0x34,
CALL_MODE_CHANGE_INFO = 0x36,
CALL_ADDITIONAL_PARAMS = 0x37,
CALL_DSAC_INFO = 0x38
};
enum call_id {
CALL_ID_NONE = 0x00,
CALL_ID_1 = 0x01,
CALL_ID_2 = 0x02,
CALL_ID_3 = 0x03,
CALL_ID_4 = 0x04,
CALL_ID_5 = 0x05,
CALL_ID_6 = 0x06,
CALL_ID_7 = 0x07,
CALL_ID_CONFERENCE = 0x10,
CALL_ID_WAITING = 0x20,
CALL_ID_HOLD = 0x40,
CALL_ID_ACTIVE = 0x80,
CALL_ID_ALL = 0xF0
};
enum call_mode {
CALL_MODE_EMERGENCY = 0x00,
CALL_MODE_SPEECH = 0x01,
CALL_GSM_MODE_ALS_LINE_1 = 0xA5,
CALL_GSM_MODE_ALS_LINE_2 = 0xA2
};
enum {
CALL_MODE_INFO_NONE = 0,
CALL_MODE_ORIGINATOR = 0x01
};
enum {
CALL_PRESENTATION_ALLOWED = 0x00,
CALL_PRESENTATION_RESTRICTED = 0x01,
CALL_GSM_PRESENTATION_DEFAULT = 0x07
};
enum call_operation {
CALL_OP_HOLD = 0x01,
CALL_OP_RETRIEVE = 0x02,
CALL_OP_SWAP = 0x03,
CALL_OP_CONFERENCE_BUILD = 0x04,
CALL_OP_CONFERENCE_SPLIT = 0x05,
CALL_OP_DATA_RATE_CHANGE = 0x06,
CALL_GSM_OP_CUG = 0xA0,
CALL_GSM_OP_TRANSFER = 0xA1,
CALL_GSM_OP_DEFLECT = 0xA2,
CALL_GSM_OP_CCBS = 0xA3,
CALL_GSM_OP_UUS1 = 0xA4,
CALL_GSM_OP_UUS2 = 0xA5,
CALL_GSM_OP_UUS3 = 0xA6
};
enum {
CALL_GSM_OP_UUS_REQUIRED = 0x01
};
enum call_status_mode {
CALL_STATUS_MODE_DEFAULT = 0x00,
CALL_STATUS_MODE_ADDR = 0x01,
CALL_STATUS_MODE_ADDR_AND_ORIGIN = 0x02,
CALL_STATUS_MODE_POC = 0x03,
CALL_STATUS_MODE_VOIP_ADDR = 0x04
};
enum {
CALL_DTMF_ENABLE_TONE_IND_SEND = 0x01,
CALL_DTMF_DISABLE_TONE_IND_SEND = 0x02
};
#ifdef __cplusplus
};
#endif
#endif /* !__ISIMODEM_CALL_H */

View File

@ -39,54 +39,15 @@
#include <ofono/modem.h>
#include <ofono/cbs.h>
#include "isi.h"
#define PN_SMS 0x02
#define CBS_TIMEOUT 5
enum message_id {
SMS_GSM_CB_ROUTING_REQ = 0x0B,
SMS_GSM_CB_ROUTING_RESP = 0x0C,
SMS_GSM_CB_ROUTING_NTF = 0x0D
};
enum routing_command {
SMS_ROUTING_RELEASE = 0x00,
SMS_ROUTING_SET = 0x01,
SMS_ROUTING_SUSPEND = 0x02,
SMS_ROUTING_RESUME = 0x03,
SMS_ROUTING_UPDATE = 0x04
};
enum routing_mode {
SMS_GSM_ROUTING_MODE_ALL = 0x0B,
SMS_GSM_ROUTING_MODE_CB_DDL = 0x0C
};
enum cause {
SMS_OK = 0x00,
SMS_ERR_ROUTING_RELEASED = 0x01,
SMS_ERR_INVALID_PARAMETER = 0x02,
SMS_ERR_DEVICE_FAILURE = 0x03,
SMS_ERR_PP_RESERVED = 0x04
};
enum subject_list_type {
SMS_CB_ALLOWED_IDS_LIST = 0x00,
SMS_CB_NOT_ALLOWED_IDS_LIST = 0x01
};
#include "isimodem.h"
#include "isiutil.h"
#include "sms.h"
#include "debug.h"
struct cbs_data {
GIsiClient *client;
struct isi_version version;
};
static void cbs_debug(const void *restrict buf, size_t len, void *data)
{
DBG("");
dump_msg(buf, len);
}
static void isi_set_topics(struct ofono_cbs *cbs, const char *topics,
ofono_cbs_set_cb_t cb, void *data)
{

74
drivers/isimodem/debug.h Normal file
View File

@ -0,0 +1,74 @@
/*
* This file is part of oFono - Open Source Telephony
*
* Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* version 2 as published by the Free Software Foundation.
*
* This program 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
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA
*
*/
#ifndef __ISIMODEM_DEBUG_H
#define __ISIMODEM_DEBUG_H
#include "ss.h"
#include "mtc.h"
#include "sms.h"
#include "sim.h"
#include "info.h"
#include "call.h"
#include "network.h"
const char *ss_message_id_name(enum ss_message_id value);
const char *ss_subblock_name(enum ss_subblock value);
const char *mtc_isi_cause_name(enum mtc_isi_cause value);
const char *mtc_message_id_name(enum mtc_message_id value);
const char *mtc_modem_state_name(enum mtc_modem_state value);
const char *sms_gsm_cause_name(enum sms_gsm_cause value);
const char *sms_isi_cause_name(enum sms_isi_cause value);
const char *sms_message_id_name(enum sms_message_id value);
const char *sms_subblock_name(enum sms_subblock value);
const char *sim_isi_cause_name(enum sim_isi_cause value);
const char *sim_message_id_name(enum sim_message_id value);
const char *sim_subblock_name(enum sim_subblock value);
const char *info_isi_cause_name(enum info_isi_cause value);
const char *info_message_id_name(enum info_message_id value);
const char *info_subblock_name(enum info_subblock value);
const char *call_gsm_cause_name(enum call_gsm_cause value);
const char *call_isi_cause_name(enum call_isi_cause value);
const char *call_status_name(enum call_status value);
const char *call_message_id_name(enum call_message_id value);
const char *net_gsm_cause_name(enum net_gsm_cause value);
const char *net_isi_cause_name(enum net_isi_cause value);
const char *net_status_name(enum net_reg_status value);
const char *net_message_id_name(enum net_message_id value);
const char *net_subblock_name(enum net_subblock value);
void ss_debug(const void *restrict buf, size_t len, void *data);
void mtc_debug(const void *restrict buf, size_t len, void *data);
void sms_debug(const void *restrict buf, size_t len, void *data);
void sim_debug(const void *restrict buf, size_t len, void *data);
void info_debug(const void *restrict buf, size_t len, void *data);
void call_debug(const void *restrict buf, size_t len, void *data);
void net_debug(const void *restrict buf, size_t len, void *data);
const char *pn_resource_name(int value);
#endif /* __ISIMODEM_DEBUG_H */

View File

@ -40,46 +40,10 @@
#include <ofono/modem.h>
#include <ofono/devinfo.h>
#include "isi.h"
#define PN_PHONE_INFO 0x1B
#define INFO_TIMEOUT 5
enum return_code {
INFO_OK = 0x00,
INFO_FAIL = 0x01,
INFO_NO_NUMBER = 0x02,
INFO_NOT_SUPPORTED = 0x03
};
enum message_id {
INFO_SERIAL_NUMBER_READ_REQ = 0x00,
INFO_SERIAL_NUMBER_READ_RESP = 0x01,
INFO_VERSION_READ_REQ = 0x07,
INFO_VERSION_READ_RESP = 0x08,
INFO_PRODUCT_INFO_READ_REQ = 0x15,
INFO_PRODUCT_INFO_READ_RESP = 0x16
};
enum sub_block_id {
INFO_SB_PRODUCT_INFO_NAME = 0x01,
INFO_SB_PRODUCT_INFO_MANUFACTURER = 0x07,
INFO_SB_SN_IMEI_PLAIN = 0x41,
INFO_SB_MCUSW_VERSION = 0x48
};
enum product_info_type {
INFO_PRODUCT_NAME = 0x01,
INFO_PRODUCT_MANUFACTURER = 0x07
};
enum serial_number_type {
INFO_SN_IMEI_PLAIN = 0x41
};
enum version_type {
INFO_MCUSW = 0x01
};
#include "isimodem.h"
#include "isiutil.h"
#include "debug.h"
#include "info.h"
struct devinfo_data {
GIsiClient *client;

73
drivers/isimodem/info.h Normal file
View File

@ -0,0 +1,73 @@
/*
* This file is part of oFono - Open Source Telephony
*
* Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* version 2 as published by the Free Software Foundation.
*
* This program 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
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA
*
*/
#ifndef __ISIMODEM_INFO_H
#define __ISIMODEM_INFO_H
#ifdef __cplusplus
extern "C" {
#endif
#define PN_PHONE_INFO 0x1B
#define INFO_TIMEOUT 5
enum info_isi_cause {
INFO_OK = 0x00,
INFO_FAIL = 0x01,
INFO_NO_NUMBER = 0x02,
INFO_NOT_SUPPORTED = 0x03
};
enum info_message_id {
INFO_SERIAL_NUMBER_READ_REQ = 0x00,
INFO_SERIAL_NUMBER_READ_RESP = 0x01,
INFO_VERSION_READ_REQ = 0x07,
INFO_VERSION_READ_RESP = 0x08,
INFO_PRODUCT_INFO_READ_REQ = 0x15,
INFO_PRODUCT_INFO_READ_RESP = 0x16,
INFO_COMMON_MESSAGE = 0xF0
};
enum info_subblock {
INFO_SB_PRODUCT_INFO_NAME = 0x01,
INFO_SB_PRODUCT_INFO_MANUFACTURER = 0x07,
INFO_SB_SN_IMEI_PLAIN = 0x41,
INFO_SB_MCUSW_VERSION = 0x48
};
enum info_product_info_type {
INFO_PRODUCT_NAME = 0x01,
INFO_PRODUCT_MANUFACTURER = 0x07
};
enum info_serial_number_type {
INFO_SN_IMEI_PLAIN = 0x41
};
enum info_version_type {
INFO_MCUSW = 0x01
};
#ifdef __cplusplus
};
#endif
#endif /* !__ISIMODEM_INFO_H */

View File

@ -1,421 +0,0 @@
/*
* This file is part of oFono - Open Source Telephony
*
* Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
*
* Contact: <Pekka.Pessi@nokia.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* version 2 as published by the Free Software Foundation.
*
* This program 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
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA
*
*/
#ifndef __GISI_CALL_H
#define __GISI_CALL_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
#define PN_CALL 0x01
enum isi_call_message_id {
CALL_CREATE_REQ = 0x01,
CALL_CREATE_RESP = 0x02,
CALL_COMING_IND = 0x03,
CALL_MO_ALERT_IND = 0x04,
CALL_MT_ALERT_IND = 0x05,
CALL_WAITING_IND = 0x06,
CALL_ANSWER_REQ = 0x07,
CALL_ANSWER_RESP = 0x08,
CALL_RELEASE_REQ = 0x09,
CALL_RELEASE_RESP = 0x0A,
CALL_RELEASE_IND = 0x0B,
CALL_TERMINATED_IND = 0x0C,
CALL_STATUS_REQ = 0x0D,
CALL_STATUS_RESP = 0x0E,
CALL_STATUS_IND = 0x0F,
CALL_SERVER_STATUS_IND = 0x10,
CALL_CONTROL_REQ = 0x11,
CALL_CONTROL_RESP = 0x12,
CALL_CONTROL_IND = 0x13,
CALL_MODE_SWITCH_REQ = 0x14,
CALL_MODE_SWITCH_RESP = 0x15,
CALL_MODE_SWITCH_IND = 0x16,
CALL_DTMF_SEND_REQ = 0x17,
CALL_DTMF_SEND_RESP = 0x18,
CALL_DTMF_STOP_REQ = 0x19,
CALL_DTMF_STOP_RESP = 0x1A,
CALL_DTMF_STATUS_IND = 0x1B,
CALL_DTMF_TONE_IND = 0x1C,
CALL_RECONNECT_IND = 0x1E,
CALL_PROPERTY_GET_REQ = 0x1F,
CALL_PROPERTY_GET_RESP = 0x20,
CALL_PROPERTY_SET_REQ = 0x21,
CALL_PROPERTY_SET_RESP = 0x22,
CALL_PROPERTY_SET_IND = 0x23,
CALL_EMERGENCY_NBR_CHECK_REQ = 0x28,
CALL_EMERGENCY_NBR_CHECK_RESP = 0x29,
CALL_EMERGENCY_NBR_GET_REQ = 0x26,
CALL_EMERGENCY_NBR_GET_RESP = 0x27,
CALL_EMERGENCY_NBR_MODIFY_REQ = 0x24,
CALL_EMERGENCY_NBR_MODIFY_RESP = 0x25,
CALL_GSM_NOTIFICATION_IND = 0xA0,
CALL_GSM_USER_TO_USER_REQ = 0xA1,
CALL_GSM_USER_TO_USER_RESP = 0xA2,
CALL_GSM_USER_TO_USER_IND = 0xA3,
CALL_GSM_BLACKLIST_CLEAR_REQ = 0xA4,
CALL_GSM_BLACKLIST_CLEAR_RESP = 0xA5,
CALL_GSM_BLACKLIST_TIMER_IND = 0xA6,
CALL_GSM_DATA_CH_INFO_IND = 0xA7,
CALL_GSM_CCP_GET_REQ = 0xAA,
CALL_GSM_CCP_GET_RESP = 0xAB,
CALL_GSM_CCP_CHECK_REQ = 0xAC,
CALL_GSM_CCP_CHECK_RESP = 0xAD,
CALL_GSM_COMING_REJ_IND = 0xA9,
CALL_GSM_RAB_IND = 0xA8,
CALL_GSM_IMMEDIATE_MODIFY_IND = 0xAE,
CALL_CREATE_NO_SIMATK_REQ = 0x2A,
CALL_GSM_SS_DATA_IND = 0xAF,
CALL_TIMER_REQ = 0x2B,
CALL_TIMER_RESP = 0x2C,
CALL_TIMER_NTF = 0x2D,
CALL_TIMER_IND = 0x2E,
CALL_TIMER_RESET_REQ = 0x2F,
CALL_TIMER_RESET_RESP = 0x30,
CALL_EMERGENCY_NBR_IND = 0x31,
CALL_SERVICE_DENIED_IND = 0x32,
CALL_RELEASE_END_REQ = 0x34,
CALL_RELEASE_END_RESP = 0x35,
CALL_USER_CONNECT_IND = 0x33,
CALL_AUDIO_CONNECT_IND = 0x40,
CALL_KODIAK_ALLOW_CTRL_REQ = 0x36,
CALL_KODIAK_ALLOW_CTRL_RESP = 0x37,
CALL_SERVICE_ACTIVATE_IND = 0x38,
CALL_SERVICE_ACTIVATE_REQ = 0x39,
CALL_SERVICE_ACTIVATE_RESP = 0x3A,
CALL_SIM_ATK_IND = 0x3B,
CALL_CONTROL_OPER_IND = 0x3C,
CALL_TEST_CALL_STATUS_IND = 0x3E,
CALL_SIM_ATK_INFO_IND = 0x3F,
CALL_SECURITY_IND = 0x41,
CALL_MEDIA_HANDLE_REQ = 0x42,
CALL_MEDIA_HANDLE_RESP = 0x43,
COMMON_MESSAGE = 0xF0,
};
enum isi_call_status {
CALL_STATUS_IDLE = 0x00,
CALL_STATUS_CREATE = 0x01,
CALL_STATUS_COMING = 0x02,
CALL_STATUS_PROCEEDING = 0x03,
CALL_STATUS_MO_ALERTING = 0x04,
CALL_STATUS_MT_ALERTING = 0x05,
CALL_STATUS_WAITING = 0x06,
CALL_STATUS_ANSWERED = 0x07,
CALL_STATUS_ACTIVE = 0x08,
CALL_STATUS_MO_RELEASE = 0x09,
CALL_STATUS_MT_RELEASE = 0x0A,
CALL_STATUS_HOLD_INITIATED = 0x0B,
CALL_STATUS_HOLD = 0x0C,
CALL_STATUS_RETRIEVE_INITIATED = 0x0D,
CALL_STATUS_RECONNECT_PENDING = 0x0E,
CALL_STATUS_TERMINATED = 0x0F,
CALL_STATUS_SWAP_INITIATED = 0x10,
};
enum isi_call_isi_cause {
CALL_CAUSE_NO_CAUSE = 0x00,
CALL_CAUSE_NO_CALL = 0x01,
CALL_CAUSE_TIMEOUT = 0x02,
CALL_CAUSE_RELEASE_BY_USER = 0x03,
CALL_CAUSE_BUSY_USER_REQUEST = 0x04,
CALL_CAUSE_ERROR_REQUEST = 0x05,
CALL_CAUSE_COST_LIMIT_REACHED = 0x06,
CALL_CAUSE_CALL_ACTIVE = 0x07,
CALL_CAUSE_NO_CALL_ACTIVE = 0x08,
CALL_CAUSE_INVALID_CALL_MODE = 0x09,
CALL_CAUSE_SIGNALLING_FAILURE = 0x0A,
CALL_CAUSE_TOO_LONG_ADDRESS = 0x0B,
CALL_CAUSE_INVALID_ADDRESS = 0x0C,
CALL_CAUSE_EMERGENCY = 0x0D,
CALL_CAUSE_NO_TRAFFIC_CHANNEL = 0x0E,
CALL_CAUSE_NO_COVERAGE = 0x0F,
CALL_CAUSE_CODE_REQUIRED = 0x10,
CALL_CAUSE_NOT_ALLOWED = 0x11,
CALL_CAUSE_NO_DTMF = 0x12,
CALL_CAUSE_CHANNEL_LOSS = 0x13,
CALL_CAUSE_FDN_NOT_OK = 0x14,
CALL_CAUSE_USER_TERMINATED = 0x15,
CALL_CAUSE_BLACKLIST_BLOCKED = 0x16,
CALL_CAUSE_BLACKLIST_DELAYED = 0x17,
CALL_CAUSE_NUMBER_NOT_FOUND = 0x18,
CALL_CAUSE_NUMBER_CANNOT_REMOVE = 0x19,
CALL_CAUSE_EMERGENCY_FAILURE = 0x1A,
CALL_CAUSE_CS_SUSPENDED = 0x1B,
CALL_CAUSE_DCM_DRIVE_MODE = 0x1C,
CALL_CAUSE_MULTIMEDIA_NOT_ALLOWED = 0x1D,
CALL_CAUSE_SIM_REJECTED = 0x1E,
CALL_CAUSE_NO_SIM = 0x1F,
CALL_CAUSE_SIM_LOCK_OPERATIVE = 0x20,
CALL_CAUSE_SIMATKCC_REJECTED = 0x21,
CALL_CAUSE_SIMATKCC_MODIFIED = 0x22,
CALL_CAUSE_DTMF_INVALID_DIGIT = 0x23,
CALL_CAUSE_DTMF_SEND_ONGOING = 0x24,
CALL_CAUSE_CS_INACTIVE = 0x25,
CALL_CAUSE_SECURITY_MODE = 0x26,
CALL_CAUSE_TRACFONE_FAILED = 0x27,
CALL_CAUSE_TRACFONE_WAIT_FAILED = 0x28,
CALL_CAUSE_TRACFONE_CONF_FAILED = 0x29,
CALL_CAUSE_TEMPERATURE_LIMIT = 0x2A,
CALL_CAUSE_KODIAK_POC_FAILED = 0x2B,
CALL_CAUSE_NOT_REGISTERED = 0x2C,
CALL_CAUSE_CS_CALLS_ONLY = 0x2D,
CALL_CAUSE_VOIP_CALLS_ONLY = 0x2E,
CALL_CAUSE_LIMITED_CALL_ACTIVE = 0x2F,
CALL_CAUSE_LIMITED_CALL_NOT_ALLOWED = 0x30,
CALL_CAUSE_SECURE_CALL_NOT_POSSIBLE = 0x31,
CALL_CAUSE_INTERCEPT = 0x32,
};
enum isi_call_gsm_cause {
CALL_GSM_CAUSE_UNASSIGNED_NUMBER = 0x01,
CALL_GSM_CAUSE_NO_ROUTE = 0x03,
CALL_GSM_CAUSE_CH_UNACCEPTABLE = 0x06,
CALL_GSM_CAUSE_OPER_BARRING = 0x08,
CALL_GSM_CAUSE_NORMAL = 0x10,
CALL_GSM_CAUSE_USER_BUSY = 0x11,
CALL_GSM_CAUSE_NO_USER_RESPONSE = 0x12,
CALL_GSM_CAUSE_ALERT_NO_ANSWER = 0x13,
CALL_GSM_CAUSE_CALL_REJECTED = 0x15,
CALL_GSM_CAUSE_NUMBER_CHANGED = 0x16,
CALL_GSM_CAUSE_NON_SELECT_CLEAR = 0x1A,
CALL_GSM_CAUSE_DEST_OUT_OF_ORDER = 0x1B,
CALL_GSM_CAUSE_INVALID_NUMBER = 0x1C,
CALL_GSM_CAUSE_FACILITY_REJECTED = 0x1D,
CALL_GSM_CAUSE_RESP_TO_STATUS = 0x1E,
CALL_GSM_CAUSE_NORMAL_UNSPECIFIED = 0x1F,
CALL_GSM_CAUSE_NO_CHANNEL = 0x22,
CALL_GSM_CAUSE_NETW_OUT_OF_ORDER = 0x26,
CALL_GSM_CAUSE_TEMPORARY_FAILURE = 0x29,
CALL_GSM_CAUSE_CONGESTION = 0x2A,
CALL_GSM_CAUSE_ACCESS_INFO_DISC = 0x2B,
CALL_GSM_CAUSE_CHANNEL_NA = 0x2C,
CALL_GSM_CAUSE_RESOURCES_NA = 0x2F,
CALL_GSM_CAUSE_QOS_NA = 0x31,
CALL_GSM_CAUSE_FACILITY_UNSUBS = 0x32,
CALL_GSM_CAUSE_COMING_BARRED_CUG = 0x37,
CALL_GSM_CAUSE_BC_UNAUTHORIZED = 0x39,
CALL_GSM_CAUSE_BC_NA = 0x3A,
CALL_GSM_CAUSE_SERVICE_NA = 0x3F,
CALL_GSM_CAUSE_BEARER_NOT_IMPL = 0x41,
CALL_GSM_CAUSE_ACM_MAX = 0x44,
CALL_GSM_CAUSE_FACILITY_NOT_IMPL = 0x45,
CALL_GSM_CAUSE_ONLY_RDI_BC = 0x46,
CALL_GSM_CAUSE_SERVICE_NOT_IMPL = 0x4F,
CALL_GSM_CAUSE_INVALID_TI = 0x51,
CALL_GSM_CAUSE_NOT_IN_CUG = 0x57,
CALL_GSM_CAUSE_INCOMPATIBLE_DEST = 0x58,
CALL_GSM_CAUSE_INV_TRANS_NET_SEL = 0x5B,
CALL_GSM_CAUSE_SEMANTICAL_ERR = 0x5F,
CALL_GSM_CAUSE_INVALID_MANDATORY = 0x60,
CALL_GSM_CAUSE_MSG_TYPE_INEXIST = 0x61,
CALL_GSM_CAUSE_MSG_TYPE_INCOMPAT = 0x62,
CALL_GSM_CAUSE_IE_NON_EXISTENT = 0x63,
CALL_GSM_CAUSE_COND_IE_ERROR = 0x64,
CALL_GSM_CAUSE_MSG_INCOMPATIBLE = 0x65,
CALL_GSM_CAUSE_TIMER_EXPIRY = 0x66,
CALL_GSM_CAUSE_PROTOCOL_ERROR = 0x6F,
CALL_GSM_CAUSE_INTERWORKING = 0x7F,
};
enum isi_call_cause_type {
CALL_CAUSE_TYPE_DEFAULT = 0x00,
CALL_CAUSE_TYPE_CLIENT = 0x01,
CALL_CAUSE_TYPE_SERVER = 0x02,
CALL_CAUSE_TYPE_NETWORK = 0x03,
};
enum isi_call_subblock {
CALL_ORIGIN_ADDRESS = 0x01,
CALL_ORIGIN_SUBADDRESS = 0x02,
CALL_DESTINATION_ADDRESS = 0x03,
CALL_DESTINATION_SUBADDRESS = 0x04,
CALL_DESTINATION_PRE_ADDRESS = 0x05,
CALL_DESTINATION_POST_ADDRESS = 0x06,
CALL_MODE = 0x07,
CALL_CAUSE = 0x08,
CALL_OPERATION = 0x09,
CALL_STATUS = 0x0A,
CALL_STATUS_INFO = 0x0B,
CALL_ALERTING_INFO = 0x0C,
CALL_RELEASE_INFO = 0x0D,
CALL_ORIGIN_INFO = 0x0E,
CALL_DTMF_DIGIT = 0x0F,
CALL_DTMF_STRING = 0x10,
CALL_DTMF_BCD_STRING = 0x19,
CALL_DTMF_INFO = 0x1A,
CALL_PROPERTY_INFO = 0x13,
CALL_EMERGENCY_NUMBER = 0x14,
CALL_DTMF_STATUS = 0x11,
CALL_DTMF_TONE = 0x12,
CALL_GSM_CUG_INFO = 0xA0,
CALL_GSM_ALERTING_PATTERN = 0xA1,
CALL_GSM_DEFLECTION_ADDRESS = 0xA2,
CALL_GSM_DEFLECTION_SUBADDRESS = 0xA3,
CALL_GSM_REDIRECTING_ADDRESS = 0xA4,
CALL_GSM_REDIRECTING_SUBADDRESS = 0xA5,
CALL_GSM_REMOTE_ADDRESS = 0xA6,
CALL_GSM_REMOTE_SUBADDRESS = 0xA7,
CALL_GSM_USER_TO_USER_INFO = 0xA8,
CALL_GSM_DIAGNOSTICS = 0xA9,
CALL_GSM_SS_DIAGNOSTICS = 0xAA,
CALL_GSM_NEW_DESTINATION = 0xAB,
CALL_GSM_CCBS_INFO = 0xAC,
CALL_GSM_ADDRESS_OF_B = 0xAD,
CALL_GSM_SUBADDRESS_OF_B = 0xB0,
CALL_GSM_NOTIFY = 0xB1,
CALL_GSM_SS_NOTIFY = 0xB2,
CALL_GSM_SS_CODE = 0xB3,
CALL_GSM_SS_STATUS = 0xB4,
CALL_GSM_SS_NOTIFY_INDICATOR = 0xB5,
CALL_GSM_SS_HOLD_INDICATOR = 0xB6,
CALL_GSM_SS_ECT_INDICATOR = 0xB7,
CALL_GSM_DATA_CH_INFO = 0xB8,
CALL_DESTINATION_CS_ADDRESS = 0x16,
CALL_GSM_CCP = 0xBA,
CALL_GSM_RAB_INFO = 0xB9,
CALL_GSM_FNUR_INFO = 0xBB,
CALL_GSM_CAUSE_OF_NO_CLI = 0xBC,
CALL_GSM_MM_CAUSE = 0xBD,
CALL_GSM_EVENT_INFO = 0xBE,
CALL_GSM_DETAILED_CAUSE = 0xBF,
CALL_GSM_SS_DATA = 0xC0,
CALL_TIMER = 0x17,
CALL_GSM_ALS_INFO = 0xC1,
CALL_STATE_AUTO_CHANGE = 0x18,
CALL_EMERGENCY_NUMBER_INFO = 0x1B,
CALL_STATUS_MODE = 0x1C,
CALL_ADDR_AND_STATUS_INFO = 0x1D,
CALL_DTMF_TIMERS = 0x1E,
CALL_NAS_SYNC_INDICATOR = 0x1F,
CALL_NW_CAUSE = 0x20,
CALL_TRACFONE_RESULT = 0x21,
CALL_KODIAK_POC = 0x22,
CALL_DISPLAY_NUMBER = 0x23,
CALL_DESTINATION_URI = 0x24,
CALL_ORIGIN_URI = 0x25,
CALL_URI = 0x26,
CALL_SYSTEM_INFO = 0x27,
CALL_SYSTEMS = 0x28,
CALL_VOIP_TIMER = 0x29,
CALL_REDIRECTING_URI = 0x2A,
CALL_REMOTE_URI = 0x2B,
CALL_DEFLECTION_URI = 0x2C,
CALL_TRANSFER_INFO = 0x2D,
CALL_FORWARDING_INFO = 0x2E,
CALL_ID_INFO = 0x2F,
CALL_TEST_CALL = 0x30,
CALL_AUDIO_CONF_INFO = 0x31,
CALL_SECURITY_INFO = 0x33,
CALL_SINGLE_TIMERS = 0x32,
CALL_MEDIA_INFO = 0x35,
CALL_MEDIA_HANDLE = 0x34,
CALL_MODE_CHANGE_INFO = 0x36,
CALL_ADDITIONAL_PARAMS = 0x37,
CALL_DSAC_INFO = 0x38,
};
enum isi_call_id {
CALL_ID_NONE = 0x00,
CALL_ID_1 = 0x01,
CALL_ID_2 = 0x02,
CALL_ID_3 = 0x03,
CALL_ID_4 = 0x04,
CALL_ID_5 = 0x05,
CALL_ID_6 = 0x06,
CALL_ID_7 = 0x07,
CALL_ID_CONFERENCE = 0x10,
CALL_ID_WAITING = 0x20,
CALL_ID_HOLD = 0x40,
CALL_ID_ACTIVE = 0x80,
CALL_ID_ALL = 0xF0,
};
enum isi_call_mode {
CALL_MODE_EMERGENCY = 0x00,
CALL_MODE_SPEECH = 0x01,
CALL_GSM_MODE_ALS_LINE_1 = 0xA5,
CALL_GSM_MODE_ALS_LINE_2 = 0xA2,
};
enum {
CALL_MODE_INFO_NONE = 0,
CALL_MODE_ORIGINATOR = 0x01,
};
enum {
CALL_PRESENTATION_ALLOWED = 0x00,
CALL_PRESENTATION_RESTRICTED = 0x01,
CALL_GSM_PRESENTATION_DEFAULT = 0x07,
};
enum isi_call_operation {
CALL_OP_HOLD = 0x01,
CALL_OP_RETRIEVE = 0x02,
CALL_OP_SWAP = 0x03,
CALL_OP_CONFERENCE_BUILD = 0x04,
CALL_OP_CONFERENCE_SPLIT = 0x05,
CALL_OP_DATA_RATE_CHANGE = 0x06,
CALL_GSM_OP_CUG = 0xA0,
CALL_GSM_OP_TRANSFER = 0xA1,
CALL_GSM_OP_DEFLECT = 0xA2,
CALL_GSM_OP_CCBS = 0xA3,
CALL_GSM_OP_UUS1 = 0xA4,
CALL_GSM_OP_UUS2 = 0xA5,
CALL_GSM_OP_UUS3 = 0xA6,
};
enum {
CALL_GSM_OP_UUS_REQUIRED = 0x01,
};
enum call_status_mode {
CALL_STATUS_MODE_DEFAULT = 0x00,
CALL_STATUS_MODE_ADDR = 0x01,
CALL_STATUS_MODE_ADDR_AND_ORIGIN = 0x02,
CALL_STATUS_MODE_POC = 0x03,
CALL_STATUS_MODE_VOIP_ADDR = 0x04,
};
enum {
CALL_DTMF_ENABLE_TONE_IND_SEND = 0x01,
CALL_DTMF_DISABLE_TONE_IND_SEND = 0x02,
};
char const *isi_call_cause_name(uint8_t cause_type, uint8_t cause);
char const *isi_call_gsm_cause_name(enum isi_call_gsm_cause value);
char const *isi_call_isi_cause_name(enum isi_call_isi_cause value);
char const *isi_call_status_name(enum isi_call_status value);
char const *isi_call_message_id_name(enum isi_call_message_id value);
void isi_call_debug(const void *restrict buf, size_t len, void *data);
#ifdef __cplusplus
};
#endif
#endif

79
drivers/isimodem/mtc.h Normal file
View File

@ -0,0 +1,79 @@
/*
* This file is part of oFono - Open Source Telephony
*
* Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* version 2 as published by the Free Software Foundation.
*
* This program 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
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA
*
*/
#ifndef __ISIMODEM_MTC_H
#define __ISIMODEM_MTC_H
#ifdef __cplusplus
extern "C" {
#endif
#define PN_MTC 0x15
#define MTC_TIMEOUT 5
enum mtc_isi_cause {
MTC_OK = 0x00,
MTC_FAIL = 0x01,
MTC_NOT_ALLOWED = 0x02,
MTC_STATE_TRANSITION_GOING_ON = 0x05,
MTC_ALREADY_ACTIVE = 0x06,
MTC_SERVICE_DISABLED = 0x10,
MTC_NOT_READY_YET = 0x13,
MTC_NOT_SUPPORTED = 0x14,
MTC_TRANSITION_ONGOING = 0x16,
MTC_RESET_REQUIRED = 0x17
};
enum mtc_message_id {
MTC_STATE_QUERY_REQ = 0x02,
MTC_POWER_OFF_REQ = 0x03,
MTC_POWER_ON_REQ = 0x04,
MTC_STATE_QUERY_RESP = 0x65,
MTC_POWER_OFF_RESP = 0x66,
MTC_POWER_ON_RESP = 0x67,
MTC_STATE_INFO_IND = 0xC0,
MTC_COMMON_MESSAGE = 0xF0
};
enum mtc_modem_state {
MTC_POWER_OFF = 0x00,
MTC_NORMAL = 0x01,
MTC_CHARGING = 0x02,
MTC_ALARM = 0x03,
MTC_TEST = 0x04,
MTC_LOCAL = 0x05,
MTC_WARRANTY = 0x06,
MTC_RELIABILITY = 0x07,
MTC_SELFTEST_FAIL = 0x08,
MTC_SWDL = 0x09,
MTC_RF_INACTIVE = 0x0A,
MTC_ID_WRITE = 0x0B,
MTC_DISCHARGING = 0x0C,
MTC_DISK_WIPE = 0x0D,
MTC_SW_RESET = 0x0E,
MTC_CMT_ONLY_MODE = 0xFF
};
#ifdef __cplusplus
};
#endif
#endif /* __ISIMODEM_MTC_H */

View File

@ -40,107 +40,13 @@
#include <ofono/modem.h>
#include <ofono/netreg.h>
#include "isi.h"
#define PN_NETWORK 0x0A
#define NETWORK_TIMEOUT 5
#define NETWORK_SCAN_TIMEOUT 180
#define NETWORK_SET_TIMEOUT 240
enum message_id {
NET_SET_REQ = 0x07,
NET_SET_RESP = 0x08,
NET_RSSI_GET_REQ = 0x0B,
NET_RSSI_GET_RESP = 0x0C,
NET_RSSI_IND = 0x1E,
NET_RAT_IND = 0x35,
NET_RAT_REQ = 0x36,
NET_RAT_RESP = 0x37,
NET_REG_STATUS_GET_REQ = 0xE0,
NET_REG_STATUS_GET_RESP = 0xE1,
NET_REG_STATUS_IND = 0xE2,
NET_AVAILABLE_GET_REQ = 0xE3,
NET_AVAILABLE_GET_RESP = 0xE4,
NET_OPER_NAME_READ_REQ = 0xE5,
NET_OPER_NAME_READ_RESP = 0xE6,
};
enum sub_block_id {
NET_REG_INFO_COMMON = 0x00,
NET_OPERATOR_INFO_COMMON = 0x02,
NET_RSSI_CURRENT = 0x04,
NET_GSM_REG_INFO = 0x09,
NET_DETAILED_NETWORK_INFO = 0x0B,
NET_GSM_OPERATOR_INFO = 0x0C,
NET_GSM_BAND_INFO = 0x11,
NET_RAT_INFO = 0x2C,
NET_AVAIL_NETWORK_INFO_COMMON = 0xE1,
NET_OPER_NAME_INFO = 0xE7
};
enum reg_status {
NET_REG_STATUS_HOME = 0x00,
NET_REG_STATUS_ROAM = 0x01,
NET_REG_STATUS_NOSERV = 0x03,
NET_REG_STATUS_NOSERV_SEARCHING = 0x04,
NET_REG_STATUS_NOSERV_NOTSEARCHING = 0x05,
NET_REG_STATUS_NOSERV_NOSIM = 0x06,
NET_REG_STATUS_POWER_OFF = 0x08,
NET_REG_STATUS_NSPS = 0x09,
NET_REG_STATUS_NSPS_NO_COVERAGE = 0x0A,
NET_REG_STATUS_NOSERV_SIM_REJECTED_BY_NW = 0x0B
};
enum cs_type {
NET_CS_GSM = 0x00
};
enum rat_name {
NET_GSM_RAT = 0x01,
NET_UMTS_RAT = 0x02
};
enum rat_type {
NET_CURRENT_RAT = 0x00,
NET_SUPPORTED_RATS = 0x01
};
enum measurement_type {
NET_CURRENT_CELL_RSSI = 0x02
};
enum search_mode {
NET_MANUAL_SEARCH = 0x00
};
enum oper_name_type {
NET_HARDCODED_LATIN_OPER_NAME = 0x00
};
enum band_info {
NET_GSM_BAND_INFO_NOT_AVAIL = 0x02,
NET_GSM_BAND_ALL_SUPPORTED_BANDS = 0x03
};
enum select_mode {
NET_SELECT_MODE_UNKNOWN = 0x00,
NET_SELECT_MODE_MANUAL = 0x01,
NET_SELECT_MODE_AUTOMATIC = 0x02,
NET_SELECT_MODE_USER_RESELECTION = 0x03,
NET_SELECT_MODE_NO_SELECTION = 0x04
};
enum return_code {
NET_CAUSE_OK = 0x00,
NET_CAUSE_COMMUNICATION_ERROR = 0x01,
NET_CAUSE_NET_NOT_FOUND = 0x05,
NET_CAUSE_NO_SELECTED_NETWORK = 0x11
};
#include "isimodem.h"
#include "isiutil.h"
#include "network.h"
#include "debug.h"
struct netreg_data {
GIsiClient *client;
struct isi_version version;
guint8 last_reg_mode;
guint8 rat;
guint8 gsm_compact;

209
drivers/isimodem/network.h Normal file
View File

@ -0,0 +1,209 @@
/*
* This file is part of oFono - Open Source Telephony
*
* Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* version 2 as published by the Free Software Foundation.
*
* This program 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
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA
*
*/
#ifndef __ISIMODEM_NETWORK_H
#define __ISIMODEM_NETWORK_H
#ifdef __cplusplus
extern "C" {
#endif
#define PN_NETWORK 0x0A
#define NETWORK_TIMEOUT 5
#define NETWORK_SCAN_TIMEOUT 180
#define NETWORK_SET_TIMEOUT 240
enum net_message_id {
NET_SET_REQ = 0x07,
NET_SET_RESP = 0x08,
NET_RSSI_GET_REQ = 0x0B,
NET_RSSI_GET_RESP = 0x0C,
NET_RSSI_IND = 0x1E,
NET_RAT_IND = 0x35,
NET_RAT_REQ = 0x36,
NET_RAT_RESP = 0x37,
NET_REG_STATUS_GET_REQ = 0xE0,
NET_REG_STATUS_GET_RESP = 0xE1,
NET_REG_STATUS_IND = 0xE2,
NET_AVAILABLE_GET_REQ = 0xE3,
NET_AVAILABLE_GET_RESP = 0xE4,
NET_OPER_NAME_READ_REQ = 0xE5,
NET_OPER_NAME_READ_RESP = 0xE6,
NET_COMMON_MESSAGE = 0xF0
};
enum net_subblock {
NET_REG_INFO_COMMON = 0x00,
NET_OPERATOR_INFO_COMMON = 0x02,
NET_RSSI_CURRENT = 0x04,
NET_GSM_REG_INFO = 0x09,
NET_DETAILED_NETWORK_INFO = 0x0B,
NET_GSM_OPERATOR_INFO = 0x0C,
NET_GSM_BAND_INFO = 0x11,
NET_RAT_INFO = 0x2C,
NET_AVAIL_NETWORK_INFO_COMMON = 0xE1,
NET_OPER_NAME_INFO = 0xE7
};
enum net_reg_status {
NET_REG_STATUS_HOME = 0x00,
NET_REG_STATUS_ROAM = 0x01,
NET_REG_STATUS_ROAM_BLINK = 0x02,
NET_REG_STATUS_NOSERV = 0x03,
NET_REG_STATUS_NOSERV_SEARCHING = 0x04,
NET_REG_STATUS_NOSERV_NOTSEARCHING = 0x05,
NET_REG_STATUS_NOSERV_NOSIM = 0x06,
NET_REG_STATUS_POWER_OFF = 0x08,
NET_REG_STATUS_NSPS = 0x09,
NET_REG_STATUS_NSPS_NO_COVERAGE = 0x0A,
NET_REG_STATUS_NOSERV_SIM_REJECTED_BY_NW = 0x0B
};
enum net_network_status {
NET_OPER_STATUS_UNKNOWN = 0x00,
NET_OPER_STATUS_AVAILABLE = 0x01,
NET_OPER_STATUS_CURRENT = 0x02,
NET_OPER_STATUS_FORBIDDEN = 0x03
};
enum net_network_pref {
NET_GSM_HOME_PLMN = 0x00,
NET_GSM_PREFERRED_PLMN = 0x01,
NET_GSM_FORBIDDEN_PLMN = 0x02,
NET_GSM_OTHER_PLMN = 0x03,
NET_GSM_NO_PLMN_AVAIL = 0x04
};
enum net_umts_available {
NET_UMTS_NOT_AVAILABLE = 0x00,
NET_UMTS_AVAILABLE = 0x01
};
enum net_band_info {
NET_GSM_BAND_900_1800 = 0x00,
NET_GSM_BAND_850_1900 = 0x01,
NET_GSM_BAND_INFO_NOT_AVAIL = 0x02,
NET_GSM_BAND_ALL_SUPPORTED_BANDS = 0x03,
NET_GSM_BAND_850_LOCKED = 0xB0,
NET_GSM_BAND_900_LOCKED = 0xA0,
NET_GSM_BAND_1800_LOCKED = 0xA1,
NET_GSM_BAND_1900_LOCKED = 0xB1,
};
enum net_gsm_cause {
NET_GSM_IMSI_UNKNOWN_IN_HLR = 0x02,
NET_GSM_ILLEGAL_MS = 0x03,
NET_GSM_IMSI_UNKNOWN_IN_VLR = 0x04,
NET_GSM_IMEI_NOT_ACCEPTED = 0x05,
NET_GSM_ILLEGAL_ME = 0x06,
NET_GSM_GPRS_SERVICES_NOT_ALLOWED = 0x07,
NET_GSM_GPRS_AND_NON_GPRS_NA = 0x08,
NET_GSM_MS_ID_CANNOT_BE_DERIVED = 0x09,
NET_GSM_IMPLICITLY_DETACHED = 0x0A,
NET_GSM_PLMN_NOT_ALLOWED = 0x0B,
NET_GSM_LA_NOT_ALLOWED = 0x0C,
NET_GSM_ROAMING_NOT_IN_THIS_LA = 0x0D,
NET_GSM_GPRS_SERV_NA_IN_THIS_PLMN = 0x0E,
NET_GSM_NO_SUITABLE_CELLS_IN_LA = 0x0F,
NET_GSM_MSC_TEMP_NOT_REACHABLE = 0x10,
NET_GSM_NETWORK_FAILURE = 0x11,
NET_GSM_MAC_FAILURE = 0x14,
NET_GSM_SYNCH_FAILURE = 0x15,
NET_GSM_CONGESTION = 0x16,
NET_GSM_AUTH_UNACCEPTABLE = 0x17,
NET_GSM_SERV_OPT_NOT_SUPPORTED = 0x20,
NET_GSM_SERV_OPT_NOT_SUBSCRIBED = 0x21,
NET_GSM_SERV_TEMP_OUT_OF_ORDER = 0x22,
NET_GSM_RETRY_ENTRY_NEW_CELL_LOW = 0x30,
NET_GSM_RETRY_ENTRY_NEW_CELL_HIGH = 0x3F,
NET_GSM_SEMANTICALLY_INCORRECT = 0x5F,
NET_GSM_INVALID_MANDATORY_INFO = 0x60,
NET_GSM_MSG_TYPE_NONEXISTENT = 0x61,
NET_GSM_CONDITIONAL_IE_ERROR = 0x64,
NET_GSM_MSG_TYPE_WRONG_STATE = 0x65,
NET_GSM_PROTOCOL_ERROR_UNSPECIFIED = 0x6F
};
enum net_cs_type {
NET_CS_GSM = 0x00
};
enum net_rat_name {
NET_GSM_RAT = 0x01,
NET_UMTS_RAT = 0x02
};
enum net_rat_type {
NET_CURRENT_RAT = 0x00,
NET_SUPPORTED_RATS = 0x01
};
enum net_measurement_type {
NET_CURRENT_CELL_RSSI = 0x02
};
enum net_search_mode {
NET_MANUAL_SEARCH = 0x00
};
enum net_oper_name_type {
NET_HARDCODED_LATIN_OPER_NAME = 0x00
};
enum net_select_mode {
NET_SELECT_MODE_UNKNOWN = 0x00,
NET_SELECT_MODE_MANUAL = 0x01,
NET_SELECT_MODE_AUTOMATIC = 0x02,
NET_SELECT_MODE_USER_RESELECTION = 0x03,
NET_SELECT_MODE_NO_SELECTION = 0x04
};
enum net_isi_cause {
NET_CAUSE_OK = 0x00,
NET_CAUSE_COMMUNICATION_ERROR = 0x01,
NET_CAUSE_INVALID_PARAMETER = 0x02,
NET_CAUSE_NO_SIM = 0x03,
NET_CAUSE_SIM_NOT_YET_READY = 0x04,
NET_CAUSE_NET_NOT_FOUND = 0x05,
NET_CAUSE_REQUEST_NOT_ALLOWED = 0x06,
NET_CAUSE_CALL_ACTIVE = 0x07,
NET_CAUSE_SERVER_BUSY = 0x08,
NET_CAUSE_SECURITY_CODE_REQUIRED = 0x09,
NET_CAUSE_NOTHING_TO_CANCEL = 0x0A,
NET_CAUSE_UNABLE_TO_CANCEL = 0x0B,
NET_CAUSE_NETWORK_FORBIDDEN = 0x0C,
NET_CAUSE_REQUEST_REJECTED = 0x0D,
NET_CAUSE_CS_NOT_SUPPORTED = 0x0E,
NET_CAUSE_PAR_INFO_NOT_AVAILABLE = 0x0F,
NET_CAUSE_NOT_DONE = 0x10,
NET_CAUSE_NO_SELECTED_NETWORK = 0x11,
NET_CAUSE_REQUEST_INTERRUPTED = 0x12,
NET_CAUSE_TOO_BIG_INDEX = 0x14,
NET_CAUSE_MEMORY_FULL = 0x15,
NET_CAUSE_SERVICE_NOT_ALLOWED = 0x16,
NET_CAUSE_NOT_SUPPORTED_IN_TECH = 0x17
};
#ifdef __cplusplus
};
#endif
#endif /* !__ISIMODEM_NETWORK_H */

View File

@ -39,41 +39,10 @@
#include <ofono/phonebook.h>
#include "util.h"
#include "isi.h"
#define PHONEBOOK_TIMEOUT 5
#define PN_SIM 0x09
enum pb_message_id {
SIM_PB_REQ_SIM_PB_READ = 0xDC,
SIM_PB_RESP_SIM_PB_READ = 0xDD
};
enum pb_service_types {
SIM_PB_READ = 0x0F
};
enum pb_sub_block_id {
SIM_PB_INFO_REQUEST = 0xE4,
SIM_PB_STATUS = 0xFB,
SIM_PB_LOCATION = 0xFE,
SIM_PB_LOCATION_SEARCH = 0xFF
};
enum pb_type {
SIM_PB_ADN = 0xC8
};
enum pb_tag {
SIM_PB_ANR = 0xCA,
SIM_PB_EMAIL = 0xDD,
SIM_PB_SNE = 0xF7
};
enum pb_status {
SIM_SERV_OK = 0x01,
SIM_SERV_NO_MATCH = 0x16
};
#include "isimodem.h"
#include "isiutil.h"
#include "sim.h"
#include "debug.h"
struct pb_data {
GIsiClient *client;

View File

@ -38,40 +38,17 @@
#include <ofono/log.h>
#include <ofono/modem.h>
#include <ofono/sim.h>
#include "isi.h"
#include "simutil.h"
#define PN_SIM 0x09
#define SIM_TIMEOUT 5
#define SIM_MAX_IMSI_LENGTH 15
enum return_code {
SIM_SERV_OK = 0x01,
};
enum message_id {
SIM_IMSI_REQ_READ_IMSI = 0x1D,
SIM_IMSI_RESP_READ_IMSI = 0x1E,
SIM_SERV_PROV_NAME_REQ = 0x21,
SIM_SERV_PROV_NAME_RESP = 0x22
};
enum service_types {
SIM_ST_READ_SERV_PROV_NAME = 0x2C,
READ_IMSI = 0x2D,
};
#include "isimodem.h"
#include "isiutil.h"
#include "sim.h"
#include "debug.h"
struct sim_data {
GIsiClient *client;
};
static void sim_debug(const void *restrict buf, size_t len, void *data)
{
DBG("");
dump_msg(buf, len);
}
/* Returns fake (static) file info for EFSPN */
static gboolean efspn_file_info(gpointer user)
{

147
drivers/isimodem/sim.h Normal file
View File

@ -0,0 +1,147 @@
/*
* This file is part of oFono - Open Source Telephony
*
* Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* version 2 as published by the Free Software Foundation.
*
* This program 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
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA
*
*/
#ifndef __ISIMODEM_SIM_H
#define __ISIMODEM_SIM_H
#ifdef __cplusplus
extern "C" {
#endif
#define PN_SIM 0x09
#define SIM_TIMEOUT 5
#define SIM_MAX_IMSI_LENGTH 15
enum sim_isi_cause {
SIM_SERV_NOT_AVAIL = 0x00,
SIM_SERV_OK = 0x01,
SIM_SERV_PIN_VERIFY_REQUIRED = 0x02,
SIM_SERV_PIN_REQUIRED = 0x03,
SIM_SERV_SIM_BLOCKED = 0x04,
SIM_SERV_SIM_PERMANENTLY_BLOCKED = 0x05,
SIM_SERV_SIM_DISCONNECTED = 0x06,
SIM_SERV_SIM_REJECTED = 0x07,
SIM_SERV_LOCK_ACTIVE = 0x08,
SIM_SERV_AUTOLOCK_CLOSED = 0x09,
SIM_SERV_AUTOLOCK_ERROR = 0x0A,
SIM_SERV_INIT_OK = 0x0B,
SIM_SERV_INIT_NOT_OK = 0x0C,
SIM_SERV_WRONG_OLD_PIN = 0x0D,
SIM_SERV_PIN_DISABLED = 0x0E,
SIM_SERV_COMMUNICATION_ERROR = 0x0F,
SIM_SERV_UPDATE_IMPOSSIBLE = 0x10,
SIM_SERV_NO_SECRET_CODE_IN_SIM = 0x11,
SIM_SERV_PIN_ENABLE_OK = 0x12,
SIM_SERV_PIN_DISABLE_OK = 0x13,
SIM_SERV_WRONG_UNBLOCKING_KEY = 0x15,
SIM_SERV_ILLEGAL_NUMBER = 0x2E,
SIM_SERV_NOT_OK = 0x1C,
SIM_SERV_PN_LIST_ENABLE_OK = 0x1E,
SIM_SERV_PN_LIST_DISABLE_OK = 0x1F,
SIM_SERV_NO_PIN = 0x20,
SIM_SERV_PIN_VERIFY_OK = 0x21,
SIM_SERV_PIN_BLOCKED = 0x22,
SIM_SERV_PIN_PERM_BLOCKED = 0x23,
SIM_SERV_DATA_NOT_AVAIL = 0x24,
SIM_SERV_IN_HOME_ZONE = 0x25,
SIM_SERV_STATE_CHANGED = 0x27,
SIM_SERV_INF_NBR_READ_OK = 0x28,
SIM_SERV_INF_NBR_READ_NOT_OK = 0x29,
SIM_SERV_IMSI_EQUAL = 0x2A,
SIM_SERV_IMSI_NOT_EQUAL = 0x2B,
SIM_SERV_INVALID_LOCATION = 0x2C,
SIM_SERV_STA_SIM_REMOVED = 0x35,
SIM_SERV_SECOND_SIM_REMOVED_CS = 0x36,
SIM_SERV_CONNECTED_INDICATION_CS = 0x37,
SIM_SERV_SECOND_SIM_CONNECTED_CS = 0x38,
SIM_SERV_PIN_RIGHTS_LOST_IND_CS = 0x39,
SIM_SERV_PIN_RIGHTS_GRANTED_IND_CS = 0x3A,
SIM_SERV_INIT_OK_CS = 0x3B,
SIM_SERV_INIT_NOT_OK_CS = 0x3C,
SIM_FDN_ENABLED = 0x19,
SIM_FDN_DISABLED = 0x1A,
SIM_SERV_INVALID_FILE = 0x45,
SIM_SERV_DATA_AVAIL = 0x4F,
SIM_SERV_ICC_EQUAL = 0x49,
SIM_SERV_ICC_NOT_EQUAL = 0x4A,
SIM_SERV_SIM_NOT_INITIALISED = 0x4B,
SIM_SERV_SERVICE_NOT_AVAIL = 0x50,
SIM_SERV_FDN_STATUS_ERROR = 0x57,
SIM_SERV_FDN_CHECK_PASSED = 0x58,
SIM_SERV_FDN_CHECK_FAILED = 0x59,
SIM_SERV_FDN_CHECK_DISABLED = 0x5A,
SIM_SERV_FDN_CHECK_NO_FDN_SIM = 0x5B,
SIM_STA_ISIM_AVAILEBLE_PIN_REQUIRED = 0x5C,
SIM_STA_ISIM_AVAILEBLE = 0x5D,
SIM_STA_USIM_AVAILEBLE = 0x5E,
SIM_STA_SIM_AVAILEBLE = 0x5F,
SIM_STA_ISIM_NOT_INITIALIZED = 0x60,
SIM_STA_IMS_READY = 0x61,
SIM_STA_APP_DATA_READ_OK = 0x96,
SIM_STA_APP_ACTIVATE_OK = 0x97,
SIM_STA_APP_ACTIVATE_NOT_OK = 0x98,
SIM_SERV_NOT_DEFINED = 0xF9,
SIM_SERV_NOSERVICE = 0xFA,
SIM_SERV_NOTREADY = 0xFB,
SIM_SERV_ERROR = 0xFC,
SIM_SERV_CIPHERING_INDICATOR_DISPLAY_REQUIRED = 0x30,
SIM_SERV_CIPHERING_INDICATOR_DISPLAY_NOT_REQUIRED = 0x31,
SIM_SERV_FILE_NOT_AVAILABLE = 0x4D
};
enum sim_subblock {
SIM_PB_INFO_REQUEST = 0xE4,
SIM_PB_STATUS = 0xFB,
SIM_PB_LOCATION = 0xFE,
SIM_PB_LOCATION_SEARCH = 0xFF
};
enum sim_pb_type {
SIM_PB_ADN = 0xC8
};
enum sim_pb_tag {
SIM_PB_ANR = 0xCA,
SIM_PB_EMAIL = 0xDD,
SIM_PB_SNE = 0xF7
};
enum sim_message_id {
SIM_IMSI_REQ_READ_IMSI = 0x1D,
SIM_IMSI_RESP_READ_IMSI = 0x1E,
SIM_SERV_PROV_NAME_REQ = 0x21,
SIM_SERV_PROV_NAME_RESP = 0x22,
SIM_PB_REQ_SIM_PB_READ = 0xDC,
SIM_PB_RESP_SIM_PB_READ = 0xDD,
SIM_COMMON_MESSAGE = 0xF0
};
enum sim_service_type {
SIM_ST_READ_SERV_PROV_NAME = 0x2C,
SIM_PB_READ = 0x0F,
READ_IMSI = 0x2D
};
#ifdef __cplusplus
};
#endif
#endif /* __ISIMODEM_SIM_H */

View File

@ -39,82 +39,15 @@
#include <ofono/modem.h>
#include <ofono/sms.h>
#include "isi.h"
#define PN_SMS 0x02
#define SMS_TIMEOUT 5
#include "isimodem.h"
#include "isiutil.h"
#include "sms.h"
#include "debug.h"
struct sms_data {
GIsiClient *client;
struct isi_version version;
};
enum message_id {
SMS_MESSAGE_SEND_REQ = 0x02,
SMS_MESSAGE_SEND_RESP = 0x03,
SMS_PP_ROUTING_REQ = 0x06,
SMS_PP_ROUTING_RESP = 0x07,
SMS_PP_ROUTING_NTF = 0x08
};
enum sub_block_id {
SMS_GSM_DELIVER = 0x00,
SMS_GSM_STATUS_REPORT = 0x01,
SMS_GSM_SUBMIT = 0x02,
SMS_GSM_COMMAND = 0x03,
SMS_GSM_ROUTING = 0x0D
};
enum routing_command {
SMS_ROUTING_RELEASE = 0x00,
SMS_ROUTING_SET = 0x01,
SMS_ROUTING_SUSPEND = 0x02,
SMS_ROUTING_RESUME = 0x03,
SMS_ROUTING_UPDATE = 0x04
};
enum routing_mode {
SMS_GSM_ROUTING_MODE_ALL = 0x0B
};
enum routing_type {
SMS_GSM_TPDU_ROUTING = 0x06
};
enum message_type {
SMS_GSM_MT_ALL_TYPE = 0x06
};
enum route_preference {
SMS_ROUTE_GPRS_PREF = 0x00,
SMS_ROUTE_CS = 0x01,
SMS_ROUTE_GPRS = 0x02,
SMS_ROUTE_CS_PREF = 0x03,
SMS_ROUTE_DEFAULT = 0x04
};
enum sender_type {
SMS_SENDER_ANY = 0x00,
SMS_SENDER_SIM_ATK = 0x01
};
enum content_type {
SMS_TYPE_DEFAULT = 0x00,
SMS_TYPE_TEXT_MESSAGE = 0x01
};
enum cause {
SMS_OK = 0x00,
SMS_ERR_ROUTING_RELEASED = 0x01,
SMS_ERR_INVALID_PARAMETER = 0x02
};
static void sms_debug(const void *restrict buf, size_t len, void *data)
{
DBG("");
dump_msg(buf, len);
}
static void isi_sca_query(struct ofono_sms *sms, ofono_sms_sca_query_cb_t cb,
void *data)
{

180
drivers/isimodem/sms.h Normal file
View File

@ -0,0 +1,180 @@
/*
* This file is part of oFono - Open Source Telephony
*
* Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* version 2 as published by the Free Software Foundation.
*
* This program 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
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA
*
*/
#ifndef __ISIMODEM_SMS_H
#define __ISIMODEM_SMS_H
#ifdef __cplusplus
extern "C" {
#endif
#define PN_SMS 0x02
#define CBS_TIMEOUT 5
#define SMS_TIMEOUT 5
enum sms_isi_cause {
SMS_OK = 0x00,
SMS_ERR_ROUTING_RELEASED = 0x01,
SMS_ERR_INVALID_PARAMETER = 0x02,
SMS_ERR_DEVICE_FAILURE = 0x03,
SMS_ERR_PP_RESERVED = 0x04,
SMS_ERR_ROUTE_NOT_AVAILABLE = 0x05,
SMS_ERR_ROUTE_NOT_ALLOWED = 0x06,
SMS_ERR_SERVICE_RESERVED = 0x07,
SMS_ERR_INVALID_LOCATION = 0x08,
SMS_ERR_NO_SIM = 0x09,
SMS_ERR_SIM_NOT_READY = 0x0A,
SMS_ERR_NO_NETW_RESPONSE = 0x0B,
SMS_ERR_DEST_ADDR_FDN_RESTRICTED = 0x0C,
SMS_ERR_SMSC_ADDR_FDN_RESTRICTED = 0x0D,
SMS_ERR_RESEND_ALREADY_DONE = 0x0E,
SMS_ERR_SMSC_ADDR_NOT_AVAILABLE = 0x0F,
SMS_ERR_ROUTING_FAILED = 0x10,
SMS_ERR_CS_INACTIVE = 0x11,
SMS_ERR_SAT_MO_CONTROL_MODIFIED = 0x12,
SMS_ERR_SAT_MO_CONTROL_REJECT = 0x13,
SMS_ERR_TRACFONE_FAILED = 0x14
};
enum sms_gsm_cause {
SMS_GSM_ERR_UNASSIGNED_NUMBER = 0x01,
SMS_GSM_ERR_OPER_DETERMINED_BARR = 0x08,
SMS_GSM_ERR_CALL_BARRED = 0x0A,
SMS_GSM_ERR_RESERVED = 0x0B,
SMS_GSM_ERR_MSG_TRANSFER_REJ = 0x15,
SMS_GSM_ERR_MEMORY_CAPACITY_EXC = 0x16,
SMS_GSM_ERR_DEST_OUT_OF_ORDER = 0x1B,
SMS_GSM_ERR_UNDEFINED_SUBSCRIBER = 0x1C,
SMS_GSM_ERR_FACILITY_REJECTED = 0x1D,
SMS_GSM_ERR_UNKNOWN_SUBSCRIBER = 0x1E,
SMS_GSM_ERR_NETW_OUT_OF_ORDER = 0x26,
SMS_GSM_ERR_TEMPORARY_FAILURE = 0x29,
SMS_GSM_ERR_CONGESTION = 0x2A,
SMS_GSM_ERR_RESOURCE_UNAVAILABLE = 0x2F,
SMS_GSM_ERR_REQ_FACILITY_NOT_SUB = 0x32,
SMS_GSM_ERR_REQ_FACILITY_NOT_IMP = 0x45,
SMS_GSM_ERR_INVALID_REFERENCE = 0x51,
SMS_GSM_ERR_INCORRECT_MESSAGE = 0x5F,
SMS_GSM_ERR_INVALID_MAND_INFO = 0x60,
SMS_GSM_ERR_INVALID_MSG_TYPE = 0x61,
SMS_GSM_ERR_MSG_NOT_COMP_WITH_ST = 0x62,
SMS_GSM_ERR_INVALID_INFO_ELEMENT = 0x63,
SMS_GSM_ERR_PROTOCOL_ERROR = 0x6F,
SMS_GSM_ERR_INTERWORKING = 0x7F,
SMS_GSM_ERR_NO_CAUSE = 0x80,
SMS_GSM_ERR_IMSI_UNKNOWN_HLR = 0x82,
SMS_GSM_ERR_ILLEGAL_MS = 0x83,
SMS_GSM_ERR_IMSI_UNKNOWN_VLR = 0x84,
SMS_GSM_ERR_IMEI_NOT_ACCEPTED = 0x85,
SMS_GSM_ERR_ILLEGAL_ME = 0x86,
SMS_GSM_ERR_PLMN_NOT_ALLOWED = 0x8B,
SMS_GSM_ERR_LA_NOT_ALLOWED = 0x8C,
SMS_GSM_ERR_ROAM_NOT_ALLOWED_LA = 0x8D,
SMS_GSM_ERR_NO_SUITABLE_CELLS_LA = 0x8F,
SMS_GSM_ERR_NETWORK_FAILURE = 0x91,
SMS_GSM_ERR_MAC_FAILURE = 0x94,
SMS_GSM_ERR_SYNC_FAILURE = 0x95,
SMS_GSM_ERR_LOW_LAYER_CONGESTION = 0x96,
SMS_GSM_ERR_AUTH_UNACCEPTABLE = 0x97,
SMS_GSM_ERR_SERV_OPT_NOT_SUPPORTED = 0xA0,
SMS_GSM_ERR_SERV_OPT_NOT_SUBSCRIBED = 0xA1,
SMS_GSM_ERR_SERV_OPT_TEMP_OUT_OF_ORDER = 0xA2,
SMS_GSM_ERR_CALL_CANNOT_BE_IDENTIFIED = 0xA6,
SMS_GSM_ERR_SEMANTICALLY_INCORR_MSG = 0xDF,
SMS_GSM_ERR_LOW_LAYER_INVALID_MAND_INFO = 0xE0,
SMS_GSM_ERR_LOW_LAYER_INVALID_MSG_TYPE = 0xE1,
SMS_GSM_ERR_LOW_LAYER_MSG_TYPE_NOT_COMP_WITH_ST = 0xE2,
SMS_GSM_ERR_LOW_LAYER_INVALID_INFO_ELEMENT = 0xE3,
SMS_GSM_ERR_CONDITIONAL_IE_ERROR = 0xE4,
SMS_GSM_ERR_LOW_LAYER_MSG_NOT_COMP_WITH_ST = 0xE5,
SMS_GSM_ERR_CS_BARRED = 0xE8,
SMS_GSM_ERR_LOW_LAYER_PROTOCOL_ERROR = 0xEF
};
enum sms_message_id {
SMS_MESSAGE_SEND_REQ = 0x02,
SMS_MESSAGE_SEND_RESP = 0x03,
SMS_PP_ROUTING_REQ = 0x06,
SMS_PP_ROUTING_RESP = 0x07,
SMS_PP_ROUTING_NTF = 0x08,
SMS_GSM_CB_ROUTING_REQ = 0x0B,
SMS_GSM_CB_ROUTING_RESP = 0x0C,
SMS_GSM_CB_ROUTING_NTF = 0x0D,
SMS_COMMON_MESSAGE = 0xF0
};
enum sms_subblock {
SMS_GSM_DELIVER = 0x00,
SMS_GSM_STATUS_REPORT = 0x01,
SMS_GSM_SUBMIT = 0x02,
SMS_GSM_COMMAND = 0x03,
SMS_GSM_ROUTING = 0x0D
};
enum sms_routing_command {
SMS_ROUTING_RELEASE = 0x00,
SMS_ROUTING_SET = 0x01,
SMS_ROUTING_SUSPEND = 0x02,
SMS_ROUTING_RESUME = 0x03,
SMS_ROUTING_UPDATE = 0x04
};
enum sms_route_preference {
SMS_ROUTE_GPRS_PREF = 0x00,
SMS_ROUTE_CS = 0x01,
SMS_ROUTE_GPRS = 0x02,
SMS_ROUTE_CS_PREF = 0x03,
SMS_ROUTE_DEFAULT = 0x04
};
enum sms_routing_mode {
SMS_GSM_ROUTING_MODE_ALL = 0x0B,
SMS_GSM_ROUTING_MODE_CB_DDL = 0x0C
};
enum sms_routing_type {
SMS_GSM_TPDU_ROUTING = 0x06
};
enum sms_message_type {
SMS_GSM_MT_ALL_TYPE = 0x06
};
enum sms_sender_type {
SMS_SENDER_ANY = 0x00,
SMS_SENDER_SIM_ATK = 0x01
};
enum sms_content_type {
SMS_TYPE_DEFAULT = 0x00,
SMS_TYPE_TEXT_MESSAGE = 0x01
};
enum sms_subject_list_type {
SMS_CB_ALLOWED_IDS_LIST = 0x00,
SMS_CB_NOT_ALLOWED_IDS_LIST = 0x01
};
#ifdef __cplusplus
};
#endif
#endif /* __ISIMODEM_SMS_H */

View File

@ -24,13 +24,14 @@
#ifndef __ISIMODEM_SS_H
#define __ISIMODEM_SS_H
#define PN_SS 0x06
#define SS_TIMEOUT 15
#define PN_SS 0x06
#define SS_TIMEOUT 15
enum ss_message_id {
SS_SERVICE_REQ = 0x00,
SS_SERVICE_COMPLETED_RESP = 0x01,
SS_SERVICE_FAILED_RESP = 0x02
SS_SERVICE_FAILED_RESP = 0x02,
SS_COMMON_MESSAGE = 0xF0
};
enum ss_operations {
@ -80,7 +81,7 @@ enum ss_response_data {
SS_SEND_ADDITIONAL_INFO = 0x01
};
enum ss_sub_block_id {
enum ss_subblock {
SS_FORWARDING = 0x00,
SS_STATUS_RESULT = 0x01,
SS_GSM_PASSWORD = 0x03,
@ -94,7 +95,7 @@ enum ss_sub_block_id {
SS_GSM_ADDITIONAL_INFO = 0x2F
};
enum ss_status_codes {
enum ss_isi_cause {
SS_GSM_ACTIVE = 0x01,
SS_GSM_REGISTERED = 0x02,
SS_GSM_PROVISIONED = 0x04,

View File

@ -42,8 +42,10 @@
#include <ofono/modem.h>
#include <ofono/voicecall.h>
#include "isi.h"
#include "isi-call.h"
#include "isimodem.h"
#include "isiutil.h"
#include "call.h"
#include "debug.h"
struct isi_call {
uint8_t id, call_id, status, mode, mode_info, cause_type, cause;