wdbTyco.c
上传用户:luoyougen
上传日期:2008-05-12
资源大小:23136k
文件大小:2k
源码类别:

VxWorks

开发平台:

C/C++

  1. /* wdbTyco.c - WDB serial communication initialization library */
  2. /* Copyright 1998 Wind River Systems, Inc. */
  3. /*
  4. modification history
  5. --------------------
  6. 01b,22may98,dbt  reworked
  7. 01a,11mar98,ms   written
  8. */
  9. /*
  10. DESCRIPTION
  11. For obsolete tyCoDrv style serial drivers.
  12. NOMANUAL
  13. */
  14. /* lower WDB_MTU to SLMTU bytes for serial connection */
  15. #if     WDB_MTU > SLMTU
  16. #undef  WDB_MTU
  17. #define WDB_MTU SLMTU
  18. #endif  /* WDB_MTU > SLMTU */
  19. /******************************************************************************
  20. *
  21. * wdbCommDevInit - initialize the serial connection
  22. *
  23. * This routine initializes the serial connection for tyCoDrv style serial
  24. * drivers used by the WDB agent.
  25. *
  26. * RETURNS :
  27. * OK or ERROR if the serial connection can not be initialized.
  28. *
  29. * NOMANUAL
  30. */
  31. STATUS wdbCommDevInit
  32.     (
  33.     WDB_COMM_IF * pCommIf,
  34.     char **  ppWdbInBuf,
  35.     char ** ppWdbOutBuf
  36.     )
  37.     {
  38.     static WDB_TYCO_SIO_CHAN tyCoSioChan; /* serial I/O device */
  39.     static WDB_SLIP_PKT_DEV wdbSlipPktDev; /* SLIP packet device */
  40.     static uint_t wdbInBuf [WDB_MTU/4];
  41.     static uint_t wdbOutBuf [WDB_MTU/4];
  42.     /* update input & output buffer pointers */
  43.     *ppWdbInBuf = (char *) wdbInBuf;
  44.     *ppWdbOutBuf = (char *) wdbOutBuf;
  45.     /* update communication interface mtu */
  46.     wdbCommMtu = WDB_MTU;
  47.     /* an old VxWorks serial driver - supports a task agent */
  48.     wdbTyCoDevInit (&tyCoSioChan, WDB_TTY_DEV_NAME, WDB_TTY_BAUD);
  49. #ifdef  INCLUDE_WDB_TTY_TEST
  50.     wdbSioTest ((SIO_CHAN *)&tyCoSioChan, SIO_MODE_INT, 0);
  51. #endif  /* INCLUDE_WDB_TTY_TEST */
  52.     wdbSlipPktDevInit (&wdbSlipPktDev, (SIO_CHAN *)&tyCoSioChan, udpRcv);
  53.     if (udpCommIfInit (pCommIf, &wdbSlipPktDev.wdbDrvIf) == ERROR)
  54. return (ERROR);
  55.     return (OK);
  56.     }