You can use the wiringPi library for this purpose.
All the necessary documentation is available here: http://wiringpi.com
Code examples are on github and available at this link.: https://github.com/WiringPi/WiringPi/tree/master/examples
1.Install the WiringPi library by typing in the console
sudo apt-get install wiringpi
2. Below I put a code example in C.
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <wiringPi.h>
#include <wiringSerial.h>
int main ()
{
int fd ;
if ((fd = serialOpen ("/dev/ttyACM0", 9600)) < 0)
{
fprintf (stderr, "Unable to open serial device: %s\n", strerror (errno)) ;
return 1 ;
}
if (wiringPiSetup () == -1)
{
fprintf (stdout, "Unable to start wiringPi: %s\n", strerror (errno)) ;
return 1 ;
}
for (;; )
{
while (serialDataAvail (fd))
{
printf ("%d \n",serialGetchar (fd)) ;
fflush (stdout) ;
}
}
return 0 ;
}
Remember to include the wiringpi library when generating the code
gcc -o test test.c -lwiringPi
3. Adapt the code to your needs and place it in DeviceDriver.c and configure reading data from gui.