J!NX Forums
J!NX Forums
Home | Forum Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
This username differs from J!NX login...
Save Password
Forgot your Password?

 All Forums
 TechSpeak
 Hardware
 com ?
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

hackedX99
Omega Member

628 Posts

Posted - 11/05/2009 :  4:13:41 PM  Show Profile  Reply with Quote
Ok , when I looked in device manager I see that my V.92 modem is plugged into the PCI slot 2 bus 0 function 0. But I also have that V.92 is using com3 port.

Their is com0 thru com255 to choose from.
I am curious what these are?

Since if these have to do with serial ports I have one on the back of the computer which is not being used at all
I just don't get where these com0 thru com255 are coming from.(Why the 256 = 2^8 different ones these must not coorspond to the physical one serial port on the back of the computer)
What input/output ports are these like virtual or something?

Either way if I can use serial port functions to read/write to the V.92 modem then that would be cool. Since then I could send/recieve AT commands directly from my computer programs. And completly control the V.92 modem in that way.

I know I can use the CreateFile function in win32api to send/recieve stuff to com1 ,...comxx ports.

And if I wanted to have the GUI in java I could write a wrapper using JNI for this function...etc

Thanks for input

Edited by - hackedX99 on 11/05/2009 5:41:25 PM

dualdflipflop
Moderator

USA
7368 Posts

Posted - 11/05/2009 :  5:23:31 PM  Show Profile  Visit dualdflipflop's Homepage  Send dualdflipflop an AOL message  Click to see dualdflipflop's MSN Messenger address  Send dualdflipflop a Yahoo! Message  Reply with Quote
I find it odd that you using Windows are seeing something starting with a zero. Usually iterations start from 1 in Windows... perhaps Oz-master-98 can shed some light. I think it's possibly Bluetooth virtual serial port action perhaps.

When dealing with what Com port takes up what actual hardware device, Windows looks at several things from BIOS configuration of PCI slots and onboard serial ports through Interrupt ReQuest (IRQ) and memory-mapped I/O, to what the driver is dishing out in the operating system. Typical x86 hardware will assign I/O port 0x3E8, IRQ 4 to Com3 by default. It's really no wonder however, that your modem was selected for Com3.

/me can't wait until he figures out what null-modem serial communication is all about if he's having so much fun tossing AT commands at silly little soft-modems.


P.S. This is what part of the alphabet would look like with Q and R eliminated.
Go to Top of Page

hackedX99
Omega Member

628 Posts

Posted - 11/05/2009 :  6:02:22 PM  Show Profile  Reply with Quote
No your right it starts off at com1 instead of com0 no such thing.

As for comX ports these can coorospond to any input/output device or any devices input/output ports?

Why the restriction on the 1 - 255 or 256 is their some reason 2^8 ???

So if com3 is the V.92 modem then can I record phone messages from the V.92 modem just by having a thread running recieveing all the data coming from the com3 port? Ofcourse leaving off the formating like .wav. If I just wrote this to a file and then send the raw file right to the sound card speakers it should play the persons message ? yes/no???

And I believe their is an AT command for the call id stuff as well :)

Curious to know though what devices can use the comX ports. I am assuming not all of them. Like could you set the harddrive to read and write from it with a com port? How about reading/writing to the The screen image i.e being able to capture/record your computer screen image. <-- I have try this with the VFW it worked OK but it was such a pain in the ass to code to get memory mapped data ...etc

If comX ports are an easy way to gain access to things that would otherwise be harder to go thru drivers ,...etc then I am on board with comX.

Like it would be cool to set your NIC card to use com6 and then read/write to it useing CREATEFILE com6 ,....etc other then having to use DDK or WinPCAP ,...etc

I am assuming their are limits in what devices can be configured for com ports ?


Null Modem , I thought this was just direct connection to 2 computers thru their serial port connector in the back.
And you could either write a progam to send/recive data from on to the other (like Transmitter/reciver program ) or use HyperTerminal ,...etc

Kind of like using a crossover cable to directly connect computers but instead using a cord that has serial connector on each side.

Thanks of any clarity
Maybe my understanding of a null modem is not the full story?

Edited by - hackedX99 on 11/05/2009 6:06:17 PM
Go to Top of Page

dualdflipflop
Moderator

USA
7368 Posts

Posted - 11/05/2009 :  7:12:33 PM  Show Profile  Visit dualdflipflop's Homepage  Send dualdflipflop an AOL message  Click to see dualdflipflop's MSN Messenger address  Send dualdflipflop a Yahoo! Message  Reply with Quote
quote:
Originally posted by hackedX99

So if com3 is the V.92 modem then can I record phone messages from the V.92 modem
Not that simple.

quote:
Originally posted by hackedX99

And I believe their is an AT command for the call id stuff as well :)
Remember, not all modems have the same command set.

quote:
Originally posted by hackedX99

Curious to know though what devices can use the comX ports. I am assuming not all of them. Like could you set the harddrive to read and write from it with a com port? How about reading/writing to the The screen image i.e being able to capture/record your computer screen image. <-- I have try this with the VFW it worked OK but it was such a pain in the ass to code to get memory mapped data ...etc
Not all devices are serial devices, not all serial devices can be invoked like RS-232 devices. Nuff said.

quote:
Originally posted by hackedX99

Null Modem , I thought this was just direct connection to 2 computers thru their serial port connector in the back.
And you could either write a progam to send/recive data from on to the other (like Transmitter/reciver program ) or use HyperTerminal ,...etc

Kind of like using a crossover cable to directly connect computers but instead using a cord that has serial connector on each side.
Yes, something like that.

I was more or less being facetious... remembering back to my days trying to play old school DOS games over the serial port. I still however, use my serial dumb terminals as shell clients for *NIX machines. Most of my micro-controller programming is done via serial... sometimes USB, but still very much RS-232 based.


P.S. This is what part of the alphabet would look like with Q and R eliminated.
Go to Top of Page

hackedX99
Omega Member

628 Posts

Posted - 11/05/2009 :  9:15:29 PM  Show Profile  Reply with Quote
quote:
Not all devices are serial devices, not all serial devices can be invoked like RS-232 devices. Nuff said.


I guess then the question here would be are the comX ports just for RS-232 based serial devices?

If so can any RS-232 based serial device be used thru a comX port?
If not then their must be some general criteria to know if a device can be used on a comX port? ( is their any physical location that the comX ports are at on a computer mobo location...etc etc )
Still curious why their is 256 = 2^8 number of com ports avalible is their some restriction on having only 256 com devices in a computer?

I still think their is a destintion between somebody saying serial ports (me automatically think of the one or two serial ports on the back of the computer) and com ports ( communication ports which can be serial or more general and only are used to get a handle to the input/output device )?

Either way moving on

quote:
Remember, not all modems have the same command set.



Most V.92 modems fax/data/voice have a few usually universal AT commands. But either way I am only coding it for my modem I don't care about being very portable. So thats not an issue


quote:
Not that simple.

Well I am going to give it a try.
Once the baud rate and all the configurations are what they should be then if I just read the enter raw thing dumping it to a file and the using another program to send that file to the speakers (sound card ) I don't see the hardness of it. Though I may at first be sending parts of the handshake or AT commands as well.
Please let me know if their is something major I am over looking.

All this is to try to avoid the TAPI but if worst comes to worst I may attempt that. I am also wondering if their is a third party api that I can download other then using TAPI which would be easier to work with and work with my V.92 modem?

Either way I am currently trying out the com port stuff with the V.92 to see if it works. Right now I am curious to see what reading/writing to the V.92 can do. I mean the V.92 takes in analog signals so it most convert it to digital somewhere before sending it to the com3 port and visa-versa little shake on how that works. I don't see any ADC or DAC but maybe the one chip on the V.92 is a DSP which does both.

Thanks duald always a pleasure talking to the elite.


Edited by - hackedX99 on 11/05/2009 9:26:22 PM
Go to Top of Page

hackedX99
Omega Member

628 Posts

Posted - 11/06/2009 :  01:27:10 AM  Show Profile  Reply with Quote
Also with hyperterminal set to com3 I have been issueing

At commands that dial phone numbers and answer phone calls.
So it stands to reason that I can issue these commands thru my program using CreateFile with \\\?\\com3 .

quote:

Commands nearly every modem recognizes:

ATs0 = # - # of rings to auto-answer after; if 0, disable auto-answer
AT A = Answer call
AT D = Dial
AT E# = Echo characters in command mode - where # = 0-no echo; 1=echo
AT H = Hangup
AT M# = Modem speaker: # = 0 - speaker off; 1 - speaker on during handshake; 2 - speaker always on
AT O = Go online
AT X# = Result codes / blind dialing - # = 0 or 1 to disable speed reporting, dial-tone detect, etc.
AT Z = reset modem
AT &F = reset modem to factory defaults
AT s6 = # - # of seconds modem waits before dialing after going off-hook
AT s7 = # - # of seconds modem waits for carrier after dialing
AT s10 = # - Durations in 1/10th second modem waits before hang-up after loss of carrier
AT s11 = # - Duration in milliseconds of tone dialing
AT s2 = ### - ASCII escape code character - defaults to 43 which is the plus sign ( + )
AT s12 = ### - Duration, in 50ths of a second, of guard time for escape code sequence (default = 50)




still haven't fully setup the c program yet. I will get back later.
Anyway my previous post had some last minute questions if anybody knows and gets a chance to write back.

Edited by - hackedX99 on 11/06/2009 01:28:51 AM
Go to Top of Page

dualdflipflop
Moderator

USA
7368 Posts

Posted - 11/06/2009 :  11:15:32 AM  Show Profile  Visit dualdflipflop's Homepage  Send dualdflipflop an AOL message  Click to see dualdflipflop's MSN Messenger address  Send dualdflipflop a Yahoo! Message  Reply with Quote
Use the edit next time, you don't need to double post.
quote:
Originally posted by hackedX99

I guess then the question here would be are the comX ports just for RS-232 based serial devices?
Basically.

quote:
Originally posted by hackedX99

If so can any RS-232 based serial device be used thru a comX port?
As long as it's assigned a port number.

quote:
Originally posted by hackedX99

Still curious why their is 256 = 2^8 number of com ports avalible is their some restriction on having only 256 com devices in a computer?
Windows assigns COM1 - COM16. Higher than those numbers can be assigned to virtual devices such as USB to serial converters or Bluetooth. Read this.

quote:
Originally posted by hackedX99

I still think their is a destintion between somebody saying serial ports (me automatically think of the one or two serial ports on the back of the computer) and com ports ( communication ports which can be serial or more general and only are used to get a handle to the input/output device )?
Yeah, only die hard Windows fanboys and people who just don't know the difference, excessively or incorrectly use the term Com when referring to serial devices. I think I've mentioned before, Microsoft is really the only one using Com as a term anymore. I find it strange, because they use the acronym COM for Component Object Model as well.

quote:
Originally posted by hackedX99

Well I am going to give it a try.
Is this what you're trying to accomplish?

quote:
Originally posted by hackedX99

Thanks duald always a pleasure talking to the elite.
I don't see how I'm elite. But thanks anyway.


P.S. This is what part of the alphabet would look like with Q and R eliminated.

Edited by - dualdflipflop on 11/06/2009 11:18:39 AM
Go to Top of Page

hackedX99
Omega Member

628 Posts

Posted - 11/06/2009 :  1:42:45 PM  Show Profile  Reply with Quote
quote:
Is this what you're trying to accomplish?

Ya , I found another software that limits to 1 minute answering machine. Yours is good as well but their is a 40 second answering machine. Not a big restriction. My standard real answering machine gives me the choice of 1 min of record time or 4.

Either way I am probably going to use these programs.
But now it is a question of just seeing if I can write one of these.
And what getting a handle to the com3 for the modem can do.
I beleive this handle will beable to control the V.92 modem. Just as hyperterminal did.

Cool, didn't know how to properly use hyperterminal until now.
It can do alot dialup connections , TCP/IP connections , comX ,serial port connections. However it is outdated but back in it's day it must have been a common thing to use.
Go to Top of Page

dualdflipflop
Moderator

USA
7368 Posts

Posted - 11/06/2009 :  7:34:17 PM  Show Profile  Visit dualdflipflop's Homepage  Send dualdflipflop an AOL message  Click to see dualdflipflop's MSN Messenger address  Send dualdflipflop a Yahoo! Message  Reply with Quote
I wasn't talking as much about the trial shareware restrictions as much as the general features of the program.

Writing an application for Windows would require you to access the modem through TAPI because it's additional telephony functionality you seek. AT commands can only go so far. The AT command string that tells the modem to accepts an incoming call after x amount of rings is one thing. Recording the media to a sound device and storing it as a sound file is another.

Hyperterminal is a very useful tool. I'm partially glad that Microsoft was able to license it so it could be part of default installs on Windows. Unfortunately for me most of the terminal emulation I required, and sometimes still require, is not supported by Hyperterm. I only use Hyperterm for BBSing these days... but only because I like the character set.


P.S. This is what part of the alphabet would look like with Q and R eliminated.
Go to Top of Page

hackedX99
Omega Member

628 Posts

Posted - 11/07/2009 :  01:18:56 AM  Show Profile  Reply with Quote
Curious when I use hyperterminal on com3 and issue At commands they
work.

But when I use this simple application I wrote and issue AT commands.
They don't seem to work?
The program is running and no errors that I can see.
The screen just echos back the commands.

What am I over looking?

Here is the code feel free to compile it and run it.
Although you will need javax.comm package ,...etc

I know I should probably use C/C++ for it but I wanted to make a quick GUI for it later and didn't want to use the Win32api for gui programming.


package CommPort;   
  
import javax.comm.*;   
  
import java.io.FileDescriptor;   
import java.io.IOException;   
import java.io.InputStream;   
import java.io.OutputStream;   
  
public class TwoWaySerialComm   
{   
    public TwoWaySerialComm()   
    {   
        super();   
    }   
       
    void connect ( String portName ) throws Exception   
    {   
        CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier(portName);   
        if ( portIdentifier.isCurrentlyOwned() )   
        {   
            System.out.println("Error: Port is currently in use");   
        }   
        else  
        {   
            CommPort commPort = portIdentifier.open(this.getClass().getName(),2000);   
               
            if ( commPort instanceof SerialPort )   
            {   
                SerialPort serialPort = (SerialPort) commPort;   
                serialPort.setSerialPortParams(57600,SerialPort.DATABITS_8,SerialPort.STOPBITS_1,SerialPort.PARITY_NONE);   
                   
                InputStream in = serialPort.getInputStream();   
                OutputStream out = serialPort.getOutputStream();   
                   
                (new Thread(new SerialReader(in))).start();   
                (new Thread(new SerialWriter(out))).start();   
  
            }   
            else  
            {   
                System.out.println("Error: Only serial ports are handled by this example.");   
            }   
        }        
    }   
       
    /** */  
    public static class SerialReader implements Runnable    
    {   
        InputStream in;   
           
        public SerialReader ( InputStream in )   
        {   
            this.in = in;   
        }   
           
        public void run ()   
        {   
            byte[] buffer = new byte[1024];   
            int len = -1;   
            try  
            {   
                while ( ( len = this.in.read(buffer)) > -1 )   
                {   
                    System.out.print(new String(buffer,0,len));   
                }   
            }   
            catch ( IOException e )   
            {   
                e.printStackTrace();   
            }               
        }   
    }   
  
    /** */  
    public static class SerialWriter implements Runnable    
    {   
        OutputStream out;   
           
        public SerialWriter ( OutputStream out )   
        {   
            this.out = out;   
        }   
           
        public void run ()   
        {   
            try  
            {                   
                int c = 0;   
                while ( ( c = System.in.read()) > -1 )   
                {   
                    this.out.write(c);   
                }                   
            }   
            catch ( IOException e )   
            {   
                e.printStackTrace();   
            }               
        }   
    }   
       
    public static void main ( String[] args )   
    {   
        try  
        {   
            (new TwoWaySerialComm()).connect("COM3");   
        }   
        catch ( Exception e )   
        {   
            // TODO Auto-generated catch block   
            e.printStackTrace();   
        }   
    }   
} 



At least the at commands should work like when I type
in AT D phone # at the console I should here it dialing the phone number like hyperterminal would???

AHHHHHHHH

WTF once you write data to the output stream of the com3 port is their anything else I have to write to initialize the command to work? Does hyperterminal just write the AT commands directly to the output stream of the modems on com3???

AHHHHHHHH , I am confused I would like to know what is going wrong.

Edited by - hackedX99 on 11/07/2009 01:25:12 AM
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
J!NX Forums © J!NX and Snitz Go To Top Of Page
Snitz Forums 2000