How to send and receive data using UART2 (RS232) interface


I am having mangOH green board (WP8548) with legato Developer studio 5
I want to send and receive some data through UART2 (from RS232 terminal)
Which api need to be used in Developer studio or any sample code for Uart2 communication ?


I am using le_tty api for uart communication.
out of these api, first I am using le_tty_open() method and then other api methods to set all baudrate, flow control, parity, stop bits etc.
after that I have used write method to send data and read to receive data.

But my application get stopped at


with error:

LE_FILENAME le_tty_Open() 231 | Error opening serial device ‘/dev/ttyHSL1’: No such file or directory

I have also tried with /dev/ttyAT , but same error.
I have also tried below command on terminal and then executed application, but same error persist.

echo -e “AT!MAPUART=17,1\r” > /dev/ttyAT

where I am doing wrong ? please suggest me solution


Hi @rups

If you’re running the app as ‘sandboxed’, you will need to request read/write acces to the device in your .adef file.

        // read and write access to the UART2 port.
        [rw]    /dev/ttyHSL1   /dev/ttyHSL1

Alternately, you can try running the app unsandboxed:

sandboxed: false


How to configure my component to access le_tty functions?