Forráskód Böngészése

did some code cleanup

Alois Zoitl 14 éve
szülő
commit
8ba146e4f0
2 módosított fájl, 5 hozzáadás és 3 törlés
  1. 1 1
      src/cip/cipioconnection.c
  2. 4 2
      src/cip/cipmessagerouter.c

+ 1 - 1
src/cip/cipioconnection.c

@@ -321,7 +321,7 @@ OpenProducingPointToPointConnection(S_CIP_ConnectionObject *pa_pstConnObj,
     S_CIP_CPF_Data *pa_CPF_data)
 {
   int newfd;
-  in_port_t nPort = htons(OPENER_EIP_IO_UDP_PORT);; /* the default port to be used if no port information is part of the forward open request */
+  in_port_t nPort = htons(OPENER_EIP_IO_UDP_PORT); /* the default port to be used if no port information is part of the forward open request */
 
   if (CIP_ITEM_ID_SOCKADDRINFO_T_TO_O == pa_CPF_data->AddrInfo[0].TypeID)
     {

+ 4 - 2
src/cip/cipmessagerouter.c

@@ -69,7 +69,7 @@ CIP_MessageRouter_Init()
 
   /* reserved for future use -> set to zero */
   gMRResponse.Reserved = 0;
-  gMRResponse.Data = &g_acMessageDataReplyBuffer[0]; /* set reply buffer, using a fixed buffer (about 100 bytes) */
+  gMRResponse.Data = g_acMessageDataReplyBuffer; /* set reply buffer, using a fixed buffer (about 100 bytes) */
 
   return EIP_OK;
 }
@@ -145,8 +145,10 @@ EIP_STATUS
 notifyMR(EIP_UINT8 * pa_pnData, int pa_nDataLength)
 {
   EIP_STATUS nRetVal = EIP_OK_SEND;
-
   EIP_BYTE nStatus;
+
+  gMRResponse.Data = g_acMessageDataReplyBuffer; /* set reply buffer, using a fixed buffer (about 100 bytes) */
+
   OPENER_TRACE_INFO("notifyMR: routing unconnected message\n");
   if (CIP_ERROR_SUCCESS != (nStatus = createMRRequeststructure(pa_pnData,
       pa_nDataLength, &gMRRequest)))