Cellular: Update cellular documentation

pull/9646/head
Ari Parkkila 2019-01-09 13:04:17 +02:00 committed by adbridge
parent a8d1d26fa7
commit 01f1c4190c
7 changed files with 55 additions and 50 deletions

View File

@ -2,26 +2,21 @@
This is the Github repo for Mbed cellular connectivity: This is the Github repo for Mbed cellular connectivity:
easy_cellular/
EasyCellularConnection Simplified cellular usage based on `CellularBase.h`
CellularConnectionUtil A utility class for cellular connection
framework/ framework/
API Application Programming Interface for cellular connectivity API Application Programming Interface for cellular connectivity
AT AT implementation based on 3GPP TS 27.007 specification AT AT implementation based on 3GPP TS 27.007 specification
common Common and utility sources common Common and utility sources
device Implementation of cellular device and state machine
targets Vendor specific cellular module adaptations targets Vendor specific cellular module adaptations
TESTS Cellular Greentea test TESTS Cellular Greentea test
UNITTESTS Cellular unit test **Application developers should only use API folder.
## Known limitations ## Known limitations
**Please note that this is a first release of Cellular framework and is subject to further development in future.** **Please note that this is a first release of Cellular framework and is subject to further development in future.**
Only UDP is supported when using AT commands to control sockets in an IP stack built into the cellular modem. If TCP is required, use the PPP/LWIP stack.
## Supported modules ## Supported modules
You can find currently supported cellular modules in the `framework/targets/` folder, where we also add support for new cellular modules. You can find currently supported cellular modules in the `framework/targets/` folder, where we also add support for new cellular modules.
@ -30,23 +25,6 @@ You can find currently supported cellular modules in the `framework/targets/` fo
You can change cellular defaults in the `mbed_lib.json` configuration file. You can change cellular defaults in the `mbed_lib.json` configuration file.
You can also override cellular defaults in the `mbed_app.json` configuration file:
"config": {
"cellular_plmn": {
"help": "PLMN selection, 0=auto",
"value": 0
},
"apn": {
"help": "Access point name, e.g. internet",
"value": "\"internet\""
},
"cellular_sim_pin": {
"help": "PIN code",
"value": "\"1234\""
}
}
## Debug traces ## Debug traces
You can define the debug tracing level in the `mbed_app.json` configuration file: You can define the debug tracing level in the `mbed_app.json` configuration file:
@ -77,9 +55,7 @@ The `TESTS` folder contains Greentea tests for cellular specific classes. You ne
## Unit tests ## Unit tests
The `UNITTESTS` folder contains unit tests for cellular specific classes. Unit tests are based on the stubbing method. Cellular unit tests are in Mbed OS root `UNITTESTS`. Unit tests are based on the stubbing method.
You can run those tests locally by running `./run_tests` script under the `UNITTESTS/` folder.
You need the following applications: `cpputest`, `gcov` and `lcov` (genhtml) for running the tests. You need the following applications: `cpputest`, `gcov` and `lcov` (genhtml) for running the tests.

View File

@ -22,6 +22,12 @@
namespace mbed { namespace mbed {
/**
* @addtogroup cellular
* @{
*/
/// CellularContext is CellularBase/NetworkInterface with extensions for cellular connectivity
class CellularContext : public CellularBase { class CellularContext : public CellularBase {
public: public:
@ -50,7 +56,7 @@ public:
Week Week
}; };
/* PDP Context information */ /// PDP Context information
struct pdpcontext_params_t { struct pdpcontext_params_t {
char apn[MAX_ACCESSPOINT_NAME_LENGTH + 1]; char apn[MAX_ACCESSPOINT_NAME_LENGTH + 1];
char local_addr[MAX_IPV6_ADDR_IN_IPV4LIKE_DOTTED_FORMAT + 1]; char local_addr[MAX_IPV6_ADDR_IN_IPV4LIKE_DOTTED_FORMAT + 1];
@ -255,6 +261,10 @@ protected: // Device specific implementations might need these so protected
const char *_pwd; const char *_pwd;
}; };
/**
* @}
*/
} // namespace mbed } // namespace mbed

View File

@ -35,6 +35,11 @@ class FileHandle;
const int MAX_PIN_SIZE = 8; const int MAX_PIN_SIZE = 8;
const int MAX_PLMN_SIZE = 16; const int MAX_PLMN_SIZE = 16;
/**
* @addtogroup cellular
* @{
*/
/** /**
* Class CellularDevice * Class CellularDevice
* *
@ -279,6 +284,10 @@ private:
Callback<void(nsapi_event_t, intptr_t)> _status_cb; Callback<void(nsapi_event_t, intptr_t)> _status_cb;
}; };
/**
* @}
*/
} // namespace mbed } // namespace mbed
#endif // CELLULAR_DEVICE_H_ #endif // CELLULAR_DEVICE_H_

View File

@ -23,6 +23,11 @@
namespace mbed { namespace mbed {
/**
* @addtogroup cellular
* @{
*/
/** /**
* Class CellularInformation * Class CellularInformation
* *
@ -83,6 +88,10 @@ public:
virtual nsapi_error_t get_serial_number(char *buf, size_t buf_size, SerialNumberType type = SN) = 0; virtual nsapi_error_t get_serial_number(char *buf, size_t buf_size, SerialNumberType type = SN) = 0;
}; };
/**
* @}
*/
} // namespace mbed } // namespace mbed
#endif // CELLULAR_INFORMATION_H_ #endif // CELLULAR_INFORMATION_H_

View File

@ -1,11 +1,3 @@
/*
* Copyright (c) 2017, Arm Limited and affiliates.
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
@ -32,18 +24,16 @@ const int MAX_OPERATOR_NAME_LONG = 16;
const int MAX_OPERATOR_NAME_SHORT = 8; const int MAX_OPERATOR_NAME_SHORT = 8;
/** /**
* Class CellularNetwork * @addtogroup cellular
* * @{
* An abstract interface for connecting to a network and getting information from it.
*/ */
/// An abstract interface for connecting to a network and getting information from it.
class CellularNetwork { class CellularNetwork {
protected: protected:
// friend of CellularDevice so that it's the only way to close/delete this class. // friend of CellularDevice so that it's the only way to close/delete this class.
friend class CellularDevice; friend class CellularDevice;
/**
* virtual Destructor
*/
virtual ~CellularNetwork() {} virtual ~CellularNetwork() {}
public: public:
@ -112,7 +102,7 @@ public:
RAT_MAX = 11 // to reserve string array RAT_MAX = 11 // to reserve string array
}; };
// 3GPP TS 27.007 - 7.3 PLMN selection +COPS /// 3GPP TS 27.007 - 7.3 PLMN selection +COPS
struct operator_t { struct operator_t {
enum Status { enum Status {
Unknown, Unknown,
@ -141,6 +131,7 @@ public:
typedef CellularList<operator_t> operList_t; typedef CellularList<operator_t> operList_t;
/// Cellular operator names in numeric and alpha format
struct operator_names_t { struct operator_names_t {
char numeric[MAX_OPERATOR_NAME_SHORT + 1]; char numeric[MAX_OPERATOR_NAME_SHORT + 1];
char alpha[MAX_OPERATOR_NAME_LONG + 1]; char alpha[MAX_OPERATOR_NAME_LONG + 1];
@ -154,7 +145,7 @@ public:
}; };
typedef CellularList<operator_names_t> operator_names_list; typedef CellularList<operator_names_t> operator_names_list;
/* Network registering mode */ /// Network registering mode
enum NWRegisteringMode { enum NWRegisteringMode {
NWModeAutomatic = 0, // automatic registering NWModeAutomatic = 0, // automatic registering
NWModeManual, // manual registering with plmn NWModeManual, // manual registering with plmn
@ -163,7 +154,7 @@ public:
NWModeManualAutomatic // if manual fails, fallback to automatic NWModeManualAutomatic // if manual fails, fallback to automatic
}; };
/* Network registration information */ /// Network registration information
struct registration_params_t { struct registration_params_t {
RegistrationType _type; RegistrationType _type;
RegistrationStatus _status; RegistrationStatus _status;
@ -365,6 +356,10 @@ public:
virtual nsapi_error_t get_registration_params(RegistrationType type, registration_params_t &reg_params) = 0; virtual nsapi_error_t get_registration_params(RegistrationType type, registration_params_t &reg_params) = 0;
}; };
/**
* @}
*/
} // namespace mbed } // namespace mbed
#endif // CELLULAR_NETWORK_H_ #endif // CELLULAR_NETWORK_H_

View File

@ -35,6 +35,11 @@ const uint16_t SMS_SIM_WAIT_TIME_MILLISECONDS = 200;
const int SMS_ERROR_MULTIPART_ALL_PARTS_NOT_READ = -5001; const int SMS_ERROR_MULTIPART_ALL_PARTS_NOT_READ = -5001;
/**
* @addtogroup cellular
* @{
*/
/** /**
* Class CellularSMS * Class CellularSMS
* *
@ -162,6 +167,10 @@ public:
virtual void set_extra_sim_wait_time(int sim_wait_time) = 0; virtual void set_extra_sim_wait_time(int sim_wait_time) = 0;
}; };
/**
* @}
*/
} // namespace mbed } // namespace mbed
#endif // CELLULAR_SMS_H_ #endif // CELLULAR_SMS_H_

View File

@ -53,16 +53,13 @@ enum DeviceErrorType {
DeviceErrorTypeErrorCME // AT ERROR CME DeviceErrorTypeErrorCME // AT ERROR CME
}; };
/* struct used when getting at response error. Defines error code and type */ /** AT response error with error code and type */
struct device_err_t { struct device_err_t {
DeviceErrorType errType; DeviceErrorType errType;
int errCode; int errCode;
}; };
/** Class ATHandler /// Class for sending AT commands and parsing AT responses.
*
* Class for sending AT commands and parsing AT responses.
*/
class ATHandler { class ATHandler {
public: public: