@@ -71,7 +71,7 @@ namespace eipScanner {
7171 auto t2oSize = t2oNCP.getConnectionSize ();
7272
7373 connectionParameters.connectionPathSize = (connectionParameters.connectionPath .size () / 2 )
74- + (connectionParameters.connectionPath .size () % 2 );
74+ + (connectionParameters.connectionPath .size () % 2 );
7575
7676 if ((connectionParameters.transportTypeTrigger & NetworkConnectionParams::CLASS1) > 0
7777 || (connectionParameters.transportTypeTrigger & NetworkConnectionParams::CLASS3) > 0 ) {
@@ -87,22 +87,17 @@ namespace eipScanner {
8787 connectionParameters.t2oNetworkConnectionParams += 4 ;
8888 }
8989
90- Buffer buffer;
91- buffer << sockets::EndPoint (" 0.0.0.0" , 2222 );
92- eip::CommonPacketItem addrItem (eip::CommonPacketItemIds::T2O_SOCKADDR_INFO, buffer.data ());
93-
94-
9590 MessageRouterResponse messageRouterResponse;
9691 if (isLarge) {
9792 LargeForwardOpenRequest request (connectionParameters);
9893 messageRouterResponse = _messageRouter->sendRequest (si,
9994 static_cast <cip::CipUsint>(ConnectionManagerServiceCodes::LARGE_FORWARD_OPEN),
100- EPath (6 , 1 ), request.pack (), {addrItem });
95+ EPath (6 , 1 ), request.pack (), {});
10196 } else {
10297 ForwardOpenRequest request (connectionParameters);
10398 messageRouterResponse = _messageRouter->sendRequest (si,
10499 static_cast <cip::CipUsint>(ConnectionManagerServiceCodes::FORWARD_OPEN),
105- EPath (6 , 1 ), request.pack (), {addrItem });
100+ EPath (6 , 1 ), request.pack (), {});
106101 }
107102
108103 IOConnection::SPtr ioConnection;
@@ -148,15 +143,15 @@ namespace eipScanner {
148143 } else {
149144 ioConnection->_socket = std::make_unique<UDPSocket>(endPoint);
150145 }
151-
146+
152147 } else {
153- ioConnection->_socket = std::make_unique<UDPSocket>(si->getRemoteEndPoint ().getHost (), 2222 );
148+ ioConnection->_socket = std::make_unique<UDPSocket>(si->getRemoteEndPoint ().getHost (), EIP_DEFAULT_IMPLICIT_PORT);
154149 }
155150
156151 Logger (LogLevel::INFO) << " Open UDP socket to send data to "
157152 << ioConnection->_socket ->getRemoteEndPoint ().toString ();
158153
159- findOrCreateSocket (sockets::EndPoint (si->getRemoteEndPoint ().getHost (), 2222 ));
154+ findOrCreateSocket (sockets::EndPoint (si->getRemoteEndPoint ().getHost (), EIP_DEFAULT_IMPLICIT_PORT ));
160155
161156 auto result = _connectionMap
162157 .insert (std::make_pair (response.getT2ONetworkConnectionId (), ioConnection));
@@ -202,6 +197,7 @@ namespace eipScanner {
202197 }
203198
204199 auto rc = _connectionMap.erase (ptr->_t2oNetworkConnectionId );
200+ (void ) rc;
205201 assert (rc);
206202 } else {
207203 Logger (LogLevel::WARNING) << " Attempt to close an already closed connection" ;
@@ -212,6 +208,7 @@ namespace eipScanner {
212208 std::vector<BaseSocket::SPtr > sockets;
213209 std::transform (_socketMap.begin (), _socketMap.end (), std::back_inserter (sockets), [](auto entry) {
214210 auto fd = entry.second ->getSocketFd ();
211+ (void ) fd;
215212 return entry.second ;
216213 });
217214
@@ -235,6 +232,7 @@ namespace eipScanner {
235232 auto newSocket = std::make_shared<UDPBoundSocket>(endPoint);
236233 _socketMap[endPoint] = newSocket;
237234 newSocket->setBeginReceiveHandler ([](sockets::BaseSocket& sock) {
235+ (void ) sock;
238236 Logger (LogLevel::DEBUG) << " Received something" ;
239237 });
240238
@@ -253,7 +251,7 @@ namespace eipScanner {
253251 if (io != _connectionMap.end ()) {
254252 io->second ->notifyReceiveData (commonPacket.getItems ().at (1 ).getData ());
255253 } else {
256- Logger (LogLevel::ERROR) << " Received data from unknow connection T2O_ID=" << connectionId;
254+ Logger (LogLevel::ERROR) << " Received data from unknown connection T2O_ID=" << connectionId;
257255 }
258256 });
259257
0 commit comments