Index: cifXAPI_Wrapper.h =================================================================== --- cifXAPI_Wrapper.h (revision 5795) +++ cifXAPI_Wrapper.h (working copy) @@ -55,6 +55,7 @@ typedef int32_t(APIENTRY *PFN_xDriverEnumBoards )( CIFXHANDLE hDriver, uint32_t ulBoard, uint32_t ulSize, void* pvBoardInfo); typedef int32_t(APIENTRY *PFN_xDriverEnumChannels )( CIFXHANDLE hDriver, uint32_t ulBoard, uint32_t ulChannel, uint32_t ulSize, void* pvChannelInfo); typedef int32_t(APIENTRY *PFN_xDriverMemoryPointer )( CIFXHANDLE hDriver, uint32_t ulBoard, uint32_t ulCmd,void* pvMemoryInfo); +typedef int32_t(APIENTRY *PFN_xDriverRestartDevice )( CIFXHANDLE hDriver, char* szBoardName, void* pvData); /* System device depending functions */ typedef int32_t(APIENTRY *PFN_xSysdeviceOpen )( CIFXHANDLE hDriver, char* szBoard, CIFXHANDLE* phSysdevice); @@ -117,6 +118,7 @@ PFN_xDriverEnumBoards pfnxDriverEnumBoards; PFN_xDriverEnumChannels pfnxDriverEnumChannels; PFN_xDriverMemoryPointer pfnxDriverMemoryPointer; + PFN_xDriverRestartDevice pfnxDriverRestartDevice; PFN_xSysdeviceOpen pfnxSysdeviceOpen; PFN_xSysdeviceClose pfnxSysdeviceClose; PFN_xSysdeviceReset pfnxSysdeviceReset; Index: CifXTransport.c =================================================================== --- CifXTransport.c (revision 5795) +++ CifXTransport.c (working copy) @@ -752,6 +752,31 @@ } break; + /*************************************************************************** + * xDriverRestartDevice + ***************************************************************************/ + case MARSHALLER_DRV_METHODID_RESTARTDEVICE: + { + PDRV_RESTARTDEVICE_REQ_T ptEnumReq = (PDRV_RESTARTDEVICE_REQ_T)(ptMarshallerHeader); + uint32_t ulDataSize = ptMarshallerHeader->ulDataSize; + + ptMarshallerHeader->ulDataSize = 0; + + if(ulDataSize != sizeof(ptEnumReq->tData)) + { + lRet = CIFX_INVALID_PARAMETER; + + } else if(!ptInstance->tDRVFunctions.pfnxDriverRestartDevice) + { + lRet = CIFX_FUNCTION_NOT_AVAILABLE; + + } else + { + lRet = ptInstance->tDRVFunctions.pfnxDriverRestartDevice(ptInstance->hDriver, ptEnumReq->tData.abBoardName, NULL); + } + } + break; + default: /* Unknown/unsupported method ID */ lRet = CIFX_INVALID_PARAMETER; Index: MarshallerFrame.h =================================================================== --- MarshallerFrame.h (revision 5795) +++ MarshallerFrame.h (working copy) @@ -50,6 +50,7 @@ #define MARSHALLER_DRV_METHODID_ENUMCHANNELS 0x00000006 /*!< Driver Object: xDriverEnumChannels */ #define MARSHALLER_DRV_METHODID_OPENCHANNEL 0x00000008 /*!< Driver Object: xDriverOpenChannel */ #define MARSHALLER_DRV_METHODID_OPENSYSDEV 0x00000009 /*!< Driver Object: xDriverSysDeviceOpen */ +#define MARSHALLER_DRV_METHODID_RESTARTDEVICE 0x00000010 /*!< Driver Object: xDriverRestartDevice */ #define MARSHALLER_SYSDEV_METHODID_CLOSE 0x00000001 /*!< Sysdevice Object: xSysdeviceClose */ #define MARSHALLER_SYSDEV_METHODID_INFO 0x00000002 /*!< Sysdevice Object: xSysdeviceInfo */ @@ -239,6 +240,23 @@ } DRV_ENUMCHANNELS_REQ_T, *PDRV_ENUMCHANNELS_REQ_T; +/*****************************************************************************/ +/*! Driver - xDriverRestartDevice request */ +/*****************************************************************************/ +typedef struct DRV_RESTARTDEVICE_REQ_DATA_Ttag +{ + char abBoardName[CIFx_MAX_INFO_NAME_LENTH]; + +} DRV_RESTARTDEVICE_REQ_DATA_T, *PDRV_RESTARTDEVICE_REQ_DATA_T; + +typedef struct DRV_RESTARTDEVICE_REQ_Ttag +{ + MARSHALLER_DATA_FRAME_HEADER_T tHeader; + DRV_RESTARTDEVICE_REQ_DATA_T tData; + +} DRV_RESTARTDEVICE_REQ_T, *PDRV_RESTARTDEVICE_REQ_T; + + /***************************************************************************** ____ _ _ / ___| _ _ ___ __| | ___ __ __ (_) ___ ___