Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sal: update bluetooth sal for zephyr 4.0.0 #32

Merged
merged 2 commits into from
Jan 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,11 @@ if(CONFIG_BLUETOOTH)
endif()

if(CONFIG_BLUETOOTH_STACK_BREDR_ZBLUE OR CONFIG_BLUETOOTH_STACK_LE_ZBLUE)
file(GLOB APPEND_FILES ${BLUETOOTH_DIR}/service/stacks/zephyr/*.c)
list(APPEND CSRCS ${APPEND_FILES})
list(APPEND CSRCS ${BLUETOOTH_DIR}/service/stacks/zephyr/sal_debug_interface.c)
list(APPEND CSRCS ${BLUETOOTH_DIR}/service/stacks/zephyr/sal_zblue.c)
if(CONFIG_BLUETOOTH_STACK_BREDR_ZBLUE)
list(APPEND CSRCS ${BLUETOOTH_DIR}/service/stacks/zephyr/sal_adapter_classic_interface.c)
endif()
endif()

if(NOT CONFIG_BLUETOOTH_BLE_AUDIO)
Expand Down Expand Up @@ -415,8 +418,6 @@ if(CONFIG_BLUETOOTH)
endif()

if(CONFIG_BLUETOOTH_STACK_BREDR_ZBLUE OR CONFIG_BLUETOOTH_STACK_LE_ZBLUE)
list(APPEND INCDIR ${BLUETOOTH_DIR}/service/stacks/zephyr/include)
list(APPEND INCDIR ${NUTTX_APPS_DIR}/external/zblue/zblue/include/zephyr)
list(APPEND INCDIR ${NUTTX_APPS_DIR}/external/zblue/zblue/port/include/)
list(APPEND INCDIR
${NUTTX_APPS_DIR}/external/zblue/zblue/port/include/kernel/include)
Expand Down
7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,11 @@ ifneq ($(CONFIG_BLUETOOTH_STACK_BREDR_BLUELET)$(CONFIG_BLUETOOTH_STACK_LE_BLUELE
CSRCS += service/stacks/bluelet/*.c
endif
ifneq ($(CONFIG_BLUETOOTH_STACK_BREDR_ZBLUE)$(CONFIG_BLUETOOTH_STACK_LE_ZBLUE),)
CSRCS += service/stacks/zephyr/*.c
CSRCS += service/stacks/zephyr/sal_debug_interface.c
CSRCS += service/stacks/zephyr/sal_zblue.c
ifeq ($(CONFIG_BLUETOOTH_BREDR_SUPPORT), y)
CSRCS += service/stacks/zephyr/sal_adapter_classic_interface.c
endif #CONFIG_BLUETOOTH_BREDR_SUPPORT
endif
ifeq ($(CONFIG_BLUETOOTH_BLE_AUDIO),)
CSRCS := $(filter-out $(wildcard service/stacks/bluelet/sal_lea_*),$(wildcard $(CSRCS)))
Expand Down Expand Up @@ -290,7 +294,6 @@ ifneq ($(CONFIG_BLUETOOTH_STACK_BREDR_BLUELET)$(CONFIG_BLUETOOTH_STACK_LE_BLUELE
endif
ifneq ($(CONFIG_BLUETOOTH_STACK_BREDR_ZBLUE)$(CONFIG_BLUETOOTH_STACK_LE_ZBLUE),)
CFLAGS += ${INCDIR_PREFIX}$(APPDIR)/frameworks/connectivity/bluetooth/service/stacks/zephyr/include
CFLAGS += ${INCDIR_PREFIX}$(APPDIR)/external/zblue/zblue/include/zephyr
CFLAGS += ${INCDIR_PREFIX}$(APPDIR)/external/zblue/zblue/port/include/
CFLAGS += ${INCDIR_PREFIX}$(APPDIR)/external/zblue/zblue/port/include/kernel/include
endif
Expand Down
7 changes: 2 additions & 5 deletions framework/common/bt_addr.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,9 @@

#include "bt_addr.h"

const bt_address_t bt_addr_empty = {
static const bt_address_t bt_addr_empty = {
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }
};
const bt_address_t bt_addr_any = {
{ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }
};

static char g_bdaddr_str[18];

Expand Down Expand Up @@ -79,7 +76,7 @@ int bt_addr_ba2str(const bt_address_t* addr, char* str)
addr->addr[2], addr->addr[1], addr->addr[0]);
}

char* bt_addr_str(const bt_address_t* addr)
char* bt_addr_bastr(const bt_address_t* addr)
{
if (!addr) {
return NULL;
Expand Down
7 changes: 4 additions & 3 deletions framework/include/bt_addr.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ extern "C" {
#define BT_ADDR_LENGTH 6 /*define the address length*/
#define BT_ADDR_STR_LENGTH 18

#define bt_addr_str(addr) bt_addr_bastr(addr)

/**
* @cond
*/
Expand Down Expand Up @@ -162,12 +164,11 @@ int bt_addr_str2ba(const char* str, bt_address_t* addr);
* **Example:**
* @code
* bt_address_t addr = {0x00, 0x11, 0x22, 0x33, 0x44, 0x55};
* printf("Address: %s\n", bt_addr_str(&addr));
* printf("Address: %s\n", bt_addr_bastr(&addr));
* // Output: Address: 00:11:22:33:44:55
* @endcode
*/
char* bt_addr_str(const bt_address_t* addr);

char* bt_addr_bastr(const bt_address_t* addr);
Frozen935 marked this conversation as resolved.
Show resolved Hide resolved

/**
* @brief Set a Bluetooth address.
Expand Down
4 changes: 0 additions & 4 deletions service/stacks/include/sal_interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,6 @@

#if defined(CONFIG_BLUETOOTH_STACK_BREDR_BLUELET) || defined(CONFIG_BLUETOOTH_STACK_LE_BLUELET)
#include "sal_adapter_interface.h"
#include "sal_bluelet.h"
#endif
#if defined(CONFIG_BLUETOOTH_STACK_BREDR_ZBLUE) || defined(CONFIG_BLUETOOTH_STACK_LE_ZBLUE)
#include "sal_zblue.h"
#endif

typedef struct bt_stack_info {
Expand Down
2 changes: 1 addition & 1 deletion service/stacks/zephyr/include/sal_zblue.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#include "bt_addr.h"
#include "bt_status.h"

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

#define AVDTP_RTP_HEADER_LEN 12
#define STREAM_DATA_RESERVED AVDTP_RTP_HEADER_LEN
Expand Down
4 changes: 2 additions & 2 deletions service/stacks/zephyr/sal_a2dp_interface.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
#include "sal_interface.h"
#include "sal_zblue.h"

#include <bluetooth/a2dp.h>
#include <bluetooth/conn.h>
#include <zephyr/bluetooth/classic/a2dp.h>
#include <zephyr/bluetooth/conn.h>

#include "bt_utils.h"
#include "utils/log.h"
Expand Down
Loading
Loading