OceanDirect  2.4.0
OceanDirect C++/C API
oceandirect::api::UserStringAPI Class Reference

Public Member Functions

int getUserString (long deviceID, int *errorCode, char *buffer, int bufferLength)
 
int getUserString (long deviceID, int *errorCode, int index, char *buffer, int bufferLength)
 
int getUserStringCount (long deviceID, int *errorCode)
 
void setUserString (long deviceID, int *errorCode, char *buffer, int bufferLength)
 
void setUserString (long deviceID, int *errorCode, int index, char *buffer, int bufferLength)
 

Static Public Member Functions

static UserStringAPIgetInstance ()
 
static void shutdown ()
 

Member Function Documentation

◆ getUserString() [1/2]

int oceandirect::api::UserStringAPI::getUserString ( long  deviceID,
int *  errorCode,
char *  buffer,
int  bufferLength 
)

Read the user string from the device. If this field in the device is not yet populated then a non-zero(6) code will be returned.

Parameters
deviceIDthe ID of the device returned by getDeviceIDs.
errorCodea code indicating the result of the operation: ERROR_SUCCESS on success; ERROR_NO_DEVICE if the device does not exist; ERROR_FEATURE_NOT_FOUND the feature is not enabled on the specified device; ERROR_TRANSFER_ERROR the device protocol for the feature could not be found; ERROR_CODE_INVALID_ARGUMENT the interface number is not 0 or 1.
bufferThe output buffer containing user string.
buffer_lengthThe buffer size should be at least 16.
Returns
The user string lengnth.

◆ getUserString() [2/2]

int oceandirect::api::UserStringAPI::getUserString ( long  deviceID,
int *  errorCode,
int  index,
char *  buffer,
int  bufferLength 
)

Read the user string from the device. The maximum string length is 16. If this field in the device is not yet populated then a non-zero(6) code will be returned. If the device don't support this command then a non-zero error code will be returned.

Parameters
deviceIDthe ID of the device returned by getDeviceIDs.
errorCodea code indicating the result of the operation: ERROR_SUCCESS on success; ERROR_NO_DEVICE if the device does not exist; ERROR_FEATURE_NOT_FOUND the feature is not enabled on the specified device; ERROR_TRANSFER_ERROR the device protocol for the feature could not be found; ERROR_CODE_INVALID_ARGUMENT the interface number is not 0 or 1.
indexThe user string index.
bufferThe output buffer for user string.
buffer_lengthThe maximum buffer size is 16.

◆ getUserStringCount()

int oceandirect::api::UserStringAPI::getUserStringCount ( long  deviceID,
int *  errorCode 
)

Read the total user string count from the device. If the device don't support this command then a non-zero error code will be returned.

Parameters
deviceIDthe ID of the device returned by getDeviceIDs.
errorCodea code indicating the result of the operation: ERROR_SUCCESS on success; ERROR_NO_DEVICE if the device does not exist; ERROR_FEATURE_NOT_FOUND the feature is not enabled on the specified device; ERROR_TRANSFER_ERROR the device protocol for the feature could not be found; ERROR_CODE_INVALID_ARGUMENT the interface number is not 0 or 1.
Returns
The total user string count.

◆ setUserString() [1/2]

void oceandirect::api::UserStringAPI::setUserString ( long  deviceID,
int *  errorCode,
char *  buffer,
int  bufferLength 
)

Write the user string to the device. The maximum string length is 16.

Parameters
deviceIDthe ID of the device returned by getDeviceIDs.
errorCodea code indicating the result of the operation: ERROR_SUCCESS on success; ERROR_NO_DEVICE if the device does not exist; ERROR_FEATURE_NOT_FOUND the feature is not enabled on the specified device; ERROR_TRANSFER_ERROR the device protocol for the feature could not be found; ERROR_CODE_INVALID_ARGUMENT the interface number is not 0 or 1.
bufferThe buffer containing a user string.
buffer_lengthThe maximum buffer size is 16.

◆ setUserString() [2/2]

void oceandirect::api::UserStringAPI::setUserString ( long  deviceID,
int *  errorCode,
int  index,
char *  buffer,
int  bufferLength 
)

Write the user string to the device. The maximum string length is 16. If the device don't support this command then a non-zero error code will be returned.

Parameters
deviceIDthe ID of the device returned by getDeviceIDs.
errorCodea code indicating the result of the operation: ERROR_SUCCESS on success; ERROR_NO_DEVICE if the device does not exist; ERROR_FEATURE_NOT_FOUND the feature is not enabled on the specified device; ERROR_TRANSFER_ERROR the device protocol for the feature could not be found; ERROR_CODE_INVALID_ARGUMENT the interface number is not 0 or 1.
indexThe user string index.
bufferThe new user string.
buffer_lengthThe maximum buffer size is 16.

The documentation for this class was generated from the following file: