Fixing full buffer check in LinkWireless::send(...)

This commit is contained in:
Rodrigo Alfonso 2024-09-14 05:54:00 -03:00
parent a11ed09bf0
commit 22c997a62a

View File

@ -635,7 +635,7 @@ class LinkWireless {
return false;
}
if (!_canSend()) {
if (!_canAddNewMessage()) {
if (_author < 0)
lastError = BUFFER_IS_FULL;
return false;
@ -733,13 +733,21 @@ class LinkWireless {
[[nodiscard]] bool _hasActiveAsyncCommand() { return asyncCommand.isActive; }
/**
* @brief Returns whether there's room for new outgoing messages or not.
* @brief Returns whether there's room for sending messages or not.
* \warning This is internal API!
*/
[[nodiscard]] bool _canSend() {
return !sessionState.outgoingMessages.isFull();
}
/**
* @brief Returns whether there's room for scheduling new messages or not.
* \warning This is internal API!
*/
[[nodiscard]] bool _canAddNewMessage() {
return !sessionState.newOutgoingMessages.isFull();
}
/**
* @brief Returns the number of pending outgoing messages.
* \warning This is internal API!