bt_gatt_srv_validate_service()

Helper function to validate the service record being passed to bt_gatt_srv_register_service.

Synopsis:

#include <btapi/btgattsrv.h>
 
int bt_gatt_srv_validate_service(bt_gatt_srv_attrvalue_t *service, char *errstr, uint16_t len)

Since:

BlackBerry 10.2.0

Arguments:

service

The GATT service to be validated.

errstr

(Optional) String to provide details on failure.

len

Length of errstr. Set to 0 if errstr is not used.

Library:

libbtapi (For the qcc command, use the -l btapi option to link against this library)

Description:

This function can be used prior to calling bt_gatt_srv_register_service() to verify that the information in the bt_gatt_srv_attrvalue_t structure is populated correctly. The errstr will be populated with a descriptive string if EINVAL is returned.

Returns:

EOK if service validation passes, -1 with the errno set otherwise. The error codes that can be returned are as follows:
  • EINVAL: The service provided has errors. The errstr argument will contain a description of the error if provided.