Bluetooth: services: Adds OTS name length checks

Adds name length checks. The OTS spec does not
explicitely specifiy a maximum name length, but the
maximum name length in the directory listing object
shall be less or equal to 120 octets.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
This commit is contained in:
Emil Gydesen 2021-04-16 12:39:24 +02:00 committed by Carles Cufí
commit cfe0849072
3 changed files with 17 additions and 3 deletions

View file

@ -33,6 +33,9 @@ extern "C" {
/** @brief Length of OTS object ID string (in bytes). */
#define BT_OTS_OBJ_ID_STR_LEN 15
/** @brief Maximum object name length */
#define BT_OTS_OBJ_MAX_NAME_LEN 120
/** @brief Type of an OTS object. */
struct bt_ots_obj_type {
union {