Ticket #34 (closed defect: worksforme)

Opened 12 years ago

Last modified 2 years ago

Need to decide if lgsm_handle is still valid.

Reported by: tonyguan@… Owned by: laforge@…
Priority: high Milestone:
Component: libgsmd Version: unspecified
Severity: blocker Keywords:
Cc: buglog@… Blocked By:
Blocking: Estimated Completion (week):
HasPatchForReview: PatchReviewResult:
Reproducible:

Description

When the daemon crashes,the client will also crash because of the ignorance of
this event.
So we need an API to decide if the lgsm_handle is still valid before we send
any command to it.

/
static struct lgsm_handle *lgsmh;

Change History

comment:1 Changed 12 years ago by laforge@…

  • Status changed from new to assigned
  • Severity changed from normal to blocker

comment:2 Changed 12 years ago by tonyguan@…

  • blocked set to 106

comment:3 Changed 12 years ago by laforge@…

  • Milestone set to Phase 0

comment:4 Changed 12 years ago by laforge@…

the lgsm_handle is always 'valid', i.e. points to a correctly allocated and
filled data structure.

However, libgsmd calls should return an error in case gsmd cannot be contacted.

There are two options for this problem:

1) have libgsmd automatically do reconnect attempts in the background

2) have libgsmd just return errors to all calls and do the reconnect inside the
application program

I will try to refine the API to include both options as possibility.

In any case, openmoko-dialer should check the return code of libgsmd function
calls and display a dialog box about gsmd not being available.

comment:5 Changed 12 years ago by tonyguan@…

Hi harald,

Did you ever use gsmd on the real phone board? I used "gsmd -p /dev/ttySAC0 -s
115200", but nothing returned fro the AT commmands. Was there anything I
missed? the hardware is GTA01Bv3.

for this bug:
1) have libgsmd automatically do reconnect attempts in the background

please also consider there can be conditions that the gsm module is offline

intentionally.
2) have libgsmd just return errors to all calls and do the reconnect inside the
application program

yes.

In any case, openmoko-dialer should check the return code of libgsmd function
calls and display a dialog box about gsmd not being available.

yes, dialer will check, but currently the return value is not defined

clearly enough to indicate the real status. I noticed that the value is bytes
it sends to the com port.

comment:6 Changed 12 years ago by laforge@…

Yes, gsmd runs on the GTA01Bv3 without any problems. Please refer to
http://wiki.openmoko.org/wiki/Manually_using_GSM
http://wiki.openmoko.org/wiki/Manually_using_GSM#Using_gsmd
http://wiki.openmoko.org/wiki/gsmd

Please make sure you use the most recent kernel and rootfs from
http://buildhost.openmoko.org/tmp/deploy/images/?C=M;O=D

As for the error reporting: I have read through the libgsmd code, and I cannot
find any occasion where proper error handling has not been implemented.

Can you please give an example where you do not get an error code from libgsmd?

comment:7 Changed 12 years ago by laforge@…

  • Status changed from assigned to closed
  • Resolution set to worksforme

it's the usual return value conventions: Everything >= 0 indicates success,
everything < 0 is an error.

So unless you get '0' reading from the gsmd socket, or a negative return value
from libgsmd_* api calls, the handle is valid.

comment:8 Changed 12 years ago by tonyguan@…

another scenario: when the dialer calls lgsm_pin() to submit the pin code,
besides the bytes that submitted, dialer will be more concerned about whether
the pin code is acceptable or not.
For such similar cases, how to make a synch command to modem?

comment:9 Changed 12 years ago by laforge@…

this is all event based. So unless gsmd asks the dialer to again prompt for a
pin, you can assume that it was valid.

Since we are using a realiable stream socket, we are guaranteed that the packet
with the command either arrives at gsmd, or we get an error in libgsmd (and
thus: the dialer app).

If gsmd is thus implemented correctly (it may still have bugs which we need to
resolve), you can safely assume that if not prompted for the PIN or PUK again (I
have actually tested even PIN reset using PUK after three times wrong PIN
recently), that it was successful.

comment:10 Changed 11 years ago by anonymous

  • Milestone Phase 0 deleted

Milestone Phase 0 deleted

comment:11 Changed 2 years ago by Chassmetly

Acquisto Cialis Con Postepay <a href=http://kama1.xyz/kamagra-cheap-online.php>Kamagra Cheap Online</a> Kamagra Gunstig Bestellen Amoxicillin Dosage Rat <a href=http://cial1.xyz/prices-cialis.php>Prices Cialis</a> Moteur A Baclofen Where I Can Buy Fast Flagyl No Rx <a href=http://lasix.ccrpdc.com/best-lasix-online.php>Best Lasix Online</a> Tuenti Propecia Progesterone Website Secure Ordering <a href=http://cial5mg.xyz/buy-cialis-online-usa.php>Buy Cialis Online Usa</a> Online Amoxicillin Order Cytotec Meilleur Prix Sans Ordonnance <a href=http://inderal.ccrpdc.com/buy-inderal.php>Buy Inderal</a> Free Overnight Viagra Shipping Lutein <a href=http://cial1.xyz/tadalafil.php>?Tadalafil</a> Antibiotics Quick Wothout Prescription

Note: See TracTickets for help on using tickets.