Rename names.

parent 251f12e7
#include "SimpleGSM.h"
#include "SimpleGsm.h"
SimpleGSM::SimpleGSM (const byte rxPin, const byte txPin, const byte powerPin) : SoftwareSerial (rxPin, txPin)
SimpleGsm::SimpleGsm (const byte rxPin, const byte txPin, const byte powerPin) : SoftwareSerial (rxPin, txPin)
{
_powerPin = powerPin;
......@@ -8,7 +8,7 @@ SimpleGSM::SimpleGSM (const byte rxPin, const byte txPin, const byte powerPin) :
}
void
SimpleGSM::restart ()
SimpleGsm::restart ()
{
digitalWrite(_powerPin, HIGH);
......@@ -20,7 +20,7 @@ SimpleGSM::restart ()
}
bool
SimpleGSM::responseIsReceived (char * const pattern, const long timeOut)
SimpleGsm::responseIsReceived (char * const pattern, const long timeOut)
{
this->setTimeout(timeOut);
......@@ -28,19 +28,19 @@ SimpleGSM::responseIsReceived (char * const pattern, const long timeOut)
}
bool
SimpleGSM::disableEcho ()
SimpleGsm::disableEcho ()
{
return this->setEcho (false);
}
bool
SimpleGSM::setSMSTextMode ()
SimpleGsm::setSmsTextMode ()
{
return this->setSMSMode (1);
return this->setSmsMode (1);
}
bool
SimpleGSM::setEcho (const bool state)
SimpleGsm::setEcho (const bool state)
{
this->print(F("ATE"));
......@@ -52,7 +52,7 @@ SimpleGSM::setEcho (const bool state)
}
bool
SimpleGSM::setSMSMode (const byte mode)
SimpleGsm::setSmsMode (const byte mode)
{
this->print(F("AT+CMGF="));
......@@ -64,7 +64,7 @@ SimpleGSM::setSMSMode (const byte mode)
}
bool
SimpleGSM::begin (const long baudRate, const byte numberOfRetries)
SimpleGsm::begin (const long baudRate, const byte numberOfRetries)
{
SoftwareSerial::begin (baudRate);
......@@ -86,7 +86,7 @@ SimpleGSM::begin (const long baudRate, const byte numberOfRetries)
}
bool
SimpleGSM::sendSMS (const String phoneNumber, const String message)
SimpleGsm::sendSms (const String phoneNumber, const String message)
{
this->print(F("AT+CMGS=\""));
......@@ -107,7 +107,7 @@ SimpleGSM::sendSMS (const String phoneNumber, const String message)
}
bool
SimpleGSM::startCall (const String phoneNumber)
SimpleGsm::startCall (const String phoneNumber)
{
this->print(F("ATD"));
......@@ -119,7 +119,7 @@ SimpleGSM::startCall (const String phoneNumber)
}
bool
SimpleGSM::callIsDialing()
SimpleGsm::callIsDialing()
{
this->queryForCallStatus();
......@@ -127,7 +127,7 @@ SimpleGSM::callIsDialing()
}
bool
SimpleGSM::callIsRinging()
SimpleGsm::callIsRinging()
{
this->queryForCallStatus();
......@@ -135,13 +135,13 @@ SimpleGSM::callIsRinging()
}
void
SimpleGSM::waitOnCallDialing()
SimpleGsm::waitOnCallDialing()
{
while (this->callIsDialing()) ;
}
void
SimpleGSM::waitOnCallRinging(const unsigned long duration)
SimpleGsm::waitOnCallRinging(const unsigned long duration)
{
const unsigned long previousMillis = millis();
......@@ -155,7 +155,7 @@ SimpleGSM::waitOnCallRinging(const unsigned long duration)
}
bool
SimpleGSM::missedCall (const String phoneNumber, const unsigned long ringingDuration)
SimpleGsm::missedCall (const String phoneNumber, const unsigned long ringingDuration)
{
if (this->startCall(phoneNumber))
{
......@@ -175,17 +175,17 @@ SimpleGSM::missedCall (const String phoneNumber, const unsigned long ringingDura
}
void
SimpleGSM::queryForCallStatus()
SimpleGsm::queryForCallStatus()
{
this->print(F("AT+CLCC\r"));
}
bool
SimpleGSM::hangCall ()
SimpleGsm::hangCall ()
{
this->print(F("ATH\r"));
return this->responseIsReceived(OK_RESPONSE_FORMAT, 2000);
}
char * SimpleGSM::OK_RESPONSE_FORMAT = "\r\nOK\r\n";
char * SimpleGsm::OK_RESPONSE_FORMAT = "\r\nOK\r\n";
#ifndef _SimpleGSM_H
#define _SimpleGSM_H
#ifndef _SimpleGsm_H
#define _SimpleGsm_H
#include "Arduino.h"
#include <SoftwareSerial.h>
class SimpleGSM : public SoftwareSerial
class SimpleGsm : public SoftwareSerial
{
public:
SimpleGSM (const byte rxPin, const byte txPin, const byte powerPin);
SimpleGsm (const byte rxPin, const byte txPin, const byte powerPin);
bool begin (const long baudRate, const byte numberOfRetries);
bool disableEcho ();
bool setSMSTextMode ();
bool setSmsTextMode ();
bool sendSMS (const String phoneNumber, const String message);
bool sendSms (const String phoneNumber, const String message);
bool missedCall (const String phoneNumber, const unsigned long ringingDuration);
......@@ -37,7 +37,7 @@ class SimpleGSM : public SoftwareSerial
bool setEcho (const bool state);
bool setSMSMode (const byte mode);
bool setSmsMode (const byte mode);
void queryForCallStatus ();
......@@ -48,4 +48,4 @@ class SimpleGSM : public SoftwareSerial
byte _powerPin;
};
#endif /* _SimpleGSM_H */
#endif /* _SimpleGsm_H */
#include <FiniteStateMachine.h>
#include <ShiftRegLCD123.h>
#include <SoftwareSerial.h>
#include <SimpleGSM.h>
#include <SimpleGsm.h>
#include <LinkedList.h>
#include <SPI.h>
#include <SD.h>
......@@ -104,14 +104,14 @@ getSystemLcd ()
return *object;
}
SimpleGSM &
SimpleGsm &
getSystemGsm ()
{
static SimpleGSM * object = NULL;
static SimpleGsm * object = NULL;
if (object == NULL)
{
object = new SimpleGSM (GSM_RECEIVER_LINE_PIN, GSM_TRANSMITTER_LINE_PIN, GSM_POWER_PIN);
object = new SimpleGsm (GSM_RECEIVER_LINE_PIN, GSM_TRANSMITTER_LINE_PIN, GSM_POWER_PIN);
}
return *object;
......@@ -292,7 +292,7 @@ initializeGsm()
return false;
}
if (!getSystemGsm().setSMSTextMode())
if (!getSystemGsm().setSmsTextMode())
{
return false;
}
......@@ -592,7 +592,7 @@ notifyUsers ()
getSystemGsm().missedCall(mobile, DELAY_TIME_OF_CALL_RINGING_DURATION);
getSystemGsm().sendSMS(mobile, smsText);
getSystemGsm().sendSms(mobile, smsText);
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment