wcWebCamClient lib  v0.8.2
Library functions and typedefs to get or set state values for client and tasks

Typedefs

typedef enum wcStateId wcStateId
 
typedef enum wcTaskStateId wcTaskStateId
 

Enumerations

enum  wcStateId {
  wcstConnection = 0 , wcstVerifyTLS = 1 , wcstError = 2 , wcstLog = 3 ,
  wcstStreaming = 4 , wcstStreams = 5 , wcstDevices = 6 , wcstRecords = 7 ,
  wcstRecordsStamp = 8 , wcstMsgs = 9 , wcstSendWithSync = 22 , wcstMsgsStamp = 10 ,
  wcstMetaData = 11 , wcstDeviceName = 12 , wcstSID = 13 , wcstHostName = 14 ,
  wcstProxy = 15 , wcstProxyAuth = 16 , wcstProxyProtocol = 17 , wcstProxyHost = 18 ,
  wcstProxyPort = 19 , wcstProxyUser = 20 , wcstProxyPwrd = 21
}
 
enum  wcTaskStateId { wctstError = 0 , wctstPath , wctstSubProto , wctstDeviceName }
 

Functions

wcRCode DLLEXPORT wcClientInvalidateState (wcHandle client, wcStateId aStateId)
 Reset the selected client state. More...
 
wcRCode DLLEXPORT wcClientGetIntState (wcHandle client, wcStateId aStateId, int *aStateVal)
 Get a integer value for the selected client state. More...
 
wcRCode DLLEXPORT wcClientGetBoolState (wcHandle client, wcStateId aStateId)
 Get a boolean value for the selected client state. More...
 
wcRCode DLLEXPORT wcClientSetBoolState (wcHandle client, wcStateId aStateId, wcStateVal aStateVal)
 Set the boolean value to the selected client state. More...
 
wcRCode DLLEXPORT wcClientGetStrValue (wcHandle client, wcStateId aStateId, char **aStateVal)
 Get a C-style string value for the selected client state. More...
 
wcRCode DLLEXPORT wcClientGetStrNValue (wcHandle client, wcStateId aStateId, uint32_t sz, char *aStateVal)
 Get a C-style string value for the selected client state. More...
 
wcRCode DLLEXPORT wcClientSetStrValue (wcHandle client, wcStateId aStateId, const char *aStateVal)
 Set a C-style string value to the selected client state. More...
 

Detailed Description

Typedef Documentation

◆ wcStateId

typedef enum wcStateId wcStateId

◆ wcTaskStateId

Enumeration Type Documentation

◆ wcStateId

enum wcStateId
Enumerator
wcstConnection 
See also
wcClientGetBoolState,
wcClientSetBoolState
wcstVerifyTLS 
See also
wcClientGetBoolState,
wcClientSetBoolState
wcstError 
See also
wcClientInvalidateState,
wcClientGetIntState,
wcClientGetBoolState
wcstLog 
See also
wcClientInvalidateState,
wcClientGetIntState,
wcClientGetBoolState,
wcClientGetStrValue,
wcClientGetStrNValue
wcstStreaming 
See also
wcClientGetIntState,
wcClientGetBoolState,
wcClientSetBoolState
wcstStreams 
See also
wcClientInvalidateState,
wcClientGetBoolState,
wcClientSetBoolState
wcstDevices 
See also
wcClientInvalidateState,
wcClientGetBoolState,
wcClientSetBoolState
wcstRecords 
See also
wcClientInvalidateState,
wcClientGetBoolState,
wcClientSetBoolState
wcstRecordsStamp 
See also
wcClientInvalidateState,
wcClientGetStrValue,
wcClientGetStrNValue,
wcClientSetStrValue
wcstMsgs 
See also
wcClientInvalidateState,
wcClientGetBoolState,
wcClientSetBoolState
wcstSendWithSync 

since v0.8

See also
wcClientInvalidateState,
wcClientGetBoolState,
wcClientSetBoolState
wcstMsgsStamp 
See also
wcClientInvalidateState,
wcClientGetStrValue,
wcClientGetStrNValue,
wcClientSetStrValue
wcstMetaData 
See also
wcClientInvalidateState,
wcClientGetStrValue,
wcClientGetStrNValue,
wcClientSetStrValue
wcstDeviceName 
See also
wcClientInvalidateState,
wcClientGetStrValue,
wcClientGetStrNValue,
wcClientSetStrValue
wcstSID 
See also
wcClientGetStrValue,
wcClientGetStrNValue
wcstHostName 
See also
wcClientInvalidateState,
wcClientGetStrValue,
wcClientGetStrNValue,
wcClientSetStrValue
wcstProxy 
See also
wcClientInvalidateState,
wcClientGetStrValue,
wcClientGetStrNValue,
wcClientSetStrValue
wcstProxyAuth 
See also
wcClientGetStrValue,
wcClientGetStrNValue
wcstProxyProtocol 
See also
wcClientSetStrValue
wcstProxyHost 
See also
wcClientSetStrValue
wcstProxyPort 
See also
wcClientSetStrValue
wcstProxyUser 
See also
wcClientSetStrValue
wcstProxyPwrd 
See also
wcClientSetStrValue

◆ wcTaskStateId

Enumerator
wctstError 
See also
wcTaskGetStrValue,
wcTaskGetStrNValue
wctstPath 
See also
wcTaskGetStrValue,
wcTaskGetStrNValue
wctstSubProto 
See also
wcTaskGetStrValue,
wcTaskGetStrNValue
wctstDeviceName 
See also
wcTaskGetStrValue,
wcTaskGetStrNValue

Function Documentation

◆ wcClientInvalidateState()

wcRCode DLLEXPORT wcClientInvalidateState ( wcHandle  client,
wcStateId  aStateId 
)

Reset the selected client state.

Acceptable values of the state param are:
wcstLog - clear the log,
wcstError - delete information about the last error,
wcstDevices - update the list of devices (see also getDevicesOnline.json),
wcstRecords - update the list of media records (see also getRecordCount.json - according to the results of the request, the wcstRecordsStamp state will be updated automatically),
wcstRecordsStamp - clear the timestamp for records (the stamp parameter in getRecordCount.json request),
wcstMsgs - update the list of messages (see also getMsgs.json - according to the results of the request, the wcstMsgsStamp state will be updated automatically),
wcstSendWithSync - uncheck the synchronization flag - the next update of the message list will occur without the sending of a 'sync' message ( getMsgsAndSync.json),
wcstMsgsStamp - clear the timestamp for messages (the stamp parameter in getMsgs.json request),
wcstStreams - update the list of streams (see also getStreams.json),
wcstMetaData - clear the metadata,
wcstDeviceName - clear the device name,
wcstHostName - clear the server address,
wcstProxy - clear proxy settings.
Resetting wcstDevices, wcstRecords, wcstMsgs, wcstStreams states will update the selected state when wcClientProceed is called. During the execution of wcClientProceed, requests getDevicesOnline.json, getRecordCount.json, getMsgs.json and getStreams.json will be generated and launched, respectively.

Parameters
clientThe client handle.
aStateIdThe selected client state.
Returns
wcRCode WC_OK or error code.
See also
wcStateId, wcRCode
Examples
lib_test/main.cpp, media_test/main.cpp, multithread_test/main.cpp, and theora_test/input_strm/main.cpp.

◆ wcClientGetIntState()

wcRCode DLLEXPORT wcClientGetIntState ( wcHandle  client,
wcStateId  aStateId,
int *  aStateVal 
)

Get a integer value for the selected client state.

Acceptable values of the state param are:
wcstError - get a code of the last error,
wcstLog - get a length of the log,
wcstStreaming - get streaming mask (input or output stream launched).

Parameters
clientThe client handle.
aStateIdThe selected client state.
aStateValPointer to a variable to which the selected client state will be written.
Returns
wcRCode WC_OK or error code.

Example

int res;
wcRCode aCode = wcClientGetIntState(client, wcstError, &res);
if (aCode == WC_OK) {
cout << "last error code is " << res << endl;
} else {
cout << "error occurred " << aCode << endl;
}
wcRCode DLLEXPORT wcClientGetIntState(wcHandle client, wcStateId aStateId, int *aStateVal)
Get a integer value for the selected client state.
@ wcstError
Definition: wcwebcamclient.h:176
const wcRCode WC_OK
Definition: wcwebcamclient.h:74
int wcRCode
Operation completion codes.
Definition: wcwebcamclient.h:65
See also
wcStateId, wcRCode, wcStateVal

◆ wcClientGetBoolState()

wcRCode DLLEXPORT wcClientGetBoolState ( wcHandle  client,
wcStateId  aStateId 
)

Get a boolean value for the selected client state.

Acceptable values of the state param are:
wcstConnection - is client connected,
wcstVerifyTLS - should client verify TLS certificate,
wcstError - an error has occurred,
wcstStreaming - has the client started the media stream - the result is disjunction of the launched task classes (see also: wcTaskClass),
wcstLog - does the log contain entries,
wcstDevices - should client update the list of devices,
wcstRecords - should client update the list of media records,
wcstMsgs - should client update the list of messages,
wcstSendWithSync - get the synchronization flag (see also: getMsgsAndSync.json, getMsgs.json),
wcstStreams - should client update the list of streams.

Parameters
clientThe client handle.
aStateIdThe selected client state.
Returns
wcRCode wcStateVal or error code.
See also
wcStateId, wcRCode, wcStateVal

◆ wcClientSetBoolState()

wcRCode DLLEXPORT wcClientSetBoolState ( wcHandle  client,
wcStateId  aStateId,
wcStateVal  aStateVal 
)

Set the boolean value to the selected client state.

Acceptable values of the state param are:
wcstConnection - disconnect ( WC_FALSE, see also wcClientDisconnect) the client ( WC_TRUE not allowed, use wcClientAuth instead),
wcstVerifyTLS - should client verify TLS certificate (both WC_TRUE/ WC_FALSE allowed),
wcstStreaming - stop output streaming ( WC_FALSE) for the client ( WC_TRUE not allowed, use wcLaunchOutStream instead),
wcstDevices - the client should update the list of devices (only WC_TRUE value allowed),
wcstRecords - the client should update the list of media records (only WC_TRUE value allowed),
wcstMsgs - the client should update the list of messages (only WC_TRUE value allowed),
wcstSendWithSync - set the synchronization flag (both WC_TRUE/ WC_FALSE allowed) - the next update of the message list will occur with or without the sending of a 'sync' message ( getMsgsAndSync.json, getMsgs.json),
wcstStreams - the client should update the list of streams (only WC_TRUE value allowed).

Parameters
clientThe client handle.
aStateIdThe selected client state.
aStateValThe boolean value.
Returns
wcRCode WC_OK or error code.
See also
wcStateId, wcRCode, wcStateVal
Examples
lib_test/main.cpp, media_test/main.cpp, multithread_test/main.cpp, theora_test/input_strm/main.cpp, and theora_test/output_strm/main.cpp.

◆ wcClientGetStrValue()

wcRCode DLLEXPORT wcClientGetStrValue ( wcHandle  client,
wcStateId  aStateId,
char **  aStateVal 
)

Get a C-style string value for the selected client state.

As a result of successful execution of the function, the aStateVal parameter will contain a pointer to NULL-terminated string. (Don't forget to free up memory after using the aStateVal). Acceptable values of the state param are:
wcstLog - get the first log entry and delete it from the clients log (see also wcSetCStringCallback, wcSetStringCallback),
wcstSID - the client session id,
wcstRecordsStamp - current timestamp value for records (the stamp parameter retrieved from the last getRecordCount.json response),
wcstMsgsStamp - current timestamp value for messages (the stamp parameter retrieved from the last getMsgs.json response),
wcstMetaData - the client metadata,
wcstDeviceName - the client device name,
wcstHostName - the client host name,
wcstProxy - the client proxy server address in format

[[protocol://]address[:port]]

,
wcstProxyAuth - the client proxy server authorization data in format

[username[:password]]

.

Parameters
clientThe client handle.
aStateIdThe selected client state.
aStateValThe pointer to the variable of char * type initialized with NULL value
Returns
wcRCode WC_OK or error code.

Example

char * res = NULL;
wcRCode aCode = wcClientGetStrValue(client, wcstSID, &res);
if (aCode == WC_OK) {
cout << "client SID is " << res << endl;
free(res);
} else {
cout << "error occurred " << aCode << endl;
}
wcRCode DLLEXPORT wcClientGetStrValue(wcHandle client, wcStateId aStateId, char **aStateVal)
Get a C-style string value for the selected client state.
@ wcstSID
Definition: wcwebcamclient.h:188
See also
wcStateId, wcRCode, wcStateVal, wcClientGetStrNValue
Examples
lib_test/main.cpp, media_test/main.cpp, multithread_test/main.cpp, theora_test/input_strm/main.cpp, and theora_test/output_strm/main.cpp.

◆ wcClientGetStrNValue()

wcRCode DLLEXPORT wcClientGetStrNValue ( wcHandle  client,
wcStateId  aStateId,
uint32_t  sz,
char *  aStateVal 
)

Get a C-style string value for the selected client state.

As a result of successful execution of the function, the requested value will be copied to the passed array aStateVal. If the size of the passed array is less than the requested state value, the function returns an WC_NOT_ENOUGH_MEM error. Acceptable values of the state param are listed in wcClientGetStrValue

Parameters
clientThe client handle.
aStateIdThe selected client state.
aStateValThe pointer to allocated char array with at least sz+1 chars.
szThe size of the given char array.
Returns
wcRCode WC_OK or error code.

Example

static const uint32_t LEN = 128;
char res [LEN];
wcRCode aCode = wcClientGetStrNValue(client, wcstSID, LEN-1, res);
if (aCode == WC_OK) {
cout << "client SID is " << res << endl;
} else {
cout << "error occurred " << aCode << endl;
}
wcRCode DLLEXPORT wcClientGetStrNValue(wcHandle client, wcStateId aStateId, uint32_t sz, char *aStateVal)
Get a C-style string value for the selected client state.
See also
wcStateId, wcRCode, wcStateVal, wcClientGetStrValue

◆ wcClientSetStrValue()

wcRCode DLLEXPORT wcClientSetStrValue ( wcHandle  client,
wcStateId  aStateId,
const char *  aStateVal 
)

Set a C-style string value to the selected client state.

Acceptable values of the state param are:
wcstMetaData - set the metadata for client (the meta parameter in authorize.json request),
wcstDeviceName - set the client device name,
wcstHostName - set the client host name,
wcstMsgsStamp - set the timestamp value for messages (the stamp parameter in getMsgs.json request),
wcstRecordsStamp - set the timestamp value for records (the stamp parameter in getRecordCount.json request),
wcstProxy - set the client proxy server authorization@address in format

[[username[:password]@][protocol://]address[:port]]

,
wcstProxyProtocol - set the client proxy server protocol ("http://", "https://", etc),
wcstProxyHost - set the client proxy server host,
wcstProxyPort - set the client proxy server port,
wcstProxyUser - set the client proxy server user name,
wcstProxyPwrd - set the client proxy server user password.

Parameters
clientThe client handle.
aStateIdThe selected client state.
aStateValThe C-style string value to be setted.
Returns
wcRCode WC_OK or error code.

Example

wcRCode aCode = wcClientSetStrValue(client, wcstProxy, "user:pw%26rd@192.168.0.1:3118");
if (aCode == WC_OK) {
cout << "Proxy was successfully setted" << endl;
} else {
cout << "error occurred " << aCode << endl;
}
wcRCode DLLEXPORT wcClientSetStrValue(wcHandle client, wcStateId aStateId, const char *aStateVal)
Set a C-style string value to the selected client state.
@ wcstProxy
Definition: wcwebcamclient.h:190
See also
wcStateId, wcRCode, wcStateVal, wcClientGetStrValue, wcClientGetStrNValue
Examples
lib_test/main.cpp, media_test/main.cpp, multithread_test/main.cpp, theora_test/input_strm/main.cpp, and theora_test/output_strm/main.cpp.