Skip to content

Commit

Permalink
Bluetooth: Add the VSC used for DLF.
Browse files Browse the repository at this point in the history
bug: v/46086

Rootcause: Other vendors have supported DLF's VSC.

Signed-off-by: chejinxian1 <[email protected]>
  • Loading branch information
chejinxian committed Jan 3, 2025
1 parent 952b765 commit 19af04a
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 2 deletions.
8 changes: 6 additions & 2 deletions service/vendor/bt_vendor.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,10 @@ bool acl_bandwidth_deconfig_builder(acl_bandwitdh_config_t* config,
bool le_dlf_enable_builder(le_dlf_config_t* config,
uint8_t* data, size_t* size)
{
#ifdef CONFIG_BLUETOOTH_VENDOR_BES
#if defined(CONFIG_BLUETOOTH_VENDOR_BES)
return bes_dlf_enable_command_builder(config, data, size);
#elif defined(CONFIG_BLUETOOTH_VENDOR_ACTIONS)
return actions_dlf_enable_command_builder(config, data, size);
#else
return false;
#endif
Expand All @@ -117,8 +119,10 @@ bool le_dlf_enable_builder(le_dlf_config_t* config,
bool le_dlf_disable_builder(le_dlf_config_t* config,
uint8_t* data, size_t* size)
{
#ifdef CONFIG_BLUETOOTH_VENDOR_BES
#if defined(CONFIG_BLUETOOTH_VENDOR_BES)
return bes_dlf_disable_command_builder(config, data, size);
#elif defined(CONFIG_BLUETOOTH_VENDOR_ACTIONS)
return actions_dlf_disable_command_builder(config, data, size);
#else
return false;
#endif
Expand Down
38 changes: 38 additions & 0 deletions service/vendor/bt_vendor_actions.h
Original file line number Diff line number Diff line change
Expand Up @@ -238,4 +238,42 @@ static inline bool actions_lea_offload_stop_builder(lea_offload_config_t* config
return true;
}

static inline bool actions_dlf_enable_command_builder(le_dlf_config_t* config, uint8_t* data, size_t* size)
{
uint8_t* param = data;

UINT8_TO_STREAM(param, 0x3f); // fill ogf
UINT16_TO_STREAM(param, 0x00d7); // fill ocf

// vendor specified fields
UINT8_TO_STREAM(param, 0x05); // data length
UINT8_TO_STREAM(param, 0x01); // subcode
UINT8_TO_STREAM(param, (uint8_t)config->connection_handle);
UINT8_TO_STREAM(param, 0x00);
UINT16_TO_STREAM(param, config->dlf_timeout);

*size = param - data;

return true;
}

static inline bool actions_dlf_disable_command_builder(le_dlf_config_t* config, uint8_t* data, size_t* size)
{
uint8_t* param = data;

UINT8_TO_STREAM(param, 0x3f); // fill ogf
UINT16_TO_STREAM(param, 0x00d7); // fill ocf

// vendor specified fields
UINT8_TO_STREAM(param, 0x05); // data length
UINT8_TO_STREAM(param, 0x01); // subcode
UINT8_TO_STREAM(param, (uint8_t)config->connection_handle);
UINT8_TO_STREAM(param, 0x01);
UINT16_TO_STREAM(param, 0x0000);

*size = param - data;

return true;
}

#endif /* _BT_CONTROLLER_VENDOR_H__ */

0 comments on commit 19af04a

Please sign in to comment.