Skip to content

Return flag from poll() to allow conditional events to trigger #62

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 30, 2022

Conversation

nsted
Copy link
Contributor

@nsted nsted commented May 20, 2021

Returning a flag from server's poll() is helpful to allow code conditionally execute when a new packet is received. For example, we may want to update holding registers after the last values were collected by the client. Using the flag is optional and can be ignored, using poll() as it has been.

@CLAassistant
Copy link

CLAassistant commented May 20, 2021

CLA assistant check
All committers have signed the CLA.

@github-actions
Copy link

Memory usage change @ 068f31b

Board flash % RAM for global variables %
arduino:avr:leonardo 🔺 +20 - +24 +0.07 - +0.08 0 - 0 0.0 - 0.0
arduino:avr:nano 🔺 +20 - +24 +0.07 - +0.08 0 - 0 0.0 - 0.0
arduino:mbed:envie_m7 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:mbed:nano33ble 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:megaavr:uno2018:mode=off 🔺 +20 - +26 +0.04 - +0.05 0 - 0 0.0 - 0.0
arduino:samd:mkrwifi1010 🔺 +8 - +24 0.0 - +0.01 0 - 0 0.0 - 0.0
Click for full report table
Board examples/RTU/ModbusRTUClientKitchenSink
flash
% examples/RTU/ModbusRTUClientKitchenSink
RAM for global variables
% examples/RTU/ModbusRTUClientToggle
flash
% examples/RTU/ModbusRTUClientToggle
RAM for global variables
% examples/RTU/ModbusRTUServerKitchenSink
flash
% examples/RTU/ModbusRTUServerKitchenSink
RAM for global variables
% examples/RTU/ModbusRTUServerLED
flash
% examples/RTU/ModbusRTUServerLED
RAM for global variables
% examples/RTU/ModbusRTUTemperatureSensor
flash
% examples/RTU/ModbusRTUTemperatureSensor
RAM for global variables
% examples/TCP/EthernetModbusClientToggle
flash
% examples/TCP/EthernetModbusClientToggle
RAM for global variables
% examples/TCP/EthernetModbusServerLED
flash
% examples/TCP/EthernetModbusServerLED
RAM for global variables
% examples/TCP/WiFiModbusClientToggle
flash
% examples/TCP/WiFiModbusClientToggle
RAM for global variables
% examples/TCP/WiFiModbusServerLED
flash
% examples/TCP/WiFiModbusServerLED
RAM for global variables
%
arduino:avr:leonardo 20 0.07 0 0.0 20 0.07 0 0.0 20 0.07 0 0.0 24 0.08 0 0.0 20 0.07 0 0.0 20 0.07 0 0.0 20 0.07 0 0.0
arduino:avr:nano 20 0.07 0 0.0 20 0.07 0 0.0 20 0.07 0 0.0 24 0.08 0 0.0 20 0.07 0 0.0 20 0.07 0 0.0 20 0.07 0 0.0
arduino:mbed:envie_m7 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0
arduino:mbed:nano33ble 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0
arduino:megaavr:uno2018:mode=off 22 0.05 0 0.0 22 0.05 0 0.0 22 0.05 0 0.0 26 0.05 0 0.0 22 0.05 0 0.0 22 0.05 0 0.0 20 0.04 0 0.0 22 0.05 0 0.0 20 0.04 0 0.0
arduino:samd:mkrwifi1010 8 0.0 0 0.0 8 0.0 0 0.0 8 0.0 0 0.0 16 0.01 0 0.0 8 0.0 0 0.0 8 0.0 0 0.0 24 0.01 0 0.0 8 0.0 0 0.0 24 0.01 0 0.0
Click for full report CSV
Board,examples/RTU/ModbusRTUClientKitchenSink<br>flash,%,examples/RTU/ModbusRTUClientKitchenSink<br>RAM for global variables,%,examples/RTU/ModbusRTUClientToggle<br>flash,%,examples/RTU/ModbusRTUClientToggle<br>RAM for global variables,%,examples/RTU/ModbusRTUServerKitchenSink<br>flash,%,examples/RTU/ModbusRTUServerKitchenSink<br>RAM for global variables,%,examples/RTU/ModbusRTUServerLED<br>flash,%,examples/RTU/ModbusRTUServerLED<br>RAM for global variables,%,examples/RTU/ModbusRTUTemperatureSensor<br>flash,%,examples/RTU/ModbusRTUTemperatureSensor<br>RAM for global variables,%,examples/TCP/EthernetModbusClientToggle<br>flash,%,examples/TCP/EthernetModbusClientToggle<br>RAM for global variables,%,examples/TCP/EthernetModbusServerLED<br>flash,%,examples/TCP/EthernetModbusServerLED<br>RAM for global variables,%,examples/TCP/WiFiModbusClientToggle<br>flash,%,examples/TCP/WiFiModbusClientToggle<br>RAM for global variables,%,examples/TCP/WiFiModbusServerLED<br>flash,%,examples/TCP/WiFiModbusServerLED<br>RAM for global variables,%
arduino:avr:leonardo,20,0.07,0,0.0,20,0.07,0,0.0,20,0.07,0,0.0,24,0.08,0,0.0,20,0.07,0,0.0,20,0.07,0,0.0,20,0.07,0,0.0
arduino:avr:nano,20,0.07,0,0.0,20,0.07,0,0.0,20,0.07,0,0.0,24,0.08,0,0.0,20,0.07,0,0.0,20,0.07,0,0.0,20,0.07,0,0.0
arduino:mbed:envie_m7,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,,,,,,,,
arduino:mbed:nano33ble,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,,,,,,,,
arduino:megaavr:uno2018:mode=off,22,0.05,0,0.0,22,0.05,0,0.0,22,0.05,0,0.0,26,0.05,0,0.0,22,0.05,0,0.0,22,0.05,0,0.0,20,0.04,0,0.0,22,0.05,0,0.0,20,0.04,0,0.0
arduino:samd:mkrwifi1010,8,0.0,0,0.0,8,0.0,0,0.0,8,0.0,0,0.0,16,0.01,0,0.0,8,0.0,0,0.0,8,0.0,0,0.0,24,0.01,0,0.0,8,0.0,0,0.0,24,0.01,0,0.0

Copy link
Contributor

@aentinger aentinger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍 (after resolving the merge conflict).

@aentinger aentinger merged commit 284cb68 into arduino-libraries:master Jun 30, 2022
@per1234 per1234 added type: enhancement Proposed improvement topic: code Related to content of the project itself labels Jun 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: code Related to content of the project itself type: enhancement Proposed improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants