From e35cabd91db638c465c80f89ba9df3631ff2438f Mon Sep 17 00:00:00 2001 From: skarg Date: Sun, 15 Feb 2009 22:19:14 +0000 Subject: [PATCH] Updated mstpcap for win32, tested. --- bacnet-stack/demo/mstpcap/main.c | 16 +--------------- bacnet-stack/ports/win32/net.h | 1 - 2 files changed, 1 insertion(+), 16 deletions(-) diff --git a/bacnet-stack/demo/mstpcap/main.c b/bacnet-stack/demo/mstpcap/main.c index c636e0a2..165c68ab 100644 --- a/bacnet-stack/demo/mstpcap/main.c +++ b/bacnet-stack/demo/mstpcap/main.c @@ -107,17 +107,6 @@ static int gettimeofday( return 0; } - -static int nanosleep( - const struct timespec *rqtp, - struct timespec *rmtp) -{ - DWORD dwMilliseconds = (rqtp->tv_sec * 1000) + (rqtp->tv_nsec / 1000); - - Sleep(dwMilliseconds); - - return 0; -} #endif static uint16_t Timer_Silence( @@ -146,7 +135,7 @@ void Sleep(unsigned long milliseconds) timeOut.tv_nsec = (milliseconds - (timeOut.tv_sec * 1000)) * 10000000; nanosleep(&timeOut, &remains); } - +#endif void *milliseconds_task( void *pArg) @@ -158,7 +147,6 @@ void *milliseconds_task( return NULL; } -#endif static void receiver_packet_put( volatile struct mstp_port_struct_t * mstp_port) @@ -487,8 +475,6 @@ int main( RECEIVE_PACKET_COUNT); #if defined(_WIN32) Receive_Packet_Flag = CreateSemaphore(NULL, 0, 1, "ReceivePacket"); -); - hThread = _beginthread(milliseconds_task_win32, 4096, &arg_value); if (hThread == 0) { fprintf(stderr, "Failed to start timer task\n"); diff --git a/bacnet-stack/ports/win32/net.h b/bacnet-stack/ports/win32/net.h index a1c12917..5c53a95a 100644 --- a/bacnet-stack/ports/win32/net.h +++ b/bacnet-stack/ports/win32/net.h @@ -36,7 +36,6 @@ #endif #include #include -#include #ifdef _MSC_VER #define inline __inline