#include <zephyr.h>
#include <net/socket.h>
#include <stdio.h>
#include "lte_post_get.h"
#include <lte_lc.h>

void main (void)
{
  printk("LTETESTING is starting \n"); 
    
     
   
     printk(" LTE is connecting........... \n"); 

     lte_lc_init_and_connect();
     int lte_err= nRF_LTE_check();
     if(lte_err==0){ printk("  find LTE_M signal........... \n");
     char sendStr[200];
     memset(sendStr, 0, sizeof(sendStr));
     memcpy(sendStr,"device_type=LTE-M&data=221",sizeof("device_type=LTE-M&data=221")-1);
    
     app_http_post(sendStr); 
      }
     else{ printk(" Couldnt find LTE_M signal........... \n");}
     printk("---------------------------------------------- \n"); 
     k_sleep(2000);
     
    // lte_lc_offline(); 
     printk(" Enable NB-IOT........... \n"); 
     Telia_SEL(); 
     NB_IOT_socket_start();
     //app_socket_start(); 
       lte_err= nRF_LTE_check();
     if(lte_err==0){ printk("  find NB-IOT signal........... \n");
      char sendStr[50];
      memset(sendStr, 0, sizeof(sendStr));
      memcpy(sendStr,"device_type=NB-IOT1&data=",sizeof("device_type=NB-IOT1&data=")-1);
      app_http_post(sendStr); 
      }
     else{ printk(" Couldnt find NB_IOT signal........... \n");}
     

     
     printk("---------------------------------------------- \n"); 
     k_sleep(5000);
   //  nRF_LTE_CLOSE(); 

     
   
   
   
}
