Skip to content

Commit 55ba541

Browse files
srcnuznSercan Uzun
and
Sercan Uzun
authored
Added comments. (#14)
Co-authored-by: Sercan Uzun <sercan.uzun@campus.tu-berlin.de>
1 parent f656e44 commit 55ba541

File tree

8 files changed

+150
-118
lines changed

8 files changed

+150
-118
lines changed

STM32CubeIDE/Application/includes/mqtt.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
*
44
* Created on: 08.05.2021
55
* Author: serca
6+
*
7+
* TODO: Add comments for mqtt.h
8+
*
69
*/
710

811
#ifndef INCLUDES_MQTT_H_

STM32CubeIDE/Application/includes/mqtt_required.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* Created on: 21.05.2021
55
* Author: serca
66
*
7-
* TODO: File Header for mqtt_required.h
7+
* TODO: Add Comment for mqtt_required.h
88
*/
99

1010
#ifndef INCLUDES_MQTT_REQUIRED_H_
@@ -14,14 +14,14 @@
1414
/* Target specific functions to be implemented by user --------------------------------------*/
1515

1616
/*
17-
* @brief Provides a tick value in millisecond.
17+
* @brief Must provide a tick value in millisecond.
1818
* @note This target-specific function must be implemented by user.
1919
* @retval tick value (uint32) in milliseconds
2020
*/
2121
extern uint32_t MqttClient_GetTick();
2222

2323
/*
24-
* @brief Performs a software-reset of the microcontroller.
24+
* @brief Must performs a software-reset of the microcontroller.
2525
* @note This target-specific function must be implemented by user.
2626
* @retval None
2727
*/
@@ -31,7 +31,7 @@ extern void MqttClient_HandleSystemResetRequest();
3131
/* Application specific functions to be implemented by user ---------------------------------*/
3232

3333
/*
34-
* @brief Writes the JSON-message to be published.
34+
* @brief Must prepare the JSON-message to be published.
3535
* @note This application-specific function must be implemented by user.
3636
* To write the JSON-message, following functions can be used:
3737
* - MqttClient_PublishInteger
@@ -44,7 +44,7 @@ extern void MqttClient_HandleSystemResetRequest();
4444
extern void MqttClient_Publish();
4545

4646
/*
47-
* @brief Registers user-specific callbacks to given events.
47+
* @brief Must register user-specific callbacks.
4848
* @note This application-specific function must be implemented by user.
4949
* To register callbacks, following functions can be used:
5050
* - MqttClient_RegisterSubscribeCallback

STM32CubeIDE/Application/includes/wizfi360.h

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
/*
2-
* test.h
2+
* wizfi360.h
33
*
44
* Created on: 29.04.2021
55
* Author: soenk
6+
*
7+
* TODO: Add Comment for wizfi360.h
8+
*
69
*/
710

811
#ifndef INCLUDES_WIZFI360_H_
@@ -287,25 +290,27 @@ typedef struct __WIZFI360_HandlerTypedef
287290

288291
WIZFI360_CommandIdTypeDef CommandId; /*!< Identifies the ongoing/last AT command */
289292

290-
uint8_t TagCharsReceived[WIZFI360_NUM_TAGS]; /*!< The amount of consecutive tag characters found in UART receive buffer. */
293+
uint8_t TagCharsReceived[WIZFI360_NUM_TAGS]; /*!< The amount of consecutive tag characters found in UartRxBuffer. */
291294

292-
uint8_t EchoCharsReceived; /*!< The amount of consecutive echo characters found in UART receive buffer. */
295+
uint8_t EchoCharsReceived; /*!< The amount of consecutive echo characters found in UartRxBuffer. */
293296

294297
uint8_t WifiState; /*!< Indicates, weather the module is connected to an AP or not. */
295298

296-
ring_buffer_t UartRxBuffer; /*!< TODO: Comment on UartRxBuffer */
299+
ring_buffer_t UartRxBuffer; /*!< Ring-buffer for received UART data. */
297300

298301

299-
char SubTopics[WIZFI360_MAX_SUBTOPIC_CALLBACKS] /*!< TODO: Comment on SubTopics */
302+
char SubTopics[WIZFI360_MAX_SUBTOPIC_CALLBACKS] /*!< List of subscribe-topic strings, that we listen to. */
300303
[WIZFI360_MAX_SUBTOPIC_SCAN_LEN];
301304

302-
void (*SubTopicCallbacks[WIZFI360_MAX_SUBTOPIC_CALLBACKS]) (char*); /*!< TODO: Comment on SubTopicCallbacks */
305+
void (*SubTopicCallbacks[
306+
WIZFI360_MAX_SUBTOPIC_CALLBACKS]) (char*); /*!< List of callback functions (mapped to SubTopics) */
303307

304-
uint8_t SubTopicCharsReceived[WIZFI360_MAX_SUBTOPIC_CALLBACKS]; /*!< TODO: Comment on SubTopicCharsReceived */
308+
uint8_t SubTopicCharsReceived[
309+
WIZFI360_MAX_SUBTOPIC_CALLBACKS]; /*!< Amount of consecutive topic characters found in UartRxBuffer. */
305310

306-
uint8_t NumSubTopicCallbacks; /*!< TODO: Comment on NumSubTopicCallbacks */
311+
uint8_t NumSubTopicCallbacks; /*!< Number of subscribe-topics, that we listen to */
307312

308-
uint8_t MessageIncoming;
313+
uint8_t MessageIncoming; /*!< Indicates, that a subscribe topic was found in UartRxBuffer. */
309314

310315
} WIZFI360_HandlerTypedef;
311316

STM32CubeIDE/Application/includes/wizfi360_opts.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
*
44
* Created on: 21.05.2021
55
* Author: serca
6+
*
7+
*
8+
* TODO: Add Comment for wizfi360_opts.h
9+
*
610
*/
711

812
#ifndef INCLUDES_WIZFI360_OPTS_H_

STM32CubeIDE/Application/includes/wizfi360_required.h

Lines changed: 50 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
*
44
* Created on: 21.05.2021
55
* Author: serca
6+
*
7+
* TODO: Add Comment for wizfi360_required.h
8+
*
69
*/
710

811
#ifndef INCLUDES_WIZFI360_REQUIRED_H_
@@ -12,92 +15,101 @@
1215
/* Target specific UART functions to be implemented -----------------------------------------*/
1316

1417
/*
15-
* TODO: Comment on WIZFI360_UART_StartContinousReception
18+
* @brief Must start the UART in continous reception mode.
19+
* @note This target-specific function must be implemented by user.
1620
*/
1721
extern void WIZFI360_UART_StartContinousReception();
1822

1923
#ifdef WIZFI360_UART_TX_MODE_NON_BLOCKING
20-
/*
21-
* TODO: Comment on WIZFI360_UART_SendNonBlockingMode
24+
/**
25+
* @brief Must send an amount of data to WizFi360 module in interrupt mode.
26+
* @note This target-specific function must be implemented by user.
27+
* @param pData Pointer to data buffer (u8 or u16 data elements).
28+
* @param Size Amount of data elements (u8 or u16) to be sent.
29+
* @retval None
2230
*/
2331
extern void WIZFI360_UART_SendNonBlockingMode(uint8_t* pData, uint16_t Size);
2432
#else
25-
/*
26-
* TODO: Comment on WIZFI360_UART_SendBlockingMode
33+
/**
34+
* @brief Must send an amount of data to WizFi360 module in blocking mode.
35+
* @note This target-specific function must be implemented by user.
36+
* @param pData Pointer to data buffer (u8 or u16 data elements).
37+
* @param Size Amount of data elements (u8 or u16) to be sent.
38+
* @retval None
2739
*/
2840
extern void WIZFI360_UART_SendBlockingMode(uint8_t* pData, uint16_t Size, uint16_t Timeout);
2941
#endif
3042

3143
/*********************************************************************************************/
3244
/* Target specific Reset functions to be implemented ----------------------------------------*/
3345

34-
/*
35-
* TODO: Comment on WIZFI360_WriteResetPinLow
36-
*/
46+
/**
47+
* @brief Must set the RST pin of the module to low.
48+
* @note This target-specific function must be implemented by user.
49+
* @retval None
50+
*/
3751
extern void WIZFI360_WriteResetPinLow();
3852

39-
/*
40-
* TODO: Comment on WIZFI360_WriteResetPinHigh
41-
*/
53+
/**
54+
* @brief Must set the RST pin of the module to high.
55+
* @note This target-specific function must be implemented by user.
56+
* @retval None
57+
*/
4258
extern void WIZFI360_WriteResetPinHigh();
4359

44-
/*
45-
* TODO: Comment on WIZFI360_PreResetHard
46-
*/
60+
/**
61+
* @brief This function executes before hard-reset is performed.
62+
* @note Writing the reset pin to low could lead to errors on UART lines.
63+
* Thus, any UART operation should be aborted and the UART reception
64+
* should be disabled, before resetting the wizfi360 module.
65+
* @note This target-specific function must be implemented by user.
66+
* @retval None
67+
*/
4768
extern void WIZFI360_PreResetHard();
4869

49-
/*
50-
* TODO: Comment on WIZFI360_PostResetHard
51-
*/
70+
/**
71+
* @brief This function executes after hard-reset is performed.
72+
* @note In this function, UART could be re-enabled, if it was disabled
73+
* before hard-reset.
74+
* @note This target-specific function must be implemented by user.
75+
* @retval None
76+
*/
5277
extern void WIZFI360_PostResetHard();
5378

54-
/*
55-
* TODO: Comment on WIZFI360_Delay
56-
*/
79+
/**
80+
* @brief Must provide a delay (in milliseconds).
81+
* @note This target-specific function must be implemented by user.
82+
* @param Delay specifies the delay time length, in milliseconds.
83+
* @retval None
84+
*/
5785
extern void WIZFI360_Delay(uint32_t Delay);
5886

5987
/*********************************************************************************************/
6088
/* User specific callback functions to be implemented ---------------------------------------*/
6189

90+
// Todo: Provide wizfi360 callback registration for user (instead of extern declaration)
91+
6292
#ifdef WIZFI360_CALLBACK_USED_COMMAND_COMPLETE
63-
/*
64-
* TODO: Comment on WIZFI360_CommandCpltCallback
65-
*/
6693
extern void WIZFI360_CommandCpltCallback(WIZFI360_CommandIdTypeDef command,
6794
WIZFI360_ResponseTypeDef response);
6895
#endif
6996

7097
#ifdef WIZFI360_CALLBACK_USED_WIFI_CONNECTED
71-
/*
72-
* TODO: Comment on WIZFI360_WifiConnectedCallback
73-
*/
7498
extern void WIZFI360_WifiConnectedCallback();
7599
#endif
76100

77101
#ifdef WIZFI360_CALLBACK_USED_WIFI_DISCONNECTED
78-
/*
79-
* TODO: Comment on WIZFI360_WifiDisconnectedCallback
80-
*/
81102
extern void WIZFI360_WifiDisconnectedCallback();
82103
#endif
83104

84105
#ifdef WIZFI360_CALLBACK_USED_WIFI_CONNECT_FAILED
85-
/*
86-
* TODO: Comment on WIZFI360_WifiConnectFailedCallback
87-
*/
88106
extern void WIZFI360_WifiConnectFailedCallback();
89107
#endif
90108

91109
#ifdef WIZFI360_CALLBACK_USED_MODULE_READY
92-
/*
93-
* TODO: Comment on WIZFI360_ModuleReadyCallback
94-
*/
95110
extern void WIZFI360_ModuleReadyCallback();
96111
#endif
97112

98-
/*
99-
* TODO: Comment on WIZFI360_RegisterSubscribeCallbacks
100-
*/
101113
extern void WIZFI360_RegisterSubscribeCallbacks();
102114

103115
/*********************************************************************************************/

0 commit comments

Comments
 (0)