Sponsored Content
Top Forums Programming Wrong data with Read from a serial port. Post 302731971 by enaud on Friday 16th of November 2012 08:03:13 AM
Old 11-16-2012
Quote:
Originally Posted by Corona688
Have you checked the return value on those calls yet?

If you set up read timeouts on the serial device, read() will timeout by itself.

I've checked all system call in open function and i dont have errors!

Now how modified read function?

thanks

Last edited by enaud; 11-16-2012 at 09:46 AM..
 

9 More Discussions You Might Find Interesting

1. Linux

Urgent - serial port

Hi All, I am a begineer in Linux, I have 4 ports and 3 are operational port 1,port 2 and port 4 (when I plug in serial device I can see it working) but port 3 seems it is not working. I am sure the hardware is fine. when I give command dmesg | grep tty I get, serial 8250:ttyS0 at... (0 Replies)
Discussion started by: vr_82
0 Replies

2. SCO

data transfer from serial port

dear sir, pls. can you help me ? , my os is unix sco 5.0.4 and ,server dat derive (1,4gb) not working, now i want to transfer my server data in other machine (unix/other possible) by serial port/other port comminication. thanks pankaj raval (2 Replies)
Discussion started by: pankajbraval
2 Replies

3. Programming

Problem with read data from serial device

I have problem with C programming. I want to send & receive data through serial communication. I send data(command) to device to get data from device but when receive data, it can't get altogether of data. It get only some data. What should I do to get altogether of data? If all of... (7 Replies)
Discussion started by: noppon_s
7 Replies

4. Shell Programming and Scripting

Need help with serial port

Hi, I have a external board connected to my serial port. I need to execute "shutdown -r now" command when system boot up. When system boots up it requires a username ans password. Then I need to run my command. I can use rc script but that is rebooting system before it asks for username and... (0 Replies)
Discussion started by: charlie.arya
0 Replies

5. Solaris

How to enable Serial port on ILOM, when Network Port is enabled in parallel

Hi Everyone, In my environment, I have few T5220. On the iLOM Management Card, I have both Network and Serial port are cabled, I don't have any issues while I try to connect using Network Management port, but when I try to connect the serial port for the same server which is actually connected... (3 Replies)
Discussion started by: bobby320
3 Replies

6. Programming

unable to send read and write serial port

hey frns pls help me out !! i hav a code of c that i have to include in my project. i am using a device (geomeda) that has unix based OS. it also support SIM card for connecting to server . I need to send SMS to user from this device.. below code is not working .. i am unable to send sms and the... (7 Replies)
Discussion started by: yashwantkumar
7 Replies

7. Programming

Read from serial port

Hi I try to communicate with a GSM modem, from C, for sending SMS. I use standart AT-commands. Working well with terminal. There is no problem writing ti the port. But when I try to read I only get a echo, I write "ATI" and get "ATI" back, I should get somthing like "SIEMENS 35... (4 Replies)
Discussion started by: dmiller
4 Replies

8. Debian

Reading data from a serial port

Dear List - I am trying to capture data from a serial port and write it to a file. /var/www$ cat /dev/ttyS0 > scale_value.html cat: /dev/ttyS0: Device or resource busy /var/www# cat /proc/tty/driver/serial serinfo:1.0 driver revision: 0: uart:16550A port:000003F8 irq:4 tx:90... (11 Replies)
Discussion started by: Meow613
11 Replies

9. Solaris

Cabling and adapters to communicate to service processor serial port from Windows PC with USB port.

Hello, I have an unloaded T5140 machine and want to access the ILOM for the first time and subsequently the network port after that., and then load Solaris 10 the final January 2011 build. The first part is what confuses me -the cabling. I am coming from a Windows machine (w/appropriate... (5 Replies)
Discussion started by: joboy
5 Replies
pthread_rwlock_timedrdlock(3C)				   Standard C Library Functions 			    pthread_rwlock_timedrdlock(3C)

NAME
pthread_rwlock_timedrdlock, pthread_rwlock_reltimedrdlock_np - lock a read-write lock for reading SYNOPSIS
cc -mt [ flag... ] file... [ library... ] #include <pthread.h> #include <time.h> int pthread_rwlock_timedrdlock(pthread_rwlock_t *restrict rwlock, const struct timespec *restrict abs_timeout); int pthread_rwlock_reltimedrdlock_np(pthread_rwlock_t *restrict rwlock, const struct timespec *restrict rel_timeout); DESCRIPTION
The pthread_rwlock_timedrdlock() function applies a read lock to the read-write lock referenced by rwlock as in the pthread_rwlock_rdlock(3C) function. If the lock cannot be acquired without waiting for other threads to unlock the lock, this wait will be terminated when the specified timeout expires. The timeout expires when the absolute time specified by abs_timeout passes, as measured by the CLOCK_REALTIME clock (that is, when the value of that clock equals or exceeds abs_timeout), or if the absolute time specified by abs_timeout has already been passed at the time of the call. The pthread_rwlock_reltimedrdlock_np() function is identical to the pthread_rwlock_timedrdlock() function, except that the timeout is spec- ified as a relative time interval. The timeout expires when the time interval specified by rel_timeout passes, as measured by the CLOCK_REALTIME clock, or if the time interval specified by rel_timeout is negative at the time of the call. The resolution of the timeout is the resolution of the CLOCK_REALTIME clock. The timespec data type is defined in the <time.h> header. Under no circumstances does either function fail with a timeout if the lock can be acquired immediately. The validity of the timeout param- eter need not be checked if the lock can be immediately acquired. If a signal that causes a signal handler to be executed is delivered to a thread blocked on a read-write lock with a call to pthread_rwlock_timedrdlock() or pthread_rwlock_reltimedrdlock_np(), upon return from the signal handler the thread resumes waiting for the lock as if it was not interrupted. The calling thread might deadlock if at the time the call is made it holds a write lock on rwlock. The results are undefined if this function is called with an uninitialized read-write lock. RETURN VALUES
The pthread_rwlock_timedrdlock() and pthread_rwlock_reltimedrdlock_np() functions return 0 if the lock for reading on the read-write lock object referenced by rwlock is acquired. Otherwise, an error number is returned to indicate the error. ERRORS
The pthread_rwlock_timedrdlock() and and pthread_rwlock_reltimedrdlock_np() functions will fail if: ETIMEDOUT The lock could not be acquired before the specified timeout expired. The pthread_rwlock_timedrdlock() and pthread_rwlock_reltimedrdlock_np() functions may fail if: EAGAIN The read lock could not be acquired because the maximum number of read locks for lock would be exceeded. EDEADLK The calling thread already holds a write lock on rwlock. EINVAL The value specified by rwlock does not refer to an initialized read-write lock object, or the timeout nanosecond value is less than zero or greater than or equal to 1 000 million. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Interface Stability |See below. | +-----------------------------+-----------------------------+ |MT-Level |MT-Safe | +-----------------------------+-----------------------------+ The pthread_rwlock_timedrdlock() function is Standard. The pthread_rwlock_reltimedrdlock_np() is Stable. SEE ALSO
pthread_rwlock_destroy(3C), pthread_rwlock_rdlock(3C), pthread_rwlock_timedwrlock(3C), pthread_rwlock_trywrlock(3C), pthread_rwlock_unlock(3C), pthread_rwlock_wrlock(3C), attributes(5), standards(5) SunOS 5.10 30 Jan 2004 pthread_rwlock_timedrdlock(3C)
All times are GMT -4. The time now is 07:33 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy