36 #include "lib/simEnvChange.h"
38 #define IMPLEMENT_PRINTF 1
43 #define MAX_LOG_LENGTH (2*UIP_BUFSIZE)
45 #define MAX_LOG_LENGTH 1024
48 #if MAX_LOG_LENGTH < 1024
50 #define MAX_LOG_LENGTH 1024
54 const struct simInterface simlog_interface;
57 char simLoggedData[MAX_LOG_LENGTH];
65 if (simLoggedLength + 1 > MAX_LOG_LENGTH) {
70 simLoggedData[simLoggedLength] = c;
76 simlog(
const char *message)
78 if (simLoggedLength + strlen(message) > MAX_LOG_LENGTH) {
83 memcpy(simLoggedData + simLoggedLength, message, strlen(message));
84 simLoggedLength += strlen(message);
89 log_message(
const char *part1,
const char *part2)
96 doInterfaceActionsBeforeTick(
void)
101 doInterfaceActionsAfterTick(
void)
122 printf(
const char *fmt, ...)
125 static char buf[MAX_LOG_LENGTH];
128 res = vsnprintf(buf, MAX_LOG_LENGTH, fmt, ap);
137 SIM_INTERFACE(simlog_interface,
138 doInterfaceActionsBeforeTick,
139 doInterfaceActionsAfterTick);