Sponsored Content
Top Forums Programming How to read the CTS and DSR of RS232 in Unix using C language? Post 44357 by Swing5 on Thursday 4th of December 2003 06:18:10 PM
Old 12-04-2003
How to read the CTS and DSR of RS232 in Unix using C language?

Hello to all Gurus out there,
Could you show me a source code in Unix platform using C language. I want to read the status or voltage level of the DSR and CTS.

Thanks a lot,

Swing5
 

10 More Discussions You Might Find Interesting

1. Programming

RS232 communication optimisation

Need help for RS232 communication with switches in order to optimise the data traffic. How to manipulate different flags in termios struct to do the same? (1 Reply)
Discussion started by: ManishSaxena
1 Replies

2. UNIX for Advanced & Expert Users

VNC via Rs232

Hi ! Is there somebody who is able to connect a VNC session via serial cable ? There is a hint on the VNC homepage that it is possible to configure that. But how? thanks joerg (2 Replies)
Discussion started by: joerg
2 Replies

3. Solaris

rs232 pci-card

hello mates, do you know a manufactor for rs232 serial pci cards for the sparc architecture? it seems that there is no original product from sun for that purpose. strange, isn't it? problem is that i have a V250 with only one db9 rs232 serial port, and i need it for a modem connection, but i also... (1 Reply)
Discussion started by: pressy
1 Replies

4. Programming

How to set the DSR pin using a C Code

Hi, I am a newbie using linux. I want to use the 9 pins of the COM port for data transmission. I am trying to write a code to toggle the DTR pin in /dev/ttyS0. Can any one help by giving a sample code or links that will help me pick up fast Regards (2 Replies)
Discussion started by: Srikanthks_2000
2 Replies

5. UNIX for Dummies Questions & Answers

Can A File Be Copied to an RS232 Port on Unix?

We have a text/csv file (4mb) sitting on a Unix box. The PC belongs to a retail store and they're asking me to bring the file over to Windows so they can import the file. Can a file be copied to an rs232 port? If so how? The idea is that I'll hook up a null modem cable to the Unix com port,... (2 Replies)
Discussion started by: alivebyscience
2 Replies

6. Programming

Help to filter read through reference file by using c language

Input_file #tmp_2 werweraewghe @tmp_2 123sdfs57a #tmp_1 aewrgheheghe @tmp_1 457awrerfa87 #tmp_4 trtyrghe @tmp_4 8898rtyr2 reference_file #tmp_4 #tmp_1 (14 Replies)
Discussion started by: cpp_beginner
14 Replies

7. Programming

regarding adding fields to DSR protocol in ns2.34

hi i am student doing project in ns2.34. i hav to add field in route cache and packet of DSR routing protocol. which files hv to be changed...pl help me (1 Reply)
Discussion started by: khubalkar
1 Replies

8. Homework & Coursework Questions

regarding adding fields to DSR protocol in ns2.34

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: want to add field to route cache and packet of DSR routing protocol in ns2.34, add field, DSR package in ns2.34... (2 Replies)
Discussion started by: khubalkar
2 Replies

9. IP Networking

How to configure RHEL6 to support Aleton 4408 in DSR mode?

Dears How to configure RHEL6 to support Aleton 4408 in DSR(Direct Server Return) mode We have config Aleton 4408 + Windows 2008R2 then Windows set loopback interface with VIP. the exec the following command in CMD netsh interface ipv4 set interface "net" weakhostreceive=enabled netsh... (0 Replies)
Discussion started by: nnnnnnine
0 Replies

10. IP Networking

Source IP address field in RREP on DSR routing

Hello I have a question about routing in MANET using Dynamic Source Routing protocol. IN RFC4728 (DSR) in section "IP fields" of RREP (Route Reply) packet we have this: ok. I read in several books and also in rfc4728 that: when a source node (node that initiate route discovery process)... (1 Reply)
Discussion started by: acu281
1 Replies
RADIOCLKD(1)						   Network Time Protocol Daemon 					      RADIOCLKD(1)

NAME
radioclkd - decode time from radio clock(s) attached to serial port SYNOPSIS
radioclkd [ -tphv ] device DESCRIPTION
radioclkd is a simple daemon that decodes the time from a radio clock device attached to the DCD and/or CTS and/or DSR status lines of serial port of a computer. It is able to decode the DCF77, MSF and WWVB time signals. The received time is then sent to ntpd using the shared memory reference clock driver. The type of time signal being received is automatically determined. If you have problems getting the program to work using interrupts, the following command is known to help in many instances. If this fails you can always fall back to the polling method. stty crtscts < /dev/ttyS0 Details on a cheap and easy to make device for receiving these time signals can be found at http://www.buzzard.org.uk/jonathan/radioclock.html OPTIONS
-p, --poll Poll the serial port for changes of status in the DCD, CTS and DSR lines rather than use interrupts -t, --test Enter test mode printing the length of each pulse and the decoded time at the end of each minute on stdout. The time is not sent to ntpd using the shared memory reference clock driver in this mode. -h, --help Print a short synopsis of the command line arguments. -v, --version Print the version number and then exit. CONFIGURATION
Configuration is very simple. Use server 127.127.28.0 in your ntp.conf file for a clock attached to the DCD line, server 127.127.28.1 for a clock attached to the CTS line, and server 127.127.28.2 for a clock attached to the DSR line. You will also want to use a fudge line on the server to change the displayed refid. CALIBRATION
Due to delays in the propogation of the radio signal, it's processing by the receiver board and the latency of the operating system the time decoded by the receiver will be slightly offset from actual UTC. Typically this delay will be less than 20ms, so unless you are very fussy about the time, or are using more than one time source, such as a GPS unit, other radio clock or NTP server on the internet you can ignore this section. The basics of the calibration procedure is to determine the average offset of the radio receiver, and use the time1 fudge factor in ntp.conf to bring the receiver as close as possible to the real time. The easiest way of determining the offset of the radio receivers time is to run it against a reference clock that does not suffer from these problems. The best reference clock would be a GPS unit. This might be a GPS unit that you don't wish to dedicate to time keeping, or a borrowed unit. If this is not possible you could use a stratum 1 server on the internet. The method of calibration is quite simple. We attach the calibration reference clock to the computer and fudge the stratum of our radio receiver up to say 5. This way we can be sure that ntpd will lock onto the calibration reference clock. We need to make sure that ntpd is configured to collect peer statistics so make sure we have some lines similar to these in ntp.conf statsdir /var/log/ntpstats/ statistics loopstats peerstats clockstats filegen peerstats file peerstats type day enable After that we restart ntpd and leave it running for several hours. We can then make a copy the peerstats file. The trick is to remove all the entries before ntpd has come into close aggrement with the calibration reference clock and then run the peer.awk script in the scripts/stats directory of the ntp distribution. This will give us a mean offset of our radio receivers in milliseconds. This can them be converted into seconds and added to the fudge line in ntp.conf for our receiver. The final step is to remove the change in stratum level for our reference clock and restart ntpd. If you move the receiver any significant distance then you will need to repeat this calibration step. Across the room or around the current building will be fine, but if you move it to the next town/city then you will need to recalibrate. IN USE
The version of ntpd that comes with most Linux distributions does not have the shared memory reference clock driver compiled in by default. This can be identified by checking the logs after ntpd is started. If the shared memory reference clock driver is not compiled in then the logs will contain warnings about the reference clock driver not being recognized. To compile ntpd with the shared memory reference clock driver you must specify the --enable-SHM option when running configure. Neither radioclkd or ntpd ever mark the shared memory segment for deletion. If you stop using the shared memory reference clock driver therefore any shared memory segments will persist until you reboot or manually delete the segment using ipcrm. The segments can be identi- fied as the one with key 0x4e545030, 0x4e545031 or 0x4e545032 using the ipcs command. BUGS
If you are running a kernel with the PPS kit and have a clock attached to the DCD line you may experience lockups. If you encounter this problem the currently recomended solution is to move the clock to either the CTS or DSR lines. AUTHOR
This program was written by Jonathan Buzzard <jonathan@buzzard.org.uk> and may be freely distributed under the terms of the GNU General Public License. There is ABSOLUTELY NO WARRANTY for this program. Version 1.0 19 Jan 2003 RADIOCLKD(1)
All times are GMT -4. The time now is 04:02 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy