Skip to content
Commit 2d859cc1 authored by Johan Hedberg's avatar Johan Hedberg Committed by Johan Hedberg
Browse files

Bluetooth: Mesh: Make model publication struct more compact



commit 42d33040 introduced the FastPeriodDivisor value to
to the model publication struct. Based on the way it was grouped it
seems the intention was to fit it within the same octet as other bit
fields, but it actually makes the octet overflow by one bit. This ends
up creating another u8_t variable which in turn adds 24 bits of
padding after it.

To keep the size of the struct as compact as possible, group the flag
together with the key index, since that only requires 12 bits. Some
care is needed here, since the mesh stack does have special internal
key index values that require more than 12 bits such as
BT_MESH_KEY_UNUSED and BT_MESH_KEY_DEV. In this case restricting
ourselves to 12 bits is fine since the value in the model publication
struct follows 1:1 the value received in the Config Model Publication
Set message, and there the parameter is defined to be exactly 12 bits.

Signed-off-by: default avatarJohan Hedberg <johan.hedberg@intel.com>
parent fc56b371
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment