Re: ModemManager: Huawei PDU encoded USSD response truncated to 112 characters



Well, here's the thing, USSD does not tell us how long the decoded
string will be, so at the time we call gsm_unpack() we don't know the
exact length so we can only assume that it is (bin_len * 8) / 7 as per
my previous patch.

I attach a new patch which, after decoding, checks whether the last
character in a 7-byte block is padding (0x0d) and drops it if it is
(for the case when our 7-byte block only contained 7 characters).
This works for Huawei modems that use PDU encoded USSD, if it is found
that this works for all modems and for SMS as well, perhaps this
should be moved into gsm_unpack() in src/mm-charsets.c.


> Right, that's my change. Does the USSD path in the plugin know the
> length of the text, or does it have to derive the text length from the
> length of the hex string? If it doesn't know the length, it's going to
> have the same problem I was seeing with SMS messages prior to this
> change, where gsm_unpack() couldn't tell if a trailing 7-byte block
> had 7 or 8 GSM7 characters in it.
>
>    - Nathan

Attachment: truncated_pdu_ussd_fix_v2.diff
Description: Binary data



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]