diff options
author | Marc Schink <jaylink-dev@marcschink.de> | 2016-07-29 11:31:47 +0200 |
---|---|---|
committer | Marc Schink <jaylink-dev@marcschink.de> | 2016-09-09 17:32:05 +0200 |
commit | 2ed5572f1eb0f38275c26c57745b63145086d583 (patch) | |
tree | 243f52077fb2c8db2929b837f086456827cc711a /libjaylink/device.c | |
parent | aee8ed0d9449a2157b1f19ba1a0de0992593d803 (diff) | |
download | libjaylink-2ed5572f1eb0f38275c26c57745b63145086d583.zip libjaylink-2ed5572f1eb0f38275c26c57745b63145086d583.tar.gz libjaylink-2ed5572f1eb0f38275c26c57745b63145086d583.tar.bz2 |
Simplify jaylink_(un)register() API
The additional information provided by jaylink_(un)register() is not yet
documented and not at all necessary to (un)register a connection. Also,
the API in its current state is not well thought out.
Remove access to the additional information in favour of a simpler API.
If necessary, the access may be re-added with a proper documentation and
well thought out API in a future version.
Signed-off-by: Marc Schink <jaylink-dev@marcschink.de>
Diffstat (limited to 'libjaylink/device.c')
-rw-r--r-- | libjaylink/device.c | 26 |
1 files changed, 2 insertions, 24 deletions
diff --git a/libjaylink/device.c b/libjaylink/device.c index cadddd8..ea67b77 100644 --- a/libjaylink/device.c +++ b/libjaylink/device.c @@ -1101,10 +1101,6 @@ static bool _inet_pton(const char *str, struct in_addr *in) * #JAYLINK_MAX_CONNECTIONS elements. * @param[out] count Number of device connections on success, and undefined on * failure. - * @param[out] info Buffer to store additional information on success, or NULL. - * The content of the buffer is undefined on failure. - * @param[out] info_size Size of the additional information in bytes on success, - * and undefined on failure. Can be NULL. * * @retval JAYLINK_OK Success. * @retval JAYLINK_ERR_ARG Invalid arguments. @@ -1118,8 +1114,7 @@ static bool _inet_pton(const char *str, struct in_addr *in) */ JAYLINK_API int jaylink_register(struct jaylink_device_handle *devh, struct jaylink_connection *connection, - struct jaylink_connection *connections, size_t *count, - uint8_t *info, uint16_t *info_size) + struct jaylink_connection *connections, size_t *count) { int ret; struct jaylink_context *ctx; @@ -1223,12 +1218,6 @@ JAYLINK_API int jaylink_register(struct jaylink_device_handle *devh, connection->handle = handle; parse_conntable(connections, buf + REG_HEADER_SIZE, num, entry_size); - if (info) - memcpy(info, buf + REG_HEADER_SIZE + table_size, addinfo_size); - - if (info_size) - *info_size = addinfo_size; - *count = num; return JAYLINK_OK; @@ -1248,10 +1237,6 @@ JAYLINK_API int jaylink_register(struct jaylink_device_handle *devh, * #JAYLINK_MAX_CONNECTIONS elements. * @param[out] count Number of device connections on success, and undefined on * failure. - * @param[out] info Buffer to store additional information on success, or NULL. - * The content of the buffer is undefined on failure. - * @param[out] info_size Size of the additional information in bytes on success, - * and undefined on failure. Can be NULL. * * @retval JAYLINK_OK Success. * @retval JAYLINK_ERR_ARG Invalid arguments. @@ -1263,8 +1248,7 @@ JAYLINK_API int jaylink_register(struct jaylink_device_handle *devh, */ JAYLINK_API int jaylink_unregister(struct jaylink_device_handle *devh, const struct jaylink_connection *connection, - struct jaylink_connection *connections, size_t *count, - uint8_t *info, uint16_t *info_size) + struct jaylink_connection *connections, size_t *count) { int ret; struct jaylink_context *ctx; @@ -1360,12 +1344,6 @@ JAYLINK_API int jaylink_unregister(struct jaylink_device_handle *devh, parse_conntable(connections, buf + REG_HEADER_SIZE, num, entry_size); - if (info) - memcpy(info, buf + REG_HEADER_SIZE + table_size, addinfo_size); - - if (info_size) - *info_size = addinfo_size; - *count = num; return JAYLINK_OK; |