added message polling limit functions
parent
64f038f781
commit
a7be396ed9
|
|
@ -178,7 +178,6 @@ ICSNEO_API icsneo_error_t icsneo_close(icsneo_device_t* device) {
|
||||||
return icsneo_error_success;
|
return icsneo_error_success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
ICSNEO_API icsneo_error_t icsneo_device_describe(icsneo_device_t* device, const char* value, uint32_t* value_length) {
|
ICSNEO_API icsneo_error_t icsneo_device_describe(icsneo_device_t* device, const char* value, uint32_t* value_length) {
|
||||||
if (!device || !device->device) {
|
if (!device || !device->device) {
|
||||||
return icsneo_error_invalid_parameters;
|
return icsneo_error_invalid_parameters;
|
||||||
|
|
@ -271,3 +270,23 @@ ICSNEO_API icsneo_error_t icsneo_get_message_polling(icsneo_device_t* device, bo
|
||||||
|
|
||||||
return icsneo_error_success;
|
return icsneo_error_success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ICSNEO_API icsneo_error_t icsneo_set_message_polling_limit(icsneo_device_t* device, uint32_t limit) {
|
||||||
|
if (!device) {
|
||||||
|
return icsneo_error_invalid_parameters;
|
||||||
|
}
|
||||||
|
auto dev = device->device;
|
||||||
|
dev->setPollingMessageLimit(static_cast<size_t>(limit));
|
||||||
|
|
||||||
|
return icsneo_error_success;
|
||||||
|
}
|
||||||
|
|
||||||
|
ICSNEO_API icsneo_error_t icsneo_get_message_polling_limit(icsneo_device_t* device, uint32_t* limit) {
|
||||||
|
if (!device || !limit) {
|
||||||
|
return icsneo_error_invalid_parameters;
|
||||||
|
}
|
||||||
|
auto dev = device->device;
|
||||||
|
*limit = static_cast<uint32_t>(dev->getPollingMessageLimit());
|
||||||
|
|
||||||
|
return icsneo_error_success;
|
||||||
|
}
|
||||||
|
|
@ -165,17 +165,16 @@ ICSNEO_API icsneo_error_t icsneo_device_describe(icsneo_device_t* device, const
|
||||||
*/
|
*/
|
||||||
ICSNEO_API icsneo_error_t icsneo_device_type(icsneo_device_t* device, icsneo_devicetype_t* value);
|
ICSNEO_API icsneo_error_t icsneo_device_type(icsneo_device_t* device, icsneo_devicetype_t* value);
|
||||||
|
|
||||||
/** @brief Get the description of a device
|
/** @brief Get the serial of a device
|
||||||
*
|
*
|
||||||
* @param[in] icsneo_device_t device The device to get the description of.
|
* @param[in] icsneo_device_t device The device to get the serial of.
|
||||||
* @param[out] const char* value Pointer to a buffer to copy the description into. Null terminated.
|
* @param[out] const char* value Pointer to a buffer to copy the serial into. Null terminated.
|
||||||
* @param[in,out] uint32_t* value_length Size of the value buffer. Modified with the length of the description.
|
* @param[in,out] uint32_t* value_length Size of the value buffer. Modified with the length of the serial.
|
||||||
*
|
*
|
||||||
* @return icsneo_error_t icsneo_error_success if successful, icsneo_error_invalid_parameters otherwise.
|
* @return icsneo_error_t icsneo_error_success if successful, icsneo_error_invalid_parameters otherwise.
|
||||||
*/
|
*/
|
||||||
ICSNEO_API icsneo_error_t icsneo_device_serial(icsneo_device_t* device, const char* value, uint32_t* value_length);
|
ICSNEO_API icsneo_error_t icsneo_device_serial(icsneo_device_t* device, const char* value, uint32_t* value_length);
|
||||||
|
|
||||||
|
|
||||||
/** @brief Set the online state of a device.
|
/** @brief Set the online state of a device.
|
||||||
*
|
*
|
||||||
* @param[in] icsneo_device_t device The device to set the online state of.
|
* @param[in] icsneo_device_t device The device to set the online state of.
|
||||||
|
|
@ -213,6 +212,27 @@ ICSNEO_API icsneo_error_t icsneo_set_message_polling(icsneo_device_t* device, bo
|
||||||
*/
|
*/
|
||||||
ICSNEO_API icsneo_error_t icsneo_get_message_polling(icsneo_device_t* device, bool* is_enabled);
|
ICSNEO_API icsneo_error_t icsneo_get_message_polling(icsneo_device_t* device, bool* is_enabled);
|
||||||
|
|
||||||
|
/** @brief Set the message polling limit of a device.
|
||||||
|
*
|
||||||
|
* This will truncate the message queue to the specified limit.
|
||||||
|
*
|
||||||
|
* @param[in] icsneo_device_t device The device to enforce the message polling limit.
|
||||||
|
* @param[in] uint32_t limit The limit to enforce.
|
||||||
|
*
|
||||||
|
* @return icsneo_error_t icsneo_error_success if successful, icsneo_error_invalid_parameters otherwise.
|
||||||
|
*/
|
||||||
|
ICSNEO_API icsneo_error_t icsneo_set_message_polling_limit(icsneo_device_t* device, uint32_t limit);
|
||||||
|
|
||||||
|
/** @brief Get the message polling limit of a device.
|
||||||
|
*
|
||||||
|
* @see icsneo_set_message_polling_limit
|
||||||
|
*
|
||||||
|
* @param[in] icsneo_device_t device The device to enforce the message polling limit.
|
||||||
|
* @param[out] uint32_t limit The limit to get.
|
||||||
|
*
|
||||||
|
* @return icsneo_error_t icsneo_error_success if successful, icsneo_error_invalid_parameters otherwise.
|
||||||
|
*/
|
||||||
|
ICSNEO_API icsneo_error_t icsneo_get_message_polling_limit(icsneo_device_t* device, uint32_t* limit);
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue