@@ -58,24 +58,24 @@ int main(int argc, char *argv[]) {
5858 if (!* family )
5959 HAL_ERROR ("hal" , "Unsupported chip family! Quitting...\n" );
6060
61- fprintf (stderr , "\033[7m Divinus for %s \033[0m\n" , family );
61+ fprintf (stderr , "\033[0m\033[ 7m Divinus (rev %s) for %s \033[0m\n" , GIT_REV , family );
6262 fprintf (stderr , "Chip ID: %s\n" , chip );
6363
64- if (parse_app_config () != CONFIG_OK )
64+ if (app_config_parse () != CONFIG_OK )
6565 HAL_ERROR ("hal" , "Can't load app config 'divinus.yaml'\n" );
6666
6767 if (app_config .watchdog )
6868 watchdog_start (app_config .watchdog );
6969
70- start_network ();
70+ network_start ();
7171
72- start_server ();
72+ server_start ();
7373
7474 if (app_config .rtsp_enable ) {
7575 rtspHandle = rtsp_create (RTSP_MAXIMUM_CONNECTIONS , app_config .rtsp_port , 1 );
7676 HAL_INFO ("rtsp" , "Started listening for clients...\n" );
7777 if (app_config .rtsp_enable_auth ) {
78- if (! app_config .rtsp_auth_user || ! app_config .rtsp_auth_pass )
78+ if (EMPTY ( app_config .rtsp_auth_user ) || EMPTY ( app_config .rtsp_auth_pass ) )
7979 HAL_ERROR ("rtsp" , "One or both credential fields have been left empty!\n" );
8080 else {
8181 rtsp_configure_auth (rtspHandle , app_config .rtsp_auth_user , app_config .rtsp_auth_pass );
@@ -85,19 +85,19 @@ int main(int argc, char *argv[]) {
8585 }
8686
8787 if (app_config .stream_enable )
88- start_streaming ();
88+ media_start ();
8989
90- if (start_sdk ())
90+ if (sdk_start ())
9191 HAL_ERROR ("hal" , "Failed to start SDK!\n" );
9292
9393 if (app_config .night_mode_enable )
94- enable_night ();
94+ night_enable ();
9595
9696 if (app_config .http_post_enable )
97- start_http_post_send ();
97+ http_post_start ();
9898
9999 if (app_config .osd_enable )
100- start_region_handler ();
100+ region_start ();
101101
102102 if (app_config .record_enable && app_config .record_continuous )
103103 record_start ();
@@ -117,28 +117,28 @@ int main(int argc, char *argv[]) {
117117 }
118118
119119 if (app_config .http_post_enable )
120- stop_http_post_send ();
120+ http_post_start ();
121121
122122 if (app_config .osd_enable )
123- stop_region_handler ();
123+ region_stop ();
124124
125125 if (app_config .night_mode_enable )
126- disable_night ();
126+ night_disable ();
127127
128- stop_sdk ();
128+ sdk_stop ();
129129
130130 if (app_config .stream_enable )
131- stop_streaming ();
131+ media_stop ();
132132
133- stop_server ();
133+ server_stop ();
134134
135- stop_network ();
135+ network_stop ();
136136
137137 if (app_config .watchdog )
138138 watchdog_stop ();
139139
140140 if (!graceful )
141- restore_app_config ();
141+ app_config_restore ();
142142
143143 if (graceful ) {
144144 fprintf (stderr , "Restarting...\n" );
0 commit comments