Gray C++ Libraries  0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
GrayLib::cATModem Class Reference

#include <cATModem.h>

Public Types

enum  ATMODE_TYPE {
  ATMODE_UNK = 0 , ATMODE_Command , ATMODE_DataCarrier , ATMODE_DataVoice ,
  ATMODE_DataFax
}
 

Public Member Functions

 cATModem (cStream *pStream, cStringF sPortName)
 
virtual ~cATModem ()
 
void SetModeUnk (bool bUnInit=false)
 
HRESULT SetModeCommand ()
 
HRESULT SendATCmd (const char *pszCmd, bool bCR=true)
 
HRESULT PollForResult ()
 
HRESULT WaitForResult (TIMESYSD_t tWaitMin=10, TIMESYSD_t tWaitMax=10 *cTimeSys::k_FREQ)
 
HRESULT SendATCmdAndWait (const char *pszCmd, TIMESYSD_t tWaitMin=10, TIMESYSD_t tWaitMax=10 *cTimeSys::k_FREQ)
 
HRESULT SendATCmdScript (const char *pszCmdScript)
 
HRESULT SendSMS (const char *pszNumber, const char *pszMsg)
 
 UNITTEST_FRIEND (cATModem)
 

Static Public Member Functions

static HRESULT GRAYCALL FindATModemStream (OUT cNewPtr< cStream > &rpStream, _Inout_ cStringF &sPortName)
 

Public Attributes

bool m_bIsInit
 I have applied my modem init set. m_sInitCommandScript. More...
 
cStringA m_sInitCommandScript
 My command init script. Must put the modem into known state. More...
 

Detailed Description

Manage a serial port connection to an AT modem device. Assume internal modem with no baud rate or handshake problems. does this device have a command mode pin ? or escape based switch to command mode.

Todo:
cATModem

Member Enumeration Documentation

◆ ATMODE_TYPE

Enumerator
ATMODE_UNK 

I have no idea if we are command mode or not. must test for this. send escape ?

ATMODE_Command 

In command mode now.

ATMODE_DataCarrier 

We are in connected data mode now. Use m_pStream freely for data.

ATMODE_DataVoice 

in voice mode. PCM ?

ATMODE_DataFax 

ATMODE_DataSMS = In SMS/Text Message mode.

in fax mode. Image?

Constructor & Destructor Documentation

◆ cATModem()

GrayLib::cATModem::cATModem ( cStream pStream,
cStringF  sPortName 
)

◆ ~cATModem()

GrayLib::cATModem::~cATModem ( )
virtual

Member Function Documentation

◆ FindATModemStream()

HRESULT GRAYCALL GrayLib::cATModem::FindATModemStream ( OUT cNewPtr< cStream > &  rpStream,
_Inout_ cStringF sPortName 
)
static

Search the system for an attached AT Modem. sPortName = "" = find the first else find the one after this.

◆ PollForResult()

HRESULT GrayLib::cATModem::PollForResult ( )

◆ SendATCmd()

HRESULT GrayLib::cATModem::SendATCmd ( const char *  pszCmd,
bool  bCR = true 
)

◆ SendATCmdAndWait()

HRESULT GrayLib::cATModem::SendATCmdAndWait ( const char *  pszCmd,
TIMESYSD_t  tWaitMin = 10,
TIMESYSD_t  tWaitMax = 10 * cTimeSys::k_FREQ 
)

◆ SendATCmdScript()

HRESULT GrayLib::cATModem::SendATCmdScript ( const char *  pszCmdScript)

Send a complex set of commands and waits. Used for long init sequence. m_sInitCommandScript

◆ SendSMS()

HRESULT GrayLib::cATModem::SendSMS ( const char *  pszNumber,
const char *  pszMsg 
)

Send an SMS message via AT modem. For backup communications. http://www.developershome.com/sms/howToSendSMSFromPC.asp AT command Meaning: +CMGS Send message +CMSS Send message from storage +CMGW Write message to memory +CMGD Delete message +CMGC Send command +CMMS More messages to send

◆ SetModeCommand()

HRESULT GrayLib::cATModem::SetModeCommand ( )

Try to put me into command mode. ATMODE_Command

◆ SetModeUnk()

void GrayLib::cATModem::SetModeUnk ( bool  bUnInit = false)

The modem responded in a bad way or not at all. I don't know what mode I'm in anymore.

◆ UNITTEST_FRIEND()

GrayLib::cATModem::UNITTEST_FRIEND ( cATModem  )

◆ WaitForResult()

HRESULT GrayLib::cATModem::WaitForResult ( TIMESYSD_t  tWaitMin = 10,
TIMESYSD_t  tWaitMax = 10 * cTimeSys::k_FREQ 
)

< Sleep some while waiting for the command response. populate m_sResult

Member Data Documentation

◆ m_bIsInit

bool GrayLib::cATModem::m_bIsInit

I have applied my modem init set. m_sInitCommandScript.

◆ m_sInitCommandScript

cStringA GrayLib::cATModem::m_sInitCommandScript

My command init script. Must put the modem into known state.


The documentation for this class was generated from the following files: