Class that:
More...
#include <cs_UartConnection.h>
Class that:
- Keeps up the UART status.
- Checks heartbeat to see if connection is alive.
- Keeps up the session nonce (also checks if it's timed out).
◆ UartConnection() [1/2]
◆ UartConnection() [2/2]
This class is singleton, deny implementation.
◆ getInstance()
Gets a static singleton (no dynamic memory allocation) of this class.
◆ getSelfStatus()
Returns the UART status reply.
◆ getSessionNonceRx()
Get the session nonce for RX.
- Parameters
-
[out] | data | Buffer to copy the session nonce to. |
- Returns
- Result code.
◆ getSessionNonceTx()
Get the session nonce for TX.
- Parameters
-
[out] | data | Buffer to copy the session nonce to. |
- Returns
- Result code.
◆ getUserStatus()
Returns the status of the UART user.
◆ handleEvent()
void UartConnection::handleEvent |
( |
event_t & |
event | ) |
|
|
privatevirtual |
◆ init()
void UartConnection::init |
( |
| ) |
|
Initialize the class.
- Reads settings from State.
- Starts listening for events.
◆ isAlive()
bool UartConnection::isAlive |
( |
| ) |
|
Returns whether the connection is considered to be alive (receiving heartbeats).
◆ isEncryptedAlive()
bool UartConnection::isEncryptedAlive |
( |
| ) |
|
Returns whether the connection is considered to be alive and encrypted (receiving encrypted heartbeats).
◆ onHeartBeat()
void UartConnection::onHeartBeat |
( |
uint16_t |
timeoutSeconds, |
|
|
bool |
encrypted |
|
) |
| |
To be called on UART heartbeat command.
Sends reply.
◆ onHello()
To be called on UART hello command.
Sends reply.
◆ onSessionNonce()
To be called on UART session nonce command.
Sends reply.
◆ onTick()
void UartConnection::onTick |
( |
| ) |
|
|
private |
◆ onUserStatus()
To be called on UART status command.
Sends reply.
◆ operator=()
This class is singleton, deny implementation.
◆ _connectionTimeoutCountdown
uint32_t UartConnection::_connectionTimeoutCountdown = 0 |
|
private |
Timeout (in tick events) set by heartbeat.
When this reaches 0, consider the connection te be dead.
◆ _isConnectionAlive
bool UartConnection::_isConnectionAlive = false |
|
private |
Keep up whether the connection is considered to be alive.
◆ _isConnectionEncrypted
bool UartConnection::_isConnectionEncrypted = false |
|
private |
Whether the connection heartbeats are encrypted.
◆ _sessionNonceRx
Session nonce used to decrypt incoming uart msgs.
◆ _sessionNonceTimeoutCountdown
uint32_t UartConnection::_sessionNonceTimeoutCountdown = 0 |
|
private |
Timeout (in tick events) set by the received session nonce.
When this reaches 0, consider the RX and TX session nonce to be invalid.
◆ _sessionNonceTx
Session nonce used to encrypt outgoing uart msgs.
◆ _sessionNonceValid
bool UartConnection::_sessionNonceValid = false |
|
private |
Whether the RX and TX session nonce are valid.
◆ _status
Keep up the UART status reply.
◆ _userStatus
Keep up the UART user status.
The documentation for this class was generated from the following file: