![]() |
|
#1
|
|||
|
|||
PortsI was wondering if it was possible and how to open and close ports using C.
thankyou |
|
#2
|
||||
|
||||
|
Quote:
Welcome Roger. Ports are pretty specific to your operating system and environment. What operating system are you using? (I assume this is PC hardware) Also, are you talking serail ports or parallel ports? Also, what do you want to do once they are open? Under *nix, serial port communication is pretty straight forward and I can help you with that. Under Windows, I may not be able to help you much there. I am pretty unfamiliar with the (*complicated* ) windows API. |
|
#3
|
|||
|
|||
|
It would be under linux as windows is <insert derogatory comment>.
Any help is much appreciated Thanks Roger ![]() |
|
#4
|
||||
|
||||
|
Good. (I am also assuming serial ports...)
Ports in linux are pretty easy because of the dev filesystem. Opening a port can be done just like opening a file: CPP / C++ / C Code:
and closing a port is as simple as CPP / C++ / C Code:
The part in between is the tricky part ![]() This link provides some great information on posix serial ports and how to use them. HTH, d |
|
#5
|
|||
|
|||
|
Ah sorry I should of made myself a little more clear i meant tcp and udp
Thanks |
|
#6
|
||||
|
||||
|
Okay. Did you find anything yet. I am currently working on a project where I am using ports. I adapted some code from UNIX, Network Programming with TCP/IP by Alan Dix. Here is the header from my library.
CPP / C++ / C Code:
I can upload this library and my implementation testing files if it would help. |
Recent GIDBlog
Toyota - 2008 November Promotion by Nihal
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The