oaisim.c 3.06 KB
Newer Older
1 2 3 4 5
/*
 * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The OpenAirInterface Software Alliance licenses this file to You under
Cedric Roux's avatar
Cedric Roux committed
6
 * the OAI Public License, Version 1.1  (the "License"); you may not use this file
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
 * except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.openairinterface.org/?page_id=698
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *-------------------------------------------------------------------------------
 * For more information about the OpenAirInterface (OAI) Software Alliance:
 *      contact@openairinterface.org
 */

22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
#include <string.h>
#include <math.h>
#include <unistd.h>
#include "SIMULATION/TOOLS/defs.h"
#include "SIMULATION/RF/defs.h"
#include "PHY/types.h"
#include "PHY/defs.h"
#include "PHY/vars.h"
#include "MAC_INTERFACE/vars.h"

#include "LAYER2/RLC/AM_v9.3.0/rlc_am.h"
#include "LAYER2/MAC/defs.h"
#include "LAYER2/MAC/vars.h"
#include "UTIL/LOG/log_if.h"
#include "UTIL/LOG/log_extern.h"
#include "RRC/LITE/vars.h"
#include "PHY_INTERFACE/vars.h"
#include "UTIL/OCG/OCG.h"
#include "UTIL/AT_COMMANDS/parser.h"

42 43 44 45 46 47 48 49 50 51 52
mapping level_names[] = {
  {"emerg", LOG_EMERG},
  {"alert", LOG_ALERT},
  {"crit", LOG_CRIT},
  {"err", LOG_ERR},
  {"warn", LOG_WARNING},
  {"notice", LOG_NOTICE},
  {"info", LOG_INFO},
  {"debug", LOG_DEBUG},
  {"trace", LOG_TRACE},
  {NULL, -1}
53 54
};

55 56
int main(int argc, char **argv)
{
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82
  char * g_log_level="trace"; // by default global log level is set to trace

  //initialize the log generator
  logInit(map_str_to_int(level_names, g_log_level));
  LOG_T(LOG,"global log level is set to %s \n",g_log_level );

  at_parse_init(at_null_callback_handler, mt_null_attach_state_request_handler, mt_null_attach_request_handler, mt_null_detach_request_handler);
  printf("+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n");
  at_parse_string("AT+CGATT=?\r");
  printf("+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n");
  at_parse_string("AT+CGATT?\r");
  printf("+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n");
  at_parse_string("AT+CGATT?\r");
  printf("+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n");
  at_parse_string("AT+CGATT?\r");
  printf("+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n");
  at_parse_string("AT+CGATT?\r");
  printf("+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n");
  at_parse_string("AT+CGATT=1\r");
  printf("+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n");
  at_parse_string("AT+CGATT=0\r");
  printf("+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n");
  return(0);
}