This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

How to use socket?

<Environment>
- Windows10
- nrf v1.3.0
- modem fw 1.2.0

I'm attempting to make a socket and communicate with the modem using it.

However, sending data doesn't work out. It was working in v1.2.0. Any tip?

I don't want to use at_cmd.c becuase I need a exclusive  socket for SMS notification.

<main.c>

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include <zephyr.h>
#include <stdio.h>
#include <net/socket.h>
#include <modem/lte_lc.h>
#define BUF_LEN 128
int fd;
void main(){
int ret;
char at_cmd[] = "AT\n";
char buf[BUF_LEN];
/* Configure LTE-M */
printk("LTE Link Connecting ...\n");
ret = lte_lc_init_and_connect();
printk("LTE Link Connected!\n");
if (ret) {
printk("Error: modem_configure\n");
return;
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX