amq amq / ublox-at-cellular-interface-ext-add-priority

Dependencies:   ublox-at-cellular-interface

Fork of ublox-at-cellular-interface-ext by u-blox

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers UbloxATCellularInterfaceExt.h Source File

UbloxATCellularInterfaceExt.h

00001 /* Copyright (c) 2017 ARM Limited
00002  *
00003  * Licensed under the Apache License, Version 2.0 (the "License");
00004  * you may not use this file except in compliance with the License.
00005  * You may obtain a copy of the License at
00006  *
00007  *     http://www.apache.org/licenses/LICENSE-2.0
00008  *
00009  * Unless required by applicable law or agreed to in writing, software
00010  * distributed under the License is distributed on an "AS IS" BASIS,
00011  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00012  * See the License for the specific language governing permissions and
00013  * limitations under the License.
00014  */
00015 
00016 #ifndef _UBLOX_AT_CELLULAR_INTERFACE_EXT_
00017 #define _UBLOX_AT_CELLULAR_INTERFACE_EXT_
00018 
00019 #include "UbloxATCellularInterface.h"
00020 #include "UbloxCellularDriverGen.h"
00021 
00022 /**UbloxATCellularInterfaceExt class.
00023  *
00024  * This interface extends the UbloxATCellularInterface to
00025  * include other features that use the IP stack on board the
00026  * cellular modem: HTTP, FTP and Cell Locate.
00027  *
00028  * Note: the UbloxCellularGeneric class is required because
00029  * reading a large HTTP response is performed via a modem
00030  * file system call and the UbloxCellularGeneric class is
00031  * where modem file system support is provided.
00032  */
00033 class UbloxATCellularInterfaceExt : public  UbloxATCellularInterface, public UbloxCellularDriverGen {
00034 
00035 public:
00036     /** Constructor.
00037      *
00038      * @param tx       the UART TX data pin to which the modem is attached.
00039      * @param rx       the UART RX data pin to which the modem is attached.
00040      * @param baud     the UART baud rate.
00041      * @param debugOn  true to switch AT interface debug on, otherwise false.
00042      */
00043     UbloxATCellularInterfaceExt(PinName tx = MDMTXD,
00044                                 PinName rx = MDMRXD,
00045                                 int baud = MBED_CONF_UBLOX_CELL_BAUD_RATE,
00046                                 bool debugOn = false,
00047                                 osPriority priority = osPriorityNormal);
00048 
00049      /* Destructor.
00050       */
00051      virtual ~UbloxATCellularInterfaceExt();
00052 
00053     /**********************************************************************
00054      * PUBLIC: General
00055      **********************************************************************/
00056 
00057     /** Infinite timeout.
00058      */
00059     #define TIMEOUT_BLOCKING -1
00060 
00061     /** A struct containing an HTTP or FTP error class and code
00062      */
00063      typedef struct {
00064         int eClass;
00065         int eCode;
00066     } Error;
00067 
00068     /**********************************************************************
00069      * PUBLIC: HTTP
00070      **********************************************************************/
00071 
00072     /** HTTP profile unused marker.
00073      */
00074     #define HTTP_PROF_UNUSED -1
00075 
00076     /** HTTP configuration parameters (reference to HTTP control +UHTTP).
00077      */
00078     typedef enum {
00079         HTTP_IP_ADDRESS = 0,
00080         HTTP_SERVER_NAME = 1,
00081         HTTP_USER_NAME = 2,
00082         HTTP_PASSWORD = 3,
00083         HTTP_AUTH_TYPE = 4,
00084         HTTP_SERVER_PORT = 5,
00085         HTTP_SECURE = 6
00086     } HttpOpCode;
00087 
00088     /** Type of HTTP Command.
00089      */
00090     typedef enum {
00091         HTTP_HEAD = 0,
00092         HTTP_GET = 1,
00093         HTTP_DELETE = 2,
00094         HTTP_PUT = 3,
00095         HTTP_POST_FILE = 4,
00096         HTTP_POST_DATA = 5
00097     } HttpCmd;
00098 
00099     /** HTTP content types.
00100      */
00101     typedef enum {
00102         HTTP_CONTENT_URLENCODED = 0,
00103         HTTP_CONTENT_TEXT = 1,
00104         HTTP_CONTENT_OCTET_STREAM = 2,
00105         HTTP_CONTENT_FORM_DATA = 3,
00106         HTTP_CONTENT_JSON = 4,
00107         HTTP_CONTENT_XML = 5,
00108         HTTP_CONTENT_USER_DEFINED = 6
00109     } HttpContentType;
00110 
00111     /** Find a free HTTP profile.
00112      *
00113      * A profile will be blocking when first allocated.
00114      *
00115      * @return the profile or negative if none are available.
00116      */
00117     int httpAllocProfile();
00118     
00119     /** Free the HTTP profile.
00120      *
00121      * @param profile the HTTP profile handle.
00122      * @return           true if successful, otherwise false.
00123      */
00124     bool httpFreeProfile(int profile);
00125 
00126     /** Set the timeout for this profile.
00127      *
00128      * @param profile    the HTTP profile handle.
00129      * @param timeout    -1 blocking, else non-blocking timeout in milliseconds.
00130      * @return           true if successful, otherwise false.
00131      */
00132     bool httpSetTimeout(int profile, int timeout);
00133     
00134     /** Reset a HTTP profile back to defaults.
00135      *
00136      * This may be called if the state of a HTTP profile
00137      * during parameter setting or exchange of HTTP commands
00138      * has become confusing/unknown.
00139      *
00140      * @param httpProfile the HTTP profile to be reset.
00141      * @return            true if successful, false otherwise.
00142      */
00143     bool httpResetProfile(int httpProfile);
00144     
00145     /** Set HTTP parameters.
00146      *
00147      * This should be called as many times as is necessary
00148      * to set all the possible parameters (HttpOpCode).
00149      *
00150      * See section 28.1 of u-blox-ATCommands_Manual(UBX-13002752).pdf
00151      * for full details.  By example:
00152      *
00153      * httpOpCode          httpInPar
00154      * HTTP_IP_ADDRESS     "145.33.18.10" (the target HTTP server IP address)
00155      * HTTP_SERVER_NAME    "www.myhttpserver.com" (the target HTTP server name)
00156      * HTTP_USER_NAME      "my_username"
00157      * HTTP_PASSWORD       "my_password"
00158      * HTTP_AUTH_TYPE      "0" for no authentication, "1" for username/password
00159      *                     authentication (the default is 0)
00160      * HTTP_SERVER_PORT    "81" (default is port 80)
00161      * HTTP_SECURE         "0" for no security, "1" for TLS (the default is 0),
00162      *                     not all modems support this parameter
00163      *
00164      * @param httpProfile the HTTP profile identifier.
00165      * @param httpOpCode  the HTTP operation code.
00166      * @param httpInPar   the HTTP input parameter.
00167      * @return            true if successful, false otherwise.
00168      */
00169     bool httpSetPar(int httpProfile, HttpOpCode httpOpCode, const char * httpInPar);
00170     
00171     /** Perform a HTTP command.
00172      *
00173      * See section 28.3 of u-blox-ATCommands_Manual(UBX-13002752).pdf
00174      * for full details.  By example, it works like this:
00175      *
00176      * httpCmd        httpPath       rspFile     sendStr  httpContentType httpCustomPar
00177      * HEAD       "path/file.html"     NULL       NULL         0             NULL
00178      * GET        "path/file.html"     NULL       NULL         0             NULL
00179      * DELETE     "path/file.html"     NULL       NULL         0             NULL
00180      * PUT        "path/file.html"     NULL    "myfile.txt"  0 to 6         Note 1
00181      * POST_FILE  "path/file.html"     NULL    "myfile.txt"  0 to 6         Note 1
00182      * POST       "path/file.html"     NULL   "hello there!" 0 to 6         Note 1
00183      *
00184      * Note 1: httpCustomPar is only applicable when httpContentType = HTTP_CONTENT_USER_DEFINED.
00185      *
00186      * The server to which this command is directed must have previously been
00187      * set with a call to httpSetPar().  If the server requires TLS (i.e. "HTTPS"),
00188      * then set that up with httpSetPar() also (HTTP_SECURE).
00189      *
00190      * rspFile may be left as NULL as the server response will be returned in buf.
00191      * Alternatively, a rspFile may be given (e.g. "myresponse.txt") and this can
00192      * later be read from the modem file system using readFile().
00193      *
00194      * @param httpProfile     the HTTP profile identifier.
00195      * @param httpCmd         the HTTP command.
00196      * @param httpPath        the path of resource on the HTTP server.
00197      * @param rspFile         the local modem file where the server
00198      *                        response will be stored, use NULL for
00199      *                        don't care.
00200      * @param sendStr         the filename or string to be sent
00201      *                        to the HTTP server with the command request.
00202      * @param httpContentType the HTTP Content-Type identifier.
00203      * @param httpCustomPar   the parameter for a user defined HTTP Content-Type.
00204      * @param buf             the buffer to read into.
00205      * @param len             the size of the buffer to read into.
00206      * @return                NULL if successful, otherwise a pointer to
00207      *                        a Error struct containing the error class and error
00208      *                        code, see section Appendix A.B of
00209      *                        u-blox-ATCommands_Manual(UBX-13002752).pdf for details.
00210      */
00211     Error * httpCommand(int httpProfile, HttpCmd httpCmd, const char* httpPath,
00212                         const char* rspFile, const char* sendStr,
00213                         int httpContentType, const char* httpCustomPar,
00214                         char* buf, int len);
00215 
00216     /**********************************************************************
00217      * PUBLIC: FTP
00218      **********************************************************************/
00219 
00220     /** FTP configuration parameters (reference to FTP control +UFTP).
00221      */
00222     typedef enum {
00223         FTP_IP_ADDRESS = 0,
00224         FTP_SERVER_NAME = 1,
00225         FTP_USER_NAME = 2,
00226         FTP_PASSWORD = 3,
00227         FTP_ACCOUNT = 4,
00228         FTP_INACTIVITY_TIMEOUT = 5,
00229         FTP_MODE = 6,
00230         FTP_SERVER_PORT = 7,
00231         FTP_SECURE = 8,
00232         NUM_FTP_OP_CODES
00233     } FtpOpCode;
00234 
00235     /** Type of FTP Command.
00236      */
00237     typedef enum {
00238         FTP_LOGOUT = 0,
00239         FTP_LOGIN = 1,
00240         FTP_DELETE_FILE = 2,
00241         FTP_RENAME_FILE = 3,
00242         FTP_GET_FILE = 4,
00243         FTP_PUT_FILE = 5,
00244         FTP_GET_DIRECT = 6,
00245         FTP_PUT_DIRECT = 7,
00246         FTP_CD = 8,
00247         FTP_MKDIR = 10,
00248         FTP_RMDIR = 11,
00249         FTP_FILE_INFO = 13,
00250         FTP_LS = 14,
00251         FTP_FOTA_FILE = 100
00252     } FtpCmd;
00253 
00254     /** Set the timeout for FTP operations.
00255      *
00256      * @param timeout -1 blocking, else non-blocking timeout in milliseconds.
00257      * @return         true if successful, otherwise false.
00258      */
00259     bool ftpSetTimeout(int timeout);
00260 
00261     /** Reset the FTP configuration back to defaults.
00262      */
00263     void ftpResetPar();
00264     
00265     /** Set FTP parameters.
00266      *
00267      * This should be called as many times as is necessary
00268      * to set all the possible parameters (FtpOpCode).
00269      *
00270      * See section 27.1 of u-blox-ATCommands_Manual(UBX-13002752).pdf
00271      * for full details.  By example:
00272      *
00273      * ftpOpCode              ftpInPar
00274      * FTP_IP_ADDRESS         "145.33.18.10" (the target FTP server IP address)
00275      * FTP_SERVER_NAME        "www.ftpserver.com" (the target FTP server name)
00276      * FTP_USER_NAME          "my_username"
00277      * FTP_PASSWORD           "my_password"
00278      * FTP_ACCOUNT            "my_account" (not required by most FTP servers)
00279      * FTP_INACTIVITY_TIMEOUT "60" (the default is 0, which means no timeout)
00280      * FTP_MODE               "0" for active, "1" for passive (the default is 0) 
00281      * FTP_SERVER_PORT        "25" (default is port 21)
00282      * FTP_SECURE             "0" for no security, "1" for SFTP (the default is 0)
00283      *
00284      * @param ftpOpCode  the FTP operation code.
00285      * @param ftpInPar   the FTP input parameter.
00286      * @return           true if successful, false otherwise.
00287      */
00288     bool ftpSetPar(FtpOpCode ftpOpCode, const char * ftpInPar);
00289     
00290     /** Perform an FTP command.
00291      *
00292      * Connect() must have been called previously to establish a data
00293      * connection.
00294      *
00295      * See section 27.2 of u-blox-ATCommands_Manual(UBX-13002752).pdf
00296      * for full details.  By example, it works like this:
00297      *
00298      * ftpCmd               file1      file2    buf     len  offset
00299      * FTP_LOGOUT            N/A        N/A     N/A     N/A    N/A 
00300      * FTP_LOGIN             N/A        N/A     N/A     N/A    N/A 
00301      * FTP_DELETE_FILE   "the_file"     N/A     N/A     N/A    N/A
00302      * FTP_RENAME_FILE   "old_name"  "new_name" N/A     N/A    N/A 
00303      * FTP_GET_FILE      "the_file"    Note 1   N/A     N/A   0 - 1    (Notes 2 & 3)
00304      * FTP_PUT_FILE      "the_file"    Note 1   N/A     N/A  0 - 65535 (Notes 2 & 4 & 5)
00305      * FTP_CD            "dir1\dir2"    N/A     N/A     N/A    N/A 
00306      * FTP_MKDIR         "newdir"       N/A     N/A     N/A    N/A 
00307      * FTP_RMDIR         "dir"          N/A     N/A     N/A    N/A 
00308      * FTP_FILE_INFO     "the_path"     N/A        Note 6      N/A
00309      * FTP_LS            "the_path"     N/A        Note 6      N/A
00310      * FTP_FOTA_FILE     "the_file"     N/A        Note 7      N/A
00311      *
00312      * Note 1: for this case, file2 is the name that the file should be
00313      * given when it arrives (in the modem file system for a GET, at the FTP
00314      * server for a PUT); if set to NULL then file1 is used.
00315      * Note 2: the file will placed into the modem file system for the
00316      * GET case (and can be read with readFile()), or must already be in the
00317      * modem file system, (can be written using writeFile()) for the PUT case.
00318      * Note 3: if offset is 1 then, where supported, the FTP GET
00319      * will be continued from the point it previously stopped.
00320      * Note 4: if the file already exists in the modem file system some
00321      * modems will return an error.  It is up to the caller to ensure that
00322      * the file does not exist before the FTP PUT operation.
00323      * Note 5: where supported, offset is the position in the file to continue
00324      * the FTP PUT from.
00325      * Note 6: buf should point to the location where the file info
00326      * or directory listing is to be stored and len should be the maximum
00327      * length that can be stored.
00328      * Note 7: a hex string representing the MD5 sum of the FOTA file will be
00329      * stored at buf; len must be at least 32 as an MD5 sum is 16 bytes.
00330      * FTP_FOTA_FILE is not supported on SARA-U2.
00331      * Note 8: FTP_GET_DIRECT and FTP_PUT_DIRECT are not supported by
00332      * this driver.
00333      *
00334      * @param ftpCmd     the FTP command.
00335      * @param file1      the first file name if required (NULL otherwise).
00336      * @param file2      the second file name if required (NULL otherwise).
00337      * @param buf        pointer to a buffer, required for FTP_DIRECT mode
00338      *                   and FTP_LS only.
00339      * @param len        the size of buf.
00340      * @param continue   if true then attempt to continue a download that
00341      *                   was previously interrupted.
00342      * @return           NULL if successful, otherwise a pointer to
00343      *                   a Error struct containing the error class and error
00344      *                   code, see section Appendix A.B of
00345      *                   u-blox-ATCommands_Manual(UBX-13002752).pdf for details.
00346      */
00347     Error *ftpCommand(FtpCmd ftpCmd, const char* file1 = NULL, const char* file2 = NULL,
00348                       char* buf = NULL, int len = 0, int offset = 0);
00349 
00350     /**********************************************************************
00351      * PUBLIC: Cell Locate
00352      **********************************************************************/
00353  
00354     /** Which form of Cell Locate sensing to use.
00355      */
00356     typedef enum {
00357         CELL_LAST,
00358         CELL_GNSS,
00359         CELL_LOCATE,
00360         CELL_HYBRID
00361     } CellSensType;
00362 
00363     /** Types of Cell Locate response.
00364      */
00365     typedef enum {
00366         CELL_DETAILED = 1,
00367         CELL_MULTIHYP = 2
00368     } CellRespType;
00369 
00370     /** Cell Locate data.
00371      */
00372     typedef struct {
00373         volatile bool validData;      //!< Flag for indicating if data is valid.
00374         volatile struct tm time;      //!< GPS Timestamp.
00375         volatile float longitude;     //!< Estimated longitude, in degrees.
00376         volatile float latitude;      //!< Estimated latitude, in degrees.
00377         volatile int altitude;        //!< Estimated altitude, in meters^2.
00378         volatile int uncertainty;     //!< Maximum possible error, in meters.
00379         volatile int speed;           //!< Speed over ground m/s^2.
00380         volatile int direction;       //!< Course over ground in degrees.
00381         volatile int verticalAcc;     //!< Vertical accuracy, in meters^2.
00382         volatile CellSensType sensor; //!< Sensor used for last calculation.
00383         volatile int svUsed;          //!< number of satellite used.
00384     } CellLocData;
00385 
00386     /** Configure the Cell Locate TCP aiding server.
00387      *
00388      * Connect() must have been called previously to establish
00389      * a data connection.
00390      *
00391      * @param server_1   host name of the primary MGA server.
00392      * @param server_2   host name of the secondary MGA server.
00393      * @param token      authentication token for MGA server access.
00394      * @param days       the number of days into the future the off-line
00395      *                   data for the u-blox 7.
00396      * @param period     the number of weeks into the future the off-line
00397      *                   data for u-blox M8.
00398      * @param resolution resolution of off-line data for u-blox M8: 1 every
00399      *                   day, 0 every other day.
00400      * @return           true if the request is successful, otherwise false.
00401      */
00402     bool cellLocSrvTcp(const char* token, const char* server_1 = "cell-live1.services.u-blox.com",
00403                        const char* server_2 = "cell-live2.services.u-blox.com",
00404                        int days = 14, int period = 4, int resolution = 1);
00405  
00406     /** Configure Cell Locate UDP aiding server.
00407      *
00408      * Connect() must have been called previously to establish
00409      * a data connection.
00410      *
00411      * @param server_1   host name of the primary MGA server.
00412      * @param port       server port.
00413      * @param latency    expected network latency in seconds from 0 to 10000 milliseconds.
00414      * @param mode       Assist Now management, mode of operation:
00415      *                   0 data downloaded at GNSS power up,
00416      *                   1 automatically kept alive, manual download.
00417      * @return           true if the request is successful, otherwise false.
00418      */
00419     bool cellLocSrvUdp(const char* server_1 = "cell-live1.services.u-blox.com",
00420                        int port = 46434, int latency = 1000, int mode = 0);
00421  
00422     /** Configure Cell Locate location sensor.
00423      *
00424      * @param scanMode network scan mode: 0 normal, 1 deep scan.
00425      * @return         true if the request is successful, otherwise false.
00426      */
00427     bool cellLocConfig(int scanMode);
00428  
00429     /** Request a one-shot Cell Locate.
00430      *
00431      * This function is non-blocking, the result is retrieved using cellLocGetxxx.
00432      *
00433      * Note: none of the CellLocate methods switch on the GNSS receiver chip.
00434      * That should be done by instantiating the GnssSerial or GnssI2C classes and
00435      * calling the init() method.
00436      *
00437      * Note: during the location process, unsolicited result codes will be returned
00438      * by the modem indicating progress and potentially flagging interesting errors.
00439      * In order to see these errors, instantiate this class with debugOn set to true.
00440      *   
00441      * @param sensor     sensor selection.
00442      * @param timeout    timeout period in seconds (1 - 999).
00443      * @param accuracy   target accuracy in meters (1 - 999999).
00444      * @param type       detailed or multi-hypothesis.
00445      * @param hypothesis maximum desired number of responses from CellLocate (up to 16),
00446      *                   must be 1 if type is CELL_DETAILED.
00447      * @return           true if the request is successful, otherwise false.
00448      */
00449     bool cellLocRequest(CellSensType sensor, int timeout, int accuracy,
00450                         CellRespType type = CELL_DETAILED, int hypothesis = 1);
00451 
00452     /** Get a position record.
00453      *
00454      * @param data  pointer to a CellLocData structure where the location will be put.
00455      * @param index of the position to retrieve.
00456      * @return      true if data has been retrieved and copied, false otherwise.
00457      */
00458     bool cellLocGetData(CellLocData *data, int index = 0);
00459     
00460     /** Get the number of position records received.
00461      *
00462      * @return number of position records received.
00463      */
00464     int cellLocGetRes();
00465     
00466     /** Get the number of position records expected to be received.
00467      *
00468      * @return number of position records expected to be received.
00469      */
00470     int cellLocGetExpRes();
00471     
00472 protected:
00473 
00474     /**********************************************************************
00475      * PROTECTED: HTTP
00476      **********************************************************************/
00477 
00478     /** Check for timeout.
00479      */
00480     #define TIMEOUT(t, ms)  ((ms != TIMEOUT_BLOCKING) && (ms < t.read_ms()))
00481 
00482     /** Check for a valid profile.
00483      */
00484     #define IS_PROFILE(p) (((p) >= 0) && (((unsigned int) p) < (sizeof(_httpProfiles)/sizeof(_httpProfiles[0]))) \
00485                            && (_httpProfiles[p].modemHandle != HTTP_PROF_UNUSED))
00486 
00487     /** Management structure for HTTP profiles.
00488      *
00489      * It is possible to have up to 4 different HTTP profiles (LISA-C200, LISA-U200 and SARA-G350) having:
00490      *
00491      * @param handle     the current HTTP profile is in handling state or not (default value is HTTP_ERROR).
00492      * @param timeout    the timeout for the current HTTP command.
00493      * @param pending    the status for the current HTTP command (in processing state or not).
00494      * @param cmd        the code for the current HTTP command.
00495      * @param result     the result for the current HTTP command once processed.
00496      */
00497      typedef struct {
00498          int modemHandle;
00499          int timeout;
00500          volatile bool pending;
00501          volatile int cmd;
00502          volatile int result;
00503          Error httpError;
00504      } HttpProfCtrl;
00505 
00506     /** The HTTP profile storage.
00507      */
00508     HttpProfCtrl _httpProfiles[4];
00509 
00510     /** Callback to capture the response to an HTTP command.
00511      */
00512     void UUHTTPCR_URC();
00513 
00514     /** Find a profile with a given handle.  If no handle is given, find the next
00515      * free profile.
00516      *
00517      * @param modemHandle the handle of the profile to find.
00518      * @return            the profile handle or negative if not found/created.
00519      */
00520     int findProfile(int modemHandle = HTTP_PROF_UNUSED);
00521 
00522     /** Helper function to get a HTTP command as a text string, useful
00523      * for debug purposes.
00524      *
00525      * @param httpCmdCode the HTTP command.
00526      * @return            HTTP command in string format.
00527      */
00528     const char* getHttpCmd(HttpCmd httpCmd);
00529 
00530     /**********************************************************************
00531      * PROTECTED: FTP
00532      **********************************************************************/
00533 
00534     /** Unused FTP op code marker.
00535      */
00536     #define FTP_OP_CODE_UNUSED -1
00537 
00538     /** The FTP timeout in milliseconds.
00539      */
00540     int _ftpTimeout;
00541 
00542     /** A place to store the FTP op code for the last result.
00543      */
00544     volatile int _lastFtpOpCodeResult;
00545 
00546     /** A place to store the last FTP result.
00547      */
00548     volatile int _lastFtpResult;
00549 
00550     /** A place to store the last FTP op code for data response.
00551      */
00552     volatile int _lastFtpOpCodeData;
00553 
00554     /** A place to store data returns from an FTP operation.
00555      */
00556     char * _ftpBuf;
00557 
00558     /** The length of FTP data that can be stored (at _ftpBuf).
00559      */
00560     int _ftpBufLen;
00561 
00562     /** storage for the last FTP error
00563      */
00564     Error _ftpError;
00565 
00566     /** Callback to capture the result of an FTP command.
00567      */
00568     void UUFTPCR_URC();
00569 
00570     /** Callback to capture data returned from an FTP command.
00571      */
00572     void UUFTPCD_URC();
00573 
00574     /** Helper function to get an FTP command as a text string, useful
00575      * for debug purposes.
00576      *
00577      * @param ftpCmdCode  the FTP command.
00578      * @return            FTP command in string format.
00579      */
00580     const char * getFtpCmd(FtpCmd ftpCmd);
00581 
00582     /**********************************************************************
00583      * PROTECTED: Cell Locate
00584      **********************************************************************/
00585 
00586     /**  The maximum number of hypotheses
00587      */
00588     #define CELL_MAX_HYP    (16 + 1)
00589 
00590     /** Received positions.
00591      */
00592     volatile int _locRcvPos;
00593 
00594     /** Expected positions.
00595      */
00596     volatile int _locExpPos;
00597 
00598     /**  The Cell Locate data.
00599      */
00600     CellLocData _loc[CELL_MAX_HYP];
00601 
00602     /** Buffer for the URC to work with
00603      */
00604     char urcBuf[128];
00605 
00606     /** Callback to capture +UULOCIND.
00607      */
00608     void UULOCIND_URC();
00609 
00610     /** Callback to capture +UULOC.
00611      */
00612     void UULOC_URC();
00613 };
00614 
00615 #endif // _UBLOX_AT_CELLULAR_INTERFACE_EXT_
00616