Files
sics/multichan.h
Douglas Clowes b95298e92c Make MultiChan a SICS object (command)
r1504 | dcl | 2007-02-19 12:23:27 +1100 (Mon, 19 Feb 2007) | 2 lines
2012-11-15 12:59:48 +11:00

42 lines
1.2 KiB
C

/*
* M U L T I C H A N
*
* This module manages communications on a multi-channel controller.
*
* A multi-channel controller is one where multiple channels or units are on a
* single controller and share a single command channel.
*
* Douglas Clowes, February 2007
*
*/
#ifndef SICSMULTICHAN
#define SICSMULTICHAN
#define MCC_DISCONNECT 101
#define MCC_RECONNECT 102
typedef struct __MultiChan MultiChan, *pMultiChan;
int MultiChanFactory(SConnection *pCon, SicsInterp *pSics,
void *pData, int argc, char *argv[]);
int MultiChanCreate(const char* controller, pMultiChan* handle);
int MultiChanDestroy(pMultiChan handle);
int MultiChanReconnect(pMultiChan handle);
mkChannel* MultiChanGetSocket(pMultiChan handle);
typedef int (*MCC_Transmit)(void* context);
typedef int (*MCC_Receive)(void* context, int ch);
int MultiChanEnque(pMultiChan unit, void* context, MCC_Transmit tx, MCC_Receive rx);
int MultiChanWrite(pMultiChan unit, void* buffer, int buflen);
typedef void (*MCC_Notify)(void* context, int event);
void MultiChanSetNotify(pMultiChan unit, void* context, MCC_Notify notify);
int MultiChanGetTimeout(pMultiChan unit);
int MultiChanSetTimeout(pMultiChan unit, int timeout);
#endif /* SICSMULTICHAN */