I believe the cause of this problem is that the output string of gsm_unpack() needs to be larger than the input string. We get 8 characters out for every 7 input characters. I have attached a simple patch to /plugins/mm-modem-huawei-gsm.c which results in the full USSD response being returned. I am not sure that this patch is the correct fix. It may be that gsm_unpack() in src/mm-charsets.c needs take the 8/7 growth into account when sizing the output array and returning the unpacked size. Would someone more familiar with src/mm-charsets.c offer some guidance please? On Fri, Nov 4, 2011 at 8:44 AM, Graham Inggs <graham inggs uct ac za> wrote: > Tested with Huawei E1820. > > ussdresult = gsmussd.Initiate("*101#") > print "ussd response: %s" % ussdresult > > ussd response: Balance = R 9.50 Expiry date:02/05/2031.On-Net Minutes > = 01:16:00.Free SMS's = 51.Free Data = 100.00 MB.Free Da > > The full response should have been: > > Balance = R 9.50 Expiry date:02/05/2031.On-Net Minutes = > 01:16:00.Free SMS's = 51.Free Data = 100.00 MB.Free Data = 2007.44 MB. > > Partial ModemManager log: > > modem-manager[3316]: <debug> [1320384816.466178] > [mm-at-serial-port.c:298] debug_log(): (ttyUSB0): --> > 'AT+CUSD=1,"AA182C3602",15<CR>' > modem-manager[3316]: <debug> [1320384816.504610] > [mm-at-serial-port.c:298] debug_log(): (ttyUSB0): <-- > '<CR><LF>OK<CR><LF>' > modem-manager[3316]: <debug> [1320384816.818950] > [mm-at-serial-port.c:298] debug_log(): (ttyUSB2): <-- > '<CR><LF>^RSSI:16<CR><LF>' > modem-manager[3316]: <debug> [1320384816.819316] > [mm-at-serial-port.c:298] debug_log(): (ttyUSB2): <-- > '<CR><LF>^CSNR:-77,-7<CR><LF>' > modem-manager[3316]: <debug> [1320384818.431324] > [mm-at-serial-port.c:298] debug_log(): (ttyUSB2): <-- '<CR><LF>+CUSD: > 0,"C2303BEC1E97413D90149473D5602050110F4FCBF32072985ED6C1642F58ED2583CD62AEA7BBE52CD341CDB4BB4E2FCF413D102CA68BD9743098CB282F9741D3E6F43407F540B598CB282F9741C4303D0CEA816230980B060335852EA3BC5C0611C3F430A80792C16037178D066A0A5D",15<CR><LF>' >
Attachment:
truncated_pdu_ussd_fix.diff
Description: Binary data