LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   I need some win32 API alternatives in linux please?! (https://www.linuxquestions.org/questions/programming-9/i-need-some-win32-api-alternatives-in-linux-please-816761/)

jeremy28 06-28-2010 04:25 AM

I need some win32 API alternatives in linux please?!
 
Hi all,

I'm porting a Win32 program into linux.
The program's name is "Serial Wrapper" that is intended to open a handle to a device in COM port and read or write some data to it by functions and structures such:

DCB
CreateFile
GetCommState
SetCommState
SetCommMask
WriteFile
ReadFile
SetCommTimeouts
...

but I have problem in replacing them by the appropriate alternatives in linux, because I'm new to linux APIs!

I've searched and found that the related header files are "sys/select.h" and " termios.h", I saw them but they didn't help me so much!!

Please share your experiences with me in this issue...

TIA.

Sergei Steshenko 06-28-2010 04:29 AM

Quote:

Originally Posted by jeremy28 (Post 4016990)
Hi all,

I'm porting a Win32 program into linux.
The program's name is "Serial Wrapper" that is intended to open a handle to a device in COM port and read or write some data to it by functions and structures such:

DCB
CreateFile
GetCommState
SetCommState
SetCommMask
WriteFile
ReadFile
SetCommTimeouts
...

but I have problem in replacing them by the appropriate alternatives in linux, because I'm new to linux APIs!

I've searched and found that the related header files are "sys/select.h" and " termios.h", I saw them but they didn't help me so much!!

Please share your experiences with me in this issue...

TIA.

Start from here: http://en.wikipedia.org/wiki/C_standard_library . You will need stdio.h.

jeremy28 06-28-2010 05:10 AM

Hi and thanks for the reply!

I saw that wiki, but unfortunately it didn't help me!

What did you mean exactly of introducing that please?

THX.

Sergei Steshenko 06-28-2010 05:20 AM

Quote:

Originally Posted by jeremy28 (Post 4017016)
Hi and thanks for the reply!

I saw that wiki, but unfortunately it didn't help me!

What did you mean exactly of introducing that please?

THX.

What ? You didn't find any file related functions in the Wiki article on stdio.h ? I.e. you didn't find anything related to file creation, reading, writing ?

Sergei Steshenko 06-28-2010 05:28 AM

You know what, I'll formalize my questions - please answer all of them according to their grammatical form, i.e. with YES or NO:
  1. Did I give an exact link to the Wiki article on "C" standard library ?
  2. Did I say you would need stdio.h ?
  3. Does the Wiki article on "C" standard library contain the "stdio.h" string ?
  4. Is there in the Wiki article on "C" standard library a link to another Wiki page, the visible name of the link being "stdio.h" ?
  5. Does that second Wiki page on "stdio.h" contain names of file creation, read and write functions among others ?

Sergei Steshenko 06-28-2010 05:55 AM

Also, try

linux serial port

in Yahoo - second link, PDF file.

Sergei Steshenko 06-28-2010 05:58 AM

And if you enter

linux windows serial port

into Yahoo, the match becomes the first one.

PTrenholme 06-28-2010 08:32 AM

Quote:

Originally Posted by Sergei Steshenko (Post 4017055)
And if you enter

linux windows serial port

into Yahoo, the match becomes the first one.

Works quite well in Google too.

gbaxtin 06-28-2010 04:02 PM

yeah man google linux serial port. lots of good info.


All times are GMT -5. The time now is 04:35 PM.