PagerDll Technical Documentation 

Description of the files included with the PagerDll.



Document Updated: June 26, 1999

Version 1.00

readme.htm   Documents the DLL functions.
readme.txt   This file.
PagerDll.dll The Pager Dll for sending pages.This should be copied to your
             project or the windows directory.
PagerDll.lib Import library for the Dll. When compiling a in C/C++ environment
             include this library in the link path and PagerDll.h as the header
             file for your source files.
PagerDll.h   C/C++ header file containing the declarations for the Dll functions.
PagerDll.bas A Visual Basic .bas file containing the declarations for the Dll
             functions. Include this in your Modules section of your Visual Basic Project.
PagerDll.def A text file containing the ordinal numbers associated with the Dll functions.
             This is mainly for programmers using the Dll at run time using the LoadLibrary
             function. The import library does not have to linked at compile time in this case.
license.txt  License agreement for the Dll. 



------------------------------------------------------------------------


The syntax used in the following constants, structures and functions is based on C . 

int refers to a 4 byte integer
short int refers to a 2 byte integer
float refers to a 4 byte floating point
char refers to a single byte.



//Constants 

COM_ERROR          -101
MEMORY_ERROR       -102
COM_OPEN           -103
COM_CLOSE          -104
INVALID_COMPORT    -105
INVALID_PHONENO    -106
STRING_TOOLONG     -107
STRLEN_ERR         -108
BAUDRATE_ERR       -109
PROTOCOLTYPE_ERR   -110
MSG_ERR            -111
BLOCKSIZE_ERR      -112
FILENAME_ERR       -113
PARAMREQUIRED_ERR  -114
CONNECT_ERR        -115
IDRECEIVE_ERR      -116
INVALID_DELAY      -117
------------------------------------------------------------------------


Return Values 

COM_ERROR indicates that there was a problem in communication over the serial port.

1 usually indicates success

-1 usually indicates failure.



------------------------------------------------------------------------

Functions

GetDllVersion
WriteToLogFile
SendNumericPage
SendAlphaPage
SendAlphaPageAdvanced
SendAlphaPageByEmail
------------------------------------------------------------------------


float GetDllVersion ();
Description
Gets the Dll version number.
Return Values
1 if successful

------------------------------------------------------------------------

short int WriteToLogFile (char EnableLogging);
Parameters
EnableLogging //0 to disable logging and 1 to enable logging
Description
Enables or disables the logging of events.
Return Values
1 if successful
-1 if unsuccessful


------------------------------------------------------------------------

short int SendNumericPage(short int ComPort, char* PagerNo, char* PinNo, char* message, short int PDelay, char PulseDial);
Parameters
ComPort // Serial Commmunication port of your modem.
PagerNo //Phone number of your Pager.
PinNo // Pin number if you have one otherwise enter NULL.
message //Numeric message. Limit is 250 characters.
PDelay //The time in seconds to wait after dialing the number.
PulseDial //0 for Tone Dial and 1 for Pulse Dial. 
Description
Use the SendNumericPager to send a numeric message to a numeric Pager. The PDelay can vary
for different pagers but is usually withing the range 6-10 seconds. Try increasing this
number if you are not receiving messages. You can also obtain an estimate of what this
value should be by dialing the Pager number from a phone and then note down the time till
the operator's voice comes telling you to enter the message. This function cannot tell whether
the message was received successfully by the Pager.
Return Values
INVALID_PHONENO Phone number string is blank.
INVALID_COMPORT An invalid comp port number was entered.
STRING_TOOLONG Message string is too long. There is usually a limit on the dial string of the
modem. Also the total length of the phone number stirng, message string and the pin number
string should not exceed 255.
COM_OPEN Error opening the com port.
COM_ERROR Error in communicating over the serial port.
COM_CLOSE Error in closing the serial port.


------------------------------------------------------------------------

short int SendAlphaPage(short int comport, char* PagerNumber, char* PagerAccessNumber, char* message, char PulseDial);
Parameters
comport // Serial Commmunication port of your modem.
PagerNumber //Phone number of your Pager.
PagerAccessNumber // Pin number of your Pager.
message //Text message. Limit is 250 characters.
PulseDial //0 for Tone Dial and 1 for Pulse Dial. 
Description
SendAlphaPage is used to send text data to an alphanumeric Pager. This function uses the
Manual protocol. You should use this function if you want to send a small string which will
fit into a single page.
Return Values
STRLEN_ERR Length of message string exceeds 250 .
INVALID_COMPORT Invalid com port number.
PARAMREQUIRED_ERR The PagerNumber or PagerAccessNumber value is missing.
MSG_ERR The message value is NULL .
COM_OPEN Error opening the com port. 
CONNECT_ERR Error in connecting to the Paging Carrier company. Either the number is busy or
the right number was not given.
IDRECEIVE_ERR Failed to receive request for the PagerAccess number.
COM_CLOSE Error in closing the serial port.



------------------------------------------------------------------------

short int SendAlphaPageAdvanced(short int comport, short int baudRate, char* PagerNumber, char* PagerAccessNumber, char TypeOfProtocol, char* fileName, char* message, short int blockSize, char PulseDial);
Parameters
comport // Serial Commmunication port of your modem.
short int baudRate // The baudrate at which the alphanumeric protocols work is usually 1200.
PagerNumber //Phone number of your Pager.
PagerAccessNumber // Pin number of your Pager.
TypeOfProtocol //There are 2 protocols used in the Dll. Value of TypeOfProtocol should be 0 for Manual Entry protocol and 1 for Automatic Entry protocol. 
fileName // If the message is exceeds 250 characters then you should use a text file containing the message. 
message //Text message. Limit is 250 characters.
blockSize // Enter the max limit of characters your alphanumeric pager can accept. If the message is bigger than the blockSize then the message is broken at word boundaries and multiple pages are sent. 
PulseDial //0 for Tone Dial and 1 for Pulse Dial. 
Description
SendAlphaPageAdvanced is used to send text data to an alphanumeric Pager. This function offers
more options than the SendAlphaPage function. If a message is longer than the blocksize value
then multiple pages are sent. The message can be taken from a text file by specifying the name
in the fileName parameter. 
Return Values
STRLEN_ERR Length of message string exceeds 250 .
INVALID_COMPORT Invalid com port number.
PARAMREQUIRED_ERR The PagerNumber or PagerAccessNumber value is missing.
MSG_ERR The message value is NULL .
BAUDRATE_ERR Invalid baudrate entry.
PROTOCOLTYPE_ERR Invalid value for the protocol.
BLOCKSIZE_ERR Invalid value for the blocksize.
COM_OPEN Error opening the com port. 
CONNECT_ERR Error in connecting to the Paging Carrier company. Either the number is busy or the
right number was not given.
IDRECEIVE_ERR Failed to receive request for the PagerAccess number.
COM_CLOSE Error in closing the serial port.


------------------------------------------------------------------------

short int short int SendAlphaPageByEmail(char* hostName, char* senderAddr, char* RecipientAddr, char* MsgID, char* Subject , char* message,char* fileName, short int blockSize ); ;
Parameters
hostName // Name of the mail server. Limit is 50 characters.
senderAddr // Email address of the sender. Limit is 50 characters.
RecipientAddr // Email address of the recipient. Limit is 50 characters.
MsgID //Message Id of the Email. This parameter is optional. Limit is 50 characters.
Subject, // Subject of the Email. Limit is 50 characters.
message //Text message. Limit is 250 characters. If this parameter is used then fileName must be NULL.
fileName // If the message is exceeds 250 characters then you should use a text file
         //  containing the message. If this parameter is used then message must be NULL. 
blockSize // Enter the max limit of characters your alphanumeric pager can accept. If the message is bigger than the blockSize then the message is broken at word boundaries and multiple pages are sent. 
PulseDial //0 for Tone Dial and 1 for Pulse Dial. 
Description
SendAlphaPageAdvanced is used to send text data to an alphanumeric Pager. This function offers
more options than the SendAlphaPage function. If a message is longer than the blocksize value
then multiple pages are sent. The message can be taken from a text file by specifying the name
in the fileName parameter. 
Return Values
1 if successful
>0 Socket Error Code (The error code returned by the function WSAGetLastError())
<0



------------------------------------------------------------------------
For Tech Support Email Ajay Mittal 
Email:  amittal@slip.net
Web Site: http://www.slip.net/~amittal/
------------------------------------------------------------------------

Information contained here is provided "as is" without warranty, expressed or implied.
Read the license agreement for more information. 1999 Ajay Mittal., All Rights Reserved.













