Added explicit datalink_cleanup to all demo applications.

Moved bip_cleanup() to port specific files.
This works better for bacnet-stack DLLs.
This commit is contained in:
skarg
2012-02-10 22:12:15 +00:00
parent 2e6a060b26
commit 9e8c2b0927
25 changed files with 86 additions and 56 deletions
+1
View File
@@ -191,6 +191,7 @@ int main(
address_init();
Init_Service_Handlers();
dlenv_init();
atexit(datalink_cleanup);
/* configure the timeout values */
last_seconds = time(NULL);
timeout_seconds = (apdu_timeout() / 1000) * apdu_retries();
+2
View File
@@ -1254,6 +1254,7 @@ int main(
address_init();
Init_Service_Handlers();
dlenv_init();
atexit(datalink_cleanup);
/* configure the timeout values */
current_seconds = time(NULL);
@@ -1619,6 +1620,7 @@ int main(
printf("End of BACnet Protocol Implementation Conformance Statement\r\n");
printf("\r\n");
}
return 0;
}
+1 -12
View File
@@ -230,17 +230,6 @@ void Initialize_Device_Addresses(
}
}
/** Handler registered with atexit() inside main function to, well, cleanup.
* Especially if we don't end normally.
* @see datalink_cleanup
*/
static void cleanup(
void)
{
datalink_cleanup();
}
/** Main function of server demo.
*
* @see Device_Set_Object_Instance_Number, dlenv_init, Send_I_Am,
@@ -289,9 +278,9 @@ int main(
first_object_instance, MAX_APDU);
Init_Service_Handlers(first_object_instance);
dlenv_init();
atexit(datalink_cleanup);
Devices_Init(first_object_instance);
Initialize_Device_Addresses();
atexit(cleanup);
#ifdef BACNET_TEST_VMAC
/* initialize vmac table and router device */
+1
View File
@@ -146,6 +146,7 @@ int main(
Init_Service_Handlers();
address_init();
dlenv_init();
atexit(datalink_cleanup);
/* send the request */
Send_I_Am_Router_To_Network(Target_Router_Networks);
+1
View File
@@ -322,6 +322,7 @@ int main(
Init_Service_Handlers();
address_init();
dlenv_init();
atexit(datalink_cleanup);
/* configure the timeout values */
last_seconds = time(NULL);
timeout_seconds = apdu_timeout() / 1000;
+1 -1
View File
@@ -222,6 +222,7 @@ int main(
address_init();
Init_Service_Handlers();
dlenv_init();
atexit(datalink_cleanup);
/* configure the timeout values */
last_seconds = time(NULL);
timeout_seconds = (apdu_timeout() / 1000) * apdu_retries();
@@ -380,7 +381,6 @@ int main(
last_seconds = current_seconds;
}
}
if (Error_Detected)
return 1;
return 0;
+1
View File
@@ -247,6 +247,7 @@ int main(
address_init();
Init_Service_Handlers();
dlenv_init();
atexit(datalink_cleanup);
/* configure the timeout values */
last_seconds = time(NULL);
timeout_seconds = (apdu_timeout() / 1000) * apdu_retries();
+1
View File
@@ -254,6 +254,7 @@ int main(
address_init();
Init_Service_Handlers();
dlenv_init();
atexit(datalink_cleanup);
/* configure the timeout values */
last_seconds = time(NULL);
timeout_seconds = (apdu_timeout() / 1000) * apdu_retries();
+1
View File
@@ -400,6 +400,7 @@ int main(
address_init();
Init_Service_Handlers();
dlenv_init();
atexit(datalink_cleanup);
/* configure the timeout values */
last_seconds = time(NULL);
timeout_seconds = (apdu_timeout() / 1000) * apdu_retries();
+1
View File
@@ -249,6 +249,7 @@ int main(
address_init();
Init_Service_Handlers();
dlenv_init();
atexit(datalink_cleanup);
/* configure the timeout values */
last_seconds = time(NULL);
timeout_seconds = (apdu_timeout() / 1000) * apdu_retries();
+1
View File
@@ -185,6 +185,7 @@ int main(
address_init();
Init_Service_Handlers();
dlenv_init();
atexit(datalink_cleanup);
/* configure the timeout values */
last_seconds = time(NULL);
timeout_seconds = (apdu_timeout() / 1000) * apdu_retries();
+1
View File
@@ -300,6 +300,7 @@ int main(
address_init();
Init_Service_Handlers();
dlenv_init();
atexit(datalink_cleanup);
/* configure the timeout values */
last_seconds = time(NULL);
timeout_seconds = (apdu_timeout() / 1000) * apdu_retries();
+2 -11
View File
@@ -131,16 +131,6 @@ static void Init_Service_Handlers(
#endif /* defined(INTRINSIC_REPORTING) */
}
/** Handler registered with atexit() inside main function to, well, cleanup.
* Especially if we don't end normally.
* @see datalink_cleanup
*/
static void cleanup(
void)
{
datalink_cleanup();
}
/** Main function of server demo.
*
* @see Device_Set_Object_Instance_Number, dlenv_init, Send_I_Am,
@@ -177,7 +167,7 @@ int main(
Device_Object_Instance_Number(), MAX_APDU);
Init_Service_Handlers();
dlenv_init();
atexit(cleanup);
atexit(datalink_cleanup);
/* configure the timeout values */
last_seconds = time(NULL);
/* broadcast an I-Am on startup */
@@ -231,6 +221,7 @@ int main(
/* blink LEDs, Turn on or off outputs, etc */
}
return 0;
}
+1
View File
@@ -148,6 +148,7 @@ int main(
Device_Set_Object_Instance_Number(BACNET_MAX_INSTANCE);
Init_Service_Handlers();
dlenv_init();
atexit(datalink_cleanup);
/* configure the timeout values */
last_seconds = time(NULL);
timeout_seconds = apdu_timeout() / 1000;
+1
View File
@@ -192,6 +192,7 @@ int main(
Device_Set_Object_Instance_Number(BACNET_MAX_INSTANCE);
Init_Service_Handlers();
dlenv_init();
atexit(datalink_cleanup);
Send_UCOV_Notify(&Handler_Transmit_Buffer[0], &cov_data);
return 0;
+1
View File
@@ -277,6 +277,7 @@ int main(
address_init();
Init_Service_Handlers();
dlenv_init();
atexit(datalink_cleanup);
/* configure the timeout values */
last_seconds = time(NULL);
timeout_seconds = (apdu_timeout() / 1000) * apdu_retries();
+1
View File
@@ -153,6 +153,7 @@ int main(
Device_Set_Object_Instance_Number(BACNET_MAX_INSTANCE);
Init_Service_Handlers();
dlenv_init();
atexit(datalink_cleanup);
/* configure the timeout values */
last_seconds = time(NULL);
timeout_seconds = apdu_timeout() / 1000;
+1
View File
@@ -234,6 +234,7 @@ int main(
Init_Service_Handlers();
address_init();
dlenv_init();
atexit(datalink_cleanup);
/* configure the timeout values */
last_seconds = time(NULL);
timeout_seconds = apdu_timeout() / 1000;
+1
View File
@@ -290,6 +290,7 @@ int main(
Init_Service_Handlers();
address_init();
dlenv_init();
atexit(datalink_cleanup);
/* configure the timeout values */
last_seconds = time(NULL);
timeout_seconds = apdu_timeout() / 1000;
+1
View File
@@ -204,6 +204,7 @@ int main(
address_init();
Init_Service_Handlers();
dlenv_init();
atexit(datalink_cleanup);
/* configure the timeout values */
last_seconds = time(NULL);
timeout_seconds = (apdu_timeout() / 1000) * apdu_retries();
+1
View File
@@ -326,6 +326,7 @@ int main(
address_init();
Init_Service_Handlers();
dlenv_init();
atexit(datalink_cleanup);
/* configure the timeout values */
last_seconds = time(NULL);
timeout_seconds = (apdu_timeout() / 1000) * apdu_retries();