You can send AT command inside unsandboxed legato application
Or you can see the sample code to send AT!BSGPIO below via /dev/ttyAT port: