Hello all,
I've started putting together some notes around the design of an
MQTT C client for embedded systems, as we're starting to be asked
for such a thing. Examples environments are mbed (mbed.org) and
FreeRTOS (freertos.org).
I'm using a wiki page at:
https://wiki.eclipse.org/Embedded_C_client
Any input welcome.
To Frank in particular, some questions/observations.
1) API style. The FreeRTOS guy we've talked to named the async API
as most natural for that OS. As a result, I was thinking that we
could go with async only, but you brought up the sync API too. The
sync API could run as a layer over the async API (do operation, then
wait for completion), but that wouldn't necessarily help if the goal
was to be single-threaded. Is that what you are suggesting with a
synchronous API - no background threads?
2) Memory allocation. The current C client already redefines
malloc/free to its own functions. We could use the same approach
and implement our own de/allocation from a static buffer if static
memory only was allowed. (On the other hand, if we could minimize
or eliminate dynamic allocation entirely, that would be even
better. I think some experiments are in order).
3) The API has to be able to pass the needed data to the underlying
layer that implements say networking. If the needs of one layer are
different from another, we may need different parameters at the MQTT
API layer - I'm thinking about create/connect in particular here.
Any particular strategies for handling this? (void pointers to an
arbitrary structures seem a bit abstract).
Ian
|