Sponsored Content
Top Forums Programming how to write application for 32 com port Post 302129483 by amitpansuria on Tuesday 31st of July 2007 07:19:36 AM
Old 07-31-2007
how to write application for 32 com port

Dear Sir,
i m going to use NP5610-16 moxa device for multiport serial communication.
i m using fedora-core 6 o.s.
after installation it will detect serial ports as /dev/ttyr0,/dev/ttyr1...ttyr32.
there are total 32 com ports.
now i want to write application which monitor all serial ports and received data from particular serial ports.
after that it send data on particular port.
its ok i understand this concept.
but i confuse that what programming approach i have to use to monitor multiport serial ports.
i have to fire 32 diff threads for each port or what
tell me how i write application such that it is easy to control all 32 com port
plz help me to sort out this issue
please also guide me that which is the best approach i have to use for this
Regards,
Amit
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

which port to write my server application?

I want to write a server application that would accept HTTP requests from client. The server would be on a machine that has no connection to the INTERNET. The clients that would be posting their HTTP requests would be doing so through webbrowser .Thus it would be sort of intranet application.... (0 Replies)
Discussion started by: rraajjiibb
0 Replies

2. IP Networking

How can I check what port addresses used the application

Hello Mentors! I am a new here in the furom, i hope somebody can understand my problem. Basically we have an application here called unigraphics and being installed per station and the setup is look like this. 1. installed unigraphics UGNX3 version on every station 2. some are installed in... (1 Reply)
Discussion started by: eykyn17
1 Replies

3. UNIX for Dummies Questions & Answers

What application is using the port

Hello im using sunos im trying to lock down application that taking my port when Im doing "netstat -in | grep 8080" Is gives me the indication that the port is taken but no indication who is taken the port. How can I find out who is taking my port? Thanks allot (7 Replies)
Discussion started by: umen
7 Replies

4. Linux

MQ application port 1414

Hi All, I have two MQ (port) 1414 established (going out) $ netstat -an | grep 1414 tcp 0 0 0.0.0.0:1414 0.0.0.0:* LISTEN tcp 0 0 20.76.1.1:32855 142.8.1.3:1414 ESTABLISHED tcp 0 0... (2 Replies)
Discussion started by: itik
2 Replies

5. Shell Programming and Scripting

command to know the application running of the port

Hi, is there any command to findout that which application is using the particular port. or whether any port is occupied with the specfic process id ? (4 Replies)
Discussion started by: mail2sant
4 Replies

6. Programming

Write own decryption application

Hi , I need some help as I dont know where to start. I need to create a unix decryption application. The information I have been given is this so far: the specification of the encryption process is: NET 2 Cryptography classes. RijndaelManaged encryption algorithm ... (13 Replies)
Discussion started by: caciing_help
13 Replies

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

8. HP-UX

how to check remote server port listening from application.

Hi, I have an application running on HP-UX, from this application I need to findout if the port number. lets say 7890,7891, 7892 are listening on the remote server running on HP-UX. Is there any way of doing it using "system()" function or any other? I noticed that nmap, netcat are not... (0 Replies)
Discussion started by: einsteinBrain
0 Replies

9. UNIX for Advanced & Expert Users

How to write if condition in shell script for application server?

Hi all, I have a code to create folder in application server through shell script and i want to create if conditional based folder folder=$HOME/test/sample/whatever if ; then echo "$folder already exists, not created." else mkdir -p "$folder" > /dev/null 2>&1 ... (7 Replies)
Discussion started by: Boost
7 Replies

10. Shell Programming and Scripting

Help Generate new port base on the last port but not in used by other application

Hi Expert, Anybody can figure it out on how to generate new port base on my last port let say my last port var1=124 and increment for new port 125,126 but this new two ports need to look at first if this port is not in used by any service, if the port is in used add 1 to new port and if in used... (6 Replies)
Discussion started by: lxdorney
6 Replies
ports(1M)                                                 System Administration Commands                                                 ports(1M)

NAME
ports - creates /dev entries and inittab entries for serial lines SYNOPSIS
/usr/sbin/ports [-r rootdir] DESCRIPTION
devfsadm(1M) is now the preferred command for /dev and /devices and should be used instead of ports. The ports command creates symbolic links in the /dev/term and /dev/cua directories to the serial-port character device files in /devices and adds new entries in /etc/inittab for non-system ports found. System-board ports are given single lower-case letters for names (such as a and b) while other ports are named numerically. ports searches the kernel device tree to find the serial devices attached to the system. It also checks /dev/term and /dev/cua to see what symbolic links to serial devices already exist. ports then performs the following: 1. Assigns new numbers (or letters for system-board ports) to ports that are attached to the system but do not have /dev/term and /dev/cua entries. The numbers or letters assigned are the lowest-unused numbers or letters. 2. Removes dangling links: links from /dev/term and /dev/cua pointing to no-longer-existing ports. 3. Creates new /dev/term and /dev/cua links for new serial devices. 4. Invokes sacadm(1M) to make new port monitor entries for the new devices. This is not done automatically for on-board ports; on worksta- tions these ports are often not used for dial-in sessions, so a port-monitor for one of these ports must be created explicitly. If the configuration has not changed, ports exits without doing anything. Notice to Driver Writers ports considers devices with a node type of DDI_NT_SERIAL, DDI_NT_SERIAL_MB, DDI_NT_SERIAL_DO, or DDI_NT_SERIAL_MB_DO to be serial port devices. Devices with one of these node types must create minor device names that obey the following conventions when calling ddi_cre- ate_minor_node(9F). o The minor name for non-system port devices (DDI_NT_SERIAL) consists of an ASCII numeric string, where the first port on the device is named 0, the second named 1, the third named 2, up to the number of ports provided by the device. o The minor name for non-system dialout devices (DDI_NT_SERIAL_DO) is the ASCII numeric port name, concatenated with ,cu. For example, the minor name for the first dialout port on the serial board is 0,cu. o The minor name for system-board port devices (DDI_NT_SERIAL_MB) consists of a string containing a single ASCII lowercase character, where the first port on the device is named a, the second is named b, the third is named c, for all ports on the device (or up through port z). o The minor name for system-board dialout devices (DDI_NT_SERIAL_MB_DO) consists of the lowercase character port name, concatenated with ,cu. For example, the minor name for the first dialout port on the on-board serial device is a,cu. To prevent disks from attempting to automatically generate links for a device, drivers must specify a private node type and refrain from using one of the above node types when calling ddi_create_minor_node(9F). OPTIONS
The following options are supported: -r rootdir Causes ports to presume that the /dev/term, /dev/cua, and /devices directories are found under rootdir, not directly under /. If this argument is specified, sacadm(1M) is not invoked, since it would update terminal administration files under /etc without regard to the rootdir. EXAMPLES
Example 1: Creating the Serial and Dialout Minor Device Nodes The following example creates the serial and dialout minor device nodes from the xkserial driver's attach(9E) function: /* * Create the minor number by combining the instance number * with the port number. */ #define XKNUMPORTS 8 #define XKMINORNUM(i, p) ((i) << 4 | (p)) #define XKMINORNUM_DO(i, p) ((i) << 4 | (p) | 0x80) int xkserialattach(dev_info_t *dip, ddi_attach_cmd_t cmd) { int instance, portnum; char name[8]; /* other stuff in attach... */ instance = ddi_get_instance(dip); for (portnum = 0; portnum < XKNUMPORTS; portnum++) { /* * create the serial port device */ sprintf(name, "%d", portnum); ddi_create_minor_node(dip, name, S_IFCHR, XKMINORNUM(instance, portnum), DDI_NT_SERIAL, 0); /* * create the dialout device */ sprintf(name,"%d,cu", portnum); ddi_create_minor_node(dip, name, S_IFCHR, XKMINORNUM_DO(instance, portnum), DDI_NT_SERIAL_DO, 0); } } Example 2: Installing the xkserial Port Driver on a Sun Fire 4800 The following example installs the xkserial port driver on a Sun Fire 4800 (with the driver controlling the fictional XKSerial 8 port serial board), with these special files in /devices: # ls -l /devices/ssm@0,0/pci@18,700000/pci@1/xkserial@f,800000/ crw-r----- 1 root sys 32, 16 Aug 29 00:02 xkserial@2000:0 crw-r----- 1 root sys 32, 144 Aug 29 00:02 xkserial@2000:0,cu crw-r----- 1 root sys 32, 17 Aug 29 00:02 xkserial@2000:1 crw-r----- 1 root sys 32, 145 Aug 29 00:02 xkserial@2000:1,cu crw-r----- 1 root sys 32, 18 Aug 29 00:02 xkserial@2000:2 crw-r----- 1 root sys 32, 146 Aug 29 00:02 xkserial@2000:2,cu crw-r----- 1 root sys 32, 19 Aug 29 00:02 xkserial@2000:3 crw-r----- 1 root sys 32, 147 Aug 29 00:02 xkserial@2000:3,cu crw-r----- 1 root sys 32, 20 Aug 29 00:02 xkserial@2000:4 crw-r----- 1 root sys 32, 148 Aug 29 00:02 xkserial@2000:4,cu crw-r----- 1 root sys 32, 21 Aug 29 00:02 xkserial@2000:5 crw-r----- 1 root sys 32, 149 Aug 29 00:02 xkserial@2000:5,cu crw-r----- 1 root sys 32, 22 Aug 29 00:02 xkserial@2000:6 crw-r----- 1 root sys 32, 150 Aug 29 00:02 xkserial@2000:6,cu crw-r----- 1 root sys 32, 23 Aug 29 00:02 xkserial@2000:7 crw-r----- 1 root sys 32, 151 Aug 29 00:02 xkserial@2000:7,cu /dev/term contain symbolic links to the serial port device nodes in /devices # ls -l /dev/term /dev/term/0 -> ../../devices/[....]/xkserial@2000:0 /dev/term/1 -> ../../devices/[....]/xkserial@2000:1 /dev/term/2 -> ../../devices/[....]/xkserial@2000:2 /dev/term/3 -> ../../devices/[....]/xkserial@2000:3 /dev/term/4 -> ../../devices/[....]/xkserial@2000:4 /dev/term/5 -> ../../devices/[....]/xkserial@2000:5 /dev/term/6 -> ../../devices/[....]/xkserial@2000:6 /dev/term/7 -> ../../devices/[....]/xkserial@2000:7 and /dev/cua contain symbolic links to the dialout port device nodes in /devices # ls -l /dev/cua /dev/cua/0 -> ../../devices/[....]/xkserial@2000:0,cu /dev/cua/1 -> ../../devices/[....]/xkserial@2000:1,cu /dev/cua/2 -> ../../devices/[....]/xkserial@2000:2,cu /dev/cua/3 -> ../../devices/[....]/xkserial@2000:3,cu /dev/cua/4 -> ../../devices/[....]/xkserial@2000:4,cu /dev/cua/5 -> ../../devices/[....]/xkserial@2000:5,cu /dev/cua/6 -> ../../devices/[....]/xkserial@2000:6,cu /dev/cua/7 -> ../../devices/[....]/xkserial@2000:7,cu FILES
/dev/term/n Logical serial port devices /dev/cua/n Logical dialout port devices /etc/inittab /etc/saf/* ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability | SUNWcsu | +-----------------------------+-----------------------------+ SEE ALSO
add_drv(1M), devfsadm(1M), drvconfig(1M), pmadm(1M), sacadm(1M), attributes(5), devfs(7FS), attach(9E), ddi_create_minor_node(9F) Writing Device Drivers SunOS 5.10 8 Nov 2002 ports(1M)
All times are GMT -4. The time now is 03:43 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy