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

void main (void)
{
  printk("GPS/LTE_M testing ..................\n"); 

  while(1){
    char posdata_t[200],posdata_lte[200],posdata_nb[200];
    memset(posdata_lte, 0, sizeof(posdata_lte)); memset(posdata_t, 0, sizeof(posdata_t));memset(posdata_nb, 0, sizeof(posdata_nb));
    strncat(posdata_lte,"device_type=LTE&data=",sizeof("device_type=LTE&data=")); 

    find_gps(posdata_t) ;
   
    strncat(posdata_lte,posdata_t,sizeof(posdata_t)); 
    printk("Postdata: %s\n",posdata_lte); 
 
  
    printk("Test is starting........................ \n"); 
    printk("lte_lc_offline.......................... \n"); 
    lte_lc_offline();

    printk("lte_lc_init_and_connect.................. \n");
    lte_lc_init_and_connect();

    printk("lte_lc_normal............................ \n");
    lte_lc_normal();
    
    printk("app_http_post............................ \n");
    app_http_post(posdata_lte);
   
    printk("release LTE connection after posting......... \n");
    lte_lc_offline(); 
    
  k_sleep(3000); 
  }


}
