Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Embedded C client

Revision as of 11:27, 2 December 2013 by Icraggs.gmail.com (Talk | contribs) (Created page with "=== Requirements === It is proposed to create a new C client specifically to work on the smallest embedded platforms. The requirements are: * small - say 10 to 20k minimum?...")

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Requirements

It is proposed to create a new C client specifically to work on the smallest embedded platforms. The requirements are:

  • small - say 10 to 20k minimum?
  • portable to various system APIs for threading, networking, memory management, persistence
  • any service features such as trace need to be of very small size - may not need them at all?

Proposal

  • asynchronous API only (I considered a single-thread only API - would that be useful?)
  • pluggable modules for networking, threading, memory management, persistence
  • ANSI standard C still, for maximum portability
  • simple threading model, say one thread per client object, as simplicity is top priority

Notes from Frank Pagliughi =

The main thing to keep in mind is that for a small system lacking an MMU, the bane of the programmer is dynamic memory. Using malloc will fragment the heap and eventually fail. So malloc should not be used directly, and any allocation should be done from within a pluggable layer that can be swapped out. The choices might be something like: (1) Don't do any allocation in the MQTT lib. The app must supply all buffers. Keep copying to a minimum. (2) Provide an allocation layer that uses malloc/free as a default reference implementation and let the user drop-in a required replacement for their system (3) Provide a basic fixed-size block allocator which can be swapped out if the system has a better one.

Back to the top