Hi,

Note: the text below will be seen better if copied to notepad or any fixed-width font 
viewer...

Here comes a part of my code: (I 've cut some checks...)

============================

void SerCommand(char *str) {
    SerSend(refNum,str, StrLen(str),&err);
}

Boolean SerReply(char *buf) {
UInt32  number=0;
UInt16  i;

    for (i=0;i<BUF_SIZE;i++)
        buf[i] = 0;

    err = SerReceiveWait(refNum,1,SysTicksPerSecond()*1);  // wait for any reply
    if (err) {
        SerClearErr(refNum);
        FrmCustomAlert(ConfirmAlert,"Failed to read","\nTimeout.","\n1char");
        return false;
    }
    err = SerReceiveWait(refNum,BUF_SIZE-1-32,SysTicksPerSecond()/2); // some time more
//  I can set larger tiem. *** IT DOESNOT AFFECT *** the problem.
    if (err == serErrLineErr) {
        SerClearErr(refNum);
        FrmCustomAlert(ConfirmAlert,"Failed to read","\nErrInLine.","\nnot 1char");
        return false;
    }

    err = SerReceiveCheck(refNum,&number);
    if (err == serErrLineErr) {
        SerClearErr(refNum);
        FrmCustomAlert(ConfirmAlert,"Failed to read","\nErrInLine.","\nCount buffer");
        return false;
    }

    if (SerReceive(refNum,buf,number,-1,&err)!=number) {
        if (err == serErrLineErr)
            SerClearErr(refNum);
        SerReceiveFlush(refNum,-1);
        FrmCustomAlert(ConfirmAlert,"Failed to read","\nLost in buffer.","\nCount 
buffer");
        return false;
    }
    return true;
}
===================================

Now the problem:

I have tried to send a set of commands via IrDA to cellular phones (Siemens S25 and 
Ericsson SH888)
and it works fine except for one specific command (+CSCA) sent to Ericsson only. The 
command is
<at+csca?> and Palm does not receive the whole phone reply. Just a part of it. I have 
to sent e.g.
<AT> command to get lost part of previous reply.

So the dump log for Ericsson SH888 (mystique splitting) and Siemens S25 (works fine) 
is below.

Record starting with -> means sent to phone, starting with <- means phone reply. I do 
sent 3
commands:
1. AT+CGMI
2. AT+CSCA?
3. AT
to both phones.
=====================

000000: 54 65 73 74 20 63 68 61  74 00 00 00 00 00 00 00 Test chat.......
000010: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00 ................
000020: 00 08 00 00 39 F0 6F 3F  39 F0 6F 7D 00 00 00 00 ....9.o?9.o}....
000030: 00 00 00 25 00 00 00 00  00 00 00 00 44 41 54 41 ...%........DATA
000040: 43 68 61 74 00 00 00 00  00 00 00 00 00 0C 00 00 Chat............
000050: 00 B0 40 28 30 01 00 00  00 BA 40 28 30 02 00 00 ..@(0.....@(0...
000060: 00 D8 40 28 30 03 00 00  00 E3 40 28 30 04 00 00 ..@(0.....@(0...
000070: 00 EE 40 28 30 05 00 00  00 F3 40 28 30 06 00 00 ..@(0.....@(0...
000080: 01 1E 40 28 30 07 00 00  01 28 40 28 30 08 00 00 ..@(0....(@(0...
000090: 01 43 40 28 30 09 00 00  01 4E 40 28 30 0A 00 00 .C@(0....N@(0...
0000A0: 01 7A 40 28 30 0B 00 00  01 7F 40 28 30 0C 7D 00 .z@(0.....@(0.}.
0000B0: 2D 3E 61 74 2B 63 67 6D  69 0D 3C 2D 61 74 2B 63 ->at+cgmi.<-at+c
0000C0: 67 6D 69 0D 0D 0A 45 52  49 43 53 53 4F 4E 20 20 gmi...ERICSSON
0000D0: 0D 0A 0D 0A 4F 4B 0D 0A  2D 3E 61 74 2B 63 73 63 ....OK..->at+csc
0000E0: 61 3F 0D 3C 2D 61 74 2B  63 73 63 61 3F 0D 2D 3E a?.<-at+csca?.->
0000F0: 61 74 0D 3C 2D 0D 0A 2B  43 53 43 41 3A 20 22 37 at.<-..+CSCA: "7
000100: 39 30 31 37 33 31 30 30  22 2C 31 34 35 0D 0A 0D 90173100",145...
000110: 0A 4F 4B 0D 0A 61 74 0D  0D 0A 4F 4B 0D 0A 2D 3E .OK..at...OK..->
000120: 61 74 2B 63 67 6D 69 0D  3C 2D 61 74 2B 63 67 6D at+cgmi.<-at+cgm
000130: 69 0D 0D 0A 53 49 45 4D  45 4E 53 0D 0A 0D 0A 4F i...SIEMENS....O
000140: 4B 0D 0A 2D 3E 61 74 2B  63 73 63 61 3F 0D 3C 2D K..->at+csca?.<-
000150: 61 74 2B 63 73 63 61 3F  0D 0D 0A 2B 43 53 43 41 at+csca?...+CSCA
000160: 3A 20 22 2B 37 39 30 31  37 33 31 30 30 22 2C 31 : "+790173100",1
000170: 34 35 0D 0A 0D 0A 4F 4B  0D 0A 2D 3E 61 74 0D 3C 45....OK..->at.<
000180: 2D 61 74 0D 0D 0A 4F 4B  0D 0A                   -at...OK..

=========================
So the final question: How one could explain this strange behaviour of Ericsson with 
CSCA command?
It works fine with other commands. And I can get lost part of second reply even if a 
do close
infrared port of Palm by hand before sending the last command. So it looks like some 
mistique of
SerReceiveCheck function....

--
Regards,
Konstantin
----------------------
http://klyatskin.da.ru
http://www.bigfoot.com/~klyatskin
mailto:[EMAIL PROTECTED]























-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/tech/support/forums/

Reply via email to