Connection Manager library for u-blox cellular modules. It manages the modem for keeping data connection always active.
CNData.h@0:86284a262735, 2016-01-12 (annotated)
- Committer:
- msinig
- Date:
- Tue Jan 12 09:08:15 2016 +0000
- Revision:
- 0:86284a262735
first drop
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
msinig | 0:86284a262735 | 1 | #pragma once |
msinig | 0:86284a262735 | 2 | |
msinig | 0:86284a262735 | 3 | #include "CNManager.h" |
msinig | 0:86284a262735 | 4 | #include "CNReg.h" |
msinig | 0:86284a262735 | 5 | |
msinig | 0:86284a262735 | 6 | //!Data Status |
msinig | 0:86284a262735 | 7 | typedef enum{ |
msinig | 0:86284a262735 | 8 | DATA_NO_CHANGES, //!< No changes |
msinig | 0:86284a262735 | 9 | DATA_IS_CONNECTED, //!< Data channel is connected |
msinig | 0:86284a262735 | 10 | DATA_IS_DISCONNECTED, //!< Data channel is disconnected |
msinig | 0:86284a262735 | 11 | } DataConnStatus; |
msinig | 0:86284a262735 | 12 | |
msinig | 0:86284a262735 | 13 | /** Data Init. |
msinig | 0:86284a262735 | 14 | This function has to be called prior to dataTick |
msinig | 0:86284a262735 | 15 | */ |
msinig | 0:86284a262735 | 16 | void cnDataInit(); |
msinig | 0:86284a262735 | 17 | |
msinig | 0:86284a262735 | 18 | /** Loop data module |
msinig | 0:86284a262735 | 19 | \param lib pointer to CN library |
msinig | 0:86284a262735 | 20 | \param regStatus for registration status |
msinig | 0:86284a262735 | 21 | \param dataStatus [output] data status |
msinig | 0:86284a262735 | 22 | \return CNResp |
msinig | 0:86284a262735 | 23 | */ |
msinig | 0:86284a262735 | 24 | CNResp cnDataLoop(CNLib* const lib, RegStatus regStatus, DataConnStatus* const dataStatus); |
msinig | 0:86284a262735 | 25 | |
msinig | 0:86284a262735 | 26 | /** Register (Attach) the MT to the GPRS service. |
msinig | 0:86284a262735 | 27 | This function can be called at any time. |
msinig | 0:86284a262735 | 28 | \param enabled if true data connection is requested, if false not. |
msinig | 0:86284a262735 | 29 | */ |
msinig | 0:86284a262735 | 30 | void cnDataEnable(bool enabled); |
msinig | 0:86284a262735 | 31 | |
msinig | 0:86284a262735 | 32 | /** Reset |
msinig | 0:86284a262735 | 33 | */ |
msinig | 0:86284a262735 | 34 | void cnDataReset(); |
msinig | 0:86284a262735 | 35 | |
msinig | 0:86284a262735 | 36 | /** Set parameters for the GPRS service. |
msinig | 0:86284a262735 | 37 | If Apn parameters are not set, the internal APN info database will be used. |
msinig | 0:86284a262735 | 38 | \param apn the of the network provider e.g. |
msinig | 0:86284a262735 | 39 | \param apn the of the network provider e.g. "internet" or "apn.provider.com" |
msinig | 0:86284a262735 | 40 | \param username is the user name text string for the authentication phase |
msinig | 0:86284a262735 | 41 | \param password is the password text string for the authentication phase |
msinig | 0:86284a262735 | 42 | \param auth is the authentication mode (CHAP,PAP,NONE or DETECT) |
msinig | 0:86284a262735 | 43 | */ |
msinig | 0:86284a262735 | 44 | void cnDataSetupApn(const char* apn, const char* username, const char* password); |