Re: [PATCH] smsc_at2.c error string

Alvaro Cornejo <[email protected]>
Newsgroups gmane.comp.mobile.kannel.devel
Message-ID <[email protected]>
Hi Vincent

Might it be possible to show the message error number/code in the
error message text? This way it will be easyer to google for
additional information.

someting like:


     case 0:
         /*
          * Station cannot be reached because, although the number is in a
          * valid format, it is not currently assigned (allocated).
          */
        return "[0] Unassigned (unallocated) number (+CMS) or No
connection to phone (+CME)";
    case 2:
        return "[2] Phone-adaptor link reserved";
     case 3:
         /*
          * This can be a lot of things, depending upon the command,
but in general
          * it relates to invaid parameters being passed.
          */
         return "[3] Operation / Parameter(s) not supported";
    case 5:
        return "[5] PH-SIM PIN required";
...

     default:
        return "[code] Error number unknown. Ask google and add it";

This will also help people parse the logs

Regards

Alvaro


|-----------------------------------------------------------------------------------------------------------------|
Envíe y Reciba Datos y mensajes de Texto (SMS) hacia y desde cualquier
celular y Nextel
en el Perú, México y en mas de 180 paises. Use aplicaciones 2 vias via
SMS y GPRS online
              Visitenos en www.perusms.NET www.smsglobal.com.mx y
www.pravcom.com



On Thu, Jun 18, 2009 at 9:50 AM, Vincent
CHAVANIS<[email protected]> wrote:
>
> Here is the revision of the latest patch i've submited.
> - Now handling +CME ERRORS
> - Added more detailled descriptions from +CME ERRORS
> - Added specs sources
>
> Vincent.
>
>
> Alexander Malysh a écrit :
>>
>> commited to cvs.
>>
>> Thanks,
>> Alex
>>
>> Am 17.06.2009 um 14:26 schrieb Vincent CHAVANIS:
>>
>>> This one should fit.
>>>
>>> Vincent.
>>>
>>> Alexander Malysh a écrit :
>>>>
>>>> sorry, but still the same:
>>>> +    case 0:
>>>> +      /*
>>>> +       * Default the code to 0 then when you extract the value from the
>>>> +       * modem response message and no code is found, 0 will result.
>>>> +       */
>>>> +      return "Modem returned ERROR but no error code - possibly
>>>> unsupported or invalid command?";
>>>> indents are 4 spaces instead of 2.
>>>> Thanks,
>>>> Alex
>>>> Am 17.06.2009 um 13:24 schrieb Vincent CHAVANIS:
>>>>>
>>>>> yep, you're right.
>>>>>
>>>>> new file attached.
>>>>> without blank comments, and text cleaned.
>>>>>
>>>>> Vincent.
>>>>>
>>>>> Alexander Malysh a écrit :
>>>>>>
>>>>>> Hi Vincent,
>>>>>> some comments:
>>>>>> +            error(0, "AT2[%s]: [%d/%ld] Initialization of device
>>>>>> failed.", octstr_get_cstr(privdata->name),
>>>>>> +                     error_count, privdata->max_error_count);
>>>>>> this is not very informative for kannel user. Please write out
>>>>>> something like Init failed errors X from max errors X.
>>>>>> please kill comments like this:
>>>>>> +      /*
>>>>>> +       */
>>>>>> please fix indentation, we use 4 spaces...
>>>>>> Thanks,
>>>>>> Alex
>>>>>> Am 17.06.2009 um 12:56 schrieb Vincent CHAVANIS:
>>>>>>>
>>>>>>> From an old thread
>>>>>>> (http://www.mail-archive.com/[email protected]/msg07693.html)
>>>>>>> Alex moved the at2_error_string into smsc_at.c
>>>>>>>
>>>>>>> 2004-09-18 Alexander Malysh <amalysh at kannel.org>
>>>>>>>  * gw/smsc/smsc_at.c: added new function 'at2_error_string' and
>>>>>>> teached
>>>>>>>   smsc_at to use it.
>>>>>>>
>>>>>>> But some error codes are missing.
>>>>>>> 1472:2009-06-16 16:00:59.0442 [2255] [8] ERROR: AT2[WAVECOM]: Generic
>>>>>>> error: +CME ERROR: 515
>>>>>>> 2710:2009-06-16 23:35:40.0142 [2255] [8] ERROR: AT2[WAVECOM]: CMS
>>>>>>> ERROR: +CMS ERROR: 513
>>>>>>> 2711:2009-06-16 23:35:40.0142 [2255] [8] ERROR: AT2[WAVECOM]: CMS
>>>>>>> ERROR: Error number unknown. Ask google and add it. (513)
>>>>>>>
>>>>>>> Each code is more or less detailled on comments
>>>>>>> I think this should be left as it as there are no documentation on
>>>>>>> it.
>>>>>>>
>>>>>>> This patch also prints the counter before the reset-string.
>>>>>>>
>>>>>>> Vincent.
>>>>>>>
>>>>> <smsc_at2_error_string_patch_v2.txt>
>>>
>>> --
>>> Telemaque - 06560 SOPHIA-ANTIPOLIS - (FR)
>>> Service Technique/Reseau - NOC
>>> Direction du Developpement xMS+
>>> http://www.telemaque.fr/
>>> [email protected]
>>> Tel : +33 4 92 90 99 84 (fax 9142)
>>> <smsc_at2_error_string_patch_v3.txt>
>>
>>
>>
>
> --
> Telemaque - 06560 SOPHIA-ANTIPOLIS - (FR)
> Service Technique/Reseau - NOC
> Direction du Developpement xMS+
> http://www.telemaque.fr/
> [email protected]
> Tel : +33 4 92 90 99 84 (fax 9142)
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.