mirror of git://git.sysmocom.de/ofono
Fix multi-line comment style issues
This commit is contained in:
parent
348a891665
commit
4196182770
|
@ -426,7 +426,8 @@ static gboolean cb_ss_control(int type, const char *sc,
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
/* According to 27.007, AG, AC and AB only work with mode = 0
|
||||
/*
|
||||
* According to 27.007, AG, AC and AB only work with mode = 0
|
||||
* We support query by querying all relevant types, since we must
|
||||
* do this for the deactivation case anyway
|
||||
*/
|
||||
|
@ -738,7 +739,8 @@ static void set_lock_callback(const struct ofono_error *error, void *data)
|
|||
return;
|
||||
}
|
||||
|
||||
/* If we successfully set the value, we must query it back
|
||||
/*
|
||||
* If we successfully set the value, we must query it back
|
||||
* Call Barring is a special case, since according to 22.088 2.2.1:
|
||||
* "The PLMN will ensure that only one of the barring programs is
|
||||
* active per basic service group. The activation of one specific
|
||||
|
@ -785,7 +787,8 @@ static gboolean cb_lock_property_lookup(const char *property, const char *value,
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
/* Gah, this is a special case. If we're setting a barring to
|
||||
/*
|
||||
* Gah, this is a special case. If we're setting a barring to
|
||||
* disabled, then generate a disable all outgoing/incoming
|
||||
* request for a particular basic service
|
||||
*/
|
||||
|
|
|
@ -144,7 +144,8 @@ static GSList *cf_cond_list_create(int total,
|
|||
int j;
|
||||
struct ofono_call_forwarding_condition *cond;
|
||||
|
||||
/* Specification is not really clear how the results are reported,
|
||||
/*
|
||||
* Specification is not really clear how the results are reported,
|
||||
* so assume both multiple list items & compound values of class
|
||||
* are possible
|
||||
*/
|
||||
|
@ -219,7 +220,8 @@ static void set_new_cond_list(struct ofono_call_forwarding *cf,
|
|||
for (l = list; l; l = l->next) {
|
||||
lc = l->data;
|
||||
|
||||
/* New condition lists might have attributes we don't care about
|
||||
/*
|
||||
* New condition lists might have attributes we don't care about
|
||||
* triggered by e.g. ss control magic strings just skip them
|
||||
* here. For now we only support Voice, although Fax & all Data
|
||||
* basic services are applicable as well.
|
||||
|
@ -457,7 +459,8 @@ static gboolean cf_condition_enabled_property(struct ofono_call_forwarding *cf,
|
|||
if (strncmp(property, prefix, len))
|
||||
continue;
|
||||
|
||||
/* We check the 4 call forwarding types, e.g.
|
||||
/*
|
||||
* We check the 4 call forwarding types, e.g.
|
||||
* unconditional, busy, no reply, not reachable
|
||||
*/
|
||||
for (j = 0; j < 4; j++)
|
||||
|
@ -928,7 +931,8 @@ static gboolean cf_ss_control(int type, const char *sc,
|
|||
type == SS_CONTROL_TYPE_DEACTIVATION))
|
||||
goto error;
|
||||
|
||||
/* Activation / Registration is figured context specific according to
|
||||
/*
|
||||
* Activation / Registration is figured context specific according to
|
||||
* 22.030 Section 6.5.2 "The UE shall determine from the context
|
||||
* whether, an entry of a single *, activation or registration
|
||||
* was intended."
|
||||
|
@ -1030,7 +1034,8 @@ static gboolean cf_ss_control(int type, const char *sc,
|
|||
break;
|
||||
}
|
||||
|
||||
/* Some modems don't understand all classes very well, particularly
|
||||
/*
|
||||
* Some modems don't understand all classes very well, particularly
|
||||
* the older models. So if the bearer class is the default, we
|
||||
* just use the more commonly understood value of 7 since BEARER_SMS
|
||||
* is not applicable to CallForwarding conditions according to 22.004
|
||||
|
|
|
@ -292,7 +292,8 @@ static DBusMessage *cm_get_properties(DBusConnection *conn, DBusMessage *msg,
|
|||
|
||||
cm->pending = dbus_message_ref(msg);
|
||||
|
||||
/* We don't need to query ppu, currency & acm_max every time
|
||||
/*
|
||||
* We don't need to query ppu, currency & acm_max every time
|
||||
* Not sure if we have to query acm & call_meter every time
|
||||
* so lets play on the safe side and query them. They should be
|
||||
* fast to query anyway
|
||||
|
@ -406,7 +407,8 @@ static void set_puct_callback(const struct ofono_error *error, void *data)
|
|||
cm->driver->puct_query(cm, set_puct_query_callback, cm);
|
||||
}
|
||||
|
||||
/* This function is for the really bizarre case of someone trying to call
|
||||
/*
|
||||
* This function is for the really bizarre case of someone trying to call
|
||||
* SetProperty before GetProperties. But we must handle it...
|
||||
*/
|
||||
static void set_puct_initial_query_callback(const struct ofono_error *error,
|
||||
|
|
|
@ -462,7 +462,8 @@ static gboolean cw_ss_control(int type,
|
|||
|
||||
case SS_CONTROL_TYPE_QUERY:
|
||||
cs->ss_req_type = SS_CONTROL_TYPE_QUERY;
|
||||
/* Always query the entire set, SMS not applicable
|
||||
/*
|
||||
* Always query the entire set, SMS not applicable
|
||||
* according to 22.004 Appendix A, so CLASS_DEFAULT
|
||||
* is safe to use here
|
||||
*/
|
||||
|
|
15
src/cbs.c
15
src/cbs.c
|
@ -249,7 +249,8 @@ void ofono_cbs_notify(struct ofono_cbs *cbs, const unsigned char *pdu,
|
|||
goto out;
|
||||
}
|
||||
|
||||
/* 3GPP 23.041: NOTE 5: Code 00 is intended for use by the
|
||||
/*
|
||||
* 3GPP 23.041: NOTE 5: Code 00 is intended for use by the
|
||||
* network operators for base station IDs.
|
||||
*/
|
||||
if (c.gs == CBS_GEO_SCOPE_CELL_IMMEDIATE) {
|
||||
|
@ -888,8 +889,10 @@ static void cbs_got_imsi(struct ofono_cbs *cbs)
|
|||
if (topics_str)
|
||||
cbs->topics = cbs_extract_topic_ranges(topics_str);
|
||||
|
||||
/* If stored value is invalid or no stored value, bootstrap
|
||||
* topics list from SIM contents */
|
||||
/*
|
||||
* If stored value is invalid or no stored value, bootstrap
|
||||
* topics list from SIM contents
|
||||
*/
|
||||
if (topics_str == NULL ||
|
||||
(cbs->topics == NULL && topics_str[0] != '\0')) {
|
||||
ofono_sim_read(cbs->sim, SIM_EFCBMI_FILEID,
|
||||
|
@ -972,7 +975,8 @@ static void cbs_location_changed(int status, int lac, int ci, int tech,
|
|||
out:
|
||||
DBG("%d, %d, %d", plmn_changed, lac_changed, ci_changed);
|
||||
|
||||
/* In order to minimize signal transmissions we wait about X seconds
|
||||
/*
|
||||
* In order to minimize signal transmissions we wait about X seconds
|
||||
* before reseting the base station id. The hope is that we receive
|
||||
* another cell broadcast with the new base station name within
|
||||
* that time
|
||||
|
@ -1018,7 +1022,8 @@ static void netreg_watch(struct ofono_atom *atom,
|
|||
cbs->lac = ofono_netreg_get_location(cbs->netreg);
|
||||
cbs->ci = ofono_netreg_get_cellid(cbs->netreg);
|
||||
|
||||
/* Clear out the cbs assembly just in case, worst case
|
||||
/*
|
||||
* Clear out the cbs assembly just in case, worst case
|
||||
* we will receive the cell broadcasts again
|
||||
*/
|
||||
cbs_assembly_location_changed(cbs->assembly, TRUE, TRUE, TRUE);
|
||||
|
|
15
src/common.c
15
src/common.c
|
@ -38,7 +38,8 @@ struct error_entry {
|
|||
const char *str;
|
||||
};
|
||||
|
||||
/* 0-127 from 24.011 Annex E2
|
||||
/*
|
||||
* 0-127 from 24.011 Annex E2
|
||||
* 127-255 23.040 Section 9.2.3.22
|
||||
* Rest are from 27.005 Section 3.2.5
|
||||
*/
|
||||
|
@ -295,7 +296,8 @@ int mmi_service_code_to_bearer_class(int code)
|
|||
{
|
||||
int cls = 0;
|
||||
|
||||
/* Teleservices according to 22.004
|
||||
/*
|
||||
* Teleservices according to 22.004
|
||||
* 1 - Voice
|
||||
* 2 - SMS
|
||||
* 3,4,5 - Unallocated
|
||||
|
@ -398,7 +400,8 @@ int valid_ussd_string(const char *str)
|
|||
if (!len)
|
||||
return FALSE;
|
||||
|
||||
/* It is hard to understand exactly what constitutes a valid USSD string
|
||||
/*
|
||||
* It is hard to understand exactly what constitutes a valid USSD string
|
||||
* According to 22.090:
|
||||
* Case a - 1, 2 or 3 digits from the set (*, #) followed by 1X(Y),
|
||||
* where X=any number 0‑4, Y=any number 0‑9, then, optionally "*
|
||||
|
@ -460,7 +463,8 @@ const char *ss_control_type_to_string(enum ss_control_type type)
|
|||
} \
|
||||
} while (0) \
|
||||
|
||||
/* Note: The str will be modified, so in case of error you should
|
||||
/*
|
||||
* Note: The str will be modified, so in case of error you should
|
||||
* throw it away and start over
|
||||
*/
|
||||
gboolean parse_ss_control_string(char *str, int *ss_type,
|
||||
|
@ -519,7 +523,8 @@ gboolean parse_ss_control_string(char *str, int *ss_type,
|
|||
|
||||
NEXT_FIELD(c, *sc);
|
||||
|
||||
/* According to 22.030 SC is 2 or 3 digits, there can be
|
||||
/*
|
||||
* According to 22.030 SC is 2 or 3 digits, there can be
|
||||
* an optional digit 'n' if this is a call setup string,
|
||||
* however 22.030 does not define any SC of length 3
|
||||
* with an 'n' present
|
||||
|
|
|
@ -465,7 +465,8 @@ static void pri_activate_callback(const struct ofono_error *error,
|
|||
__ofono_dbus_pending_reply(&gc->pending,
|
||||
dbus_message_new_method_return(gc->pending));
|
||||
|
||||
/* If we don't have the interface, don't bother emitting any settings,
|
||||
/*
|
||||
* If we don't have the interface, don't bother emitting any settings,
|
||||
* as nobody can make use of them
|
||||
*/
|
||||
if (interface != NULL)
|
||||
|
@ -1913,8 +1914,10 @@ static gboolean load_context(struct ofono_gprs *gprs, const char *group)
|
|||
if (strlen(apn) > OFONO_GPRS_MAX_APN_LENGTH)
|
||||
goto error;
|
||||
|
||||
/* Accept empty (just created) APNs, but don't allow other
|
||||
* invalid ones */
|
||||
/*
|
||||
* Accept empty (just created) APNs, but don't allow other
|
||||
* invalid ones
|
||||
*/
|
||||
if (apn[0] != '\0' && is_valid_apn(apn) == FALSE)
|
||||
goto error;
|
||||
|
||||
|
|
|
@ -255,8 +255,10 @@ static void mbdn_set_cb(int ok, void *data)
|
|||
&number);
|
||||
}
|
||||
|
||||
/* Make a single attempt at keeping the CPHS version of the file
|
||||
* in sync. */
|
||||
/*
|
||||
* Make a single attempt at keeping the CPHS version of the file
|
||||
* in sync.
|
||||
*/
|
||||
if (req->cphs == FALSE)
|
||||
set_cphs_mbdn(req->mw, TRUE, req->mailbox,
|
||||
phone_number_to_string(&req->number), NULL);
|
||||
|
@ -274,7 +276,7 @@ static DBusMessage *set_mbdn(struct ofono_message_waiting *mw, int mailbox,
|
|||
struct mbdn_set_request *req;
|
||||
unsigned char efmbdn[255];
|
||||
|
||||
/*
|
||||
/*
|
||||
* If we have no 3GPP EFmbdn on the card, maybe the
|
||||
* CPHS version is available
|
||||
*/
|
||||
|
@ -727,10 +729,12 @@ static void handle_special_sms_iei(struct ofono_message_waiting *mw,
|
|||
if (type == (SMS_MWI_TYPE_OTHER | 4))
|
||||
type = SMS_MWI_TYPE_VIDEO;
|
||||
else
|
||||
/* 23.040 9.2.3.24.2: "Terminals should be capable of
|
||||
/*
|
||||
* 23.040 9.2.3.24.2: "Terminals should be capable of
|
||||
* receiving any values in octet 1, even including
|
||||
* those marked as Reserved." Treat Reserved as
|
||||
* "Other". */
|
||||
* "Other".
|
||||
*/
|
||||
type = SMS_MWI_TYPE_OTHER;
|
||||
}
|
||||
|
||||
|
@ -819,7 +823,8 @@ void __ofono_message_waiting_mwi(struct ofono_message_waiting *mw,
|
|||
if (out_discard)
|
||||
*out_discard = FALSE;
|
||||
|
||||
/* Check MWI types in the order from highest priority to lowest
|
||||
/*
|
||||
* Check MWI types in the order from highest priority to lowest
|
||||
* because they must override one another.
|
||||
*/
|
||||
|
||||
|
@ -880,7 +885,8 @@ void __ofono_message_waiting_mwi(struct ofono_message_waiting *mw,
|
|||
}
|
||||
|
||||
if (iei_found) {
|
||||
/* 23.040 9.2.3.24.2 says "In the event of a
|
||||
/*
|
||||
* 23.040 9.2.3.24.2 says "In the event of a
|
||||
* conflict between this setting and the setting
|
||||
* of the Data Coding Scheme (see 3GPP TS 23.038 [9])
|
||||
* then the message shall be stored if either the DCS
|
||||
|
|
|
@ -346,9 +346,11 @@ static char *get_operator_display_name(struct ofono_netreg *netreg)
|
|||
int len = sizeof(name);
|
||||
int home_or_spdi;
|
||||
|
||||
/* The name displayed to user depends on whether we're in a home
|
||||
/*
|
||||
* The name displayed to user depends on whether we're in a home
|
||||
* PLMN or roaming and on configuration bits from the SIM, all
|
||||
* together there are four cases to consider. */
|
||||
* together there are four cases to consider.
|
||||
*/
|
||||
|
||||
if (!opd) {
|
||||
g_strlcpy(name, "", len);
|
||||
|
@ -415,7 +417,8 @@ static void set_network_operator_name(struct network_operator_data *opd,
|
|||
strncpy(opd->name, name, OFONO_MAX_OPERATOR_NAME_LENGTH);
|
||||
opd->name[OFONO_MAX_OPERATOR_NAME_LENGTH] = '\0';
|
||||
|
||||
/* If we have Enhanced Operator Name info on the SIM, we always use
|
||||
/*
|
||||
* If we have Enhanced Operator Name info on the SIM, we always use
|
||||
* that, so do not need to emit the signal here
|
||||
*/
|
||||
if (opd->eons_info && opd->eons_info->longname)
|
||||
|
@ -896,7 +899,8 @@ static void append_operator_struct_list(struct ofono_netreg *netreg,
|
|||
return;
|
||||
}
|
||||
|
||||
/* Quoting 27.007: "The list of operators shall be in order: home
|
||||
/*
|
||||
* Quoting 27.007: "The list of operators shall be in order: home
|
||||
* network, networks referenced in SIM or active application in the
|
||||
* UICC (GSM or USIM) in the following order: HPLMN selector, User
|
||||
* controlled PLMN selector, Operator controlled PLMN selector and
|
||||
|
@ -1108,8 +1112,10 @@ void __ofono_netreg_set_base_station_name(struct ofono_netreg *netreg,
|
|||
if (name == NULL) {
|
||||
netreg->base_station = NULL;
|
||||
|
||||
/* We just got unregistered, set name to NULL
|
||||
* but don't emit signal */
|
||||
/*
|
||||
* We just got unregistered, set name to NULL
|
||||
* but don't emit signal
|
||||
*/
|
||||
if (netreg->current_operator == NULL)
|
||||
return;
|
||||
} else {
|
||||
|
@ -1365,7 +1371,8 @@ static void init_registration_status(const struct ofono_error *error,
|
|||
|
||||
ofono_netreg_status_notify(netreg, status, lac, ci, tech);
|
||||
|
||||
/* Bootstrap our signal strength value without waiting for the
|
||||
/*
|
||||
* Bootstrap our signal strength value without waiting for the
|
||||
* stack to report it
|
||||
*/
|
||||
if (netreg->status == NETWORK_REGISTRATION_STATUS_REGISTERED ||
|
||||
|
@ -1392,7 +1399,8 @@ void ofono_netreg_strength_notify(struct ofono_netreg *netreg, int strength)
|
|||
if (netreg->signal_strength == strength)
|
||||
return;
|
||||
|
||||
/* Theoretically we can get signal strength even when not registered
|
||||
/*
|
||||
* Theoretically we can get signal strength even when not registered
|
||||
* to any network. However, what do we do with it in that case?
|
||||
*/
|
||||
if (netreg->status != NETWORK_REGISTRATION_STATUS_REGISTERED &&
|
||||
|
@ -1474,10 +1482,12 @@ static void sim_pnn_read_cb(int ok, int length, int record,
|
|||
return;
|
||||
|
||||
check:
|
||||
/* If PNN is not present then OPL is not useful, don't
|
||||
/*
|
||||
* If PNN is not present then OPL is not useful, don't
|
||||
* retrieve it. If OPL is not there then PNN[1] will
|
||||
* still be used for the HPLMN and/or EHPLMN, if PNN
|
||||
* is present. */
|
||||
* is present.
|
||||
*/
|
||||
if (netreg->eons && !sim_eons_pnn_is_empty(netreg->eons))
|
||||
ofono_sim_read(netreg->sim, SIM_EFOPL_FILEID,
|
||||
OFONO_SIM_FILE_STRUCTURE_FIXED,
|
||||
|
@ -1530,7 +1540,8 @@ static void sim_spn_read_cb(int ok, int length, int record,
|
|||
|
||||
dcbyte = data[0];
|
||||
|
||||
/* TS 31.102 says:
|
||||
/*
|
||||
* TS 31.102 says:
|
||||
*
|
||||
* the string shall use:
|
||||
*
|
||||
|
|
|
@ -105,8 +105,9 @@ static void vcard_printf(GString *str, const char *fmt, ...)
|
|||
g_string_append(str, "\r\n");
|
||||
}
|
||||
|
||||
/* According to RFC 2426, we need escape following characters:
|
||||
* '\n', '\r', ';', ',', '\'.
|
||||
/*
|
||||
* According to RFC 2426, we need escape following characters:
|
||||
* '\n', '\r', ';', ',', '\'.
|
||||
*/
|
||||
static void add_slash(char *dest, const char *src, int len_max, int len)
|
||||
{
|
||||
|
|
18
src/sim.c
18
src/sim.c
|
@ -582,7 +582,8 @@ static DBusMessage *sim_lock_or_unlock(struct ofono_sim *sim, int lock,
|
|||
|
||||
type = sim_string_to_passwd(typestr);
|
||||
|
||||
/* SIM PIN2 cannot be locked / unlocked according to 27.007,
|
||||
/*
|
||||
* SIM PIN2 cannot be locked / unlocked according to 27.007,
|
||||
* however the PIN combination can be changed
|
||||
*/
|
||||
if (password_is_pin(type) == FALSE ||
|
||||
|
@ -1283,7 +1284,8 @@ static gboolean sim_efli_format(const unsigned char *ef, int length)
|
|||
if (ef[i] == 0xff && ef[i+1] == 0xff)
|
||||
continue;
|
||||
|
||||
/* ISO 639 country codes are each two lower-case SMS 7-bit
|
||||
/*
|
||||
* ISO 639 country codes are each two lower-case SMS 7-bit
|
||||
* characters while CB DCS language codes are in ranges
|
||||
* (0 - 15) or (32 - 47), so the ranges don't overlap
|
||||
*/
|
||||
|
@ -1306,7 +1308,8 @@ static GSList *parse_language_list(const unsigned char *ef, int length)
|
|||
if (ef[i] > 0x7f || ef[i+1] > 0x7f)
|
||||
continue;
|
||||
|
||||
/* ISO 639 codes contain only characters that are coded
|
||||
/*
|
||||
* ISO 639 codes contain only characters that are coded
|
||||
* identically in SMS 7 bit charset, ASCII or UTF8 so
|
||||
* no conversion.
|
||||
*/
|
||||
|
@ -1395,7 +1398,8 @@ skip_efpl:
|
|||
efli = parse_eflp(sim->efli, sim->efli_length);
|
||||
}
|
||||
|
||||
/* If efli_format is TRUE, make a list of languages in both files in
|
||||
/*
|
||||
* If efli_format is TRUE, make a list of languages in both files in
|
||||
* order of preference following TS 31.102.
|
||||
* Quoting 31.102 Section 5.1.1.2:
|
||||
* The preferred language selection shall always use the EFLI in
|
||||
|
@ -1466,7 +1470,8 @@ static void sim_iccid_read_cb(int ok, int length, int record,
|
|||
|
||||
static void sim_initialize(struct ofono_sim *sim)
|
||||
{
|
||||
/* Perform SIM initialization according to 3GPP 31.102 Section 5.1.1.2
|
||||
/*
|
||||
* Perform SIM initialization according to 3GPP 31.102 Section 5.1.1.2
|
||||
* The assumption here is that if sim manager is being initialized,
|
||||
* then sim commands are implemented, and the sim manager is then
|
||||
* responsible for checking the PIN, reading the IMSI and signaling
|
||||
|
@ -1498,7 +1503,8 @@ static void sim_initialize(struct ofono_sim *sim)
|
|||
|
||||
/* EFecc is read by the voicecall atom */
|
||||
|
||||
/* According to 31.102 the EFli is read first and EFpl is then
|
||||
/*
|
||||
* According to 31.102 the EFli is read first and EFpl is then
|
||||
* only read if none of the EFli languages are supported by user
|
||||
* interface. 51.011 mandates the exact opposite, making EFpl/EFelp
|
||||
* preferred over EFlp (same EFid as EFli, different format).
|
||||
|
|
|
@ -579,8 +579,10 @@ gboolean ber_tlv_builder_next(struct ber_tlv_builder *builder,
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
/* Resize the TLV because the content of Value field needs more space. If
|
||||
* this TLV is part of another TLV, resize that one too. */
|
||||
/*
|
||||
* Resize the TLV because the content of Value field needs more space.
|
||||
* If this TLV is part of another TLV, resize that one too.
|
||||
*/
|
||||
gboolean ber_tlv_builder_set_length(struct ber_tlv_builder *builder,
|
||||
unsigned int new_len)
|
||||
{
|
||||
|
@ -709,8 +711,10 @@ gboolean comprehension_tlv_builder_next(
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
/* Resize the TLV because the content of Value field needs more space. If
|
||||
* this TLV is part of another TLV, resize that one too. */
|
||||
/*
|
||||
* Resize the TLV because the content of Value field needs more space.
|
||||
* If this TLV is part of another TLV, resize that one too.
|
||||
*/
|
||||
gboolean comprehension_tlv_builder_set_length(
|
||||
struct comprehension_tlv_builder *builder,
|
||||
unsigned int new_len)
|
||||
|
@ -781,8 +785,10 @@ static char *sim_network_name_parse(const unsigned char *buffer, int length,
|
|||
dcs = *buffer++;
|
||||
length--;
|
||||
|
||||
/* "The MS should add the letters for the Country's Initials and a
|
||||
* separator (e.g. a space)" */
|
||||
/*
|
||||
* "The MS should add the letters for the Country's Initials and a
|
||||
* separator (e.g. a space)"
|
||||
*/
|
||||
if (is_bit_set(dcs, 4))
|
||||
ci = TRUE;
|
||||
|
||||
|
@ -1303,8 +1309,10 @@ gboolean sim_parse_3g_get_response(const unsigned char *data, int len,
|
|||
if (fcp == NULL)
|
||||
return FALSE;
|
||||
|
||||
/* Find the file size tag 0x80 according to
|
||||
* ETSI 102.221 Section 11.1.1.3.2 */
|
||||
/*
|
||||
* Find the file size tag 0x80 according to
|
||||
* ETSI 102.221 Section 11.1.1.3.2
|
||||
*/
|
||||
tlv = ber_tlv_find_by_tag(fcp, 0x80, fcp_length, &tlv_length);
|
||||
|
||||
if (!tlv || tlv_length < 2)
|
||||
|
@ -1347,14 +1355,17 @@ gboolean sim_parse_3g_get_response(const unsigned char *data, int len,
|
|||
if (str != 0x00 && tlv_length != 5)
|
||||
return FALSE;
|
||||
|
||||
/* strictly speaking the record length is 16 bit, but the valid
|
||||
* range is 0x01 to 0xFF according to 102.221 */
|
||||
/*
|
||||
* strictly speaking the record length is 16 bit, but the valid
|
||||
* range is 0x01 to 0xFF according to 102.221
|
||||
*/
|
||||
if (str != 0x00)
|
||||
rlen = tlv[3];
|
||||
else
|
||||
rlen = 0;
|
||||
|
||||
/* The 3G response data contains references to EFarr which actually
|
||||
/*
|
||||
* The 3G response data contains references to EFarr which actually
|
||||
* contains the security attributes. These are usually not carried
|
||||
* along with the response data unlike in 2G. Instead of querying
|
||||
* this, we simply look it up in our database. We fudge it somewhat
|
||||
|
|
27
src/sms.c
27
src/sms.c
|
@ -1151,7 +1151,8 @@ static void sms_dispatch(struct ofono_sms *sms, GSList *sms_list)
|
|||
if (sms_list == NULL)
|
||||
return;
|
||||
|
||||
/* Qutoting 23.040: The TP elements in the SMS‑SUBMIT PDU, apart from
|
||||
/*
|
||||
* Qutoting 23.040: The TP elements in the SMS‑SUBMIT PDU, apart from
|
||||
* TP‑MR, TP-SRR, TP‑UDL and TP‑UD, should remain unchanged for each
|
||||
* SM which forms part of a concatenated SM, otherwise this may lead
|
||||
* to irrational behaviour
|
||||
|
@ -1342,8 +1343,10 @@ void ofono_sms_deliver_notify(struct ofono_sms *sms, unsigned char *pdu,
|
|||
return;
|
||||
}
|
||||
|
||||
/* This is an older style MWI notification, process MWI
|
||||
* headers and handle it like any other message */
|
||||
/*
|
||||
* This is an older style MWI notification, process MWI
|
||||
* headers and handle it like any other message
|
||||
*/
|
||||
if (s.deliver.pid == SMS_PID_TYPE_RETURN_CALL) {
|
||||
if (handle_mwi(sms, &s))
|
||||
return;
|
||||
|
@ -1351,8 +1354,10 @@ void ofono_sms_deliver_notify(struct ofono_sms *sms, unsigned char *pdu,
|
|||
goto out;
|
||||
}
|
||||
|
||||
/* The DCS indicates this is an MWI notification, process it
|
||||
* and then handle the User-Data as any other message */
|
||||
/*
|
||||
* The DCS indicates this is an MWI notification, process it
|
||||
* and then handle the User-Data as any other message
|
||||
*/
|
||||
if (sms_mwi_dcs_decode(s.deliver.dcs, NULL, NULL, NULL, NULL)) {
|
||||
if (handle_mwi(sms, &s))
|
||||
return;
|
||||
|
@ -1393,7 +1398,8 @@ void ofono_sms_deliver_notify(struct ofono_sms *sms, unsigned char *pdu,
|
|||
break;
|
||||
}
|
||||
|
||||
/* Check to see if the SMS has any other MWI related headers,
|
||||
/*
|
||||
* Check to see if the SMS has any other MWI related headers,
|
||||
* as sometimes they are "tacked on" by the SMSC.
|
||||
* While we're doing this we also check for messages containing
|
||||
* WCMP headers or headers that can't possibly be in a normal
|
||||
|
@ -1417,9 +1423,11 @@ void ofono_sms_deliver_notify(struct ofono_sms *sms, unsigned char *pdu,
|
|||
switch (iei) {
|
||||
case SMS_IEI_SPECIAL_MESSAGE_INDICATION:
|
||||
case SMS_IEI_ENHANCED_VOICE_MAIL_INFORMATION:
|
||||
/* TODO: ignore if not in the very first
|
||||
/*
|
||||
* TODO: ignore if not in the very first
|
||||
* segment of a concatenated SM so as not
|
||||
* to repeat the indication. */
|
||||
* to repeat the indication.
|
||||
*/
|
||||
if (handle_mwi(sms, &s))
|
||||
return;
|
||||
|
||||
|
@ -1708,7 +1716,8 @@ void ofono_sms_register(struct ofono_sms *sms)
|
|||
|
||||
sim_atom = __ofono_modem_find_atom(modem, OFONO_ATOM_TYPE_SIM);
|
||||
|
||||
/* If we have a sim atom, we can uniquely identify the SIM,
|
||||
/*
|
||||
* If we have a sim atom, we can uniquely identify the SIM,
|
||||
* otherwise create an sms assembly which doesn't backup the fragment
|
||||
* store.
|
||||
*/
|
||||
|
|
|
@ -1861,7 +1861,7 @@ static gboolean extract_app_port_common(struct sms_udh_iter *iter, int *dst,
|
|||
* processing at the next information element) any information element
|
||||
* where the value of the Information-Element-Data is Reserved or not
|
||||
* supported.
|
||||
*/
|
||||
*/
|
||||
while ((iei = sms_udh_iter_get_ie_type(iter)) !=
|
||||
SMS_IEI_INVALID) {
|
||||
switch (iei) {
|
||||
|
@ -3048,7 +3048,8 @@ static inline GSList *sms_list_append(GSList *l, const struct sms *in)
|
|||
return l;
|
||||
}
|
||||
|
||||
/* Prepares the text for transmission. Breaks up into fragments if
|
||||
/*
|
||||
* Prepares the text for transmission. Breaks up into fragments if
|
||||
* necessary using ref as the concatenated message reference number.
|
||||
* Returns a list of sms messages in order. If ref_offset is given,
|
||||
* then the ref_offset contains the reference number offset or 0
|
||||
|
@ -3343,7 +3344,8 @@ gboolean cbs_decode(const unsigned char *pdu, int len, struct cbs *out)
|
|||
out->max_pages = pdu[5] & 0xf;
|
||||
out->page = (pdu[5] >> 4) & 0xf;
|
||||
|
||||
/* If a mobile receives the code 0000 in either the first field or
|
||||
/*
|
||||
* If a mobile receives the code 0000 in either the first field or
|
||||
* the second field then it shall treat the CBS message exactly the
|
||||
* same as a CBS message with page parameter 0001 0001 (i.e. a single
|
||||
* page message).
|
||||
|
@ -3511,7 +3513,8 @@ char *cbs_decode_text(GSList *cbs_list, char *iso639_lang)
|
|||
if (cbs_list == NULL)
|
||||
return NULL;
|
||||
|
||||
/* CBS can only come from the network, so we're much less lenient
|
||||
/*
|
||||
* CBS can only come from the network, so we're much less lenient
|
||||
* on what we support. Namely we require the same charset to be
|
||||
* used across all pages.
|
||||
*/
|
||||
|
@ -3601,7 +3604,8 @@ char *cbs_decode_text(GSList *cbs_list, char *iso639_lang)
|
|||
|
||||
i = iso639 ? 3 : 0;
|
||||
|
||||
/* CR is a padding character, which means we can
|
||||
/*
|
||||
* CR is a padding character, which means we can
|
||||
* safely discard everything afterwards
|
||||
*/
|
||||
for (; i < written; i++, bufsize++) {
|
||||
|
@ -3611,7 +3615,8 @@ char *cbs_decode_text(GSList *cbs_list, char *iso639_lang)
|
|||
buf[bufsize] = unpacked[i];
|
||||
}
|
||||
|
||||
/* It isn't clear whether extension sequences
|
||||
/*
|
||||
* It isn't clear whether extension sequences
|
||||
* (2 septets) must be wholly present in the page
|
||||
* and not broken over multiple pages. The behavior
|
||||
* is probably the same as SMS, but we don't make
|
||||
|
@ -3622,9 +3627,10 @@ char *cbs_decode_text(GSList *cbs_list, char *iso639_lang)
|
|||
int i = taken;
|
||||
int max_offset = taken + num_ucs2_chars * 2;
|
||||
|
||||
/* It is completely unclear how UCS2 chars are handled
|
||||
/*
|
||||
* It is completely unclear how UCS2 chars are handled
|
||||
* especially across pages or when the UDH is present.
|
||||
* For now do the best we can
|
||||
* For now do the best we can.
|
||||
*/
|
||||
if (iso639) {
|
||||
i += 2;
|
||||
|
@ -3662,7 +3668,8 @@ static inline gboolean cbs_is_update_newer(unsigned int n, unsigned int o)
|
|||
if (new_update == old_update)
|
||||
return FALSE;
|
||||
|
||||
/* Any Update Number eight or less higher (modulo 16) than the last
|
||||
/*
|
||||
* Any Update Number eight or less higher (modulo 16) than the last
|
||||
* received Update Number will be considered more recent, and shall be
|
||||
* treated as a new CBS message, provided the mobile has not been
|
||||
* switched off.
|
||||
|
@ -3741,8 +3748,9 @@ static void cbs_assembly_expire(struct cbs_assembly *assembly,
|
|||
GSList *prev;
|
||||
GSList *tmp;
|
||||
|
||||
/* Take care of the case where several updates are being
|
||||
* reassembled at the same time. If the newer one is assembled
|
||||
/*
|
||||
* Take care of the case where several updates are being
|
||||
* reassembled at the same time. If the newer one is assembled
|
||||
* first, then the subsequent old update is discarded, make
|
||||
* sure that we're also discarding the assembly node for the
|
||||
* partially assembled ones
|
||||
|
@ -3776,7 +3784,8 @@ static void cbs_assembly_expire(struct cbs_assembly *assembly,
|
|||
void cbs_assembly_location_changed(struct cbs_assembly *assembly, gboolean plmn,
|
||||
gboolean lac, gboolean ci)
|
||||
{
|
||||
/* Location Area wide (in GSM) (which means that a CBS message with the
|
||||
/*
|
||||
* Location Area wide (in GSM) (which means that a CBS message with the
|
||||
* same Message Code and Update Number may or may not be "new" in the
|
||||
* next cell according to whether the next cell is in the same Location
|
||||
* Area as the current cell), or
|
||||
|
|
|
@ -4148,7 +4148,8 @@ static gboolean build_dataobj_text(struct stk_tlv_builder *tlv,
|
|||
return FALSE;
|
||||
|
||||
if (text->yesno == TRUE) {
|
||||
/* Section 6.8.5:
|
||||
/*
|
||||
* Section 6.8.5:
|
||||
* When the terminal issues [...] command qualifier set
|
||||
* to "Yes/No", it shall supply the value "01" when the
|
||||
* answer is "positive" and the value '00' when the
|
||||
|
@ -4299,7 +4300,8 @@ static gboolean build_empty_dataobj_location_info(struct stk_tlv_builder *tlv,
|
|||
stk_tlv_builder_close_container(tlv);
|
||||
}
|
||||
|
||||
/* Described in TS 102.223 Section 8.20
|
||||
/*
|
||||
* Described in TS 102.223 Section 8.20
|
||||
*
|
||||
* See format note in parse_dataobj_imei.
|
||||
*/
|
||||
|
@ -4862,7 +4864,8 @@ static gboolean build_dataobj_pdp_context_params(struct stk_tlv_builder *tlv,
|
|||
stk_tlv_builder_close_container(tlv);
|
||||
}
|
||||
|
||||
/* Described in TS 102.223 Section 8.74
|
||||
/*
|
||||
* Described in TS 102.223 Section 8.74
|
||||
*
|
||||
* See format note in parse_dataobj_imeisv.
|
||||
*/
|
||||
|
@ -4998,8 +5001,10 @@ static gboolean build_dataobj_mms_transfer_status(struct stk_tlv_builder *tlv,
|
|||
const struct stk_mms_transfer_status *mts = data;
|
||||
unsigned char tag = STK_DATA_OBJECT_TYPE_MMS_TRANSFER_STATUS;
|
||||
|
||||
/* Assume the length is never 0 for a valid Result message, however
|
||||
* the whole data object's presence is conditional. */
|
||||
/*
|
||||
* Assume the length is never 0 for a valid Result message, however
|
||||
* the whole data object's presence is conditional.
|
||||
*/
|
||||
if (mts->len == 0)
|
||||
return TRUE;
|
||||
|
||||
|
@ -5387,7 +5392,8 @@ const unsigned char *stk_pdu_from_response(const struct stk_response *response,
|
|||
if (stk_tlv_builder_close_container(&builder) == FALSE)
|
||||
return NULL;
|
||||
|
||||
/* TS 102 223 section 6.8 states:
|
||||
/*
|
||||
* TS 102 223 section 6.8 states:
|
||||
* "For all COMPREHENSION-TLV objects with Min = N, the terminal
|
||||
* should set the CR flag to comprehension not required."
|
||||
* All the data objects except "Command Details" and "Result" have
|
||||
|
|
|
@ -586,8 +586,8 @@ struct stk_address {
|
|||
* and a maximum length of 23 octets"
|
||||
*
|
||||
* According to TS 31.102 Section 4.4.2.4: "The subaddress data contains
|
||||
* information as defined for this purpose in TS 24.008 [9]. All information
|
||||
* defined in TS 24.008, except the information element identifier, shall be
|
||||
* information as defined for this purpose in TS 24.008 [9]. All information
|
||||
* defined in TS 24.008, except the information element identifier, shall be
|
||||
* stored in the USIM. The length of this subaddress data can be up to 22
|
||||
* bytes."
|
||||
*/
|
||||
|
@ -602,7 +602,7 @@ struct stk_subaddress {
|
|||
*
|
||||
* According to 24.008 Section 10.5.4.5 "The bearer capability is a type 4
|
||||
* information element with a minimum length of 3 octets and a maximum length
|
||||
* of 16 octets."
|
||||
* of 16 octets."
|
||||
*
|
||||
* According to TS 31.102 Section 4.2.38 the CCP length is 15 bytes.
|
||||
*
|
||||
|
@ -663,7 +663,8 @@ struct stk_ussd_string {
|
|||
int len;
|
||||
};
|
||||
|
||||
/* Define the struct of single file in TS102.223 Section 8.18.
|
||||
/*
|
||||
* Define the struct of single file in TS102.223 Section 8.18.
|
||||
* According to TS 11.11 Section 6.2, each file id has two bytes, and the
|
||||
* maximum Dedicated File level is 2. So the maximum size of file is 8, which
|
||||
* contains two bytes of Master File, 2 bytes of 1st level Dedicated File,
|
||||
|
|
12
src/ussd.c
12
src/ussd.c
|
@ -251,9 +251,11 @@ static gboolean recognized_control_string(struct ofono_ussd *ussd,
|
|||
DBG("Got parse result: %d, %s, %s, %s, %s, %s, %s",
|
||||
type, sc, sia, sib, sic, sid, dn);
|
||||
|
||||
/* A password change string needs to be treated separately
|
||||
/*
|
||||
* A password change string needs to be treated separately
|
||||
* because it uses a fourth SI and is thus not a valid
|
||||
* control string. */
|
||||
* control string.
|
||||
*/
|
||||
if (recognized_passwd_change_string(ussd, type, sc,
|
||||
sia, sib, sic, sid, dn, msg)) {
|
||||
ret = TRUE;
|
||||
|
@ -280,10 +282,10 @@ static gboolean recognized_control_string(struct ofono_ussd *ussd,
|
|||
|
||||
/* TODO: Handle all strings that control voice calls */
|
||||
|
||||
/* TODO: Handle Multiple subscriber profile DN*59#SEND and *59#SEND
|
||||
*/
|
||||
/* TODO: Handle Multiple subscriber profile DN*59#SEND and *59#SEND */
|
||||
|
||||
/* Note: SIM PIN/PIN2 change and unblock and IMEI presentation
|
||||
/*
|
||||
* Note: SIM PIN/PIN2 change and unblock and IMEI presentation
|
||||
* procedures are not handled by the daemon since they are not followed
|
||||
* by SEND and are not valid USSD requests.
|
||||
*/
|
||||
|
|
21
src/util.c
21
src/util.c
|
@ -917,17 +917,21 @@ unsigned char *unpack_7bit_own_buf(const unsigned char *in, long len,
|
|||
/* Figure out the remainder */
|
||||
rest = (in[i] >> bits) & ((1 << (8-bits)) - 1);
|
||||
|
||||
/* We have the entire character, here we don't increate
|
||||
/*
|
||||
* We have the entire character, here we don't increate
|
||||
* out if this is we started at an offset. Instead
|
||||
* we effectively populate variable rest */
|
||||
* we effectively populate variable rest
|
||||
*/
|
||||
if (i != 0 || bits == 7)
|
||||
out++;
|
||||
|
||||
if ((out-buf) == max_to_unpack)
|
||||
break;
|
||||
|
||||
/* We expected only 1 bit from this octet, means there's 7
|
||||
* left, take care of them here */
|
||||
/*
|
||||
* We expected only 1 bit from this octet, means there's 7
|
||||
* left, take care of them here
|
||||
*/
|
||||
if (bits == 1) {
|
||||
*out = rest;
|
||||
out++;
|
||||
|
@ -938,7 +942,8 @@ unsigned char *unpack_7bit_own_buf(const unsigned char *in, long len,
|
|||
}
|
||||
}
|
||||
|
||||
/* According to 23.038 6.1.2.3.1, last paragraph:
|
||||
/*
|
||||
* According to 23.038 6.1.2.3.1, last paragraph:
|
||||
* "If the total number of characters to be sent equals (8n-1)
|
||||
* where n=1,2,3 etc. then there are 7 spare bits at the end
|
||||
* of the message. To avoid the situation where the receiving
|
||||
|
@ -1021,7 +1026,8 @@ unsigned char *pack_7bit_own_buf(const unsigned char *in, long len,
|
|||
bits = bits - 1;
|
||||
}
|
||||
|
||||
/* If <CR> is intended to be the last character and the message
|
||||
/*
|
||||
* If <CR> is intended to be the last character and the message
|
||||
* (including the wanted <CR>) ends on an octet boundary, then
|
||||
* another <CR> must be added together with a padding bit 0. The
|
||||
* receiving entity will perform the carriage return function twice,
|
||||
|
@ -1096,7 +1102,8 @@ char *sim_string_to_utf8(const unsigned char *buffer, int length)
|
|||
return NULL;
|
||||
|
||||
if (buffer[0] < 0x80) {
|
||||
/* We have to find the real length, since on SIM file system
|
||||
/*
|
||||
* We have to find the real length, since on SIM file system
|
||||
* alpha fields are 0xff padded
|
||||
*/
|
||||
for (i = 0; i < length; i++)
|
||||
|
|
|
@ -599,10 +599,12 @@ static void voicecall_set_call_lineid(struct voicecall *v,
|
|||
call->clip_validity == clip_validity)
|
||||
return;
|
||||
|
||||
/* Two cases: We get an incoming call with CLIP factored in, or
|
||||
/*
|
||||
* Two cases: We get an incoming call with CLIP factored in, or
|
||||
* CLIP comes in later as a separate event
|
||||
* For COLP only the phone number should be checked, it can come
|
||||
* in with the initial call event or later as a separate event */
|
||||
* in with the initial call event or later as a separate event
|
||||
*/
|
||||
|
||||
/* For plugins that don't keep state, ignore */
|
||||
if (call->clip_validity == CLIP_VALIDITY_VALID &&
|
||||
|
@ -755,8 +757,10 @@ static GSList *voicecalls_held_list(struct ofono_voicecall *vc)
|
|||
return r;
|
||||
}
|
||||
|
||||
/* Intended to be used for multiparty, which cannot be incoming,
|
||||
* alerting or dialing */
|
||||
/*
|
||||
* Intended to be used for multiparty, which cannot be incoming,
|
||||
* alerting or dialing
|
||||
*/
|
||||
static GSList *voicecalls_active_list(struct ofono_voicecall *vc)
|
||||
{
|
||||
GSList *l;
|
||||
|
@ -1007,8 +1011,10 @@ static struct voicecall *dial_handle_result(struct ofono_voicecall *vc,
|
|||
return NULL;
|
||||
}
|
||||
|
||||
/* Two things can happen, the call notification arrived before dial
|
||||
* callback or dial callback was first. Handle here */
|
||||
/*
|
||||
* Two things can happen, the call notification arrived before dial
|
||||
* callback or dial callback was first. Handle here
|
||||
*/
|
||||
for (l = vc->call_list; l; l = l->next) {
|
||||
v = l->data;
|
||||
|
||||
|
@ -1130,7 +1136,8 @@ static DBusMessage *manager_transfer(DBusConnection *conn,
|
|||
|
||||
numactive = voicecalls_num_active(vc);
|
||||
|
||||
/* According to 22.091 section 5.8, the network has the option of
|
||||
/*
|
||||
* According to 22.091 section 5.8, the network has the option of
|
||||
* implementing the call transfer operation for a call that is
|
||||
* still dialing/alerting.
|
||||
*/
|
||||
|
@ -1223,7 +1230,8 @@ static DBusMessage *manager_hold_and_answer(DBusConnection *conn,
|
|||
if (voicecalls_have_waiting(vc) == FALSE)
|
||||
return __ofono_error_failed(msg);
|
||||
|
||||
/* We have waiting call and both an active and held call. According
|
||||
/*
|
||||
* We have waiting call and both an active and held call. According
|
||||
* to 22.030 we cannot use CHLD=2 in this situation.
|
||||
*/
|
||||
if (voicecalls_have_active(vc) && voicecalls_have_held(vc))
|
||||
|
@ -1378,7 +1386,8 @@ static DBusMessage *multiparty_private_chat(DBusConnection *conn,
|
|||
if (!l)
|
||||
return __ofono_error_not_found(msg);
|
||||
|
||||
/* If we found id on the list of multiparty calls, then by definition
|
||||
/*
|
||||
* If we found id on the list of multiparty calls, then by definition
|
||||
* the multiparty call exists. Only thing to check is whether we have
|
||||
* held calls
|
||||
*/
|
||||
|
@ -1498,7 +1507,8 @@ static DBusMessage *multiparty_hangup(DBusConnection *conn,
|
|||
goto out;
|
||||
}
|
||||
|
||||
/* Multiparty is currently active, if we have held calls
|
||||
/*
|
||||
* Multiparty is currently active, if we have held calls
|
||||
* we shouldn't use release_all_active here since this also
|
||||
* has the side-effect of activating held calls
|
||||
*/
|
||||
|
@ -2113,7 +2123,8 @@ void ofono_voicecall_register(struct ofono_voicecall *vc)
|
|||
|
||||
ofono_modem_add_interface(modem, OFONO_VOICECALL_MANAGER_INTERFACE);
|
||||
|
||||
/* Start out with the 22.101 mandated numbers, if we have a SIM and
|
||||
/*
|
||||
* Start out with the 22.101 mandated numbers, if we have a SIM and
|
||||
* the SIM contains EFecc, then we update the list once we've read them
|
||||
*/
|
||||
add_to_en_list(&vc->en_list, default_en_list_no_sim);
|
||||
|
|
Loading…
Reference in New Issue