#include <stdio.h>
#include <stdlib.h>
#include <pthread.h>
#include <string.h>

#include "JZsdkLib.h"

#include "BaseConfig.h"

int main(int argc, char* argv[])
{
    //设定本程序为 uart程序模式  还是 psdk程序模式
    //前者可用于 uart连接对外接口 或者是 通过uart控制的psdk
    //后者则是用于直接镶套在psdk程序里面

    //参数解析
    JZsdk_ParamterParsing(argc, argv);

    //通过参数判断出进行什么提示程序操作

    //如果是喊话器设备
#if MEGAPHONE_CONFIG_STATUS == VERSION_SWITCH_ON

    //如果是 -e 程序错误 播放喊话器错误

    //如果是 -s 程序成功 播放喊话器升级成功

    //如果是 -f 程序失败 播放喊话器升级失败


#endif


    while (1)
    {
        delayMs(1000);
    }
}

//  #include<stdio.h>
//  #include<unistd.h>
//  #include<string.h>
//  #include<getopt.h>
 
//  void print_usage()
//  {
//      printf("\nUsage:\n");
//      printf("\t--name=student name\n");
//      printf("\t-s, --sex=student sex\n"
//              "\t\tif no usage ,sex is 0 means man\n\n");
//      printf("\t-g, --grade=student in grade\n");
//      printf("\t-c, --class=student in class\n");
//      printf("\t-h, --help\n");
//  }
 
//  int main(int argc, char* argv[])
//  {
//      int opt, grade, class, sex = -1; 
//      char *name = NULL;
 
//      struct option long_options[] = { 
//          {"name", required_argument, NULL, 'n'},
//          {"sex",  optional_argument, &sex, 's'},
//          {"grade", optional_argument, NULL, 'g'},
//          {"class", required_argument, NULL, 'c'},
//          {"help", no_argument, NULL, 'H'},
//          {0, 0, 0, 0}
//      };  
     
//      printf("n:s::g::c:H\n");
 
//   while ((opt = getopt_long(argc, argv, "n:s::g::c:H", long_options, NULL)) != -1) {
//          printf ("\nopt:%c, optarg:%s, optind:%d, opterr:%d, optopt:%c, argv[optind]:%s\n",
//                                   opt, optarg, optind, opterr, optopt, argv[optind-1]);
//          switch (opt) {
//              case 'n':
//                  name = optarg;
//                  printf("name:%s\n", name);
//                  break;
//              case 's':
//                  printf("sex:%d\n", sex);
//                  if (sex == -1)sex = 0;
//                  //printf("sex:%d, %s", sex, sex > 0 ? "gilr":"mem");
//                  break;
//              case 'g':
//                  if (!strcmp(argv[optind-1], "-g"))grade = 1;
//                  else
//                      grade = strtoul(optarg, NULL, 10);
//                  break;
//              case 'c':
//                  class = strtoul(optarg, NULL, 10);
//                  break;
//              case 'H':
//                  print_usage();
//                  return 0;
//              default:
//                  print_usage();
//                  return -1;
//          }
//      }
//      printf("A student info:\n"
//              "name:%s\n"
//              "sex:%s\n"
//              "grade:%d\n"
//              "class:%d\n",
//              name, sex > 0 ? "gilr" : "men", grade, class)
//          ;
//      return 0;
//  }