gnokii-users
[Top][All Lists]
Advanced

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

RE: CVS update


From: Marcin Wiacek
Subject: RE: CVS update
Date: Tue, 2 Apr 2002 12:31:25 +0200

> * the following is just a simple workaround, so I rejected it:
>     snprintf(foo, foosize, ...)
>     foo[foosize-1] = 0
>   the real problem is the broken snprintf() implementation in
> VC6. We _will_
>   solve the real problem, I have found a GPL compatible snprintf()
>   implementation (please wait some days). Maybe there are 
> some *nix platform
>   too, where snprintf() isn't available or broken.
OK. Maybe don't use snprintf ?

> * message dumping patch: I don't like it. This format is hard 
> to read (at
>   last for me).
Message received: 0x1b / 0x0037
01 |1c |00 |04 |00 |56V|20 |300|355|2e.|355|366|0a |322|355|2d
.....V 05.56.25-
300|311|2d-|300|322|0a |4eN|50P|45E|2d-|333|0a |28(|63c|29)|20
01-02.NPE-3.(c) 
4eN|4dM|50P|2e.|00 |4dM|50P|2e.|00 |4dM|50P|2e.|00 |00 |00 |00
NMP..MP..MP.....
00 |00 |00 |00 |00 |01 |00
.......         

So OK. See source. Debug will look like this one. On left you have char
+ char code. You see, how it look exactly. On right short info about
frame - only chars like they look. It's easy to find location for char.

/* Dumps a message */
void SM_DumpMessage(int messagetype, unsigned char *message, int
messagesize)
{
        int i;
        char buf[17];

        buf[16] = 0;

        dump("0x%02x / 0x%04x", messagetype, messagesize);

        for (i = 0; i < messagesize; i++) {
                if (i % 16 == 0) {
                        if (i != 0) dump(" %s", buf);
                        dump("\n");
                        memset(buf, ' ', 16);
                } else {
                        dump("|");
                }
                dump("%02x", message[i]);
                if (isprint(message[i])) {
                        if ((i+1) % 16 != 0) dump("%c", message[i]);
                        buf[i % 16] = message[i];
                } else {
                        if ((i+1) % 16 != 0) dump(" ");
                        buf[i % 16] = '.';
                }
        }

        if (i % 16) dump("%*s %s", 4 * (16 - i % 16) - 1, "", buf);
        dump("\n");
}


> I'll continue this work tomorrow.
AFAIR, only gsm-sms.c functions need to be moved to gsm-encoding.c
additionaly. So, I hope to see progress fast.

Pozdrowienia/Best Regards
-- 
Marcin Wiacek (mailto:address@hidden,
http://marcin-wiacek.topnet.pl, http://marcin-wiacek.fkn.pl/)

mygnokii mirrors (http://www.mds.mdh.se/~cel95eig/mygnokii/,
http://grumble.zereau.com/gnokii/, http://reinhold.bachrain.de/)
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]