Skip to content

Documentation fixes and additions#373

Merged
AniruddhaKanhere merged 1 commit into
FreeRTOS:mainfrom
AniruddhaKanhere:doc-fixes
May 7, 2026
Merged

Documentation fixes and additions#373
AniruddhaKanhere merged 1 commit into
FreeRTOS:mainfrom
AniruddhaKanhere:doc-fixes

Conversation

@AniruddhaKanhere
Copy link
Copy Markdown
Member

  • core_mqtt.h: fix MQTT_InitRetransmits example (remove phantom publishClearAllCallback so example matches the 3-callback signature); fix MQTT_InitStatefulQoS docstring (@p pBuffer -> @p pAckPropsBuf); complete the truncated MQTTStatusNotConnected return-value sentence in MQTT_CheckConnectStatus.

  • Replace C99 compound literals (&(uint8_t){ MQTT_PACKET_TYPE_* }) in all doc examples with the C90-compatible MQTT_PROP_VALIDATE_* macros across core_mqtt.h (5), core_mqtt_serializer.h (1), MigrationGuide.md (26), and MQTTv5Guide.md (9). The one PUBREL case, which has no matching MQTT_PROP_VALIDATE_* macro, uses MQTT_PROP_NO_VALIDATE.

  • README.md: add Thread Safety section documenting the MQTT_PRE_STATE_UPDATE_HOOK / MQTT_POST_STATE_UPDATE_HOOK extension points, with a non-recursive FreeRTOS mutex example (verified: the library does not re-enter a hook-protected region).

  • core_mqtt_serializer.h: add an explanatory comment block above the MQTT_PACKET_TYPE_VAL file-scope statics explaining why they exist and why the MISRA C:2012 Rule 2.2 / 2.8 deviations are accepted (macros cannot be addressed, MQTT_PROP_VALIDATE needs a typed const uint8_t *).

  • Add source/include/core_mqtt_config_template.h: a commented-out starter template users can copy as core_mqtt_config.h, covering every tunable documented in core_mqtt_config_defaults.h plus the thread-safety hooks.

Description

Test Steps

Checklist:

  • I have tested my changes. No regression in existing tests.
  • I have modified and/or added unit-tests to cover the code changes in this Pull Request.

Related Issue

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

- core_mqtt.h: fix MQTT_InitRetransmits example (remove phantom
  publishClearAllCallback so example matches the 3-callback signature);
  fix MQTT_InitStatefulQoS docstring (@p pBuffer -> @p pAckPropsBuf);
  complete the truncated MQTTStatusNotConnected return-value sentence
  in MQTT_CheckConnectStatus.

- Replace C99 compound literals (&(uint8_t){ MQTT_PACKET_TYPE_* }) in
  all doc examples with the C90-compatible MQTT_PROP_VALIDATE_* macros
  across core_mqtt.h (5), core_mqtt_serializer.h (1), MigrationGuide.md
  (26), and MQTTv5Guide.md (9). The one PUBREL case, which has no
  matching MQTT_PROP_VALIDATE_* macro, uses MQTT_PROP_NO_VALIDATE.

- README.md: add Thread Safety section documenting the
  MQTT_PRE_STATE_UPDATE_HOOK / MQTT_POST_STATE_UPDATE_HOOK extension
  points, with a non-recursive FreeRTOS mutex example (verified: the
  library does not re-enter a hook-protected region).

- core_mqtt_serializer.h: add an explanatory comment block above the
  MQTT_PACKET_TYPE_*_VAL file-scope statics explaining why they exist
  and why the MISRA C:2012 Rule 2.2 / 2.8 deviations are accepted
  (macros cannot be addressed, MQTT_PROP_VALIDATE_* needs a typed
  const uint8_t *).

- Add source/include/core_mqtt_config_template.h: a commented-out
  starter template users can copy as core_mqtt_config.h, covering
  every tunable documented in core_mqtt_config_defaults.h plus the
  thread-safety hooks.
@AniruddhaKanhere AniruddhaKanhere enabled auto-merge (squash) May 6, 2026 23:47
@AniruddhaKanhere AniruddhaKanhere merged commit 0c4f64b into FreeRTOS:main May 7, 2026
11 checks passed
@AniruddhaKanhere AniruddhaKanhere deleted the doc-fixes branch May 7, 2026 21:51
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