Fix rilmodem SMSC quoting
cover Fix rilmodem SMSC quoting
This changeset fixes the string formatting of the RIL_REQUEST_SET_SMSC_ADDRESS request, which requires the string to bracketed by quotation marks.
Tony Espy (2):
rilmodem: restore SET_SMSC_ADDRESS number format
unit: update test-rilmodem-sms set_sca test case
drivers/rilmodem/sms.c | 4 +++- unit/test-rilmodem-sms.c | 8 ++++---- 2 files changed, 7 insertions(+), 5 deletions(-)
Signature · 1 line
2.1.4
PATCH 1/2 rilmodem: restore SET_SMSC_ADDRESS number format
Restore quoting of SMSC number string, as it's required by at least one rild implementation (mako).
--- drivers/rilmodem/sms.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/rilmodem/sms.c +3 -1
@@ -73,7 +73,9 @@ static void ril_csca_set(struct ofono_sms *sms,struct sms_data *sd =ofono_sms_get_data (sms);struct cb_data *cbd =cb_data_new (cb, user_data, sd);struct parcel rilp; -const char *number =phone_number_to_string (sca); +char number[OFONO_MAX_PHONE_NUMBER_LENGTH +4 ]; + +snprintf (number,sizeof (number),"\"%s\"" ,phone_number_to_string (sca));parcel_init (&rilp);parcel_w_string (&rilp, number);
Signature · 1 line
2.1.4
PATCH 2/2 unit: update test-rilmodem-sms set_sca test case
In reply to Tony EspyUpdate test-rilmodem-sms set_sca test case to take into account additional quotes used for sending a SET_SMSC_ADDRESS request.
--- unit/test-rilmodem-sms.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
unit/test-rilmodem-sms.c +4 -4
@@ -237,10 +237,10 @@ static const struct sms_data testdata_sca_query_invalid_3 = {* {number="+34607003110"} */ static const guchar req_set_smsc_address_parcel_1[] = { -0x00 ,0x00 ,0x00 ,0x28 ,0x65 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 , -0x0c ,0x00 ,0x00 ,0x00 ,0x2b ,0x00 ,0x33 ,0x00 ,0x34 ,0x00 ,0x36 ,0x00 , -0x30 ,0x00 ,0x37 ,0x00 ,0x30 ,0x00 ,0x30 ,0x00 ,0x33 ,0x00 ,0x31 ,0x00 , -0x31 ,0x00 ,0x30 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 +0x00 ,0x00 ,0x00 ,0x2c ,0x65 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 , +0x0e ,0x00 ,0x00 ,0x00 ,0x22 ,0x00 ,0x2b ,0x00 ,0x33 ,0x00 ,0x34 ,0x00 , +0x36 ,0x00 ,0x30 ,0x00 ,0x37 ,0x00 ,0x30 ,0x00 ,0x30 ,0x00 ,0x33 ,0x00 , +0x31 ,0x00 ,0x31 ,0x00 ,0x30 ,0x00 ,0x22 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 };static const struct sms_data testdata_sca_set_valid_1 = {
Signature · 1 line
2.1.4
Hi Tony,
Quoted 4 lines · Tony Espy
This changeset fixes the string formatting of the
RIL_REQUEST_SET_SMSC_ADDRESSrequest, which requires the string to bracketed by quotation marks.
Quoted 8 lines
Tony Espy (2):
rilmodem: restoreSET_SMSC_ADDRESSnumber format
unit: update test-rilmodem-smsset_scatest casedrivers/rilmodem/sms.c | 4 +++- unit/test-rilmodem-sms.c | 8 ++++---- 2 files changed, 7 insertions(+), 5 deletions(-)
Both applied, thanks.
Regards,
-Denis