473,395 Members | 1,696 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

I need help with C for Linux

I have a program write in VB and I need to convert the code to C for Linux.
Well, I began to do that but I have some problems ...

- How can I write te code in C to comunicate with the serial port?

I hope someone could help me!

Thks

JP
Nov 13 '05 #1
4 2244
In article <1b**************************@posting.google.com >, Joćo Pires wrote:
I have a program write in VB and I need to convert the code to C for Linux.
Well, I began to do that but I have some problems ...

- How can I write te code in C to comunicate with the serial port?


See the FAQ at

http://www.eskimo.com/~scs/C-faq/q19.7.html

Then take your question to one of the Linux programming groups.
--
Andreas Kähäri
Nov 13 '05 #2
Joćo Pires wrote:
I have a program write in VB and I need to convert the code to C for Linux.
Well, I began to do that but I have some problems ...

- How can I write te code in C to comunicate with the serial port?

I hope someone could help me!


Communicating with a serial port often requires knowledge of how to handle
OS- or hardware-specific characteristics. The C language itself deals only
with logical streams which can be handled with the <stdio.h> functions. It
is possible that your implementation supplies a layer allowing you to
handle these ports as FILE*'s, but that's hardly guaranteed and would be
non-portable.

More often, these things are handled via non-standard libraries, which may
be supplied with your implementation or by third parties.

In any case, they would not be topical here, since there is nothing in the
C standard that can be appealed to for us to decide what ought to be
happening. If your goal includes maximizing where such programs could be
run, it may be best to look for a library with BSD-functionality. Not only
would these generally be portable to Unix-like systems, but such libraries
exist for Windows (or just DOS) and Mac platforms. Discussion of problems
with them belongs, of course, somewhere other than comp.lang.c.

--
Martin Ambuhl

Nov 13 '05 #3
Jo?o Pires <jp****@lip.pt> wrote:
I have a program write in VB and I need to convert the code to C for Linux.
Well, I began to do that but I have some problems ...

- How can I write te code in C to comunicate with the serial port?


This is actually a Linux programming question rather than a C
programming question (there's no standard "C way" to access the serial
ports, but there are standard "Linux ways" that work in lots of
languages on Linux). So ask away in comp.os.linux.development.apps.

- Kevin.

Nov 13 '05 #4

"Andreas Kahari" <ak*******@freeshell.org> wrote in message
news:sl**********************@vinland.freeshell.or g...
In article <1b**************************@posting.google.com >, Joćo Pires

wrote:
I have a program write in VB and I need to convert the code to C for Linux. Well, I began to do that but I have some problems ...

- How can I write te code in C to comunicate with the serial port?


See the FAQ at

http://www.eskimo.com/~scs/C-faq/q19.7.html

Then take your question to one of the Linux programming groups.


Better yet, after reading the FAQ, do some Google searches on serial
programming in Linux. You'll find more then enough on the subject to get
you started.

Nov 13 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

383
by: John Bailo | last post by:
The war of the OSes was won a long time ago. Unix has always been, and will continue to be, the Server OS in the form of Linux. Microsoft struggled mightily to win that battle -- creating a...
5
by: mr.iali | last post by:
Hi Everyone I would like to get into software developent using a programming language like c++, java or pl/sql for oracle. I have no idea where to start from. Which language is there more...
28
by: Jed | last post by:
Hello to all! I have a couple of projects I intend starting on, and was wondering if someone here could make a suggestion for a good compiler and development environment. My goals are as...
2
by: O.R.Senthil Kumaran | last post by:
Hi list: Following is a piece of code: main(int argc, char** argv) { int rc, result; struct passwd *uidpwent; /* init resources */
8
by: john | last post by:
To test a new piece of software designed to help with (among other things) eCommerce WWW site development. The software is fairly easy to use but you must fit a profile. Retail price is 120 GBP and...
17
by: Nirjhar Oberoi | last post by:
Hi, I am new to Linux and wanted to know how to use GCC to Compile the Code written in C? I dont want to use EMacs or VI for my editor. Can you suggest a good IDE for linux for C Programming.. ...
7
by: elgiei | last post by:
Good morning at all, i have to implement a server,that every n-seconds (eg. 10sec) sends to other clients,which files and directory has been deleted or modified. i build a n-tree, for each...
1
by: crabbie_upk | last post by:
Hi, Need help in tuning JAVA on LINUX. From http://www.trutek.com/index.php?id=173 I understand that on Linux operating system with 4GB memory, JVM can be run with maximum memory of 3800m. But...
6
by: ansh | last post by:
Hi Guys, I am working with the porting of librpc from BSD to Linux, below is the code snippet from the librpc(BSD) -------------------------------- sfd = open(fbuf, O_WRONLY | O_NONBLOCK);...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.