فهرست منبع

Let CipStackInit return EipStatus

Signed-off-by: Martin Melik Merkumians <melik-merkumians@acin.tuwien.ac.at>
Martin Melik Merkumians 5 سال پیش
والد
کامیت
642fb84270
2فایلهای تغییر یافته به همراه6 افزوده شده و 12 حذف شده
  1. 2 8
      source/src/cip/cipcommon.c
  2. 4 4
      source/src/opener_api.h

+ 2 - 8
source/src/cip/cipcommon.c

@@ -22,9 +22,6 @@
 #if defined(OPENER_IS_DLR_DEVICE) && 0 != OPENER_IS_DLR_DEVICE
   #include "cipdlr.h"
 #endif
-
-#include "../cip_objects/CIPFileObject/cipfile.h"
-
 #include "cipqos.h"
 #include "cpf.h"
 #include "trace.h"
@@ -36,7 +33,7 @@
 void EncodeEPath(CipEpath *epath,
                  ENIPMessage *message);
 
-void CipStackInit(const EipUint16 unique_connection_id) {
+EipStatus CipStackInit(const EipUint16 unique_connection_id) {
   /* The message router is the first CIP object be initialized!!! */
   EipStatus eip_status = CipMessageRouterInit();
   OPENER_ASSERT(kEipStatusOk == eip_status)
@@ -56,14 +53,11 @@ void CipStackInit(const EipUint16 unique_connection_id) {
 #endif
   eip_status = CipQoSInit();
   OPENER_ASSERT(kEipStatusOk == eip_status)
-  eip_status = CipFileInit();
-  OPENER_ASSERT(kEipStatusOk == eip_status)
   /* the application has to be initialized at last */
   eip_status = ApplicationInitialization();
   OPENER_ASSERT(kEipStatusOk == eip_status)
 
-  /* Shut up compiler warning with traces disabled */
-    (void) eip_status;
+  return eip_status;
 }
 
 void ShutdownCipStack(void) {

+ 4 - 4
source/src/opener_api.h

@@ -101,7 +101,7 @@ void SetDeviceStatus(const CipWord status);
  * @param unique_connection_id value passed to Connection_Manager_Init() to form
  * a "per boot" unique connection ID.
  */
-void CipStackInit(const EipUint16 unique_connection_id);
+EipStatus CipStackInit(const EipUint16 unique_connection_id);
 
 /** @ingroup CIP_API
  * @brief Shutdown of the CIP stack
@@ -298,6 +298,8 @@ void InsertGetSetCallback
   CIPAttributeFlag callbacks_to_install
 );
 
+
+//TODO: Update documentation
 /** @ingroup CIP_API
  * @brief Produce the data according to CIP encoding onto the message buffer.
  *
@@ -307,9 +309,7 @@ void InsertGetSetCallback
  *  @param cip_data pointer to data value.
  *  @param message_router_response The message router response construct
  */
-void EncodeData(const EipUint8 cip_data_type,
-                const void *const cip_data,
-                CipMessageRouterResponse *const message_router_response);
+
 
 void EncodeCipBool(const void *const data,
                    ENIPMessage *const outgoing_message);