hi, everyone:
I tried to make palm pilot to receive the character(s) from another device.
But it wan't working at all. Anyone can tell look my code, and tell me how
to fix it?

static Boolean Get_Buffer_Data (unsigned char buffer_num,unsigned int
num_bytes , void * buf )
{
        Err serror;
        unsigned char buffer_sent;
        char* bufchar;
        num_bytes = 25;  // Here is how many characters palm pilot will
receive.
        
        bufchar = buf;
        if
((SerReceiveWait(serial_lib,num_bytes,5*SERIAL_TIMEOUT))==serErrTimeOut) {
                beep();
                beep();
     
                 SerClearErr(serial_lib);
                 SAMPLE_READY_FLAG = 0;
        
         }
        else { 
                 fieldptr_ldu_ch3v = FrmGetObjectPtr(FrmGetActiveForm(),
FrmGetObjectIndex(FrmGetActiveForm(), fieldID_ldu_ch3v));
          FldSetTextPtr(fieldptr_ldu_ch3v, "ELSE");
            FldRecalculateField(fieldptr_ldu_ch3v, true);
                SAMPLE_READY_FLAG = 1;
                
 
SerReceive(serial_lib,&buffer_sent,1,SERIAL_TIMEOUT,&serror);
                SerReceive(serial_lib,buf,num_bytes,SERIAL_TIMEOUT,&serror);
        }
    
    return 1;
}


Basically, what I am doing is that palm pilot will put the characters into
the field if palm pilot receive the characters. If not, plam pilot will put
character"ELSE" into the field, and show that palm pilot doesn't receive
anything.

thanks as advance.

Allen

Reply via email to