diff --git a/bacnet-stack/bacapp.c b/bacnet-stack/bacapp.c index 9921cbc4..749f364b 100644 --- a/bacnet-stack/bacapp.c +++ b/bacnet-stack/bacapp.c @@ -488,7 +488,7 @@ bool bacapp_parse_application_data(BACNET_APPLICATION_TAG tag_number, value->type.Signed_Int = long_value; } else if (tag_number == BACNET_APPLICATION_TAG_REAL) { double_value = strtod(argv, NULL); - value->type.Real = double_value; + value->type.Real = (float)double_value; } else if (tag_number == BACNET_APPLICATION_TAG_DOUBLE) { double_value = strtod(argv, NULL); value->type.Double = double_value; diff --git a/bacnet-stack/dcc.c b/bacnet-stack/dcc.c index c5b18bdc..9285af43 100644 --- a/bacnet-stack/dcc.c +++ b/bacnet-stack/dcc.c @@ -174,7 +174,7 @@ int dcc_decode_service_request(uint8_t * apdu, &len_value_type); len += decode_unsigned(&apdu[len], len_value_type, &value32); if (timeDuration) - *timeDuration = value32; + *timeDuration = (uint16_t)value32; } else if (timeDuration) *timeDuration = 0; /* Tag 1: enable_disable */ diff --git a/bacnet-stack/demo/object/bo.c b/bacnet-stack/demo/object/bo.c index 77f7edbc..0bb5fcd2 100644 --- a/bacnet-stack/demo/object/bo.c +++ b/bacnet-stack/demo/object/bo.c @@ -104,9 +104,9 @@ unsigned Binary_Output_Instance_To_Index(uint32_t object_instance) return index; } -static float Binary_Output_Present_Value(uint32_t object_instance) +static BACNET_BINARY_PV Binary_Output_Present_Value(uint32_t object_instance) { - float value = RELINQUISH_DEFAULT; + BACNET_BINARY_PV value = RELINQUISH_DEFAULT; unsigned index = 0; unsigned i = 0; diff --git a/bacnet-stack/demo/readfile/readfile.ide b/bacnet-stack/demo/readfile/readfile.ide index bec8f23e..ba4fbdc8 100644 Binary files a/bacnet-stack/demo/readfile/readfile.ide and b/bacnet-stack/demo/readfile/readfile.ide differ diff --git a/bacnet-stack/ports/win32/bacnet/bacnet.dsp b/bacnet-stack/ports/win32/bacnet/bacnet.dsp index 15367ab6..8616c621 100644 --- a/bacnet-stack/ports/win32/bacnet/bacnet.dsp +++ b/bacnet-stack/ports/win32/bacnet/bacnet.dsp @@ -137,6 +137,14 @@ SOURCE=..\..\..\bactext.c # End Source File # Begin Source File +SOURCE=..\..\..\demo\object\bi.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\demo\object\bi.h +# End Source File +# Begin Source File + SOURCE=..\..\..\bigend.c # End Source File # Begin Source File @@ -149,6 +157,14 @@ SOURCE=..\..\..\bip.c # End Source File # Begin Source File +SOURCE=..\..\..\demo\object\bo.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\demo\object\bo.h +# End Source File +# Begin Source File + SOURCE=..\..\..\crc.c # End Source File # Begin Source File @@ -201,6 +217,14 @@ SOURCE=..\..\..\indtext.c # End Source File # Begin Source File +SOURCE=..\..\..\demo\object\lsp.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\demo\object\lsp.h +# End Source File +# Begin Source File + SOURCE=..\main.c # End Source File # Begin Source File diff --git a/bacnet-stack/ports/win32/bacnet/bacnet.ncb b/bacnet-stack/ports/win32/bacnet/bacnet.ncb index af86a066..c0c0a8be 100644 Binary files a/bacnet-stack/ports/win32/bacnet/bacnet.ncb and b/bacnet-stack/ports/win32/bacnet/bacnet.ncb differ diff --git a/bacnet-stack/ports/win32/bacnet/bacnet.opt b/bacnet-stack/ports/win32/bacnet/bacnet.opt index aa9fe807..feca8cce 100644 Binary files a/bacnet-stack/ports/win32/bacnet/bacnet.opt and b/bacnet-stack/ports/win32/bacnet/bacnet.opt differ diff --git a/bacnet-stack/ports/win32/bacnet/bacnet.plg b/bacnet-stack/ports/win32/bacnet/bacnet.plg index 8366d25f..22cbaa9d 100644 --- a/bacnet-stack/ports/win32/bacnet/bacnet.plg +++ b/bacnet-stack/ports/win32/bacnet/bacnet.plg @@ -6,13 +6,56 @@ --------------------Configuration: bacnet - Win32 Debug--------------------

Command Lines

-Creating temporary file "C:\DOCUME~1\stk01\LOCALS~1\Temp\RSP58A.tmp" with contents +Creating temporary file "C:\DOCUME~1\stk01\LOCALS~1\Temp\RSP3A6.tmp" with contents [ -/nologo /MLd /W3 /Gm /GX /ZI /Od /I "c:\code\bacnet-stack\demo\object" /I "c:\code\bacnet-stack\\" /I "c:\code\bacnet-stack\ports\win32\\" /I "c:\code\bacnet-stack\demo\object\\" /I "c:\code\bacnet-stack\demo\handler\\" /D "_DEBUG" /D "BACDL_BIP" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /FR"Debug/" /Fo"Debug/" /Fd"Debug/" /FD /GZ /c +/nologo /MLd /W3 /Gm /GX /ZI /Od /I "..\..\.." /I ".." /I "..\..\..\demo\object\\" /I "..\..\..\demo\handler\\" /D "_DEBUG" /D "BACDL_BIP" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D TSM_ENABLED=1 /FR"Debug/" /Fo"Debug/" /Fd"Debug/" /FD /GZ /c +"C:\code\bacnet-stack\abort.c" +"C:\code\bacnet-stack\address.c" +"C:\code\bacnet-stack\demo\object\ai.c" +"C:\code\bacnet-stack\demo\object\ao.c" +"C:\code\bacnet-stack\apdu.c" +"C:\code\bacnet-stack\arf.c" +"C:\code\bacnet-stack\bacapp.c" +"C:\code\bacnet-stack\bacdcode.c" +"C:\code\bacnet-stack\bacerror.c" +"C:\code\bacnet-stack\demo\object\bacfile.c" +"C:\code\bacnet-stack\bacstr.c" +"C:\code\bacnet-stack\bactext.c" +"C:\code\bacnet-stack\bigend.c" +"C:\code\bacnet-stack\ports\win32\bip-init.c" +"C:\code\bacnet-stack\bip.c" +"C:\code\bacnet-stack\crc.c" +"C:\code\bacnet-stack\datalink.c" +"C:\code\bacnet-stack\dcc.c" +"C:\code\bacnet-stack\demo\object\device.c" +"C:\code\bacnet-stack\demo\handler\h_arf.c" +"C:\code\bacnet-stack\demo\handler\h_arf_a.c" +"C:\code\bacnet-stack\demo\handler\h_iam.c" +"C:\code\bacnet-stack\demo\handler\h_rp.c" +"C:\code\bacnet-stack\demo\handler\h_rp_a.c" +"C:\code\bacnet-stack\demo\handler\h_whois.c" +"C:\code\bacnet-stack\demo\handler\h_wp.c" +"C:\code\bacnet-stack\iam.c" +"C:\code\bacnet-stack\indtext.c" "C:\code\bacnet-stack\ports\win32\main.c" +"C:\code\bacnet-stack\demo\handler\noserv.c" +"C:\code\bacnet-stack\npdu.c" +"C:\code\bacnet-stack\reject.c" +"C:\code\bacnet-stack\ringbuf.c" +"C:\code\bacnet-stack\rp.c" +"C:\code\bacnet-stack\demo\handler\s_rp.c" +"C:\code\bacnet-stack\demo\handler\s_whois.c" +"C:\code\bacnet-stack\demo\handler\s_wp.c" +"C:\code\bacnet-stack\tsm.c" +"C:\code\bacnet-stack\demo\handler\txbuf.c" +"C:\code\bacnet-stack\whois.c" +"C:\code\bacnet-stack\wp.c" +"C:\code\bacnet-stack\demo\object\bi.c" +"C:\code\bacnet-stack\demo\object\bo.c" +"C:\code\bacnet-stack\demo\object\lsp.c" ] -Creating command line "cl.exe @C:\DOCUME~1\stk01\LOCALS~1\Temp\RSP58A.tmp" -Creating temporary file "C:\DOCUME~1\stk01\LOCALS~1\Temp\RSP58B.tmp" with contents +Creating command line "cl.exe @C:\DOCUME~1\stk01\LOCALS~1\Temp\RSP3A6.tmp" +Creating temporary file "C:\DOCUME~1\stk01\LOCALS~1\Temp\RSP3A7.tmp" with contents [ kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib /nologo /subsystem:console /incremental:yes /pdb:"Debug/bacnet.pdb" /debug /machine:I386 /out:"Debug/bacnet.exe" /pdbtype:sept ".\Debug\abort.obj" @@ -32,21 +75,8 @@ kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32 ".\Debug\bip.obj" ".\Debug\crc.obj" ".\Debug\datalink.obj" +".\Debug\dcc.obj" ".\Debug\device.obj" -".\Debug\iam.obj" -".\Debug\indtext.obj" -".\Debug\main.obj" -".\Debug\npdu.obj" -".\Debug\reject.obj" -".\Debug\ringbuf.obj" -".\Debug\rp.obj" -".\Debug\tsm.obj" -".\Debug\whois.obj" -".\Debug\wp.obj" -".\Debug\s_rp.obj" -".\Debug\s_whois.obj" -".\Debug\s_wp.obj" -".\Debug\txbuf.obj" ".\Debug\h_arf.obj" ".\Debug\h_arf_a.obj" ".\Debug\h_iam.obj" @@ -54,16 +84,88 @@ kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32 ".\Debug\h_rp_a.obj" ".\Debug\h_whois.obj" ".\Debug\h_wp.obj" +".\Debug\iam.obj" +".\Debug\indtext.obj" +".\Debug\main.obj" ".\Debug\noserv.obj" +".\Debug\npdu.obj" +".\Debug\reject.obj" +".\Debug\ringbuf.obj" +".\Debug\rp.obj" +".\Debug\s_rp.obj" +".\Debug\s_whois.obj" +".\Debug\s_wp.obj" +".\Debug\tsm.obj" +".\Debug\txbuf.obj" +".\Debug\whois.obj" +".\Debug\wp.obj" +".\Debug\bi.obj" +".\Debug\bo.obj" +".\Debug\lsp.obj" ] -Creating command line "link.exe @C:\DOCUME~1\stk01\LOCALS~1\Temp\RSP58B.tmp" +Creating command line "link.exe @C:\DOCUME~1\stk01\LOCALS~1\Temp\RSP3A7.tmp"

Output Window

Compiling... +abort.c +address.c +ai.c +c:\code\bacnet-stack\demo\object\ai.c(87) : warning C4305: 'initializing' : truncation from 'const double ' to 'float ' +ao.c +c:\code\bacnet-stack\demo\object\ao.c(163) : warning C4305: 'initializing' : truncation from 'const double ' to 'float ' +apdu.c +arf.c +bacapp.c +bacdcode.c +bacerror.c +bacfile.c +bacstr.c +bactext.c +bigend.c +bip-init.c +bip.c +crc.c +datalink.c +dcc.c +device.c +h_arf.c +Generating Code... +c:\code\bacnet-stack\demo\object\bacfile.c(263) : warning C4761: integral size mismatch in argument; conversion supplied +c:\code\bacnet-stack\bacapp.c(444) : warning C4761: integral size mismatch in argument; conversion supplied +Compiling... +h_arf_a.c +h_iam.c +h_rp.c +h_rp_a.c +h_whois.c +h_wp.c +iam.c +indtext.c main.c -c:\code\bacnet-stack\ports\win32\net.h(30) : warning C4005: 'STRICT' : macro redefinition - c:\program files\microsoft visual studio\vc98\include\windef.h(15) : see previous definition of 'STRICT' +noserv.c +npdu.c +reject.c +ringbuf.c +rp.c +s_rp.c +s_whois.c +s_wp.c +tsm.c +txbuf.c +whois.c +Generating Code... +c:\code\bacnet-stack\demo\handler\s_wp.c(92) : warning C4761: integral size mismatch in argument; conversion supplied +c:\code\bacnet-stack\demo\handler\s_rp.c(88) : warning C4761: integral size mismatch in argument; conversion supplied +c:\code\bacnet-stack\npdu.c(289) : warning C4761: integral size mismatch in argument; conversion supplied +c:\code\bacnet-stack\demo\handler\h_rp_a.c(73) : warning C4761: integral size mismatch in argument; conversion supplied +Compiling... +wp.c +bi.c +bo.c +lsp.c +Generating Code... +c:\code\bacnet-stack\wp.c(121) : warning C4761: integral size mismatch in argument; conversion supplied Linking... -Creating temporary file "C:\DOCUME~1\stk01\LOCALS~1\Temp\RSP58C.tmp" with contents +Creating temporary file "C:\DOCUME~1\stk01\LOCALS~1\Temp\RSP3A9.tmp" with contents [ /nologo /o"Debug/bacnet.bsc" ".\Debug\abort.sbr" @@ -83,21 +185,8 @@ Creating temporary file "C:\DOCUME~1\stk01\LOCALS~1\Temp\RSP58C.tmp" with conten ".\Debug\bip.sbr" ".\Debug\crc.sbr" ".\Debug\datalink.sbr" +".\Debug\dcc.sbr" ".\Debug\device.sbr" -".\Debug\iam.sbr" -".\Debug\indtext.sbr" -".\Debug\main.sbr" -".\Debug\npdu.sbr" -".\Debug\reject.sbr" -".\Debug\ringbuf.sbr" -".\Debug\rp.sbr" -".\Debug\tsm.sbr" -".\Debug\whois.sbr" -".\Debug\wp.sbr" -".\Debug\s_rp.sbr" -".\Debug\s_whois.sbr" -".\Debug\s_wp.sbr" -".\Debug\txbuf.sbr" ".\Debug\h_arf.sbr" ".\Debug\h_arf_a.sbr" ".\Debug\h_iam.sbr" @@ -105,15 +194,32 @@ Creating temporary file "C:\DOCUME~1\stk01\LOCALS~1\Temp\RSP58C.tmp" with conten ".\Debug\h_rp_a.sbr" ".\Debug\h_whois.sbr" ".\Debug\h_wp.sbr" -".\Debug\noserv.sbr"] -Creating command line "bscmake.exe @C:\DOCUME~1\stk01\LOCALS~1\Temp\RSP58C.tmp" +".\Debug\iam.sbr" +".\Debug\indtext.sbr" +".\Debug\main.sbr" +".\Debug\noserv.sbr" +".\Debug\npdu.sbr" +".\Debug\reject.sbr" +".\Debug\ringbuf.sbr" +".\Debug\rp.sbr" +".\Debug\s_rp.sbr" +".\Debug\s_whois.sbr" +".\Debug\s_wp.sbr" +".\Debug\tsm.sbr" +".\Debug\txbuf.sbr" +".\Debug\whois.sbr" +".\Debug\wp.sbr" +".\Debug\bi.sbr" +".\Debug\bo.sbr" +".\Debug\lsp.sbr"] +Creating command line "bscmake.exe @C:\DOCUME~1\stk01\LOCALS~1\Temp\RSP3A9.tmp" Creating browse info file...

Output Window

Results

-bacnet.exe - 0 error(s), 1 warning(s) +bacnet.exe - 0 error(s), 9 warning(s) diff --git a/bacnet-stack/ports/win32/bip-init.c b/bacnet-stack/ports/win32/bip-init.c index 00c38cd2..b011d98a 100644 --- a/bacnet-stack/ports/win32/bip-init.c +++ b/bacnet-stack/ports/win32/bip-init.c @@ -159,6 +159,19 @@ bool bip_init(void) bip_set_socket(-1); return false; } + #if 0 + /* probably only for Apple... */ + /* rebind a port that is already in use. + Note: all users of the port must specify this flag */ + rv = setsockopt(sock_fd, SOL_SOCKET, SO_REUSEPORT, + (char *) &value, sizeof(value)); + if (rv < 0) { + fprintf(stderr, "bip: failed to set REUSEPORT socket option.\n"); + close(sock_fd); + bip_set_socket(-1); + return false; + } + #endif /* bind the socket to the local port number and IP address */ sin.sin_family = AF_INET; #if USE_INADDR