Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
r10kindsofpeople opened this issue Feb 6, 2016 · 1 comment

Comments

@r10kindsofpeople
Copy link

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.

@chenxiaosonggithub
Copy link

chenxiaosonggithub commented Jan 23, 2019

I found this problem too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants