Skip to content

Commit ea4f994

Browse files
authored
[Cellular Library] Update doxygen configuration file and fix warning 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
1 parent bee44cc commit ea4f994

38 files changed

+3968
-1562
lines changed

.github/CONTRIBUTING.md

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# Contributing Guidelines
2+
3+
Thank you for your interest in contributing to our project. Whether it's a bug report, new feature, correction, or additional
4+
documentation, we greatly value feedback and contributions from our community.
5+
6+
Please read through this document before submitting any issues or pull requests to ensure we have all the necessary
7+
information to effectively respond to your bug report or contribution.
8+
9+
10+
## Reporting Bugs/Feature Requests
11+
12+
We welcome you to use the GitHub issue tracker to report bugs or suggest features.
13+
14+
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
15+
reported the issue. Please try to include as much information as you can. Details like these are incredibly useful:
16+
17+
* A reproducible test case or series of steps
18+
* The version of our code being used
19+
* Any modifications you've made relevant to the bug
20+
* Anything unusual about your environment or deployment
21+
22+
23+
## Contributing via Pull Requests
24+
Contributions via pull requests are much appreciated. Before sending us a pull request, please ensure that:
25+
26+
1. You are working against the latest source on the *main* branch.
27+
1. You check existing open, and recently merged, pull requests to make sure someone else hasn't addressed the problem already.
28+
1. You open an issue to discuss any significant work - we would hate for your time to be wasted.
29+
30+
To send us a pull request, please:
31+
32+
1. Fork the repository.
33+
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.
34+
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).
35+
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).
36+
1. Ensure local tests pass.
37+
1. Commit to your fork using clear commit messages.
38+
1. Send us a pull request, answering any default questions in the pull request interface.
39+
1. Pay attention to any automated CI failures reported in the pull request, and stay involved in the conversation.
40+
41+
GitHub provides additional document on [forking a repository](https://help.github.com/articles/fork-a-repo/) and
42+
[creating a pull request](https://help.github.com/articles/creating-a-pull-request/).
43+
44+
45+
## Finding contributions to work on
46+
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.
47+
48+
49+
## Code of Conduct
50+
This project has adopted the [Amazon Open Source Code of Conduct](https://aws.github.io/code-of-conduct).
51+
For more information see the [Code of Conduct FAQ](https://aws.github.io/code-of-conduct-faq) or contact
52+
[email protected] with any additional questions or comments.
53+
54+
55+
## Security issue notifications
56+
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.
57+
58+
59+
## Licensing
60+
61+
See the [LICENSE](../LICENSE) file for our project's licensing. We will ask you to confirm the licensing of your contribution.
62+
63+
We may ask you to sign a [Contributor License Agreement (CLA)](https://en.wikipedia.org/wiki/Contributor_License_Agreement) for larger changes.

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
path: ./
4646
source_path: common
4747
doxygen:
48-
runs-on: ubuntu-20.04
48+
runs-on: ubuntu-latest
4949
steps:
5050
- uses: actions/checkout@v2
5151
- name: Run doxygen build

common/include/cellular_at_core.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@
2323
* http://www.FreeRTOS.org
2424
*/
2525

26+
/**
27+
* @file cellular_at_core.h
28+
*/
29+
2630
#ifndef __CELLULAR_AT_CORE_H__
2731
#define __CELLULAR_AT_CORE_H__
2832

@@ -45,7 +49,9 @@
4549
*/
4650
#define CELLULAR_AT_MAX_PREFIX_SIZE ( 32 )
4751

48-
52+
/**
53+
* @brief The arrary size of an array.
54+
*/
4955
#define ARRY_SIZE( x ) ( sizeof( x ) / sizeof( x[ 0 ] ) )
5056

5157
/*-----------------------------------------------------------*/

common/include/cellular_common.h

Lines changed: 53 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@
2323
* http://www.FreeRTOS.org
2424
*/
2525

26+
/**
27+
* @file cellular_common.h
28+
*/
29+
2630
#ifndef __CELLULAR_COMMON_H__
2731
#define __CELLULAR_COMMON_H__
2832

@@ -48,12 +52,12 @@
4852
*/
4953
typedef struct CellularAtReq
5054
{
51-
const char * pAtCmd;
52-
CellularATCommandType_t atCmdType;
53-
const char * pAtRspPrefix;
54-
CellularATCommandResponseReceivedCallback_t respCallback;
55-
void * pData;
56-
uint16_t dataLen;
55+
const char * pAtCmd; /**< The At command string used for at command request. */
56+
CellularATCommandType_t atCmdType; /**< The At command type. */
57+
const char * pAtRspPrefix; /**< The prefix of at command response. */
58+
CellularATCommandResponseReceivedCallback_t respCallback; /**< The callback function #CellularATCommandResponseReceivedCallback_t. */
59+
void * pData; /**< The data pointer to the data. */
60+
uint16_t dataLen; /**< The length of the data pointer . */
5761
} CellularAtReq_t;
5862

5963
/**
@@ -62,19 +66,21 @@ typedef struct CellularAtReq
6266
*/
6367
typedef struct CellularAtDataReq
6468
{
65-
const uint8_t * pData; /* Data to send. */
66-
uint32_t dataLen; /* Data length to send. */
67-
uint32_t * pSentDataLength; /* Data actually sent. */
68-
const uint8_t * pEndPattern; /* End pattern after pData is sent completely.
69+
const uint8_t * pData; /**< Data to send. */
70+
uint32_t dataLen; /**< Data length to send. */
71+
uint32_t * pSentDataLength; /**< Data actually sent. */
72+
const uint8_t * pEndPattern; /**< End pattern after pData is sent completely.
6973
* Set NULL if not required. Cellular modem uses
7074
* end pattern instead of length in AT command
7175
* can make use of this variable. */
72-
uint32_t endPatternLen; /* End pattern length. */
76+
uint32_t endPatternLen; /**< End pattern length. */
7377
} CellularAtDataReq_t;
7478

7579
/**
7680
* @ingroup cellular_common_datatypes_functionpointers
7781
* @brief URC handler function.
82+
*
83+
* @return Void.
7884
*/
7985
typedef void ( * CellularAtParseTokenHandler_t )( CellularContext_t * pContext,
8086
char * pInputStr );
@@ -85,8 +91,8 @@ typedef void ( * CellularAtParseTokenHandler_t )( CellularContext_t * pContext,
8591
*/
8692
typedef struct CellularAtParseTokenMap
8793
{
88-
const char * pStrValue;
89-
CellularAtParseTokenHandler_t parserFunc;
94+
const char * pStrValue; /**< The URC token string. */
95+
CellularAtParseTokenHandler_t parserFunc; /**< The function pointer points to #CellularAtParseTokenHandler_t. */
9096
} CellularAtParseTokenMap_t;
9197

9298
/**
@@ -95,10 +101,10 @@ typedef struct CellularAtParseTokenMap
95101
*/
96102
typedef enum CellularSocketState
97103
{
98-
SOCKETSTATE_ALLOCATED = 0, /* Socket is created. */
99-
SOCKETSTATE_CONNECTING, /* Socket is connecting in progress with remote peer. */
100-
SOCKETSTATE_CONNECTED, /* Socket is connected. */
101-
SOCKETSTATE_DISCONNECTED /* Socket is disconnected by remote peer or due to network error. */
104+
SOCKETSTATE_ALLOCATED = 0, /**< Socket is created. */
105+
SOCKETSTATE_CONNECTING, /**< Socket is connecting in progress with remote peer. */
106+
SOCKETSTATE_CONNECTED, /**< Socket is connected. */
107+
SOCKETSTATE_DISCONNECTED /**< Socket is disconnected by remote peer or due to network error. */
102108
} CellularSocketState_t;
103109

104110
/**
@@ -107,33 +113,33 @@ typedef enum CellularSocketState
107113
*/
108114
typedef struct CellularSocketContext
109115
{
110-
uint8_t contextId; /* PDN context ID on which this socket exists. */
111-
uint32_t socketId; /* Socket ID of this socket. */
112-
CellularSocketState_t socketState; /* State of the socket, Allocated, Free etc. */
113-
CellularSocketType_t socketType; /* Type of socket, DGRAM or STREAM. */
114-
CellularSocketDomain_t socketDomain; /* Socket domain, IPV4 or V6. */
115-
CellularSocketProtocol_t socketProtocol; /* Socket transport protocol, TCP or UDP. */
116-
CellularIPAddress_t localIpAddress; /* IP address assigned to the device. */
117-
uint16_t localPort; /* Local Port. */
118-
CellularSocketAccessMode_t dataMode; /* Data Access mode enabled for this socket. */
116+
uint8_t contextId; /**< PDN context ID on which this socket exists. */
117+
uint32_t socketId; /**< Socket ID of this socket. */
118+
CellularSocketState_t socketState; /**< State of the socket, Allocated, Free etc. */
119+
CellularSocketType_t socketType; /**< Type of socket, DGRAM or STREAM. */
120+
CellularSocketDomain_t socketDomain; /**< Socket domain, IPV4 or V6. */
121+
CellularSocketProtocol_t socketProtocol; /**< Socket transport protocol, TCP or UDP. */
122+
CellularIPAddress_t localIpAddress; /**< IP address assigned to the device. */
123+
uint16_t localPort; /**< Local Port. */
124+
CellularSocketAccessMode_t dataMode; /**< Data Access mode enabled for this socket. */
119125

120126
/* Set using socket options. */
121-
uint32_t sendTimeoutMs; /* Send timeout value in milliseconds. */
122-
uint32_t recvTimeoutMs; /* Receive timeout value in milliseconds. */
127+
uint32_t sendTimeoutMs; /**< Send timeout value in milliseconds. */
128+
uint32_t recvTimeoutMs; /**< Receive timeout value in milliseconds. */
123129

124130
/* Set during socket connect. */
125-
CellularSocketAddress_t remoteSocketAddress; /* Remote IP address and port. */
131+
CellularSocketAddress_t remoteSocketAddress; /**< Remote IP address and port. */
126132

127133
/* Callback functions. */
128-
CellularSocketDataReadyCallback_t dataReadyCallback; /* Informs data on this socket. */
129-
void * pDataReadyCallbackContext; /* Data ready callback context. */
130-
CellularSocketOpenCallback_t openCallback; /* Informs the socket open status. */
131-
void * pOpenCallbackContext; /* socket open callback context. */
132-
CellularSocketClosedCallback_t closedCallback; /* Informs the socket is closed. */
133-
void * pClosedCallbackContext; /* socket closed callback context. */
134+
CellularSocketDataReadyCallback_t dataReadyCallback; /**< Informs data on this socket. */
135+
void * pDataReadyCallbackContext; /**< Data ready callback context. */
136+
CellularSocketOpenCallback_t openCallback; /**< Informs the socket open status. */
137+
void * pOpenCallbackContext; /**< socket open callback context. */
138+
CellularSocketClosedCallback_t closedCallback; /**< Informs the socket is closed. */
139+
void * pClosedCallbackContext; /**< socket closed callback context. */
134140

135141
/* Modem data. */
136-
void * pModemData; /* Modem specific data. */
142+
void * pModemData; /**< Modem specific data. */
137143
} CellularSocketContext_t;
138144

139145
/**
@@ -143,22 +149,22 @@ typedef struct CellularSocketContext
143149
typedef struct CellularTokenTable
144150
{
145151
/* URC handler mapping table. */
146-
CellularAtParseTokenMap_t * pCellularUrcHandlerTable;
147-
uint32_t cellularPrefixToParserMapSize;
152+
CellularAtParseTokenMap_t * pCellularUrcHandlerTable; /**< URC handler table. */
153+
uint32_t cellularPrefixToParserMapSize; /**< URC handler table size. */
148154

149155
/* Table to decide AT command respone status. */
150-
const char ** pCellularSrcTokenErrorTable;
151-
uint32_t cellularSrcTokenErrorTableSize;
152-
const char ** pCellularSrcTokenSuccessTable;
153-
uint32_t cellularSrcTokenSuccessTableSize;
156+
const char ** pCellularSrcTokenErrorTable; /**< Solicited error token table. */
157+
uint32_t cellularSrcTokenErrorTableSize; /**< Solicited error token table size. */
158+
const char ** pCellularSrcTokenSuccessTable; /**< Solicited success token table. */
159+
uint32_t cellularSrcTokenSuccessTableSize; /**< Solicited success token table size. */
154160

155161
/* Table to URC with prefix Token. */
156-
const char ** pCellularUrcTokenWoPrefixTable;
157-
uint32_t cellularUrcTokenWoPrefixTableSize;
162+
const char ** pCellularUrcTokenWoPrefixTable; /**< URC token without prefix table. */
163+
uint32_t cellularUrcTokenWoPrefixTableSize; /**< URC token without prefix table size. */
158164

159165
/* Extra success token for specific AT command. */
160-
const char ** pCellularSrcExtraTokenSuccessTable;
161-
uint32_t cellularSrcExtraTokenSuccessTableSize;
166+
const char ** pCellularSrcExtraTokenSuccessTable; /**< Extra token success table. */
167+
uint32_t cellularSrcExtraTokenSuccessTableSize; /**< Extra token success table size. */
162168
} CellularTokenTable_t;
163169

164170
/**
@@ -168,7 +174,7 @@ typedef struct CellularTokenTable
168174
* @param[in] pCallbackContext The pCallbackContext in _Cellular_TimeoutAtcmdDataRecvRequestWithCallback.
169175
* @param[in] pLine The input line form cellular modem.
170176
* @param[in] lineLength The length of the input line from cellular modem.
171-
* @param[out] pData Is the start of of data in pLine.
177+
* @param[out] pDataStart Is the start of of data in pLine.
172178
* @param[out] pDataLength Is the data length.
173179
*
174180
* @return CELLULAR_PKT_STATUS_OK if the operation is successful.

common/include/cellular_common_api.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@
2323
* http://www.FreeRTOS.org
2424
*/
2525

26+
/**
27+
* @file cellular_common_api.h
28+
*/
29+
2630
#ifndef __CELLULAR_COMMON_API_H__
2731
#define __CELLULAR_COMMON_API_H__
2832

common/include/cellular_common_portable.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@
2323
* http://www.FreeRTOS.org
2424
*/
2525

26+
/**
27+
* @file cellular_common_portable.h
28+
*/
29+
2630
#ifndef __CELLULAR_COMMON_PORTABLE_H__
2731
#define __CELLULAR_COMMON_PORTABLE_H__
2832

common/src/cellular_3gpp_api.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ static CellularPktStatus_t _parseYearMonthDayInCCLKResponse( char ** ppToken,
318318
}
319319
else
320320
{
321-
( "Error in Processing month. Token %s", *ppToken );
321+
LogError( ( "Error in Processing month. Token %s", *ppToken ) );
322322
atCoreStatus = CELLULAR_AT_ERROR;
323323
}
324324
}

doc/config/cellular

Lines changed: 0 additions & 26 deletions
This file was deleted.

doc/config/cellular_common

Lines changed: 0 additions & 26 deletions
This file was deleted.

0 commit comments

Comments
 (0)