Skip to content

Commit

Permalink
os/board/rtl8730e: Add BLE TX power setting API
Browse files Browse the repository at this point in the history
- added ble_server_set_adv_tx_power to set TX power for multi adv
  • Loading branch information
yeetee179 committed Feb 24, 2025
1 parent 048fb0c commit 4e31871
Show file tree
Hide file tree
Showing 9 changed files with 421 additions and 12 deletions.
3 changes: 2 additions & 1 deletion framework/src/ble_manager/ble_manager_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,8 @@ ble_result_e ble_server_create_multi_adv(uint8_t adv_event_prop, uint32_t primar
uint8_t own_addr_type, uint8_t own_addr_val[BLE_BD_ADDR_MAX_LEN], uint8_t *adv_handle)
{
blemgr_msg_params param = { 5, {(void *)&adv_event_prop, (void *)primary_adv_interval,
(void *)&own_addr_type, (void *)own_addr_val, (void *)adv_handle}};
(void *)&own_addr_type, (void *)own_addr_val,
(void *)adv_handle}};
blemgr_msg_s msg = {BLE_CMD_CREATE_MULTI_ADV, BLE_MANAGER_FAIL, (void *)(&param), NULL};
int res = blemgr_post_message(&msg);

Expand Down
5 changes: 3 additions & 2 deletions framework/src/ble_manager/ble_manager_lwnl.c
Original file line number Diff line number Diff line change
Expand Up @@ -601,8 +601,9 @@ trble_result_e ble_drv_create_multi_adv(uint8_t adv_event_prop, uint32_t *primar
uint8_t own_addr_type, uint8_t *own_addr_val, uint8_t *adv_handle)
{
trble_result_e res = TRBLE_SUCCESS;
lwnl_msg_params msg_data = { 4, {(void *)&adv_event_prop, (void *)primary_adv_interval,
(void *)&own_addr_type, (void *)own_addr_val, (void *)adv_handle} };
lwnl_msg_params msg_data = { 5, {(void *)&adv_event_prop, (void *)primary_adv_interval,
(void *)&own_addr_type, (void *)own_addr_val,
(void *)adv_handle} };
lwnl_msg msg = {BLE_INTF_NAME, {LWNL_REQ_BLE_CREATE_ADV}, sizeof(msg_data), (void *)&msg_data, (void *)&res};
if (_send_msg(&msg) < 0) {
res = TRBLE_FILE_ERROR;
Expand Down
4 changes: 3 additions & 1 deletion framework/src/ble_manager/ble_manager_state.c
Original file line number Diff line number Diff line change
Expand Up @@ -1075,8 +1075,10 @@ ble_result_e blemgr_handle_request(blemgr_msg_s *msg)
uint8_t own_addr_type = *(uint8_t *)param->param[2];
uint8_t *adv_handle = (uint8_t *)param->param[4];
uint32_t *primary_adv_interval = (uint32_t *)param->param[1];

ret = ble_drv_create_multi_adv(adv_event_prop, primary_adv_interval,
own_addr_type, own_addr_val, adv_handle);
own_addr_type, own_addr_val,
adv_handle);
} break;

case BLE_CMD_DELETE_MULTI_ADV: {
Expand Down
3 changes: 2 additions & 1 deletion os/board/rtl8730e/src/component/bluetooth/api/Make.defs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ CSRCS += rtk_bt_le_gap.c \
rtk_bt_device.c \
rtk_bt_gatt.c \
rtk_bt_gap.c \
rtk_bt_power_control.c
rtk_bt_power_control.c\
rtk_bt_vendor.c

DEPPATH += --dep-path component/bluetooth/api
VPATH += :component/bluetooth/api
Loading

0 comments on commit 4e31871

Please sign in to comment.