Compare commits

...

6 Commits

Author SHA1 Message Date
Slava Monich
deecd829a6 Merge pull request #5 from sailfishos/jb55388
Remove incorrect hardcoded tech value.
2021-09-07 16:49:39 +03:00
Matti Lehtimäki
3acf91c6a9 [ril] Remove incorrect hardcoded tech value. JB#55388 2021-09-06 20:44:26 +03:00
Marcel Holtmann
85b61c8964 call-forwarding: Increase string buffer to avoid overflow 2021-08-26 03:03:55 +03:00
Jonas Bonn
8986749585 atmodem: enlarge command buffer
The ofono phone number max length is 80 so a buffer size of 64 is
obviously insufficient.  Expanding the buffer to 128 prevents a
potential failure and suppresses the folowing compiler warning:

../drivers/atmodem/sms.c: In function ‘at_csca_set’:
../drivers/atmodem/sms.c:108:40: warning: ‘%s’ directive output may be truncated writing up to 80 bytes into a region of size 55 [-Wformat-truncation=]
  snprintf(buf, sizeof(buf), "AT+CSCA=\"%s\",%d", sca->number, sca->type);
                                        ^~
../drivers/atmodem/sms.c:108:2: note: ‘snprintf’ output between 13 and 103 bytes into a destination of size 64
  snprintf(buf, sizeof(buf), "AT+CSCA=\"%s\",%d", sca->number, sca->type);
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2021-08-26 03:03:55 +03:00
Juho Hämäläinen
1c0f5094a6 Merge pull request #3 from jusa/jb55276
Be less pedantic about ordering of speech codecs.
2021-08-25 17:00:06 +03:00
Juho Hämäläinen
4208b6d9ea [bluetooth] Be less pedantic about ordering of speech codecs. Fixes JB#55276
HFP spec 1.7.1 (4.34.1) says:

The Codec ID for the mandatory narrow band codec (CVSD) shall
always be included.

If wide band speech is supported, then the mandatory codec (mSBC)
shall be included unless it is temporarily unavailable.

Any other optional wide band speech codecs may also be included
in this list as long as the mandatory codec is included first.

---

The wording in spec is slightly vague on what the ordering of
mandatory narrow band codec (CVSD) and - IF wide band speech
is supported - mandatory wide band coded (mSBC) should be.
oFono's take is that the mandatory narrow band codec should
be listed first, and when mSBC is there oFono will abort the
connection.

To fix this we can be less pedantic about the ordering of
codecs - as long as the mandatory ones are there.
2021-08-25 16:32:55 +03:00
4 changed files with 15 additions and 17 deletions

View File

@@ -104,7 +104,7 @@ static void at_csca_set(struct ofono_sms *sms,
{
struct sms_data *data = ofono_sms_get_data(sms);
struct cb_data *cbd = cb_data_new(cb, user_data);
char buf[64];
char buf[128];
snprintf(buf, sizeof(buf), "AT+CSCA=\"%s\",%d", sca->number, sca->type);

View File

@@ -960,12 +960,6 @@ static gboolean ril_data_call_setup_submit(struct ril_data_request *req)
RADIO_TECH_LTE : priv->network->data.ril_tech;
if (tech > 2) {
tech += 2;
} else {
/*
* This value used to be hardcoded, let's keep using it
* as the default.
*/
tech = RADIO_TECH_HSPA;
}
if (setup->username && setup->username[0]) {

View File

@@ -268,7 +268,7 @@ static void set_new_cond_list(struct ofono_call_forwarding *cf,
const char *number;
dbus_uint16_t timeout;
char attr[64];
char tattr[64];
char tattr[72];
gboolean update_sim = FALSE;
gboolean old_cfu;
gboolean new_cfu;

View File

@@ -994,18 +994,17 @@ static void bac_cb(GAtServer *server, GAtServerRequestType type,
/*
* CVSD codec is mandatory and must come first.
* See HFP v1.6 4.34.1
* However, some headsets send the list in wrong order,
* but function fine otherwise, so to get those working
* let's not be pedantic about the codec order.
*/
if (g_at_result_iter_next_number(&iter, &val) == FALSE ||
val != HFP_CODEC_CVSD)
goto fail;
em->bac_received = TRUE;
em->negotiated_codec = 0;
em->r_codecs[CVSD_OFFSET].supported = TRUE;
while (g_at_result_iter_next_number(&iter, &val)) {
switch (val) {
case HFP_CODEC_CVSD:
em->bac_received = TRUE;
em->negotiated_codec = 0;
em->r_codecs[CVSD_OFFSET].supported = TRUE;
break;
case HFP_CODEC_MSBC:
em->r_codecs[MSBC_OFFSET].supported = TRUE;
break;
@@ -1015,6 +1014,11 @@ static void bac_cb(GAtServer *server, GAtServerRequestType type,
}
}
if (!em->bac_received) {
DBG("Mandatory codec %d not received.", HFP_CODEC_CVSD);
goto fail;
}
g_at_server_send_final(server, G_AT_SERVER_RESULT_OK);
/*