Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


ID: 20729, sending AT commands

by Derrick Hobson Email: Anonymous


Programming modems with AT commands
Download Details
FTP  download also available 0 bytes
CDN Login Required to Download. (You will be redirected to the login page if you click on the Download Link)
To download this, you must have registered:
A free membership

For C++Builder, Version 3.0  to 3.0 3 downloads
Copyright: No significant restrictions


Size: 0 bytes
Updated on Mon, 06 Oct 2003 01:08:13 GMT
Originally uploaded on Mon, 06 Oct 2003 01:04:27 GMT
Description
I'm writting an application that sends AT commands (ECHO ATF etc) to modems, i cannot use the TAPI to do this. It's going to be a replacement for the DOS batch files that used to do the task as windows 2000 and windows XP they don't work.

I've tried the following function as a test

bool TfrmTransmit::WriteABuffer(char *lpBuf, DWORD dwToWrite) {

OVERLAPPED osWrite = {0};
DWORD dwWritten;
BOOL fRes;

osWrite.hEvent = CreateEvent(NULL, TRUE, FALSE, NULL);
if (osWrite.hEvent == NULL)
return FALSE;
if (!WriteFile(hCom, lpBuf, dwToWrite, &dwWritten, &osWrite)) {
if (GetLastError() != ERROR_IO_PENDING) {
fRes = false;
}
else {
if (!GetOverlappedResult(hCom, &osWrite, &dwWritten, true))
fRes = false;
else
fRes = true;
}
}
else {
fRes = true;
};

CloseHandle(osWrite.hEvent);
return fRes;
};


but on my test command the modem just does not dial and eventually locks up the port.
The command line used to call this function is (number changed) :-
Sent = WriteABuffer("ATDT0123456789", sizeof("ATDT0123456789"));


Any thoughts...i've even tried using a fprintf command too and most of the solutions online I have to pay for which is not n option as this will be freeware when completed.

   Latest Comments  View All Add New

Move mouse over comment to see the full text

Could not retrieve comments. Please try again later.

Server Response from: ETNACDC04