Hello,
I have to send hardcoded AT commands on button press on nRF9160dk. So for that, first I did program for button press. It is working fine. Then I did simple_at program, which is also working fine. So now I have merged these 2 programs. But it is not working.
I have pasted the code. In the interrupt callback function button_pressed, all other functions are working, except app_socket_start. It stucks inside callback function. when I call app_socket_start function in main, it is working fine, but get stucked when I call inside the callbak function. What is the solution for this?
Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include <net/socket.h>
#include <stdio.h>
#include <string.h>
#include <uart.h>
#include <gpio.h>
#include <device.h>
#include <zephyr.h>
#include <misc/util.h>
#include <misc/printk.h>
#define HTTP_HOST "google.com"
#define HTTP_PORT 80
#define RECV_BUF_SIZE 1024
char recv_buf[RECV_BUF_SIZE + 1];
#define LED_PORT LED1_GPIO_CONTROLLER
#define LED LED1_GPIO_PIN
/* change this to use another GPIO port */
#ifndef SW1_GPIO_CONTROLLER