소스 검색

Merge branch 'master' of https://tree.clementinecomputing.com/clementinecomputing/popufare

clementinecomputing 5 년 전
부모
커밋
863617ce7d
1개의 변경된 파일12개의 추가작업 그리고 2개의 파일을 삭제
  1. 12 2
      busunit/DIUv2/diu_main.c

+ 12 - 2
busunit/DIUv2/diu_main.c

@@ -54,6 +54,8 @@
 
 #define _SLEN LINE_BUFFER_SIZE
 
+#define DIU_MINDER_VERSION "2.1.10"
+
 static const char *s_http_port = "60535";
 static struct mg_serve_http_opts s_http_server_opts;
 
@@ -1402,15 +1404,23 @@ int main(int argc, char **argv) {
 
   time_t last_stale_gps_check = 0;
 
+  struct mg_connection *nc;
+
   long long int _usec_now, _usec_prv, _usec_del;
+
+  if ( (argc>1) && (
+        (strncmp(argv[1], "-h", 3)==0) ||
+        (strncmp(argv[1], "-v", 3)==0) ) ) { 
+    printf("diu_minder version: %s\n", DIU_MINDER_VERSION);
+    exit(0);
+  }
+
   _usec_now = get_usec_time();
   _usec_prv = _usec_now;
   _usec_del = 60000000;
 
   // setup mongoose web server
   //
-  struct mg_connection *nc;
-
   mg_mgr_init(&g_mgr, NULL);
   nc = mg_bind(&g_mgr, s_http_port, ev_handler);
   if (!nc) {