Procházet zdrojové kódy

Merge branch 'master' of github.com:EIPStackGroup/OpENer

Martin Melik Merkumians před 5 roky
rodič
revize
4f3d61aa30

+ 3 - 3
source/src/ports/nvdata/conffile.c

@@ -91,8 +91,8 @@ static FILE *FopenMkdir(char *p_path,
  *
  *  @param  write   Open for write?
  *  @param  p_name  pointer to file name string
- *  @param  p_filep pointer to FILE* to initialize
- *  @return       0: success; -1: failure, errno set
+
+ *  @return valid file handle: success; NULL: failure, errno set
  *
  *  This function open a configuration file, possibly for write operation,
  *  in the NV data storage directory.
@@ -113,7 +113,7 @@ FILE *ConfFileOpen(const bool write,
 /** @brief Close the configuration file associated with the FILE* given
  *
  *  @param  p_filep pointer to FILE* to close
- *  @return       0: success; -1: failure, errno set
+ *  @return kEipStatusOk: success; kEipStatusError: failure and errno set
  *
  *  Closes the configuration file associated to p_filep. No data
  *  synchronization to disk yet.

+ 8 - 12
source/src/ports/nvdata/nvdata.c

@@ -50,6 +50,8 @@ EipStatus NvdataLoad(void) {
  * @param  attribute pointer to attribute structure
  * @param  service   the CIP service code of current request
  *
+ *  @return kEipStatusOk: success; kEipStatusError: failure
+ *
  * This function implements the PostSetCallback for the QoS class. The
  * purpose of this function is to save the NV attributes of the QoS
  * class instance to external storage.
@@ -57,12 +59,9 @@ EipStatus NvdataLoad(void) {
  * This application specific implementation chose to save all attributes
  * at once using a single NvQosStore() call.
  */
-EipStatus NvQosSetCallback
-(
-  CipInstance *const instance,
-  CipAttributeStruct *const attribute,
-  CipByte service
-) {
+EipStatus NvQosSetCallback(CipInstance *const instance,
+                           CipAttributeStruct *const attribute,
+                           CipByte service) {
   EipStatus status = kEipStatusOk;
 
   if (0 != (kNvDataFunc & attribute->attribute_flags) ) {
@@ -88,12 +87,9 @@ EipStatus NvQosSetCallback
  * This application specific implementation chose to save all attributes
  * at once using a single NvTcpipStore() call.
  */
-EipStatus NvTcpipSetCallback
-(
-  CipInstance *const instance,
-  CipAttributeStruct *const attribute,
-  CipByte service
-) {
+EipStatus NvTcpipSetCallback(CipInstance *const instance,
+                             CipAttributeStruct *const attribute,
+                             CipByte service) {
   EipStatus status = kEipStatusOk;
 
   if (0 != (kNvDataFunc & attribute->attribute_flags) ) {

+ 2 - 2
source/src/ports/nvdata/nvqos.c

@@ -26,7 +26,7 @@
 /** @brief Load NV data of the QoS object from file
  *
  *  @param  p_qos pointer to the QoS object's data structure
- *  @return       0: success; -1: failure
+ *  @return kEipStatusOk: success; kEipStatusError: failure
  */
 int NvQosLoad(CipQosObject *p_qos) {
   int rd_cnt = 0;
@@ -70,7 +70,7 @@ int NvQosLoad(CipQosObject *p_qos) {
 /** @brief Store NV data of the QoS object to file
  *
  *  @param  p_qos pointer to the QoS object's data structure
- *  @return       0: success; -1: failure
+ *  @return kEipStatusOk: success; kEipStatusError: failure
  */
 EipStatus NvQosStore(const CipQosObject *p_qos) {
   FILE  *p_file = ConfFileOpen(true, QOS_CFG_NAME);

+ 4 - 7
source/src/ports/nvdata/nvtcpip.c

@@ -12,12 +12,9 @@
  */
 #include "nvtcpip.h"
 
-// #include <inttypes.h>
-// #include <stdio.h>
 #include <string.h>
 
 #include "trace.h"
-
 #include "conffile.h"
 
 #define TCPIP_CFG_NAME  "tcpip.cfg" /**< Name of the configuration file */
@@ -25,8 +22,8 @@
 
 /** @brief Load NV data of the TCP/IP object from file
  *
- *  @param  p_qos pointer to the TCP/IP object's data structure
- *  @return       0: success; -1: failure
+ *  @param  p_tcp_ip pointer to the TCP/IP object's data structure
+ *  @return kEipStatusOk: success; kEipStatusError: failure
  */
 int NvTcpipLoad(CipTcpIpObject *p_tcp_ip) {
   CipTcpIpObject tcpip = {0};
@@ -54,8 +51,8 @@ int NvTcpipLoad(CipTcpIpObject *p_tcp_ip) {
 
 /** @brief Store NV data of the TCP/IP object to file
  *
- *  @param  p_qos pointer to the TCP/IP object's data structure
- *  @return       0: success; -1: failure
+ *  @param  p_tcp_ip pointer to the TCP/IP object's data structure
+ *  @return kEipStatusOk: success; kEipStatusError: failure
  */
 EipStatus NvTcpipStore(const CipTcpIpObject *p_tcp_ip) {
   FILE *p_file = ConfFileOpen(true, TCPIP_CFG_NAME);