Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Igor Cherednichenko
committed
Mar 25, 2013
1 parent
a766ee2
commit 44477c1
Showing
2 changed files
with
101 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/* | ||
* BearerConfig.cpp | ||
* | ||
* Created on: Mar 25, 2013 | ||
* Author: ia64domain | ||
*/ | ||
|
||
#include "BearerConfig.h" | ||
|
||
const char BearerConfig::connectionTypeParamName[] = "CONTYPE"; | ||
const char BearerConfig::apnNameParamName[] = "APN"; | ||
const char BearerConfig::userNameParamName[] = "USER"; | ||
const char BearerConfig::userPasswordParamName[] = "PWD"; | ||
const char BearerConfig::phoneNumberParamName[] = "PHONENUM"; | ||
const char BearerConfig::connectionSpeedParamName[] = "RATE"; | ||
|
||
BearerConfig::BearerConfig(unsigned int bearerProfileID, | ||
const BEARER_CONFIG_CONNECTION_TYPE connectionType, const char * apnName[APN_MAX_LENGHT]) { | ||
this->bearerProfileID = bearerProfileID; | ||
this->connectionType = connectionType; | ||
this->apnName | ||
|
||
} | ||
|
||
BearerConfig::~BearerConfig() { | ||
// TODO Auto-generated destructor stub | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
/* | ||
* BearerConfig.h | ||
* | ||
* Created on: Mar 25, 2013 | ||
* Author: ia64domain | ||
*/ | ||
|
||
#ifndef BEARERCONFIG_H_ | ||
#define BEARERCONFIG_H_ | ||
|
||
#define APN_MAX_LENGHT 51 /*max length of APN parameter value (include terminate key code)*/ | ||
#define USER_MAX_LENGHT 51 /*max length of user name parameter value (include terminate key code)*/ | ||
#define PWD_MAX_LENGHT 51 /*max length of password parameter value (include terminate key code)*/ | ||
#define PNUM_MAX_LENGHT 20 /*max length of phone number parameter value (include terminate key code)*/ | ||
|
||
enum BEARER_CONFIG_CONNECTION_TYPE { | ||
BEARER_PARAM_CONTYPE_CSD, BEARER_PARAM_CONTYPE_GPRS | ||
}; | ||
|
||
enum BEARER_CONFIG_CONNECTION_SPEED { | ||
BEARER_PARAM_CSD_SPEED_2400, BEARER_PARAM_CSD_SPEED_4800, | ||
BEARER_PARAM_CSD_SPEED_9600, BEARER_PARAM_CSD_SPEED_14400 | ||
}; | ||
|
||
class BearerConfig { | ||
private: | ||
/** | ||
* Block of configuration parameter names. | ||
*/ | ||
static const char connectionTypeParamName[8]; | ||
static const char apnNameParamName[4]; | ||
static const char userNameParamName[5]; | ||
static const char userPasswordParamName[4]; | ||
static const char phoneNumberParamName[9]; | ||
static const char connectionSpeedParamName[5]; | ||
|
||
unsigned int bearerProfileID; | ||
BEARER_CONFIG_CONNECTION_TYPE connectionType; | ||
char * apnName[APN_MAX_LENGHT]; | ||
char * userName[USER_MAX_LENGHT]; | ||
char * userPassword[PWD_MAX_LENGHT]; | ||
char * phoneNumber[PNUM_MAX_LENGHT]; | ||
BEARER_CONFIG_CONNECTION_SPEED connectionSpeed; | ||
|
||
public: | ||
BearerConfig(unsigned int bearerProfileID, | ||
const BEARER_CONFIG_CONNECTION_TYPE connectionType, const char * apnName[APN_MAX_LENGHT]); | ||
virtual ~BearerConfig(); | ||
|
||
void setConnectionType(const BEARER_CONFIG_CONNECTION_TYPE connectionType); | ||
void setApnName(const apnName[APN_MAX_LENGHT]); | ||
void setUserName(const userName[USER_MAX_LENGHT]); | ||
void setUserPassword(const userPassword[PWD_MAX_LENGHT]); | ||
void setPhoneNumber(const phoneNumber[PNUM_MAX_LENGHT]); | ||
void setConnectionSpeed(const BEARER_CONFIG_CONNECTION_SPEED connectionSpeed); | ||
|
||
const unsigned int & getBearerProfileID() const; | ||
const BEARER_CONFIG_CONNECTION_TYPE & getConnectionType() const; | ||
const char * const getApnName() const; | ||
const char * const getUserName() const; | ||
const char * const getUserPassword() const; | ||
const char * const getPhoneNumber() const; | ||
const BEARER_CONFIG_CONNECTION_SPEED & getConnectionSpeed() const; | ||
|
||
const char * const getConnectionTypeParamName() const; | ||
const char * const getApnNameParamName() const; | ||
const char * const getUserNameParamName() const; | ||
const char * const getUserPasswordParamName() const; | ||
const char * const getPhoneNumberParamName() const; | ||
const char * const getConnectionSpeedParamName() const; | ||
}; | ||
|
||
#endif /* BEARERCONFIG_H_ */ |