Skip to content

Commit

Permalink
btshell: Fix build with SHELL_CMD_HELP option disabled
Browse files Browse the repository at this point in the history
This fixes btshell application compilation errors with
SHELL_CMD_HELP option disabled.
  • Loading branch information
MariuszSkamra committed Nov 18, 2024
1 parent 1b804a9 commit 1221e95
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 16 deletions.
2 changes: 1 addition & 1 deletion apps/btshell/src/cmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -4152,13 +4152,13 @@ static const struct shell_param sync_transfer_receive_params[] = {
{"reports_disabled", "disable reports, usage: =[0-1], default: 0"},
{NULL, NULL}
};
#endif

static const struct shell_cmd_help sync_transfer_receive_help = {
.summary = "start/stop periodic sync reception with specific parameters",
.usage = NULL,
.params = sync_transfer_receive_params,
};
#endif /* SHELL_CMD_HELP */
#endif

static int
Expand Down
27 changes: 12 additions & 15 deletions apps/btshell/src/cmd_leaudio.c
Original file line number Diff line number Diff line change
Expand Up @@ -501,20 +501,19 @@ broadcast_sink_action_fn(struct ble_audio_broadcast_sink_action *action, void *a
return 0;
}


#if MYNEWT_VAL(SHELL_CMD_HELP)
static const struct shell_param cmd_leaudio_broadcast_sink_start_params[] = {
{"source_id", "usage: =<UINT8>"},
{"broadcast_code", "usage: =[string], default: NULL"},
{NULL, NULL}
};

#if MYNEWT_VAL(SHELL_CMD_HELP)
const struct shell_cmd_help cmd_leaudio_broadcast_sink_start_help = {
.summary = "Start audio Broadcast Sink",
.usage = NULL,
.params = cmd_leaudio_broadcast_sink_start_params
};
#endif
#endif /* SHELL_CMD_HELP */

int
cmd_leaudio_broadcast_sink_start(int argc, char **argv)
Expand Down Expand Up @@ -549,18 +548,18 @@ cmd_leaudio_broadcast_sink_start(int argc, char **argv)
return rc;
}

#if MYNEWT_VAL(SHELL_CMD_HELP)
static const struct shell_param cmd_leaudio_broadcast_sink_stop_params[] = {
{"source_id", "usage: =<UINT8>"},
{NULL, NULL}
};

#if MYNEWT_VAL(SHELL_CMD_HELP)
const struct shell_cmd_help cmd_leaudio_broadcast_sink_stop_help = {
.summary = "Stop audio Broadcast Sink",
.usage = NULL,
.params = cmd_leaudio_broadcast_sink_stop_params
};
#endif
#endif /* SHELL_CMD_HELP */

int
cmd_leaudio_broadcast_sink_stop(int argc, char **argv)
Expand All @@ -587,20 +586,20 @@ cmd_leaudio_broadcast_sink_stop(int argc, char **argv)
return rc;
}

#if MYNEWT_VAL(SHELL_CMD_HELP)
static const struct shell_param cmd_leaudio_broadcast_sink_metadata_update_params[] = {
{"source_id", "usage: =<UINT8>"},
{"subgroup_index", "usage: =<UINT8>"},
{"metadata", "usage: =[XX:XX...]"},
{NULL, NULL}
};

#if MYNEWT_VAL(SHELL_CMD_HELP)
const struct shell_cmd_help cmd_leaudio_broadcast_sink_metadata_update_help = {
.summary = "Update Broadcast Sink metadata",
.usage = NULL,
.params = cmd_leaudio_broadcast_sink_metadata_update_params
};
#endif
#endif /* SHELL_CMD_HELP */

int
cmd_leaudio_broadcast_sink_metadata_update(int argc, char **argv)
Expand Down Expand Up @@ -778,6 +777,7 @@ scan_delegator_action_fn(struct ble_audio_scan_delegator_action *action, void *a
return 0;
}

#if MYNEWT_VAL(SHELL_CMD_HELP)
static const struct shell_param cmd_leaudio_scan_delegator_receive_state_add_params[] = {
{"addr_type", "usage: =[public|random], default: public"},
{"addr", "usage: =[XX:XX:XX:XX:XX:XX]"},
Expand All @@ -786,7 +786,6 @@ static const struct shell_param cmd_leaudio_scan_delegator_receive_state_add_par
{NULL, NULL}
};

#if MYNEWT_VAL(SHELL_CMD_HELP)
const struct shell_cmd_help cmd_leaudio_scan_delegator_receive_state_add_help = {
.summary = "Add receive state",
.usage = NULL,
Expand Down Expand Up @@ -834,12 +833,12 @@ cmd_leaudio_scan_delegator_receive_state_add(int argc, char **argv)
return rc;
}

#if MYNEWT_VAL(SHELL_CMD_HELP)
static const struct shell_param cmd_leaudio_scan_delegator_receive_state_remove_params[] = {
{"source_id", "usage: =<UINT8>"},
{NULL, NULL}
};

#if MYNEWT_VAL(SHELL_CMD_HELP)
const struct shell_cmd_help cmd_leaudio_scan_delegator_receive_state_remove_help = {
.summary = "Remove receive state",
.usage = NULL,
Expand Down Expand Up @@ -889,17 +888,15 @@ const struct parse_arg_kv_pair cmd_big_enc_type[] = {
{ NULL }
};

#if MYNEWT_VAL(SHELL_CMD_HELP)
static const struct shell_param cmd_leaudio_scan_delegator_receive_state_set_params[] = {
{"source_id", "usage: =<UINT8>"},
{"pa_sync_state", "usage: =[not_synced|sync_info_req|synced|failed|no_past],"
" default: not_synced"},
{"big_enc", "usage: =[not_encrypted|code_req|decrypting|bad_code],"
" default: not_encrypted"},
{"pa_sync_state", "usage: =[not_synced|sync_info_req|synced|failed|no_past], default: not_synced"},
{"big_enc", "usage: =[not_encrypted|code_req|decrypting|bad_code], default: not_encrypted"},
{"bad_code", "usage: =[string], default: NULL"},
{NULL, NULL}
};

#if MYNEWT_VAL(SHELL_CMD_HELP)
const struct shell_cmd_help cmd_leaudio_scan_delegator_receive_state_set_help = {
.summary = "Set receive state",
.usage = NULL,
Expand Down Expand Up @@ -1001,12 +998,12 @@ scan_delegator_receive_state_printf(const struct ble_audio_scan_delegator_receiv
}
}

#if MYNEWT_VAL(SHELL_CMD_HELP)
static const struct shell_param cmd_leaudio_scan_delegator_receive_state_get_params[] = {
{"source_id", "usage: =<UINT8>"},
{NULL, NULL}
};

#if MYNEWT_VAL(SHELL_CMD_HELP)
const struct shell_cmd_help cmd_leaudio_scan_delegator_receive_state_get_help = {
.summary = "Get receive state",
.usage = NULL,
Expand Down

0 comments on commit 1221e95

Please sign in to comment.