Skip to content

Passing current_hci_state as struct creates a copy that is unmodified after return #4

@r10kindsofpeople

Description

@r10kindsofpeople

When you create a function such as:
void start_hci_scan(struct hci_state current_hci_state)
any changes within start_hci_scan will get discarded (like error states and messages)

To fix, the structure can be passed as a pointer, or as a reference, like
void start_hci_scan(struct hci_state **&**current_hci_state)

In my case, hci_le_set_scan_parameters was returning an error, but the error was getting discarded.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions