Status of org.freesmartphone.GSM.SIM
Michael 'Mickey' Lauer
mickey at vanille-media.de
Mon Jun 30 23:39:21 CEST 2008
Am Montag 30 Juni 2008 10:25:06 schrieb Guillaume Chereau:
> I would like to know about the status of the GSM.SIM interface. Is it
> already possible to store and retrieve contacts ?
Yeah, that should work. Although:
> Today I tried it on my OM (with the FSO Image), I had a few problems.
>
> Should I open tickets in trac for those problems ? Since I didn't use
> the last version I am not sure what is corrected or not.
Yes, please always open tickets for found problems. "Worst" thing that can
happen is it's already fixed and we close it as INVALID :)
> Here is the list of problems I encountered :
>
>
> * RetrievePhonebook always returns an empty list
>
> * After error, all methods fail with the
> "org.freesmartphone.GSM.Device.Timeout: device did not answer within 5
> seconds" Error, and I need to kill ophoned
Yes, that's a bug. Since we're still in debug mode, I prefer not to add a
global try/except since that would shield bugs. In release mode, this will be
fixed. Please add a ticket, I will add a 'release' mode parameter for now.
> * When ophoned is killed, it has to be restarted manually, (We need to put
> a .service file in /usr/share/dbus-1)
Agreed, ticket please.
> * After a TimeOut Error, the method GetSimStatus once returned the string
> "0", I couldn't make it happen again...
Ah, I know what this is: the parser got confused and had a bogus ("EXT ERROR:
0") laying around which it fed into a wrong call. I fixed it now, so it
should never happen -- see below:
> * When trying the following command :
> dbus-send --system --print-reply --dest=org.freesmartphone.ophoned
> /org/freesmartphone/GSM/Device org.freesmartphone.GSM.SIM.StoreEntry
> int32:0 string:"fabien" string:"04060708" I get :
> queue is: deque([(u'AT+CPBS="SM";+CPBW=0,"04060708",129,"fabien"\r\n'
> sending to port: u'AT+CPBS="SM";+CPBW=0,"04060708",129,"fabien"\r\n')
> TIMEOUT 'AT+CPBS="SM";+CPBW=0,"04060708",129,"fabien"' => ???)
> SimStoreEntry.errorFromChannel: ENTER
> (u'AT+CPBS="SM";+CPBW=0,"04060708",129,"fabien"', ('timeout', 5)),{}
SIM entries are counted starting with '1', so 0 is an invalid parameter. This
triggered an '+EXT ERROR: 0' which I never seen before, since I never tried
with an invalid index (good that now other people than me are testing :)). My
parser did not know about the EXT ERROR and assumed the modem never completed
the answer, hence it (falsely) triggered a timeout and the parser state got
completely confused.
It works now or correctly raises an error, see:
>>> gsmsim.StoreEntry(0,"Mickey","+4912345678")
Traceback (most recent call last):
File "<console>", line 1, in <module>
File "/usr/lib/python2.5/site-packages/dbus/proxies.py", line 140, in
__call__
**keywords)
File "/usr/lib/python2.5/site-packages/dbus/connection.py", line 607, in
call_blocking
message, timeout)
DBusException: org.freesmartphone.GSM.SIM.InvalidIndex: SimInvalidIndex:
org.freesmartphone.GSM.SIM.InvalidIndex:
>>> gsmsim.StoreEntry(1,"Mickey","+4912345678")
>>> gsmsim.RetrieveEntry(1)
(dbus.String(u'Mickey'), dbus.String(u'+4912345678'))
> * When trying GetSubscriberNumbers,
> I get :
> File "/usr/lib/python2.5/site-packages/ophoned/objects.py", line 203,
> in GetSubscriberNumbers mediator.SimGetSubscriberNumbers( self, dbus_ok,
> dbus_error ) AttributeError: 'module' object has no attribute
> 'SimGetSubscriberNumbers'
Ah, right. This will emerge (together with GetImsi) into the combined method
GetSimInfo, which is already in OTAPI, but not implemented in ophoned yet.
Please add a ticket.
> * When trying GetPhonebookInfo,
> I get :
> File
> "/usr/lib/python2.5/site-packages/ophoned/modems/abstract/mediator.py",
> line 370, in responseFromChannel match = PAT_PHONEBOOK_INFO.match(
> response[0] )
> NameError: global name 'PAT_PHONEBOOK_INFO' is not defined
>
> (note, just need to replace "PAT_PHONEBOOK_INFO" by
> "const.PAT_PHONEBOOK_INFO")
oops, thanks. There were a couple of bugs in this function. Fixed now:
>>> gsmsim.GetPhonebookInfo()
dbus.Dictionary({dbus.String(u'max_index'): dbus.Int32(250, variant_level=1),
dbus.String(u'name_length'): dbus.Int32(17, variant_level=1),
dbus.String(u'min_index'): dbus.Int32(1, variant_level=1),
dbus.String(u'number_length'): dbus.Int32(44, variant_level=1)},
signature=dbus.Signature('sv'))
> * After a fail in StoreEntry, when I try a GetServiceCenterNumber,
> I get :
> File
> "/usr/lib/python2.5/site-packages/ophoned/modems/abstract/mediator.py",
> line 448, in responseFromChannel number = number.replace( '+', '' ) #
> normalize
> AttributeError: 'list' object has no attribute 'replace'
Yes, that's because the parser was confused. Should also be fixed now.
Charlie, this is _very_ helpful for us! Thanks a lot and keep stress-testing
this!
Cheers,
Mickey.
More information about the smartphones-standards
mailing list