Skip to content

Commit 9e8f862

Browse files
committed
SocketHelpers: ping, fix build for generic M4
1 parent 9f0337f commit 9e8f862

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Diff for: libraries/SocketWrapper/src/SocketHelpers.cpp

+4-1
Original file line numberDiff line numberDiff line change
@@ -142,11 +142,14 @@ int arduino::MbedSocketClass::ping(SocketAddress &socketAddress, uint8_t ttl, ui
142142
{
143143
/* ttl is not supported by mbed ICMPSocket. Default value used is 255 */
144144
(void)ttl;
145+
int response = -1;
146+
#if MBED_CONF_LWIP_RAW_SOCKET_ENABLED
145147
ICMPSocket s;
146148
s.set_timeout(timeout);
147149
s.open(getNetwork());
148-
int response = s.ping(socketAddress, timeout);
150+
response = s.ping(socketAddress, timeout);
149151
s.close();
152+
#endif
150153

151154
return response;
152155
}

0 commit comments

Comments
 (0)