Exported C functions for camera link protocol drivers. More...
Go to the source code of this file.
Classes | |
struct | clpLogCallback_t |
Macros | |
#define | CLPROTOCOL __attribute__((cdecl)) |
#define | CLPROTOCOL_DECL __attribute__((visibility("default"))) |
#define | CLPROTOCOLEXPORT USER_EXTERN_C __attribute__((visibility("default"))) |
#define | USER_EXTERN_C |
#define | USER_EXTERN_C_END |
#define | USER_EXTERN_C_START |
Typedefs | |
typedef void(CLPROTOCOL * | clp_logger_t) (CLINT32 level, const char *stringFormat, va_list argptr) |
typedef USER_EXTERN_C_START struct clpLogCallback_t | clpLogCallback_t |
Enumerations | |
enum | CLP_LOG_LEVEL_VALUE { CLP_LOG_FATAL = 0, CLP_LOG_ALERT = 100, CLP_LOG_CRIT = 200, CLP_LOG_ERROR = 300, CLP_LOG_WARN = 400, CLP_LOG_NOTICE = 500, CLP_LOG_INFO = 600, CLP_LOG_DEBUG = 700, CLP_LOG_NOTSET = 800 } |
enum | CLP_PARAMS { CLP_LOG_LEVEL = 1, CLP_LOG_CALLBACK = 2, CLP_STOP_PROBE_DEVICE = 3, CLP_DEVICE_BAUDERATE = -1, CLP_DEVICE_SUPPORTED_BAUDERATES = -2 } |
Types of parameters to be accessed by clpGetParam/clpSetParam. More... | |
Functions | |
CLPROTOCOLEXPORT CLINT32 CLPROTOCOL | clpCloseLib (void) |
This function is call to close the library before unloading. More... | |
CLPROTOCOLEXPORT CLINT32 CLPROTOCOL | clpContinueWriteRegister (ISerial *pSerial, const CLUINT32 Cookie, const BOOL8 ContinueWaiting, const CLUINT32 TimeOut) |
Calling This function is called after a write function returned CL_ERR_PENDING_WRITE. It either issues another wait for write cycle or cancels the write action. More... | |
CLPROTOCOLEXPORT CLINT32 CLPROTOCOL | clpDisconnect (const CLUINT32 Cookie) |
This function disconnects the DLL from the device. More... | |
CLPROTOCOLEXPORT CLINT32 CLPROTOCOL | clpGetCLProtocolVersion (CLUINT32 *pVersionMajor, CLUINT32 *pVersionMinor) |
This function returns the version of the CLProtocol interface version. More... | |
CLPROTOCOLEXPORT CLINT32 CLPROTOCOL | clpGetErrorText (CLINT32 errorCode, CLINT8 *errorText, CLUINT32 *errorTextSize, const CLUINT32 Cookie=0) |
This function converts an error code to error text for display in a dialog box or in a standard I/O window. More... | |
CLPROTOCOLEXPORT CLINT32 CLPROTOCOL | clpGetEventData (const CLUINT32 Cookie, CLINT8 *pBuffer, CLUINT32 *pBufferSize) |
This function is call to get a possible event by a CLProtocol. More... | |
CLPROTOCOLEXPORT CLINT32 CLPROTOCOL | clpGetParam (ISerial *pSerial, CLP_PARAMS param, const CLUINT32 Cookie, CLINT8 *pBuffer, const CLINT64 BufferSize, const CLUINT32 TimeOut) |
This function is call to read a CLProtocol parameter value. More... | |
CLPROTOCOLEXPORT CLINT32 CLPROTOCOL | clpGetShortDeviceIDTemplates (CLINT8 *pShortDeviceTemplates, CLUINT32 *pBufferSize) |
This function returns a list of short device templates coded into a single string. More... | |
CLPROTOCOLEXPORT CLINT32 CLPROTOCOL | clpGetXMLDescription (ISerial *pSerial, const CLUINT32 Cookie, const CLINT8 *pXMLID, CLINT8 *pXMLBuffer, CLUINT32 *pBufferSize, const CLUINT32 TimeOut) |
This function retrieves an XML file from the camera if possible. More... | |
CLPROTOCOLEXPORT CLINT32 CLPROTOCOL | clpGetXMLIDs (ISerial *pSerial, const CLUINT32 Cookie, CLINT8 *pXMLIDs, CLUINT32 *pBufferSize, const CLUINT32 TimeOut) |
This function returns a list of XML IDs coded into a single string. More... | |
CLPROTOCOLEXPORT CLINT32 CLPROTOCOL | clpInitLib (clp_logger_t logger, CLP_LOG_LEVEL_VALUE logLevel) |
This function is call to initialize the library after it is loaded. More... | |
CLPROTOCOLEXPORT CLINT32 CLPROTOCOL | clpIsParamSupported (CLP_PARAMS param) |
This function is call know if a parameter is supported by a CLProtocol. More... | |
CLPROTOCOLEXPORT CLINT32 CLPROTOCOL | clpProbeDevice (ISerial *pSerial, const CLINT8 *pDeviceIDTemplate, CLINT8 *pDeviceID, CLUINT32 *pBufferSize, CLUINT32 *pCookie, const CLUINT32 TimeOut) |
Connects and identifies the device and returns a DeviceID. More... | |
CLPROTOCOLEXPORT CLINT32 CLPROTOCOL | clpReadRegister (ISerial *pSerial, const CLUINT32 Cookie, const CLINT64 Address, CLINT8 *pBuffer, const CLINT64 BufferSize, const CLUINT32 TimeOut) |
This function reads numBytes from the serial device referred to by serialRef. clSerialRead will return when numBytes are available at the serial port or when the serialTimeout period has passed. More... | |
CLPROTOCOLEXPORT CLINT32 CLPROTOCOL | clpSetParam (ISerial *pSerial, CLP_PARAMS param, const CLUINT32 Cookie, const CLINT8 *pBuffer, const CLINT64 BufferSize, const CLUINT32 TimeOut) |
This function is call to change a CLProtocol parameter value. More... | |
CLPROTOCOLEXPORT CLINT32 CLPROTOCOL | clpWriteRegister (ISerial *pSerial, const CLUINT32 Cookie, const CLINT64 Address, const CLINT8 *pBuffer, const CLINT64 BufferSize, const CLUINT32 TimeOut) |
This function writes numBytes to the serial device referred to by serialRef. clSerialRead will return when numBytes are available at the serial port or when the serialTimeout period has passed. More... | |
Exported C functions for camera link protocol drivers.
Definition in file CLProtocol.h.
#define CLPROTOCOL __attribute__((cdecl)) |
Definition at line 73 of file CLProtocol.h.
#define CLPROTOCOL_DECL __attribute__((visibility("default"))) |
Definition at line 64 of file CLProtocol.h.
#define CLPROTOCOLEXPORT USER_EXTERN_C __attribute__((visibility("default"))) |
Definition at line 63 of file CLProtocol.h.
#define USER_EXTERN_C |
Definition at line 45 of file CLProtocol.h.
#define USER_EXTERN_C_END |
Definition at line 47 of file CLProtocol.h.
#define USER_EXTERN_C_START |
Definition at line 46 of file CLProtocol.h.
typedef void(CLPROTOCOL * clp_logger_t) (CLINT32 level, const char *stringFormat, va_list argptr) |
Definition at line 84 of file CLProtocol.h.
typedef USER_EXTERN_C_START struct clpLogCallback_t clpLogCallback_t |
enum CLP_LOG_LEVEL_VALUE |
Enumerator | |
---|---|
CLP_LOG_FATAL | |
CLP_LOG_ALERT | |
CLP_LOG_CRIT | |
CLP_LOG_ERROR | |
CLP_LOG_WARN | |
CLP_LOG_NOTICE | |
CLP_LOG_INFO | |
CLP_LOG_DEBUG | |
CLP_LOG_NOTSET |
Definition at line 116 of file CLProtocol.h.
enum CLP_PARAMS |
Types of parameters to be accessed by clpGetParam/clpSetParam.
Enumerator | |
---|---|
CLP_LOG_LEVEL | |
CLP_LOG_CALLBACK | A 32-bit value that contains the current log level. This parameter expects a value represented by the CLP_LOG_LEVEL_VALUE constants. |
CLP_STOP_PROBE_DEVICE | A 32-bit value that contains a clpLogCallback_t pointer to the logger function. |
CLP_DEVICE_BAUDERATE | A 32-bit value that contains a signal to stop all running ProbeDevice. |
CLP_DEVICE_SUPPORTED_BAUDERATES | A 32-bit value that contains the baudrate used to communicate with the device. This parameter expects a value represented by the CL_BAUDRATE_XXX constants. |
Definition at line 94 of file CLProtocol.h.
CLPROTOCOLEXPORT CLINT32 CLPROTOCOL clpCloseLib | ( | void | ) |
This function is call to close the library before unloading.
CL_ERR_NO_ERR | No error occurred |
CLPROTOCOLEXPORT CLINT32 CLPROTOCOL clpContinueWriteRegister | ( | ISerial * | pSerial, |
const CLUINT32 | Cookie, | ||
const BOOL8 | ContinueWaiting, | ||
const CLUINT32 | TimeOut | ||
) |
Calling This function is called after a write function returned CL_ERR_PENDING_WRITE. It either issues another wait for write cycle or cancels the write action.
This function must be called if clpWriteRegister or clpContinueWriteRegister returns CL_ERR_PENDING_WRITE.
Note, that the CLProtocol.dll is responsible for preventing an endless number of calls to this function by tracking the total time elapsed since the original call and returning CL_ERR_TIMEOUT if this time is larger than the write operation should normally take place.
[in] | pSerial | The interface giving access to the serial port |
[in] | Cookie | ManToken supplied by the driver dll via the clpProbeDevice function. |
[in] | ContinueWaiting | If true the function will block waiting for the previous call to clpWriteRegister to finish. If false the call will be cancelled. |
[in] | TimeOut | A timeout value in [ms] used during accessing the device. |
CL_ERR_NO_ERR | No error occurred |
CL_ERR_TIMEOUT | A timeout occurred |
CL_ERR_INVALID_COOKIE | The cookie supplied is invalid |
CL_ERR_PENDING_WRITE | The timeout has expired but the write is still pending for a good reason. The next call must be clpContinueWriteRegister |
CLPROTOCOLEXPORT CLINT32 CLPROTOCOL clpDisconnect | ( | const CLUINT32 | Cookie | ) |
This function disconnects the DLL from the device.
When this function is called all resources allocated in the driver DLL and associated with the Cookie are deleted and the Cookie becomes invalid.
[in] | Cookie | ManToken supplied by the driver dll via the clpProbeDevice function. |
CL_ERR_NO_ERR | No error occurred |
CL_ERR_INVALID_COOKIE | The cookie supplied is invalid |
CLPROTOCOLEXPORT CLINT32 CLPROTOCOL clpGetCLProtocolVersion | ( | CLUINT32 * | pVersionMajor, |
CLUINT32 * | pVersionMinor | ||
) |
This function returns the version of the CLProtocol interface version.
The function is required to ensure this interface can be extended.
[out] | pVersionMajor | If this parameter changes backward compatibility is broken. |
[out] | pVersionMinor | If this parameter changes backward compatibility is maintained. |
CL_ERR_NO_ERR | No error occurred |
CLPROTOCOLEXPORT CLINT32 CLPROTOCOL clpGetErrorText | ( | CLINT32 | errorCode, |
CLINT8 * | errorText, | ||
CLUINT32 * | errorTextSize, | ||
const CLUINT32 | Cookie = 0 |
||
) |
This function converts an error code to error text for display in a dialog box or in a standard I/O window.
Note: clGetErrorText first looks for the error code in CCTserial.dll. If the error code is not found in CCTserial.dll, it is not a standard Camera Link error. clGetErrorText then passes the error code to the manufacturer-specific .dll, which returns the manufacturer-specific error text.
[in] | errorCode | The error code used to find the appropriate error text. An error code is returned by every function in this library. |
[out] | errorText | A caller-allocated buffer which contains the NULL-terminated error text on function return. |
[in,out] | errorTextSize | On success, contains the number of bytes written into the buffer, including the NULL-termination character. This value should be the size in bytes of the error text buffer passed in. On CL_ERR__BUFFER_TOO_SMALL, contains the size of the buffer needed to write the error text. |
[in] | Cookie | Used only for CL_ERR_GET_LAST_ERROR. Returns the last error fired on the connection identified by the Cookie |
CL_ERR_NO_ERR | No error occurred |
CL_ERR_BUFFER_TOO_SMALL | The pDeviceID buffer is too small |
CL_ERR_ERROR_NOT_FOUND | No error string could be retrieved for the given error number |
CLPROTOCOLEXPORT CLINT32 CLPROTOCOL clpGetEventData | ( | const CLUINT32 | Cookie, |
CLINT8 * | pBuffer, | ||
CLUINT32 * | pBufferSize | ||
) |
This function is call to get a possible event by a CLProtocol.
[in] | pSerial | Pointer to the interface giving access to the serial port |
[in] | Cookie | Token supplied by the driver dll via the clpProbeDevice function. |
[out] | pBuffer | A pointer to a user-allocated buffer into which the function copies the event data. |
[in,out] | pBufferSize | As an input, the value contains the size of the buffer that is passed through the pBuffer parameter. On successful return, this parameter contains the number of bytes written into the buffer, including the NULL termination character. On CL_ERR_BUFFER_TOO_SMALL, this parameter contains the size of the buffer needed to write the data text. |
CL_ERR_NO_ERR | The next event is copied to pBuffer |
CL_ERR_TIMEOUT | There was no new event received |
CL_ERR_BUFFER_TOO_SMALL | The pBuffer is too small |
CL_ERR_INVALID_COOKIE | The cookie supplied is invalid |
CLPROTOCOLEXPORT CLINT32 CLPROTOCOL clpGetParam | ( | ISerial * | pSerial, |
CLP_PARAMS | param, | ||
const CLUINT32 | Cookie, | ||
CLINT8 * | pBuffer, | ||
const CLINT64 | BufferSize, | ||
const CLUINT32 | TimeOut | ||
) |
This function is call to read a CLProtocol parameter value.
[in] | param | The parameter to read. |
[in] | Cookie | Token supplied by the driver dll via the clpProbeDevice function. Some parameters ignore the Cookie. |
[in] | pBuffer | Points to a user-allocated buffer. Upon a successful call, buffer contains the value of the parameter. |
[in] | BufferSize | This is the number of bytes to be written. Caller must ensure that buffer size match the parameters size. |
[in] | TimeOut | A timeout value in [ms] used during accessing the device. |
CL_ERR_NO_ERR | No error occurred |
CL_ERR_TIMEOUT | A timeout occurred |
CL_ERR_PARAM_NOT_SUPPORTED | The parameters is not supported |
CLPROTOCOLEXPORT CLINT32 CLPROTOCOL clpGetShortDeviceIDTemplates | ( | CLINT8 * | pShortDeviceTemplates, |
CLUINT32 * | pBufferSize | ||
) |
This function returns a list of short device templates coded into a single string.
Short device templates can have the following form: - <CODE>"CameraManufacturer"</CODE> - <CODE>"CameraManufacturer#CameraFamily"</CODE> - <CODE>"CameraManufacturer#CameraFamily#CameraModel"</CODE> As compared to the long version the protocol driver dll's directory and file name is missing at the beginning. The device templates are separated by tabulators. The whole list is contained in a NULL terminated string.
[out] | pShortDeviceTemplates | A pointer to a user-allocated buffer into which the function copies the list of device template names. |
[in,out] | pBufferSize | As an input, the value contains the size of the buffer that is passed through the pShortDeviceTemplates parameter. On successful return, this parameter contains the number of bytes written into the buffer, including the NULL termination character. On CL_ERR_BUFFER_TOO_SMALL, this parameter contains the size of the buffer needed to write the data text. |
CL_ERR_NO_ERR | No error occurred |
CL_ERR_BUFFER_TOO_SMALL | The pShortDeviceTemplates is too small |
CLPROTOCOLEXPORT CLINT32 CLPROTOCOL clpGetXMLDescription | ( | ISerial * | pSerial, |
const CLUINT32 | Cookie, | ||
const CLINT8 * | pXMLID, | ||
CLINT8 * | pXMLBuffer, | ||
CLUINT32 * | pBufferSize, | ||
const CLUINT32 | TimeOut | ||
) |
This function retrieves an XML file from the camera if possible.
The DLL may ask the camera for the XML code, or may have the code as a resource compiled in itself or even may have it's own private registry mechanism installed. In order to support the latter use case the long DeviceID is supplied which contains the driver dll's directory.
[in] | pSerial | Pointer to the interface giving access to the serial port |
[in] | Cookie | Token supplied by the driver dll via the clpProbeDevice function. |
[in] | pXMLID | A pointer to a NULL terminated string containing the connected device's XML ID |
[out] | pXMLBuffer | A pointer to a user-allocated buffer. Can be NULL if only the size of the buffer is requested (see pBufferSize) |
[in,out] | pBufferSize | pBufferSize As an input, the value contains the size of the buffer that is passed through the pDeviceID parameter. On successful return, this parameter contains the number of bytes written into the buffer, including the NULL termination character. On CL_ERR_BUFFER_TOO_SMALL, this parameter contains the size of the buffer needed to write the data text. |
[in] | TimeOut | A timeout value in [ms] used during accessing the device. Note that the execution of the function itself can take longer than TimeOut because more than one access might be necessary. |
CL_ERR_NO_ERR | No error occurred |
CL_ERR_BUFFER_TOO_SMALL | The pDeviceID buffer is too small |
CL_ERR_NO_XMLDESCRIPTION_FOUND | No XML description could be retrieved for the given XML ID |
CL_ERR_TIMEOUT | A timeout occurred |
CL_ERR_INVALID_COOKIE | The cookie supplied is invalid |
CLPROTOCOLEXPORT CLINT32 CLPROTOCOL clpGetXMLIDs | ( | ISerial * | pSerial, |
const CLUINT32 | Cookie, | ||
CLINT8 * | pXMLIDs, | ||
CLUINT32 * | pBufferSize, | ||
const CLUINT32 | TimeOut | ||
) |
This function returns a list of XML IDs coded into a single string.
XML IDs have the following form:
"SchemaVersion.1.1@CameraManufacturer#CameraFamily#CameraModel@XMLVersion.2.3.4"
The first part of the XML ID denotes the major and minor version number of the XML schema. The last part of the XML ID denotes the major, minor, and subminor version number of the camera. Both version numbers mut be the same as given in the attributes of the RegisterDescription node of the corrensponding XML file. The middle part of the XML ID must be a complete DeviceID.
The device templates are separated by tabulators. The whole list is contained in a NULL terminated string.
[in] | pSerial | Pointer to the interface giving access to the serial port |
[in] | Cookie | Token supplied by the driver dll via the clpProbeDevice function. |
[out] | pXMLIDs | A pointer to a user-allocated buffer into which the function copies the list of XML IDs. The list may be empty in which case is contains of a '0' only. |
[in,out] | pBufferSize | As an input, the value contains the size of the buffer that is passed through the pXMLIDs parameter. On successful return, this parameter contains the number of bytes written into the buffer, including the NULL termination character. On CL_ERR_BUFFER_TOO_SMALL, this parameter contains the size of the buffer needed to write the data text. |
[in] | TimeOut | A timeout value in [ms] used during accessing the device. Note that the execution of the function itself can take longer than TimeOut because more than one access might be necessary. |
CL_ERR_NO_ERR | No error occurred |
CL_ERR_BUFFER_TOO_SMALL | The pXMLIDs buffer is too small |
CL_ERR_TIMEOUT | A timeout occurred |
CL_ERR_INVALID_COOKIE | The cookie supplied is invalid |
CLPROTOCOLEXPORT CLINT32 CLPROTOCOL clpInitLib | ( | clp_logger_t | logger, |
CLP_LOG_LEVEL_VALUE | logLevel | ||
) |
This function is call to initialize the library after it is loaded.
[in] | logger | A function pointer that contains a logging function. |
[in] | logLevel | The log level default value. This argument expects a value represented by the CLP_LOG_LEVEL_VALUE constants. |
CL_ERR_NO_ERR | No error occurred |
CLPROTOCOLEXPORT CLINT32 CLPROTOCOL clpIsParamSupported | ( | CLP_PARAMS | param | ) |
This function is call know if a parameter is supported by a CLProtocol.
[in] | param | The parameter to probe. |
CL_ERR_NO_ERR | The parameters is supported |
CL_ERR_PARAM_NOT_SUPPORTED | The parameters is not supported |
CLPROTOCOLEXPORT CLINT32 CLPROTOCOL clpProbeDevice | ( | ISerial * | pSerial, |
const CLINT8 * | pDeviceIDTemplate, | ||
CLINT8 * | pDeviceID, | ||
CLUINT32 * | pBufferSize, | ||
CLUINT32 * | pCookie, | ||
const CLUINT32 | TimeOut | ||
) |
Connects and identifies the device and returns a DeviceID.
This function connects to a device attached to the serial port and attempts to identify it using the DeviceID template as hint. If the function is successful it returns a DeviceID as well as a Cookie. The DeviceID has the form: <CODE>"CameraManufacturer#CameraFamily#CameraModel#Version.2.3.4#SerialNumber"</CODE> The connection is made with 9600 baud which is the power up baud rate as defined by the CameraLink standard. This function attempts to re-connect the device if a DeviceID is passed instead of a template as pDeviceIDTemplate.
[in] | pSerial | Pointer to the interface giving access to the serial port |
[in] | pDeviceIDTemplate | A pointer to NULL-terminated string containing a device ID template (in the probe use case) or a device ID (in the connect use case) |
[in,out] | pDeviceID | A pointer to a user-allocated buffer. If DeviceIDTemplate is valid and a device is found and identified the DLL copies a device ID to the buffer. |
[in,out] | pBufferSize | As an input, the value contains the size of the buffer that is passed through the pDeviceID parameter. On successful return, this parameter contains the number of bytes written into the buffer, including the NULL termination character. On CL_ERR_BUFFER_TOO_SMALL, this parameter contains the size of the buffer needed to write the data text. |
[out] | pCookie | A token supplied by the driver dll which must be handed in by all functions called later to access the device. The dll's implementation can use this token to cache information about the connected device thus avoiding to have to parse the deviceID again. Note that the cookie value must not be 0. |
[in] | TimeOut | A timeout value in [ms] used during accessing the device. Note that the execution of the function itself can take longer than TimeOut because more than one access might be necessary. |
CL_ERR_NO_ERR | No error occurred |
CL_BUFFER_TOO_SMALL | The pDeviceID buffer is too small |
CL_ERR_INVALID_DEVICEID | The DeviceID is not recognized as valid by this dll |
CL_ERR_NO_DEVICE_FOUND | There was no device found matching the DeviceID |
CLPROTOCOLEXPORT CLINT32 CLPROTOCOL clpReadRegister | ( | ISerial * | pSerial, |
const CLUINT32 | Cookie, | ||
const CLINT64 | Address, | ||
CLINT8 * | pBuffer, | ||
const CLINT64 | BufferSize, | ||
const CLUINT32 | TimeOut | ||
) |
This function reads numBytes from the serial device referred to by serialRef. clSerialRead will return when numBytes are available at the serial port or when the serialTimeout period has passed.
Upon success, numBytes are copied into buffer. In the case of any error, including CL_ERR_TIMEOUT, no data is copied into buffer.
[in] | pSerial | The interface giving access to the serial port |
[in] | Cookie | Token supplied by the driver dll via the clpProbeDevice function. |
[in] | Address | Address the data is to be read from |
[out] | pBuffer | Points to a user-allocated buffer. Upon a successful call, buffer contains the data read from the serial device. Caller should ensure that buffer is at least numBytes in size. |
[in] | BufferSize | This is the number of bytes requested by the caller. |
[in] | TimeOut | A timeout value in [ms] used during accessing the device. Note that there may be specific commands which may take longer than TimeOut to be accessed. Since clpReadRegister is missing a CL_ERR_PENDING_WRITE mechanism the CLProcotol DLL may be forced for these commands to delay the return for more than TimeOut. |
CL_ERR_NO_ERR | No error occurred |
CL_ERR_TIMEOUT | A timeout occurred |
CL_ERR_INVALID_COOKIE | The cookie supplied is invalid |
CLPROTOCOLEXPORT CLINT32 CLPROTOCOL clpSetParam | ( | ISerial * | pSerial, |
CLP_PARAMS | param, | ||
const CLUINT32 | Cookie, | ||
const CLINT8 * | pBuffer, | ||
const CLINT64 | BufferSize, | ||
const CLUINT32 | TimeOut | ||
) |
This function is call to change a CLProtocol parameter value.
[in] | param | The parameter to be changed. |
[in] | Cookie | Token supplied by the driver dll via the clpProbeDevice function. Some parameters ignore the Cookie. |
[in] | pBuffer | Points to a buffer containing the data to be written |
[in] | BufferSize | This is the number of bytes in the buffer. Caller must ensure that buffer size match the parameters size. |
[in] | TimeOut | A timeout value in [ms] used during accessing the device. |
CL_ERR_NO_ERR | No error occurred |
CL_ERR_TIMEOUT | A timeout occurred |
CL_ERR_PARAM_NOT_SUPPORTED | The parameters is not supported |
CLPROTOCOLEXPORT CLINT32 CLPROTOCOL clpWriteRegister | ( | ISerial * | pSerial, |
const CLUINT32 | Cookie, | ||
const CLINT64 | Address, | ||
const CLINT8 * | pBuffer, | ||
const CLINT64 | BufferSize, | ||
const CLUINT32 | TimeOut | ||
) |
This function writes numBytes to the serial device referred to by serialRef. clSerialRead will return when numBytes are available at the serial port or when the serialTimeout period has passed.
Upon success, numBytes are copied into buffer. In the case of any error, including CL_ERR_TIMEOUT, no data is copied into buffer.
[in] | pSerial | The interface giving access to the serial port |
[in] | Cookie | ManToken supplied by the driver dll via the clpProbeDevice function. |
[in] | Address | Address the data is to be read from |
[in] | pBuffer | Points to a containing the data to be written Caller should ensure that buffer is at least BufferSize in size. |
[in] | BufferSize | This is the number of bytes to be written. |
[in] | TimeOut | A timeout value in [ms] used during accessing the device. If the CLProtocol DLL knowns for specific registers that accessing them will take longer than TiemOut for a good reason, e.g., because some re-calibration is triggered, it can use the CL_ERR_PENDING_WRITE mechanism to inform the client abou this and prolong the waiting time. |
CL_ERR_NO_ERR | No error occurred |
CL_ERR_TIMEOUT | A timeout occurred |
CL_ERR_INVALID_COOKIE | The cookie supplied is invalid |
CL_ERR_PENDING_WRITE | The timeout has expired but the write is still pending for a good reason. The next call must be clpContinueWriteRegister |