12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- // gfamininetdev.h :
- //
- #if !defined(AGD_GFAMININETDEV_H__A748DF9B_2D65_499F_952B_104B6F1228F7__INCLUDED_)
- #define AGD_GFAMININETDEV_H__A748DF9B_2D65_499F_952B_104B6F1228F7__INCLUDED_
- #include <gfagenericdev.h>
- #ifdef __cplusplus
- extern "C" {
- #endif // __cplusplus
- /////////////////////////////////////////////////////////////////////////////
- // gfamininetdev.h - Declarations:
- typedef void *HMINETDEV;
- /////////////////////////////////////////////////////////////////////////////
- typedef struct _GFA_MININET_DEV_CFG_PARAMS
- {
- const char *pszDeviceName;
- const void *pDevParams;
- size_t nSizeDevParams;
- GFA_GENERIC_DEVICE_INTERFACE itf;
- }GFA_MININET_DEV_CFG_PARAMS, *LPGFA_MININET_DEV_CFG_PARAMS;
- typedef const GFA_MININET_DEV_CFG_PARAMS *LPCGFA_MININET_DEV_CFG_PARAMS;
- /////////////////////////////////////////////////////////////////////////////
- HMINETDEV GfaMininetDeviceOpen(LPCGFA_MININET_DEV_CFG_PARAMS pmdcp);
- void GfaMininetDeviceClose(HMINETDEV hDev);
- ssize_t GfaMininetDeviceGetConfigParams(HMINETDEV hDev, void *pDevParams, size_t nSizeDevParams);
- int GfaMininetDeviceSetConfigParams(HMINETDEV hDev, const void *pDevParams, size_t nSizeDevParams);
- bool GfaMininetDeviceIsValidBaudrate(HMINETDEV hDev, uint32_t nBaudrate);
- int GfaMininetDeviceGetBaudrate(HMINETDEV hDev, uint32_t *pnBaudrate);
- int GfaMininetDeviceSetBaudrate(HMINETDEV hDev, uint32_t nBaudrate);
- bool GfaMininetDeviceGetTimeouts(HMINETDEV hDev, struct timeval *ptvRX, struct timeval *ptvTX);
- bool GfaMininetDeviceSetTimeouts(HMINETDEV hDev, const struct timeval *ptvRX, const struct timeval *ptvTX);
- ssize_t GfaMininetDevicePurgeRXBuffer(HMINETDEV hDev);
- ssize_t GfaMininetDeviceReceive(HMINETDEV hDev, void *pBuf, size_t nCbToRead); // blocking
- ssize_t GfaMininetDeviceRead(HMINETDEV hDev, void *pBuf, size_t nCbToRead); // not blocking
- ssize_t GfaMininetDevicePop(HMINETDEV hDev, uint8_t *pb); // 1 byte, blocking
- ssize_t GfaMininetDevicePeek(HMINETDEV hDev); // not blocking
- ssize_t GfaMininetDeviceTransmit(HMINETDEV hDev, const void *pData, size_t nCbData); // blocking
- ssize_t GfaMininetDeviceWrite(HMINETDEV hDev, const void *pData, size_t nCbData); // not blocking
- ssize_t GfaMininetDevicePush(HMINETDEV hDev, uint8_t b); // 1 byte, blocking
- /////////////////////////////////////////////////////////////////////////////
- #ifdef __cplusplus
- }
- #endif // __cplusplus
- #endif // !defined(AGD_GFAMININETDEV_H__A748DF9B_2D65_499F_952B_104B6F1228F7__INCLUDED_)
|