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

Multiple fixes and improvements in mqtt client source #97

Open
wants to merge 18 commits into
base: master
Choose a base branch
from

Conversation

ajaybhargav
Copy link

Compiler generate unused variable 'i' warning in mqtt_list_subscribe_topic when MQTT_LOG_LEVEL < MQTT_LOG_INFO_LEVEL.

如果任务优先级比初始化的任务优先级高会导致无法连接, 因为新建的任务在进入的时候会检查这一个状态, 如果被抢占, 这一个状态就不会被修改
@SL-RU
Copy link

SL-RU commented Feb 23, 2024

We cannot do that because this flag is not meant to be used in such way, MQTT_LOG_LEVEL is only for mqtt_log. It is better to do in such way to remove warning and not to not mix definitions:

int i = 0;
(void) i;

@ajaybhargav
Copy link
Author

yes that's another way to do it. independent of LOG setting. I will modify that and push again.

This patch fix the issue where platform_thread_destroy do not actually
delete the thread created, only memory free was done.

Signed-off-by: Ajay Bhargav <[email protected]>
Compiler generate unused variable 'i' warning in mqtt_list_subscribe_topic
when MQTT_LOG_LEVEL < MQTT_LOG_INFO_LEVEL.

Signed-off-by: Ajay Bhargav <[email protected]>
@@ -1463,6 +1463,8 @@ int mqtt_publish(mqtt_client_t* c, const char* topic_filter, mqtt_message_t* msg
int mqtt_list_subscribe_topic(mqtt_client_t* c)
{
int i = 0;

(void) i; /* prevent compiler warning */
Copy link

Choose a reason for hiding this comment

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

Awesome!

Copy link

Choose a reason for hiding this comment

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

@jiejieTop approve?

In tencentos implementation of platform_thread_destroy, stack size is
getting freed where as stack base is suppose to be freed.

platform_thread_t structure varaible is also not freed. this patch fix
both the issues

Signed-off-by: Ajay Bhargav <[email protected]>
Task handle must be storead in temporary variable and then memory is to be freed. Else task exits before memory free is executed.

Signed-off-by: Ajay Bhargav <[email protected]>
when topic filter string passed to mqtt_subscribe via a local variable, topic
subscribe is success but does not receive anything afterwards.

This patch remove dependency of type of variable passed to mqtt_subscribe

Signed-off-by: Ajay Bhargav <[email protected]>
last will topic and message is now allocated to remove dependency on variable
type passed to function.

Signed-off-by: Ajay Bhargav <[email protected]>
remove full path name from error and debug messages.

Signed-off-by: Ajay Bhargav <[email protected]>
@ajaybhargav ajaybhargav changed the title fix build warning when LOG_LEVEL < LOG_INFO_LEVEL Multiple fixes and improvements in mqtt client source Feb 26, 2025
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

Successfully merging this pull request may close these issues.

3 participants