468,504 Members | 1,992 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,504 developers. It's quick & easy.

running a c program thruogh hyperterminal

hi Ppl,

I'm doing a project wherein i got to run a c program to read a text string from a cell phone.the cell phone is connected via data cable and my c program has to read an incoming message using AT commands which i got to send out using the hyperterminal.how do i make a c program to run through hyperterminal.
cud anyone help me plzzzz.

thanks,
Rylan
Jan 31 '08 #1
1 5615
Banfa
9,055 Expert Mod 8TB
You don't make a C program that runs through hyperterminal, you make a C program that opens the serial port itself and sends the AT commands and reads the replies.

Are you sure you want to use C rather than C++??

If you are using C then the WIN32 API function calls you will need to look into are

BuildCommDCB Fills a specified DCB structure with values specified in a device-control string.
BuildCommDCBAndTimeouts Translates a device-definition string into appropriate device-control block codes and places them into a device control block.
ClearCommBreak Restores character transmission for a specified communications device and places the transmission line in a nonbreak state.
ClearCommError Retrieves information about a communications error and reports the current status of a communications device.
CommConfigDialog Displays a driver-supplied configuration dialog box.
EscapeCommFunction Directs a specified communications device to perform an extended function.
GetCommConfig Retrieves the current configuration of a communications device.
GetCommMask Retrieves the value of the event mask for a specified communications device.
GetCommModemStatus Retrieves modem control-register values.
GetCommProperties Retrieves information about the communications properties for a specified communications device.
GetCommState Retrieves the current control settings for a specified communications device.
GetCommTimeouts Retrieves the time-out parameters for all read and write operations on a specified communications device.
GetDefaultCommConfig Retrieves the default configuration for the specified communications device.
PurgeComm Discards all characters from the output or input buffer of a specified communications resource.
SetCommBreak Suspends character transmission for a specified communications device and places the transmission line in a break state.
SetCommConfig Sets the current configuration of a communications device.
SetCommMask Specifies a set of events to be monitored for a communications device.
SetCommState Configures a communications device according to the specifications in a device-control block.
SetCommTimeouts Sets the time-out parameters for all read and write operations on a specified communications device.
SetDefaultCommConfig Sets the default configuration for a communications device.
SetupComm Initializes the communications parameters for a specified communications device.
TransmitCommChar Transmits a specified character ahead of any pending data in the output buffer of the specified communications device.
WaitCommEvent Waits for an event to occur for a specified communications device.

Help on these available here.

You will also need the general IO functions below

CloseHandle Closes an open object handle.
CreateFile Creates or opens a file, directory, physical disk, volume, console buffer, tape drive, communications resource, mailslot, or named pipe.
ReadFile Reads data from a file, starting at the position that is indicated by a file pointer. This function can operate synchronously and asynchronously.
ReadFileEx Reads data from a file asynchronously.
WriteFile Writes data to a file at a position that a file pointer specifies. This function can operate synchronously and asynchronously.
WriteFileEx Writes data to a file. This function reports the completion status asynchronously by calling a specified completion routine when writing is completed or canceled and when the calling thread is in an alertable wait state.

Help on these available here.


If rather than C you are going to use C++ or C# then are other options open to you if you use the .NET framework.
Jan 31 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

2 posts views Thread by Gerry Sutton | last post: by
1 post views Thread by Cc | last post: by
2 posts views Thread by Dzemal Tipura | last post: by
1 post views Thread by dinh1410 | last post: by
7 posts views Thread by C a r l o s A n t o n i o | last post: by
reply views Thread by NPC403 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.