Sponsored Content
Top Forums Programming Problem with read data from serial device Post 302395996 by noppon_s on Wednesday 17th of February 2010 12:00:21 PM
Old 02-17-2010
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 you have the solution. Please advice me.
Many thanks.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

serial port device path

hi. Im trying to install a switch. And the manual says i should type a command including a SerialPortDevicePath. which is the filepath to serial port used for connection. However.. nothing about how to find this info. Could anyone help me where to find this path? thx mr.T (6 Replies)
Discussion started by: tyskertøs
6 Replies

2. Programming

Accessing device with Prolific USB-serial controller.

I am trying to access DG-100 gps logger on Mac OS X with POSIX API. The device uses a Prolific usb-serial controller, and connect to the usb port on my mac. After I install the Prolific driver, it shows up as /dev/tty.usbserial and /dev/cu.usbserial. The vendor has published the data format. So... (1 Reply)
Discussion started by: monkeybiz
1 Replies

3. Linux

Device serial number

Hey! I'm trying to figure out a sollution for a problem I have at my company with an Iomega MiniMax 500 GB USB disk. If i run cat /proc/bus/usb/devices I get this information: T: Bus=01 Lev=02 Prnt=04 Port=00 Cnt=01 Dev#= 5 Spd=480 MxCh= 0 D: Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00... (2 Replies)
Discussion started by: noratx
2 Replies

4. Ubuntu

Ubuntu 9.04 Serial application to telnet to serial device

Hello! I am working on an application which reads environmental instruments which have serial ports. The application requires a serial port to be present to talk to the device (i.e. /dev/ttyS0 ). In some instances the environmental devices will be 100's of yards away from the computer, so a... (5 Replies)
Discussion started by: mvona
5 Replies

5. Shell Programming and Scripting

problem to read data in array

My input is a long list of data start with "#": #read_1 123456898787987 #read_2 54645646540646406 #read_3 4654564654316 . . I got a bit confusing about how to set all in an array first. And then when I run a program name "statistic_program", it will read the array in scalar and do... (24 Replies)
Discussion started by: patrick87
24 Replies

6. AIX

Tape drive problem - no process to read data written to a pipe

Hi Everyone, The machine I'm working on is an AIX 5.3 LPAR running on a P650. oslevel -r shows 5300-08. I'm trying to take a backup to a SCSI tape drive, which has been working up until this point. I know of nothing that has changed recently to cause this problem. But when I try to take a... (0 Replies)
Discussion started by: need2bageek
0 Replies

7. SCO

Modifying serial printers device

I am trying to change one of my serial printers from /dev/ttyr002 to /dev/ttyr014: lpstat -s device for check3: /dev/ttyr002 device for check4: /dev/ttyr002 I changed the tty setting for check3 in: /etc/printcap /var/spool/lp/admins/lp/printers/check3 to /dev/ttyr014 Then I get:... (4 Replies)
Discussion started by: herot
4 Replies

8. Programming

Wrong data with Read from a serial port.

hi, I've a problem on my C/C++ program with Posix Library. I have to read data from the serial but I have incorrect data, in fact I get a bunch of zeros: "2953.3174, 2785.2126, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0 , 0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ,... (24 Replies)
Discussion started by: enaud
24 Replies

9. 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

10. Shell Programming and Scripting

Read line from serial device with BASH

I'm new to Linux (Ubuntu 16.04), and very new to BASH scripting. I have a Numato 8-channel USB GPIO device, which is a DAQ that appears in the system as a serial port. In Linux it appears as ttyACM0. I can easily manipulate a GPO with, for example: echo "gpio set 7" > /dev/ttyACM0 ...followed... (12 Replies)
Discussion started by: Chalk-X
12 Replies
SNOOPER(1)						    BSD General Commands Manual 						SNOOPER(1)

NAME
snooper -- a utility for capturing data flowing between serial devices SYNOPSIS
snooper [-h] snooper [-b baudrate] [-t] [-u] [-x] [-n] port0 port1 DESCRIPTION
snooper passes data transparently between two serial (RS232C) devices, capturing and logging the data and occasional comments you want to insert into the logs. It is useful for debugging or analyzing the communications protocol between two devices that would normally be connected directly to each other, e.g. a digital camera and a personal computer. By sitting in the middle (after you connect the two devices to serial ports on your Linux machine) snooper is able to capture data traveling in either direction while also passing it unmodified to the other device. It is also possible to operate with a single serial device, using your console and keyboard as the second device. OPTIONS
-b baudrate Specify baudrate to use. Default baudrate is 9600. -t Include current time (in microseconds) with each write to the textual log file. See L under KEYBOARD COMMANDS, below. -u Do not perform serial device locking. (This option is discouraged, and should never be necessary on a properly-configured Debian system.) -x Hex display only. (Even printable characters will be displayed in hex.) -n Do not forward traffic between the two ports; useful when you have a splitter cable. -h Help; presents a brief synopsis of the command line options. KEYBOARD COMMANDS
snooper has a set of commands that act similar to those of vi. Note that the characters transmitted into the serial ports will not be forwarded while snooper is in command parameter input mode. You should therefore set the log file and so forth while the serial line has no activity. L Switch textual log file. You'll be asked to answer the filename of the log file. B Switch binary log file. You'll asked to answer which device to log, and the log file name. Please note that the binary log will contain the input from the perspective of snooper. Therefore, if you would like to make a log of input of line 0 (thus the output from device connected to line 0), you shold specify line 0. You should use a file that is local, or on a virtual disk, so that no characters will be lost. m add a memo line to the text log file. The memo line will contain a timestamp and the text you provide. Q Quit. c Reset the counter. b Change the baudrate. C Make the console act as one of the serial lines. ESC Go back to command mode. ^V Quote the next char (so that you can send ESC, for example). ^X input a byte by its 2-character hexadecimal value (so that you can send any character you like). By tapping any other key, that character will be sent to the line. ^L Repaint the screen. An unrecognized command character will present a brief list of the valid command characters. EXAMPLE
snooper /dev/ttyS0 /dev/ttyS1 AUTHOR
Jun-ichiro Itoh <itojun@itojun.org> This man page was written by David Coe <davidc@debian.org> for the Debian project, and may be used by others under the terms of the GNU Gen- eral Purpose License, version 2 or later. Debian Januray 20, 2002 Debian
All times are GMT -4. The time now is 09:40 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy