Utils
- class n2k.utils.IntRef(value: int = 0) None[source]
Bases:
objectA reference to an integer value.
This class is useful for creating a mutable integer object that can be passed around and modified in place.
Implements basic arithmetic operations to allow for easy manipulation of the integer value.
-
value:
int
-
value:
- n2k.utils.n2k_reset_binary_status() int[source]
Reset all single binary status values to not available
This helper function returns a new fully reset 64bit bank status. For each individual item the status will be 3 (0b11 - Unavailable
N2kOnOff)- Return type:
int
- n2k.utils.n2k_get_status_on_binary_status(bank_status: int, item_index: int = 1) N2kOnOff[source]
Get single status of full binary bank status returned by
n2k.messages.parse_n2k_binary_status_report().- Parameters:
bank_status (
int) – Full bank status read byn2k.messages.parse_n2k_binary_status_report()item_index (
int, default:1) – Status item index 1-28
- Return type:
- Returns:
single status of full binary bank status
- n2k.utils.n2k_set_status_binary_on_status(bank_status: int, item_status: N2kOnOff, item_index: int = 1) int[source]
Set single status to full binary bank status.
- Parameters:
bank_status (
int) – Existing Bank Statusitem_status (
N2kOnOff) – New Item Statusitem_index (
int, default:1) – Index of Item to be changed
- Return type:
int- Returns:
New Bank Status