How publish period is calculated in nrf sdk for Mesh

Hi,

I am trying to provision and  set the publish period for a sensor server model by using an ESP32 as both my provisioner and configuration client. I am able to provision my node and able to set the model publication state too. But when I set the publish period as 30 seconds from my ESP32, the actual publish period being set is 57 seconds and when I set the publish period to 20 seconds,  the actual publish period set is 17 seconds. May I know why this happens? 

I am following the ble mesh standard to set the publish period wherein, I use the first two bits for resolution and the remaining bits for steps. 

So the publish period is calculated as = steps * resolution.

I am trying to set the publish period as 30 seconds and the value I used to set the publish period in the model publication state is 121(in decimal). When I right shift 121 by two I get steps as 30. And when I get the first two bits using bit masking it is 1 (0b01). As per this calculation, the publish period set in the sensor server should be = 30(steps) * 1sec(resolution). But it isn't the case. I have attached the screenshot from mesh profile specification document which will comply with the above calculation. 

Please help me in resolving this issue.

Related