programing to read USB-GPS for SBC2440-IV Single Board Computer

OP (Company: MEMSLAB) #1501446
I have an USB-GPS receiver (Haicom 204E) and a SBC2440-IV Single Board
Computer. I have written a C program to read my GPS receiver on Unbutu
8.10 for testing. It has worked well. On my PC, I have created a file
asserted for usb port by using command " $ sudo mknod /dev/ttyUSB0 c 188
0". so I"ve treated my device as a file named "/dev/ttyUSB0".

However, on SBC2440-IV Single Board Computer, when I plug the GPS 
receiver
in the USB host port1, I see a message on the terminal: 
"[root@arm-linux]#
usb 1-1: new full speed USB device using s3c2410-ohci and address 2". 
then
I create /dev/ttyUSB0 file by using command "$ mknod /dev/ttyUSB0 c 188
0". I see a file "ttyUSB0" in root/dev folder, but I can"t open it like 
the
way on Unbutu. It"s seem to be that /dev/ttyUSB0 is not asserted for the 
USB host1.

Could someone help me to read the GPS receiver on SBC2440-IV Single 
Board
Computer?
this is my C code to read the file.
/*********************************************************************** 
*********
*****/
int main(void)

{

int status,n;

char *port = "/dev/ttyUSB0";

printf("GPS receiver\n");

open_port (port);

configure_port(1);
pthread_create(&GPS_READ_ID, NULL, GPSreceiver, 0);
pthread_create(&GPS_SHOW_ID, NULL, GPSshow, 0);


while(1){

}

/* close the device file */

close(GPS_handle);

}



void open_port(char *port)

{

/* open the serial port device file

* O_NDELAY - tells port to operate and ignore the DCD line

* O_NOCTTY - this process is not to become the controlling

* process for the port. The driver will not send

* this process signals due to keyboard aborts, etc.

* O_NONBLOCK- tells port to be nonblocking (read will return immediatly)

*/

GPS_handle = open(port, O_RDWR | O_NDELAY | O_NOCTTY | O_NONBLOCK);

if (GPS_handle == -1)

{

perror("open_port: Unable to open");

exit(1);

}

else

tcgetattr(GPS_handle, &tio);

fcntl(GPS_handle, F_SETOWN, getpid());

fcntl(GPS_handle, F_SETFL, FASYNC);
//////////////////////////////////////////////////////////////////////// 
//////////////////////////////////////////////////////////////////////// 
/
USB GPS Haicom204E is a device which has USB output port; baud-rate 
4800,8,N,1;
NMEA108 standard.
My problem is that I don"t know how to make the file asserted for USB 
hostport1 of
SBC2440-IV Single Board Computer.

Reply

A question of your own? This thread is over 16 years old. Ask it in a thread of its own – more people read along there, and it gets answered more often and sooner.

Start a new thread

A fix, an addition or feedback on this thread? Then reply here.

Formatting
  • [c]C-Code[/c]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]
  • [[Title]] – link to an article
  • Link to another post: right-click its post ID (#8078628), copy the address, paste it into the text

More about formatting

Post long source code as an attachment, not in the text.

Already registered? Log in

Not shown to anyone. We send you a link; your post appears once you confirm it there.

By submitting you create a free account and accept the terms of use.