mosquitto-users team mailing list archive
-
mosquitto-users team
-
Mailing list archive
-
Message #00470
Re: v1.30 breaks embedded usage
Hi David,
It's a simple mistake, nothing more. Rest assured you aren't expected to
have threading! I'll fix it up for you.
Cheers,
Roger
On Fri, Mar 21, 2014 at 9:03 PM, David Reid
<david.reid@xxxxxxxxxxxxxxxxxx>wrote:
> Roger,
>
>
>
> I think v1.30 has some issues, please advise.
>
>
>
> With v1.2.3 I was able to get a Mosquitto C client running on a STM32
> microcontroller with lwIP and FreeRTOS with relative ease, just a little
> massaging of the code here and there.
>
>
>
> With v1.30 it seems to have gotten broken, namely because of #ifdef
> WITH_THREADING requirements to add the in_message_mutex and
> out_message_mutex members to the mosquito struct. Since threading does not
> apply to my usage case, if I do not define WITH_THREADING then these
> members are not included in the struct and the code fails to compile for
> places where these members are accessed but not protected by that ifdef.
> For example, all of these functions require in_message_mutex and/or
> out_message_mutex member to exist, but if WITH_THREADING is not defined
> then the code will fail to compile because those members do not exist.
>
> _mosquitto_messages_reconnect_reset()
>
> _mosquitto_message_remove()
>
> _mosquitto_message_retry_check()
>
> mosquitto_loop_read()
>
> mosquitto_loop_write()
>
> _mosquitto_handle_publish()
>
>
>
> Am I wrong? Should I be defining WITH_THREADING for a FreeRTOS build? I
> am not sure that I should, there is no pthread.h header file for me to
> include if I do so, so I end up including the dummypthread.h header
> instead.
>
>
>
> Also, I had to add a definition for pthread_mutex_t to your dummypthread.h
> file since it is not defined anywhere else that I could find. Without it,
> the code will not compile.
>
>
>
> I realize that my usage case is not the norm, so perhaps you just assumed
> that the target would support threading? If I am wrong and need to change
> something, please advise.
>
>
>
> Thanks.
>
>
>
> Regards,
>
>
>
>
>
> David Reid
>
> Silicon Engines
>
> david.reid@xxxxxxxxxxxxxxxxxx
>
> 847.637.1180 x234
>
> 847.637.1185 (f)
>
>
>
>
> ------------------------------
> <http://www.avast.com/>
>
> This email is free from viruses and malware because avast! Antivirus<http://www.avast.com/>protection is active.
>
>
> --
> Mailing list: https://launchpad.net/~mosquitto-users
> Post to : mosquitto-users@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~mosquitto-users
> More help : https://help.launchpad.net/ListHelp
>
>
Follow ups
References