Skip to content

Commit

Permalink
Update version and add C++ guards (#168)
Browse files Browse the repository at this point in the history
* Update version numbers

* Update CHANGELOG.md

* Add guards for C++ linkage

* Link to Memory estimates markdown from README

* Make possible to override CMake C Standard for tests
  • Loading branch information
muneebahmed10 authored Jul 22, 2021
1 parent a108af5 commit 51c8067
Show file tree
Hide file tree
Showing 57 changed files with 138 additions and 59 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,4 +115,4 @@ jobs:
uses: FreeRTOS/CI-CD-Github-Actions/memory_statistics@main
with:
config: .github/memory_statistics_config.json
check_against: docs/doxygen/include/size_table.html
check_against: docs/doxygen/include/size_table.md
2 changes: 1 addition & 1 deletion .github/workflows/memory_statistics.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ jobs:
uses: actions/upload-artifact@v2
with:
name: size_table
path: size_table.html
path: size_table.md
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# Changelog for coreMQTT Client Library

## Commits to `main`
## v1.1.2 (July 2021)

### Updates
- [#168](https://github.com/FreeRTOS/coreMQTT/pull/168) Add header guards for C++ linkage.
- [#163](https://github.com/FreeRTOS/coreMQTT/pull/163) Fix bug to check for ping responses within `MQTT_PINGRESP_TIMEOUT_MS` instead of the entire keep alive interval.
- [#159](https://github.com/FreeRTOS/coreMQTT/pull/159) Add more checks for malformed packets when deserializing acknowledgments.

Expand Down
17 changes: 15 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This repository contains the coreMQTT library that has been optimized for a low

This library has gone through code quality checks including verification that no function has a [GNU Complexity](https://www.gnu.org/software/complexity/manual/complexity.html) score over 8, and checks against deviations from mandatory rules in the [MISRA coding standard](https://www.misra.org.uk). Deviations from the MISRA C:2012 guidelines are documented under [MISRA Deviations](MISRA.md). This library has also undergone both static code analysis from [Coverity static analysis](https://scan.coverity.com/), and validation of memory safety through the [CBMC automated reasoning tool](https://www.cprover.org/cbmc/).

See memory requirements for this library [here](https://docs.aws.amazon.com/embedded-csdk/202103.00/lib-ref/libraries/standard/coreMQTT/docs/doxygen/output/html/index.html#mqtt_memory_requirements).
See memory requirements for this library [here](./docs/doxygen/include/size_table.md).

**coreMQTT v1.1.0 [source code](https://github.com/FreeRTOS/coreMQTT/tree/v1.1.0/source) is part of the [FreeRTOS 202012.00 LTS](https://github.com/FreeRTOS/FreeRTOS-LTS/tree/202012.00-LTS) release.**

Expand Down Expand Up @@ -120,7 +120,20 @@ Please refer to the demos of the MQTT client library in the following locations
| FreeRTOS | [FreeRTOS AWS Reference Integrations](https://github.com/aws/amazon-freertos/tree/master/demos/coreMQTT) | Based on Secure Sockets Abstraction |


## Generating documentation
## Documentation

### Existing Documentation

For pre-generated documentation, please see the documentation linked in the locations below:

| Location |
| :-: |
| [AWS IoT Device SDK for Embedded C](https://github.com/aws/aws-iot-device-sdk-embedded-C#releases-and-documentation) |
| [FreeRTOS.org](https://freertos.org/Documentation/api-ref/coreMQTT/docs/doxygen/output/html/index.html) |

Note that the latest included version of coreMQTT may differ across repositories.

### Generating Documentation

The Doxygen references were created using Doxygen version 1.8.20. To generate the
Doxygen pages, please run the following command from the root of this repository:
Expand Down
2 changes: 1 addition & 1 deletion docs/doxygen/config.doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ PROJECT_NAME = "coreMQTT"
# could be handy for archiving the generated documentation or if some version
# control system is used.

PROJECT_NUMBER = "v1.1.1"
PROJECT_NUMBER = "v1.1.2"

# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion docs/doxygen/pages.dox
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Please see https://github.com/aws/aws-iot-device-sdk-embedded-C/tree/main/demos/
@section mqtt_memory_requirements Memory Requirements
@brief Memory requirements of the MQTT library.

@include{doc} size_table.html
@include{doc} size_table.md
*/

/**
Expand Down
1 change: 1 addition & 0 deletions lexicon.txt
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ mainpage
malloc
managekeepalive
matchtopic
md
mdash
memcpy
memset
Expand Down
2 changes: 1 addition & 1 deletion manifest.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name : "coreMQTT"
version: "v1.1.1"
version: "v1.1.2"
description: |
"Client implementation of the MQTT 3.1.1 specification for embedded devices.\n"
license: "MIT"
2 changes: 1 addition & 1 deletion source/core_mqtt.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* coreMQTT v1.1.1
* coreMQTT v1.1.2
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
Expand Down
2 changes: 1 addition & 1 deletion source/core_mqtt_serializer.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* coreMQTT v1.1.1
* coreMQTT v1.1.2
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
Expand Down
2 changes: 1 addition & 1 deletion source/core_mqtt_state.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* coreMQTT v1.1.1
* coreMQTT v1.1.2
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
Expand Down
16 changes: 14 additions & 2 deletions source/include/core_mqtt.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* coreMQTT v1.1.1
* coreMQTT v1.1.2
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
Expand Down Expand Up @@ -27,6 +27,12 @@
#ifndef CORE_MQTT_H
#define CORE_MQTT_H

/* *INDENT-OFF* */
#ifdef __cplusplus
extern "C" {
#endif
/* *INDENT-ON* */

/* MQTT_DO_NOT_USE_CUSTOM_CONFIG allows building the MQTT library
* without a custom config. If a custom config is provided, the
* MQTT_DO_NOT_USE_CUSTOM_CONFIG macro should not be defined. */
Expand All @@ -49,7 +55,7 @@
* @cond DOXYGEN_IGNORE
* The current version of this library.
*/
#define MQTT_LIBRARY_VERSION "v1.1.1"
#define MQTT_LIBRARY_VERSION "v1.1.2"
/** @endcond */

/**
Expand Down Expand Up @@ -887,4 +893,10 @@ MQTTStatus_t MQTT_GetSubAckStatusCodes( const MQTTPacketInfo_t * pSubackPacket,
const char * MQTT_Status_strerror( MQTTStatus_t status );
/* @[declare_mqtt_status_strerror] */

/* *INDENT-OFF* */
#ifdef __cplusplus
}
#endif
/* *INDENT-ON* */

#endif /* ifndef CORE_MQTT_H */
14 changes: 13 additions & 1 deletion source/include/core_mqtt_config_defaults.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* coreMQTT v1.1.1
* coreMQTT v1.1.2
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
Expand Down Expand Up @@ -35,6 +35,12 @@
#ifndef CORE_MQTT_CONFIG_DEFAULTS_H_
#define CORE_MQTT_CONFIG_DEFAULTS_H_

/* *INDENT-OFF* */
#ifdef __cplusplus
extern "C" {
#endif
/* *INDENT-ON* */

/* The macro definition for MQTT_DO_NOT_USE_CUSTOM_CONFIG is for Doxygen
* documentation only. */

Expand Down Expand Up @@ -247,4 +253,10 @@
#define LogDebug( message )
#endif

/* *INDENT-OFF* */
#ifdef __cplusplus
}
#endif
/* *INDENT-ON* */

#endif /* ifndef CORE_MQTT_CONFIG_DEFAULTS_H_ */
14 changes: 13 additions & 1 deletion source/include/core_mqtt_serializer.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* coreMQTT v1.1.1
* coreMQTT v1.1.2
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
Expand Down Expand Up @@ -34,6 +34,12 @@
#include <stdint.h>
#include <stdbool.h>

/* *INDENT-OFF* */
#ifdef __cplusplus
extern "C" {
#endif
/* *INDENT-ON */

/* MQTT_DO_NOT_USE_CUSTOM_CONFIG allows building the MQTT library
* without a custom config. If a custom config is provided, the
* MQTT_DO_NOT_USE_CUSTOM_CONFIG macro should not be defined. */
Expand Down Expand Up @@ -1171,4 +1177,10 @@ MQTTStatus_t MQTT_GetIncomingPacketTypeAndLength( TransportRecv_t readFunc,
MQTTPacketInfo_t * pIncomingPacket );
/* @[declare_mqtt_getincomingpackettypeandlength] */

/* *INDENT-OFF* */
#ifdef __cplusplus
}
#endif
/* *INDENT-ON* */

#endif /* ifndef CORE_MQTT_SERIALIZER_H */
14 changes: 13 additions & 1 deletion source/include/core_mqtt_state.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* coreMQTT v1.1.1
* coreMQTT v1.1.2
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
Expand Down Expand Up @@ -27,6 +27,12 @@
#ifndef CORE_MQTT_STATE_H
#define CORE_MQTT_STATE_H

/* *INDENT-OFF* */
#ifdef __cplusplus
extern "C" {
#endif
/* *INDENT-ON* */

#include "core_mqtt.h"

/**
Expand Down Expand Up @@ -275,4 +281,10 @@ uint16_t MQTT_PublishToResend( const MQTTContext_t * pMqttContext,
const char * MQTT_State_strerror( MQTTPublishState_t state );
/** @endcond */

/* *INDENT-OFF* */
#ifdef __cplusplus
}
#endif
/* *INDENT-ON* */

#endif /* ifndef CORE_MQTT_STATE_H */
14 changes: 13 additions & 1 deletion source/interface/transport_interface.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* coreMQTT v1.1.1
* coreMQTT v1.1.2
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
Expand Down Expand Up @@ -31,6 +31,12 @@
#include <stdint.h>
#include <stddef.h>

/* *INDENT-OFF* */
#ifdef __cplusplus
extern "C" {
#endif
/* *INDENT-ON* */

/**
* @transportpage
* @brief The transport interface definition.
Expand Down Expand Up @@ -250,4 +256,10 @@ typedef struct TransportInterface
} TransportInterface_t;
/* @[define_transportinterface] */

/* *INDENT-OFF* */
#ifdef __cplusplus
}
#endif
/* *INDENT-ON* */

#endif /* ifndef TRANSPORT_INTERFACE_H_ */
10 changes: 7 additions & 3 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,13 @@ project ( "CoreMQTT unit test"
# Allow the project to be organized into folders.
set_property( GLOBAL PROPERTY USE_FOLDERS ON )

# Use C90.
set( CMAKE_C_STANDARD 90 )
set( CMAKE_C_STANDARD_REQUIRED ON )
# Use C90 if not specified.
if( NOT DEFINED CMAKE_C_STANDARD )
set( CMAKE_C_STANDARD 90 )
endif()
if( NOT DEFINED CMAKE_C_STANDARD_REQUIRED )
set( CMAKE_C_STANDARD_REQUIRED ON )
endif()

# Do not allow in-source build.
if( ${PROJECT_SOURCE_DIR} STREQUAL ${PROJECT_BINARY_DIR} )
Expand Down
2 changes: 1 addition & 1 deletion test/cbmc/include/core_mqtt_config.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* coreMQTT v1.1.1
* coreMQTT v1.1.2
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
Expand Down
2 changes: 1 addition & 1 deletion test/cbmc/include/event_callback_stub.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* coreMQTT v1.1.1
* coreMQTT v1.1.2
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
Expand Down
2 changes: 1 addition & 1 deletion test/cbmc/include/get_time_stub.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* coreMQTT v1.1.1
* coreMQTT v1.1.2
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
Expand Down
2 changes: 1 addition & 1 deletion test/cbmc/include/mqtt_cbmc_state.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* coreMQTT v1.1.1
* coreMQTT v1.1.2
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
Expand Down
2 changes: 1 addition & 1 deletion test/cbmc/include/network_interface_stubs.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* coreMQTT v1.1.1
* coreMQTT v1.1.2
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
Expand Down
2 changes: 1 addition & 1 deletion test/cbmc/proofs/MQTT_Connect/MQTT_Connect_harness.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* coreMQTT v1.1.1
* coreMQTT v1.1.2
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* coreMQTT v1.1.1
* coreMQTT v1.1.2
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* coreMQTT v1.1.1
* coreMQTT v1.1.2
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
Expand Down
2 changes: 1 addition & 1 deletion test/cbmc/proofs/MQTT_Disconnect/MQTT_Disconnect_harness.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* coreMQTT v1.1.1
* coreMQTT v1.1.2
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* coreMQTT v1.1.1
* coreMQTT v1.1.2
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* coreMQTT v1.1.1
* coreMQTT v1.1.2
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* coreMQTT v1.1.1
* coreMQTT v1.1.2
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
Expand Down
2 changes: 1 addition & 1 deletion test/cbmc/proofs/MQTT_Init/MQTT_Init_harness.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* coreMQTT v1.1.1
* coreMQTT v1.1.2
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
Expand Down
2 changes: 1 addition & 1 deletion test/cbmc/proofs/MQTT_MatchTopic/MQTT_MatchTopic_harness.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* coreMQTT v1.1.1
* coreMQTT v1.1.2
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
Expand Down
2 changes: 1 addition & 1 deletion test/cbmc/proofs/MQTT_Ping/MQTT_Ping_harness.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* coreMQTT v1.1.1
* coreMQTT v1.1.2
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
Expand Down
Loading

0 comments on commit 51c8067

Please sign in to comment.