How to read from serial in c ? (under linux)

Thanks guys I think I figured out the way! :slight_smile:

Now I have a bigger problem anyway...in my kernel module the open() function is not recognized, it gives me "implicit declaration"!
My include part is:

#include <linux/module.h>
#include <linux/unistd.h>
#include <asm/io.h>
#include <asm/fcntl.h>
#define SERIAL_PORT "/dev/ttyACM0"

while the error is in this line:

void myfun(void){
  int fd = open(SERIAL_PORT,O_RDONLY | O_NOCTTY);
  ..reading...

can you help me to solve this?