0

I have a problem when using the serial port as GPS function on Android OS. There are no available serial ports except for the one being used for the console. So how can I configure the console serial port as a normal serial port at runtime, not by the recompiling the kernel with make menuconfig?

Benjamin Leinweber
  • 2,774
  • 1
  • 24
  • 41
  • Not sure if you can complete do that, but would stopping console-related messages be enough? You can try `echo "0" > /proc/sys/kernel/printk` or see http://stackoverflow.com/questions/16829746/how-to-switch-linux-kernel-console-after-boot-process – Chris Stratton Sep 25 '13 at 21:45
  • 1
    thanks,it's very helpful.but i see another solve method via remap the console like below. i try that in own platform,and the result is fail with error open /dev/tty1 /dev/tty0.fp = open("/dev/tty1",O_RDONLY); ioctl(fp,TIOCCONS); close(fp); fp = open("/dev/tts/0",O_RDWR|O_NOCTTY|O_NDELAY); if(fp == -1) exit(0); tcgetattr(fp,&options); cfsetispeed(&options,B115200); cfsetospeed(&options,B115200); options.c_cflag |= (CLOCAL|CREAD); tcsetattr(fp,TCSANOW,&options); write(fp,"hello world!\n123",15); close(fp); fp = open("/dev/tty0",O_RDONLY); ioctl(fp,TIOCCONS); close(fp); – user2684543 Sep 26 '13 at 08:08

0 Answers0