Creating a TCP/IP socket connection

Hi,
i want to connect my legato board to server using TCP/IP socket to send my data to server.Can someone guide me to do that?

Thanks

Do you have a data connection to outside world? The programmatic way to get an IP connection is to use the api - le_data_Request().

To begin with, I would probably use a tool - “cm data connect” and see if I can get an interface such as rmnet_data0 with correct ip address etc., once I have a valid ip address, I would ping to the server and make sure that succeeds. Then you can use any socket programming example online to connect to your server.

Here is example to use command line:
root@swi-mdm9x28:~# cm data connect &
root@swi-mdm9x28:~#
root@swi-mdm9x28:~# Setting up profile 1
Setting access point name … ok
Setting packet data protocol … ok
Setting Authentication … ok
Connecting … ok
Checking if device is up … ok
Routing … ok
Updating /etc/resolv.conf … ok
Updating /etc/resolv.conf … ok
Testing connection … ok

[1]+ Done cm data connect
root@swi-mdm9x28:~#
root@swi-mdm9x28:~# nc 123.123.123.123 5044

asdf

asdf