Skip to content

Commit ce223cc

Browse files
ThalleyPavelVPV
authored andcommitted
[nrf fromtree] Bluetooth: Host: Set scan option type to uint8_t
Changed the scan option type from uint32_t to uint8_t. There are 2 reasons for this: 1) This reduces the size of the struct bt_le_scan_param. Since we are now storing two copies of scan parameters statically in the host, this is not insignficant. 2) This fixes a "hole" in the struct. There are no longer 3 empty octets between the `type` and the `options`, which caused valgrind warnings when using `memcpy` and `memcmp` of the struct. Currently we only need 8 bits for the options available. If additional options are added later, the field need to be increased. For the above reasons some additional refactoring my be required to avoid significant size increases and the valgrind issue. Signed-off-by: Emil Gydesen <[email protected]> (cherry picked from commit e1e4f2a)
1 parent e7f6b94 commit ce223cc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

include/zephyr/bluetooth/bluetooth.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2065,7 +2065,7 @@ struct bt_le_scan_param {
20652065
uint8_t type;
20662066

20672067
/** Bit-field of scanning options. */
2068-
uint32_t options;
2068+
uint8_t options;
20692069

20702070
/** Scan interval (N * 0.625 ms).
20712071
*

0 commit comments

Comments
 (0)