# How to connect gprs in the legato project without use of terminal commands

**URL:** https://forum.legato.io/t/how-to-connect-gprs-in-the-legato-project-without-use-of-terminal-commands/2392
**Category:** Uncategorized
**Created:** [March 22, 2017, 5:57am UTC](https://forum.legato.io/t/how-to-connect-gprs-in-the-legato-project-without-use-of-terminal-commands/2392 "2017-03-22T05:57:31Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![rups](https://avatars.discourse-cdn.com/v4/letter/r/5e9695/32.png) [@rups](https://forum.legato.io/u/rups)
#### Post date: [March 22, 2017, 5:57am UTC](https://forum.legato.io/t/how-to-connect-gprs-in-the-legato-project-without-use-of-terminal-commands/2392/1 "2017-03-22T05:57:31Z")

</div>

Hello everyone,

I simply want to connect to gprs through my code.  
I am able to connect to gprs using terminal command “cm data connect &” and it is connecting to interface “rmnet0”.  
But my requirement is to connect to internet at starting of my project execution through code (using some api ).  
I am going to use socket programming to send and receive data to particular destination  
so, only challenge for me to connect to gprs

which api does the work of terminal command “cm data connect &” in legato.  
and also the sequence of apis to be use so as to connect to internet.

Please guide me in this regards as my work get stuck to it.  
Thanks!

---

<div class="post-metadata">

### Author: ![lotam](https://avatars.discourse-cdn.com/v4/letter/l/958977/32.png) [@lotam](https://forum.legato.io/u/lotam)
#### Post date: [October 11, 2017, 8:41am UTC](https://forum.legato.io/t/how-to-connect-gprs-in-the-legato-project-without-use-of-terminal-commands/2392/2 "2017-10-11T08:41:28Z")

</div>

Hi rups,

There are two APIs available:  
le\_data\_Request()

> **[le\_data Interface - Legato Docs](http://docs.legato.io/latest/c_le_data.html)**
>
> legato™ is an open source Linux-based embedded platform designed to simplify connected IoT application development

le\_mdc\_StartSession()

> **[Modem Data Control - Legato Docs](http://docs.legato.io/latest/c_mdc.html)**
>
> legato™ is an open source Linux-based embedded platform designed to simplify connected IoT application development

You may also check sample app modemDemo for reference.
