bluez-experiments icon indicating copy to clipboard operation
bluez-experiments copied to clipboard

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

Open r10kindsofpeople opened this issue 10 years ago • 1 comments

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.

r10kindsofpeople avatar Feb 06 '16 19:02 r10kindsofpeople

I found this problem too.

chenxiaosonggithub avatar Jan 23 '19 10:01 chenxiaosonggithub