Skip to content

Commit

Permalink
neard: Fix reading State message
Browse files Browse the repository at this point in the history
dbus_message_iter_recurse only makese sense for container types, this is a string.

Fixes: bluez#300
  • Loading branch information
nicolasfella authored and Vudentz committed Feb 24, 2022
1 parent 58dec00 commit bf09e1f
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions plugins/neard.c
Original file line number Diff line number Diff line change
Expand Up @@ -575,14 +575,12 @@ static int process_message(DBusMessage *msg, struct oob_params *remote)
if (process_nokia_com_bt(data, size, remote))
goto error;
} else if (strcasecmp(key, "State") == 0) {
DBusMessageIter array;
const char *state;

if (dbus_message_iter_get_arg_type(&value) !=
DBUS_TYPE_STRING)
goto error;

dbus_message_iter_recurse(&value, &array);
dbus_message_iter_get_basic(&value, &state);

remote->power_state = process_state(state);
Expand Down

0 comments on commit bf09e1f

Please sign in to comment.