Convert Bits to String
txt = pcb.bits2string(t, bits)
Uses a table to convert a bit field into a string representation.
Parameter | Type | Description |
---|---|---|
t |
table | table of bit-field names |
bits |
integer | bit field value |
Returns | Type | Description |
---|---|---|
txt |
string | Comma separated list of bit names. |
e.g.
pcb._reasons = { [0]='WAKEUP1', [1]='WAKEUP2'... [15]='COLD'}
txt = pcb.bits2string(pcb._reasons, 123)