Skip to content
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

FPU-Trap when calculating client->typical_response_time #152

Open
fawkes851 opened this issue Jan 11, 2022 · 0 comments
Open

FPU-Trap when calculating client->typical_response_time #152

fawkes851 opened this issue Jan 11, 2022 · 0 comments

Comments

@fawkes851
Copy link

I get a FPU error on a hardware device in line 868 of mqtt.c:

client->typical_response_time = 0.875 * (client->typical_response_time) + 0.125 * (double) (MQTT_PAL_TIME() - msg->time_sent)

When the response time is typically below 1 second, the difference (MQTT_PAL_TIME() - msg->time_sent) is zero and the product get smaller each time a response is received until it hits the minimum value of a double.

As MQTT_PAL_TIME() is meant to be in seconds, it's the question whether this calculation makes sense in low latency environments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant