Zephyr API Documentation 4.0.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
vocs.h File Reference

Bluetooth Volume Offset Control Service (VOCS) APIs. More...

#include <stdint.h>
#include <stdbool.h>
#include <zephyr/bluetooth/conn.h>

Go to the source code of this file.

Data Structures

struct  bt_vocs_register_param
 Structure for registering a Volume Offset Control Service instance. More...
 
struct  bt_vocs_discover_param
 Structure for discovering a Volume Offset Control Service instance. More...
 
struct  bt_vocs_cb
 Struct to hold the Volume Offset Control Service callbacks. More...
 

Macros

Volume Offset Control Service Error codes
#define BT_VOCS_ERR_INVALID_COUNTER   0x80
 The Change_Counter operand value does not match the Change_Counter field value of the Volume Offset State characteristic.
 
#define BT_VOCS_ERR_OP_NOT_SUPPORTED   0x81
 An invalid opcode has been used in a control point procedure.
 
#define BT_VOCS_ERR_OUT_OF_RANGE   0x82
 An operand value used in a control point procedure is outside the permissible range.
 
Volume Offset Control Service offset limits
#define BT_VOCS_MIN_OFFSET   -255
 Minimum offset value.
 
#define BT_VOCS_MAX_OFFSET   255
 Maximum offset value.
 

Typedefs

typedef void(* bt_vocs_state_cb) (struct bt_vocs *inst, int err, int16_t offset)
 Callback function for the offset state.
 
typedef void(* bt_vocs_set_offset_cb) (struct bt_vocs *inst, int err)
 Callback function for setting offset.
 
typedef void(* bt_vocs_location_cb) (struct bt_vocs *inst, int err, uint32_t location)
 Callback function for the location.
 
typedef void(* bt_vocs_description_cb) (struct bt_vocs *inst, int err, char *description)
 Callback function for the description.
 
typedef void(* bt_vocs_discover_cb) (struct bt_vocs *inst, int err)
 Callback function for bt_vocs_discover.
 

Functions

struct bt_vocs * bt_vocs_free_instance_get (void)
 Get a free service instance of Volume Offset Control Service from the pool.
 
void * bt_vocs_svc_decl_get (struct bt_vocs *vocs)
 Get the service declaration attribute.
 
int bt_vocs_client_conn_get (const struct bt_vocs *vocs, struct bt_conn **conn)
 Get the connection pointer of a client instance.
 
int bt_vocs_register (struct bt_vocs *vocs, const struct bt_vocs_register_param *param)
 Register the Volume Offset Control Service instance.
 
int bt_vocs_state_get (struct bt_vocs *inst)
 Read the Volume Offset Control Service offset state.
 
int bt_vocs_state_set (struct bt_vocs *inst, int16_t offset)
 Set the Volume Offset Control Service offset state.
 
int bt_vocs_location_get (struct bt_vocs *inst)
 Read the Volume Offset Control Service location.
 
int bt_vocs_location_set (struct bt_vocs *inst, uint32_t location)
 Set the Volume Offset Control Service location.
 
int bt_vocs_description_get (struct bt_vocs *inst)
 Read the Volume Offset Control Service output description.
 
int bt_vocs_description_set (struct bt_vocs *inst, const char *description)
 Set the Volume Offset Control Service description.
 
void bt_vocs_client_cb_register (struct bt_vocs *inst, struct bt_vocs_cb *cb)
 Registers the callbacks for the Volume Offset Control Service client.
 
struct bt_vocs * bt_vocs_client_free_instance_get (void)
 Returns a pointer to a Volume Offset Control Service client instance.
 
int bt_vocs_discover (struct bt_conn *conn, struct bt_vocs *inst, const struct bt_vocs_discover_param *param)
 Discover a Volume Offset Control Service.
 

Detailed Description

Bluetooth Volume Offset Control Service (VOCS) APIs.