// +build ignore

#include "air720u.h"

// 主函数入口, 测试联网
int main(int argc,char *argv[])
{
  int ret = Air720U_ComInit();
  if(ret < 0)
  {
    sw_log_error("an error occurred while calling the Air720U_ComInit() function(%d)!!", ret);
    goto end_p;
  }

  char MMEI[16] = { 0 };
  ret = Air720U_GetIMEI(MMEI);
  if(ret < 0)
  {
    sw_log_error("an error occurred while calling the Air720U_GetIMEI() function(%d)!!", ret);
    goto end_p;
  }
  sw_log_info("IMEI: %s", MMEI);

  ret = Air720U_GetCregState();
  if(ret < 0)
  {
    sw_log_error("an error occurred while calling the Air720U_GetCregState() function(%d)!!", ret);
    goto end_p;
  }
  sw_log_info("Creg State: %d", ret);

  ret = Air720U_GetRSSIFromCSQ();
  if(ret < 0)
  {
    sw_log_error("an error occurred while calling the Air720U_GetRSSIFromCSQ() function(%d)!!", ret);
    goto end_p;
  }
  sw_log_info("RSSI: %d", ret);

  ret = Air720U_IsSimCardReady();
  if(ret < 0)
  {
    sw_log_error("an error occurred while calling the Air720U_IsSimCardReady() function(%d)!!", ret);
    goto end_p;
  }
  sw_log_info("SIM card status: %d", ret);

  char ICCID[21] = { 0 };
  ret = Air720U_GetSimICCID(ICCID);
  if(ret < 0)
  {
    sw_log_error("an error occurred while calling the Air720U_GetSimICCID() function(%d)!!", ret);
    goto end_p;
  }
  sw_log_info("ICCID: %s", ICCID);

end_p:
  Air720U_ComExit();
  return ret;
}
