Skip to content

Commit 3cc8848

Browse files
ifdefs?
1 parent 606ba61 commit 3cc8848

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

NetX/src/u_nx_debug.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#include "u_nx_debug.h"
2+
#include "nxd_ptp_client.h"
23

34
// clang-format off
45

@@ -73,7 +74,8 @@ const char* nx_status_toString(UINT status) {
7374
case NX_CONTINUE: return "NX_CONTINUE";
7475
case NX_TCPIP_OFFLOAD_ERROR: return "NX_TCPIP_OFFLOAD_ERROR";
7576

76-
/* MQTT-specific stuff. Might want to put a include gaurd here? */
77+
/* MQTT-specific stuff. */
78+
#ifdef NXD_MQTT_SUCCESS
7779
case NXD_MQTT_SUCCESS: return "NXD_MQTT_SUCCESS";
7880
case NXD_MQTT_ALREADY_CONNECTED: return "NXD_MQTT_ALREADY_CONNECTED";
7981
case NXD_MQTT_NOT_CONNECTED: return "NXD_MQTT_NOT_CONNECTED";
@@ -99,11 +101,17 @@ const char* nx_status_toString(UINT status) {
99101
case NXD_MQTT_ERROR_SERVER_UNAVAILABLE: return "NXD_MQTT_ERROR_SERVER_UNAVAILABLE";
100102
case NXD_MQTT_ERROR_BAD_USERNAME_PASSWORD: return "NXD_MQTT_ERROR_BAD_USERNAME_PASSWORD";
101103
case NXD_MQTT_ERROR_NOT_AUTHORIZED: return "NXD_MQTT_ERROR_NOT_AUTHORIZED";
104+
#endif
105+
106+
/* PTP-specific stuff. */
107+
#ifdef NX_PTP_CLIENT_NOT_STARTED
102108
case NX_PTP_CLIENT_NOT_STARTED: return "NX_PTP_CLIENT_NOT_STARTED";
103109
case NX_PTP_CLIENT_ALREADY_STARTED: return "NX_PTP_CLIENT_ALREADY_STARTED";
104110
case NX_PTP_PARAM_ERROR: return "NX_PTP_PARAM_ERROR";
105111
case NX_PTP_CLIENT_INSUFFICIENT_PACKET_PAYLOAD: return "NX_PTP_CLIENT_INSUFFICIENT_PACKET_PAYLOAD";
106112
case NX_PTP_CLIENT_CLOCK_CALLBACK_FAILURE: return "NX_PTP_CLIENT_CLOCK_CALLBACK_FAILURE";
113+
#endif
114+
107115
default: return "UNKNOWN_STATUS";
108116
}
109117
}

0 commit comments

Comments
 (0)