Skip to content

Commit

Permalink
apps/btshell: Add Audio Broadcast Sink to shell application
Browse files Browse the repository at this point in the history
this extends the btshell application with Audio Broadcast Sink
functionality.
  • Loading branch information
MariuszSkamra committed Mar 14, 2024
1 parent e0e58be commit 8279cae
Show file tree
Hide file tree
Showing 9 changed files with 556 additions and 3 deletions.
1 change: 1 addition & 0 deletions apps/btshell/src/btshell.h
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ int btshell_broadcast_update(uint8_t adv_instance,
int btshell_broadcast_start(uint8_t adv_instance);
int btshell_broadcast_stop(uint8_t adv_instance);
#endif
void btshell_audio_broadcast_sink_init(void);

int btshell_gap_event(struct ble_gap_event *event, void *arg);
void btshell_sync_stats(uint16_t handle);
Expand Down
48 changes: 46 additions & 2 deletions apps/btshell/src/cmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,14 +87,14 @@ static const struct parse_arg_kv_pair cmd_peer_addr_types[] = {
{ NULL }
};

static const struct parse_arg_kv_pair cmd_addr_type[] = {
const struct parse_arg_kv_pair cmd_addr_type[] = {
{ "public", BLE_ADDR_PUBLIC },
{ "random", BLE_ADDR_RANDOM },
{ NULL }
};


static int
int
parse_dev_addr(const char *prefix, const struct parse_arg_kv_pair *addr_types,
ble_addr_t *addr)
{
Expand Down Expand Up @@ -4924,6 +4924,50 @@ static const struct shell_cmd btshell_commands[] = {
.help = &leaudio_broadcast_stop_help,
#endif
},
#endif
#if MYNEWT_VAL(BLE_ISO_BROADCAST_SINK)
{
.sc_cmd = "broadcast-sink-create",
.sc_cmd_func = cmd_leaudio_broadcast_sink_create,
#if MYNEWT_VAL(SHELL_CMD_HELP)
.help = &cmd_leaudio_broadcast_sink_create_help,
#endif
},
{
.sc_cmd = "broadcast-sink-destroy",
.sc_cmd_func = cmd_leaudio_broadcast_sink_destroy,
#if MYNEWT_VAL(SHELL_CMD_HELP)
.help = &cmd_leaudio_broadcast_sink_destroy_help,
#endif
},
{
.sc_cmd = "broadcast-sink-pa-sync",
.sc_cmd_func = cmd_leaudio_broadcast_sink_pa_sync,
#if MYNEWT_VAL(SHELL_CMD_HELP)
.help = &cmd_leaudio_broadcast_sink_pa_sync_help,
#endif
},
{
.sc_cmd = "broadcast-sink-pa-sync-term",
.sc_cmd_func = cmd_leaudio_broadcast_sink_pa_sync_term,
#if MYNEWT_VAL(SHELL_CMD_HELP)
.help = &cmd_leaudio_broadcast_sink_pa_sync_term_help,
#endif
},
{
.sc_cmd = "broadcast-sink-big-sync",
.sc_cmd_func = cmd_leaudio_broadcast_sink_sync,
#if MYNEWT_VAL(SHELL_CMD_HELP)
.help = &cmd_leaudio_broadcast_sink_big_sync_help,
#endif
},
{
.sc_cmd = "broadcast-sink-big-sync-term",
.sc_cmd_func = cmd_leaudio_broadcast_sink_big_sync_term,
#if MYNEWT_VAL(SHELL_CMD_HELP)
.help = &cmd_leaudio_broadcast_sink_big_sync_term_help,
#endif
},
#endif /* BLE_ISO_BROADCAST_SOURCE */
#if MYNEWT_VAL(BLE_ISO)
#if MYNEWT_VAL(BLE_ISO_BROADCAST_SOURCE)
Expand Down
5 changes: 5 additions & 0 deletions apps/btshell/src/cmd.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,17 @@
#include "host/ble_uuid.h"
#include <parse_arg/parse_arg.h>

extern const struct parse_arg_kv_pair cmd_addr_type[];

int parse_eddystone_url(char *full_url, uint8_t *out_scheme, char *out_body,
uint8_t *out_body_len, uint8_t *out_suffix);

int cmd_parse_conn_start_end(uint16_t *out_conn, uint16_t *out_start,
uint16_t *out_end);

int parse_dev_addr(const char *prefix, const struct parse_arg_kv_pair *addr_types,
ble_addr_t *addr);

void cmd_init(void);

#endif
Loading

0 comments on commit 8279cae

Please sign in to comment.