mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-01-03 23:47:08 +00:00
hfp: check for custom commands in both roles
This commit is contained in:
parent
892f58a83a
commit
04cf3dd4b6
@ -1194,8 +1194,8 @@ static hfp_command_entry_t hfp_hf_command_table[] = {
|
||||
|
||||
static const hfp_custom_at_command_t *
|
||||
hfp_custom_command_lookup(bool isHandsFree, const char *text) {
|
||||
btstack_linked_list_iterator_t it;
|
||||
btstack_linked_list_t * custom_commands = isHandsFree ? &hfp_custom_commands_hf : &hfp_custom_commands_ag;
|
||||
btstack_linked_list_iterator_t it;
|
||||
btstack_linked_list_iterator_init(&it, custom_commands);
|
||||
while (btstack_linked_list_iterator_has_next(&it)) {
|
||||
hfp_custom_at_command_t *at_command = (hfp_custom_at_command_t *) btstack_linked_list_iterator_next(&it);
|
||||
@ -1210,11 +1210,9 @@ hfp_custom_command_lookup(bool isHandsFree, const char *text) {
|
||||
static hfp_command_t parse_command(const char * line_buffer, int isHandsFree){
|
||||
|
||||
// check for custom commands, AG only
|
||||
if (isHandsFree == 0) {
|
||||
const hfp_custom_at_command_t * custom_at_command = hfp_custom_command_lookup(isHandsFree, line_buffer);
|
||||
if (custom_at_command != NULL){
|
||||
return HFP_CMD_CUSTOM_MESSAGE;
|
||||
}
|
||||
const hfp_custom_at_command_t * custom_at_command = hfp_custom_command_lookup(isHandsFree, line_buffer);
|
||||
if (custom_at_command != NULL){
|
||||
return HFP_CMD_CUSTOM_MESSAGE;
|
||||
}
|
||||
|
||||
// table lookup based on role
|
||||
|
Loading…
Reference in New Issue
Block a user