Skip to content

Commit

Permalink
[Cellular Library] Update doxygen configuration file and fix warning …
Browse files Browse the repository at this point in the history
…message. (#36)

* [Cellular Library] Add doxygen supported by CI check.

* [Cellular Library] Modify doxygen configuration file and removed files.

* [Cellular Library] Update doxygen configuration and fix warning in header files.

* [Cellular Library] Add Contribution page and fix build warning fo coverity_analysis

* [Cellular Library] Fix missing data type from cellular library.

* [Cellular Library] Fill in comment for cellular_type.h

* [Cellular Library] Remove unused file
  • Loading branch information
andysun2015 authored Aug 31, 2021
1 parent bee44cc commit ea4f994
Show file tree
Hide file tree
Showing 38 changed files with 3,968 additions and 1,562 deletions.
63 changes: 63 additions & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# Contributing Guidelines

Thank you for your interest in contributing to our project. Whether it's a bug report, new feature, correction, or additional
documentation, we greatly value feedback and contributions from our community.

Please read through this document before submitting any issues or pull requests to ensure we have all the necessary
information to effectively respond to your bug report or contribution.


## Reporting Bugs/Feature Requests

We welcome you to use the GitHub issue tracker to report bugs or suggest features.

When filing an issue, please check [existing open](https://github.com/FreeRTOS/backoffAlgorithm/issues), or [recently closed](https://github.com/FreeRTOS/backoffAlgorithm/issues?q=is%3Aissue+is%3Aclosed), issues to make sure somebody else hasn't already
reported the issue. Please try to include as much information as you can. Details like these are incredibly useful:

* A reproducible test case or series of steps
* The version of our code being used
* Any modifications you've made relevant to the bug
* Anything unusual about your environment or deployment


## Contributing via Pull Requests
Contributions via pull requests are much appreciated. Before sending us a pull request, please ensure that:

1. You are working against the latest source on the *main* branch.
1. You check existing open, and recently merged, pull requests to make sure someone else hasn't addressed the problem already.
1. You open an issue to discuss any significant work - we would hate for your time to be wasted.

To send us a pull request, please:

1. Fork the repository.
1. Modify the source; please focus on the specific change you are contributing. If you also reformat all the code, it will be hard for us to focus on your change.
1. Ensure that your contributions conform to the [style guide](https://docs.aws.amazon.com/embedded-csdk/202011.00/lib-ref/docs/doxygen/output/html/guide_developer_styleguide.html).
1. Format your code with uncrustify, using the config available in [FreeRTOS/CI-CD-Github-Actions](https://github.com/FreeRTOS/CI-CD-Github-Actions/blob/main/formatting/uncrustify.cfg).
1. Ensure local tests pass.
1. Commit to your fork using clear commit messages.
1. Send us a pull request, answering any default questions in the pull request interface.
1. Pay attention to any automated CI failures reported in the pull request, and stay involved in the conversation.

GitHub provides additional document on [forking a repository](https://help.github.com/articles/fork-a-repo/) and
[creating a pull request](https://help.github.com/articles/creating-a-pull-request/).


## Finding contributions to work on
Looking at the existing issues is a great way to find something to contribute on. As our projects, by default, use the default GitHub issue labels ((enhancement/bug/duplicate/help wanted/invalid/question/wontfix), looking at any ['help wanted'](https://github.com/FreeRTOS/backoffAlgorithm/labels?q=help+wanted) issues is a great place to start.


## Code of Conduct
This project has adopted the [Amazon Open Source Code of Conduct](https://aws.github.io/code-of-conduct).
For more information see the [Code of Conduct FAQ](https://aws.github.io/code-of-conduct-faq) or contact
[email protected] with any additional questions or comments.


## Security issue notifications
If you discover a potential security issue in this project we ask that you notify AWS/Amazon Security via our [vulnerability reporting page](https://aws.amazon.com/security/vulnerability-reporting/). Please do **not** create a public github issue.


## Licensing

See the [LICENSE](../LICENSE) file for our project's licensing. We will ask you to confirm the licensing of your contribution.

We may ask you to sign a [Contributor License Agreement (CLA)](https://en.wikipedia.org/wiki/Contributor_License_Agreement) for larger changes.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
path: ./
source_path: common
doxygen:
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Run doxygen build
Expand Down
8 changes: 7 additions & 1 deletion common/include/cellular_at_core.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@
* http://www.FreeRTOS.org
*/

/**
* @file cellular_at_core.h
*/

#ifndef __CELLULAR_AT_CORE_H__
#define __CELLULAR_AT_CORE_H__

Expand All @@ -45,7 +49,9 @@
*/
#define CELLULAR_AT_MAX_PREFIX_SIZE ( 32 )


/**
* @brief The arrary size of an array.
*/
#define ARRY_SIZE( x ) ( sizeof( x ) / sizeof( x[ 0 ] ) )

/*-----------------------------------------------------------*/
Expand Down
100 changes: 53 additions & 47 deletions common/include/cellular_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@
* http://www.FreeRTOS.org
*/

/**
* @file cellular_common.h
*/

#ifndef __CELLULAR_COMMON_H__
#define __CELLULAR_COMMON_H__

Expand All @@ -48,12 +52,12 @@
*/
typedef struct CellularAtReq
{
const char * pAtCmd;
CellularATCommandType_t atCmdType;
const char * pAtRspPrefix;
CellularATCommandResponseReceivedCallback_t respCallback;
void * pData;
uint16_t dataLen;
const char * pAtCmd; /**< The At command string used for at command request. */
CellularATCommandType_t atCmdType; /**< The At command type. */
const char * pAtRspPrefix; /**< The prefix of at command response. */
CellularATCommandResponseReceivedCallback_t respCallback; /**< The callback function #CellularATCommandResponseReceivedCallback_t. */
void * pData; /**< The data pointer to the data. */
uint16_t dataLen; /**< The length of the data pointer . */
} CellularAtReq_t;

/**
Expand All @@ -62,19 +66,21 @@ typedef struct CellularAtReq
*/
typedef struct CellularAtDataReq
{
const uint8_t * pData; /* Data to send. */
uint32_t dataLen; /* Data length to send. */
uint32_t * pSentDataLength; /* Data actually sent. */
const uint8_t * pEndPattern; /* End pattern after pData is sent completely.
const uint8_t * pData; /**< Data to send. */
uint32_t dataLen; /**< Data length to send. */
uint32_t * pSentDataLength; /**< Data actually sent. */
const uint8_t * pEndPattern; /**< End pattern after pData is sent completely.
* Set NULL if not required. Cellular modem uses
* end pattern instead of length in AT command
* can make use of this variable. */
uint32_t endPatternLen; /* End pattern length. */
uint32_t endPatternLen; /**< End pattern length. */
} CellularAtDataReq_t;

/**
* @ingroup cellular_common_datatypes_functionpointers
* @brief URC handler function.
*
* @return Void.
*/
typedef void ( * CellularAtParseTokenHandler_t )( CellularContext_t * pContext,
char * pInputStr );
Expand All @@ -85,8 +91,8 @@ typedef void ( * CellularAtParseTokenHandler_t )( CellularContext_t * pContext,
*/
typedef struct CellularAtParseTokenMap
{
const char * pStrValue;
CellularAtParseTokenHandler_t parserFunc;
const char * pStrValue; /**< The URC token string. */
CellularAtParseTokenHandler_t parserFunc; /**< The function pointer points to #CellularAtParseTokenHandler_t. */
} CellularAtParseTokenMap_t;

/**
Expand All @@ -95,10 +101,10 @@ typedef struct CellularAtParseTokenMap
*/
typedef enum CellularSocketState
{
SOCKETSTATE_ALLOCATED = 0, /* Socket is created. */
SOCKETSTATE_CONNECTING, /* Socket is connecting in progress with remote peer. */
SOCKETSTATE_CONNECTED, /* Socket is connected. */
SOCKETSTATE_DISCONNECTED /* Socket is disconnected by remote peer or due to network error. */
SOCKETSTATE_ALLOCATED = 0, /**< Socket is created. */
SOCKETSTATE_CONNECTING, /**< Socket is connecting in progress with remote peer. */
SOCKETSTATE_CONNECTED, /**< Socket is connected. */
SOCKETSTATE_DISCONNECTED /**< Socket is disconnected by remote peer or due to network error. */
} CellularSocketState_t;

/**
Expand All @@ -107,33 +113,33 @@ typedef enum CellularSocketState
*/
typedef struct CellularSocketContext
{
uint8_t contextId; /* PDN context ID on which this socket exists. */
uint32_t socketId; /* Socket ID of this socket. */
CellularSocketState_t socketState; /* State of the socket, Allocated, Free etc. */
CellularSocketType_t socketType; /* Type of socket, DGRAM or STREAM. */
CellularSocketDomain_t socketDomain; /* Socket domain, IPV4 or V6. */
CellularSocketProtocol_t socketProtocol; /* Socket transport protocol, TCP or UDP. */
CellularIPAddress_t localIpAddress; /* IP address assigned to the device. */
uint16_t localPort; /* Local Port. */
CellularSocketAccessMode_t dataMode; /* Data Access mode enabled for this socket. */
uint8_t contextId; /**< PDN context ID on which this socket exists. */
uint32_t socketId; /**< Socket ID of this socket. */
CellularSocketState_t socketState; /**< State of the socket, Allocated, Free etc. */
CellularSocketType_t socketType; /**< Type of socket, DGRAM or STREAM. */
CellularSocketDomain_t socketDomain; /**< Socket domain, IPV4 or V6. */
CellularSocketProtocol_t socketProtocol; /**< Socket transport protocol, TCP or UDP. */
CellularIPAddress_t localIpAddress; /**< IP address assigned to the device. */
uint16_t localPort; /**< Local Port. */
CellularSocketAccessMode_t dataMode; /**< Data Access mode enabled for this socket. */

/* Set using socket options. */
uint32_t sendTimeoutMs; /* Send timeout value in milliseconds. */
uint32_t recvTimeoutMs; /* Receive timeout value in milliseconds. */
uint32_t sendTimeoutMs; /**< Send timeout value in milliseconds. */
uint32_t recvTimeoutMs; /**< Receive timeout value in milliseconds. */

/* Set during socket connect. */
CellularSocketAddress_t remoteSocketAddress; /* Remote IP address and port. */
CellularSocketAddress_t remoteSocketAddress; /**< Remote IP address and port. */

/* Callback functions. */
CellularSocketDataReadyCallback_t dataReadyCallback; /* Informs data on this socket. */
void * pDataReadyCallbackContext; /* Data ready callback context. */
CellularSocketOpenCallback_t openCallback; /* Informs the socket open status. */
void * pOpenCallbackContext; /* socket open callback context. */
CellularSocketClosedCallback_t closedCallback; /* Informs the socket is closed. */
void * pClosedCallbackContext; /* socket closed callback context. */
CellularSocketDataReadyCallback_t dataReadyCallback; /**< Informs data on this socket. */
void * pDataReadyCallbackContext; /**< Data ready callback context. */
CellularSocketOpenCallback_t openCallback; /**< Informs the socket open status. */
void * pOpenCallbackContext; /**< socket open callback context. */
CellularSocketClosedCallback_t closedCallback; /**< Informs the socket is closed. */
void * pClosedCallbackContext; /**< socket closed callback context. */

/* Modem data. */
void * pModemData; /* Modem specific data. */
void * pModemData; /**< Modem specific data. */
} CellularSocketContext_t;

/**
Expand All @@ -143,22 +149,22 @@ typedef struct CellularSocketContext
typedef struct CellularTokenTable
{
/* URC handler mapping table. */
CellularAtParseTokenMap_t * pCellularUrcHandlerTable;
uint32_t cellularPrefixToParserMapSize;
CellularAtParseTokenMap_t * pCellularUrcHandlerTable; /**< URC handler table. */
uint32_t cellularPrefixToParserMapSize; /**< URC handler table size. */

/* Table to decide AT command respone status. */
const char ** pCellularSrcTokenErrorTable;
uint32_t cellularSrcTokenErrorTableSize;
const char ** pCellularSrcTokenSuccessTable;
uint32_t cellularSrcTokenSuccessTableSize;
const char ** pCellularSrcTokenErrorTable; /**< Solicited error token table. */
uint32_t cellularSrcTokenErrorTableSize; /**< Solicited error token table size. */
const char ** pCellularSrcTokenSuccessTable; /**< Solicited success token table. */
uint32_t cellularSrcTokenSuccessTableSize; /**< Solicited success token table size. */

/* Table to URC with prefix Token. */
const char ** pCellularUrcTokenWoPrefixTable;
uint32_t cellularUrcTokenWoPrefixTableSize;
const char ** pCellularUrcTokenWoPrefixTable; /**< URC token without prefix table. */
uint32_t cellularUrcTokenWoPrefixTableSize; /**< URC token without prefix table size. */

/* Extra success token for specific AT command. */
const char ** pCellularSrcExtraTokenSuccessTable;
uint32_t cellularSrcExtraTokenSuccessTableSize;
const char ** pCellularSrcExtraTokenSuccessTable; /**< Extra token success table. */
uint32_t cellularSrcExtraTokenSuccessTableSize; /**< Extra token success table size. */
} CellularTokenTable_t;

/**
Expand All @@ -168,7 +174,7 @@ typedef struct CellularTokenTable
* @param[in] pCallbackContext The pCallbackContext in _Cellular_TimeoutAtcmdDataRecvRequestWithCallback.
* @param[in] pLine The input line form cellular modem.
* @param[in] lineLength The length of the input line from cellular modem.
* @param[out] pData Is the start of of data in pLine.
* @param[out] pDataStart Is the start of of data in pLine.
* @param[out] pDataLength Is the data length.
*
* @return CELLULAR_PKT_STATUS_OK if the operation is successful.
Expand Down
4 changes: 4 additions & 0 deletions common/include/cellular_common_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@
* http://www.FreeRTOS.org
*/

/**
* @file cellular_common_api.h
*/

#ifndef __CELLULAR_COMMON_API_H__
#define __CELLULAR_COMMON_API_H__

Expand Down
4 changes: 4 additions & 0 deletions common/include/cellular_common_portable.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@
* http://www.FreeRTOS.org
*/

/**
* @file cellular_common_portable.h
*/

#ifndef __CELLULAR_COMMON_PORTABLE_H__
#define __CELLULAR_COMMON_PORTABLE_H__

Expand Down
2 changes: 1 addition & 1 deletion common/src/cellular_3gpp_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ static CellularPktStatus_t _parseYearMonthDayInCCLKResponse( char ** ppToken,
}
else
{
( "Error in Processing month. Token %s", *ppToken );
LogError( ( "Error in Processing month. Token %s", *ppToken ) );
atCoreStatus = CELLULAR_AT_ERROR;
}
}
Expand Down
26 changes: 0 additions & 26 deletions doc/config/cellular

This file was deleted.

26 changes: 0 additions & 26 deletions doc/config/cellular_common

This file was deleted.

Loading

0 comments on commit ea4f994

Please sign in to comment.