mesh: Fix HB Pub Count Log calculation routine
mesh: Fix HB Pub Count Log calculation routine

"4.1.2 Log field transformation

In order to compress two-octet values into one-octet fields,
the following logarithmic transformation is used: any two-octet
value is mapped onto a one-octet field value representing
the largest integer n, where 2^(n-1) is less than or equal
to the two-octet value."

Log field transformation table:

Log Field Value 	2-octet Value
0x01			0x0001
0x02			0x0002 through 0x0003
0x03			0x0004 through 0x0007
0x04			0x0008 through 0x000F
0x05			0x0010 through 0x001F
0x06			0x0020 through 0x003F
0x07			0x0040 through 0x007F
0x08			0x0080 through 0x00FF
0x09			0x0100 through 0x01FF
0x0A			0x0200 through 0x03FF
0x0B			0x0400 through 0x07FF
0x0C			0x0800 through 0x0FFF
0x0D			0x1000 through 0x1FFF
0x0E			0x2000 through 0x3FFF
0x0F			0x4000 through 0x7FFF
0x10			0x8000 through 0xFFFF

"4.2.17.2 Heartbeat Publication Count Log

The Heartbeat Publication Count Log value between 0x01 and 0x11
shall represent that smallest integer n where 2^(n-1) is greater
than or equal to the Heartbeat Publication Count value. For example,
if the Heartbeat Publication Count value is 0x0579, then the Heartbeat
Publication Count Log value would be 0x0C."

According to this definition 2^(n-1) is an upper bound for n log value.

Proposed Publication Count Log transformation table:

Pub Count Log Value 	2-octet Value
0x01			0x0001
0x02			0x0002
0x03			0x0003 through 0x0004
0x04			0x0005 through 0x0008
0x05			0x0009 through 0x0010
0x06			0x0011 through 0x0020
0x07			0x0021 through 0x0040
0x08			0x0041 through 0x0080
0x09			0x0081 through 0x0100
0x0A			0x0101 through 0x0200
0x0B			0x0201 through 0x0400
0x0C			0x0401 through 0x0800
0x0D			0x0801 through 0x1000
0x0E			0x1001 through 0x2000
0x0F			0x2001 through 0x4000
0x10			0x4001 through 0x8000
0x11			0x8001 through 0x10000

According to Log field transformation table 0x0579 would be transformed
to 0x0B and should be to transformed to 0x0C.

This is required to pass MESH/NODE/CFG/HBP/BV-01-C.

X-Original-Commit: c1d8367d5ed88fa85adc99c0983762cacec005ea

apache/mynewt-nimble,apache/mynewt-nimble,apache/mynewt-nimble,apache/mynewt-nimble,apache/mynewt-nimble