Long transition times fail in 'light_ctrl' mesh sample due to 16bit value 'rem_time', should be 32bit

nRF Connect SDK v1.7.1 sample \ncs\v1.7.1\nrf\samples\bluetooth\mesh\light_ctrl\

Long transition times fail due to a 16bit value which needs to be 32bit (I believe, can't see a reason why it needs to be 16).

The following code in model_handler.c is used to store the lightness context - rem_time holds the remaining time in millisec. Being a 16bit value, this is < 60sec so long transition times fail and are pulled to their target level when the remaining time prematurely reaches zero.

struct lightness_ctx {
	struct bt_mesh_lightness_srv lightness_srv;
	struct k_work_delayable per_work;
	uint16_t target_lvl;
	uint16_t current_lvl;
	uint32_t time_per;
	uint16_t rem_time;
};

Changing to uint32_t rem_time fixes the issue (the lower SDK mesh models use 32bit for their remaining time variables).

Parents Reply Children
No Data
Related