I am getting the following error when I call SerSend.

DEX 1.0 reports "SerialMgr68328.c Line 904, null ref" ...

Hopefully here is a code snippet that will hopefully show clearly and
simply how I am a idiot.

Err *SerErr;
UInt  RefNumber;

void tx_byte(char ch)
{
  static char tmp;
  
  tmp = ch;
  SerSend(RefNumber,&tmp,1,SerErr);
}


........
  err = SysLibFind("Serial Library",&RefNumber);
  ErrFatalDisplayIf(err!=0,"sysLibFind");


  err = SerOpen(RefNumber,0,9600);
  ErrFatalDisplayIf(err!=0,"SerOpen");

  SerSettingsType serial;
  serial.baudRate= 9600;
  serial.ctsTimeout = serDefaultCTSTimeout;
  serial.flags = serSettingsFlagBitsPerChar8 | 
                                       serSettingsFlagStopBits1;
        err = SerSetSettings(RefNumber,&serial);
  ErrFatalDisplayIf(err!=0,"SerSetSettings");
...
  tx_byte(ENQ);



I have looked at all the examples of setting up a serial connection
that I can find and I can't see what I am missing. 

Thanks

Reply via email to