Skip to content

Commit e53b931

Browse files
author
Ari Parkkila
committed
Typedef OnboardCellularInterface to EasyCellularConnection
1 parent c9c3f85 commit e53b931

File tree

4 files changed

+11
-8
lines changed

4 files changed

+11
-8
lines changed

features/cellular/easy_cellular/CellularConnectionFSM.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ namespace mbed {
3838

3939
static events::EventQueue at_queue(8 * EVENTS_EVENT_SIZE);
4040
static CELLULAR_DEVICE cellularDevice(at_queue);
41-
static char device_info_buf[2048];
4241

4342
CellularConnectionFSM::CellularConnectionFSM() :
4443
_serial(0), _state(STATE_INIT), _next_state(_state), _status_callback(0), _network(0), _power(0), _sim(0), _queue(
@@ -160,6 +159,7 @@ bool CellularConnectionFSM::open_sim()
160159
void CellularConnectionFSM::device_ready()
161160
{
162161
CellularInformation *info = _cellularDevice->open_information(_serial);
162+
char device_info_buf[2048]; // may be up to 2048 according to 3GPP
163163

164164
if (info->get_manufacturer(device_info_buf, sizeof(device_info_buf)) == NSAPI_ERROR_OK) {
165165
tr_info("Cellular device manufacturer: %s", device_info_buf);

features/cellular/framework/AT/ATHandler.cpp

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@ using namespace events;
3131
//#define MBED_TRACE_MAX_LEVEL TRACE_LEVEL_DEBUG
3232
#include "CellularLog.h"
3333

34-
// this is intentionally TRACE_LEVEL_INFO
35-
#if MBED_TRACE_MAX_LEVEL >= TRACE_LEVEL_INFO
34+
#if MBED_CONF_MBED_TRACE_ENABLE
3635
#define at_debug(format, ...) do { if (_debug_on) debug(format, ## __VA_ARGS__); } while (0)
3736
#else
3837
#define at_debug(...)
@@ -78,11 +77,7 @@ ATHandler::ATHandler(FileHandle *fh, EventQueue &queue, int timeout, const char
7877
_urc_matched(false),
7978
_error_found(false),
8079
_max_resp_length(MAX_RESP_LENGTH),
81-
#if MBED_TRACE_MAX_LEVEL == TRACE_LEVEL_DEBUG
82-
_debug_on(true),
83-
#else
8480
_debug_on(false),
85-
#endif
8681
_cmd_start(false)
8782
{
8883
//enable_debug(true);

features/netsocket/cellular/generic_modem_driver/OnboardCellularInterface.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,11 @@
1212
* See the License for the specific language governing permissions and
1313
* limitations under the License.
1414
*/
15+
1516
#include "OnboardCellularInterface.h"
1617

18+
#ifndef CELLULAR_DEVICE
19+
1720
#if MODEM_ON_BOARD && MODEM_ON_BOARD_UART && NSAPI_PPP_AVAILABLE
1821

1922
#include "onboard_modem_api.h"
@@ -52,3 +55,5 @@ void OnboardCellularInterface::modem_power_down()
5255
::onboard_modem_power_down();
5356
}
5457
#endif
58+
59+
#endif // CELLULAR_DEVICE

features/netsocket/cellular/generic_modem_driver/OnboardCellularInterface.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@
1616
#ifndef ONBOARD_CELLULAR_INTERFACE_
1717
#define ONBOARD_CELLULAR_INTERFACE_
1818

19-
#if MODEM_ON_BOARD && MODEM_ON_BOARD_UART && NSAPI_PPP_AVAILABLE
19+
#include "EasyCellularConnection.h"
20+
#ifdef CELLULAR_DEVICE
21+
typedef mbed::EasyCellularConnection OnboardCellularInterface;
22+
#elif MODEM_ON_BOARD && MODEM_ON_BOARD_UART && NSAPI_PPP_AVAILABLE
2023

2124
#include "UARTCellularInterface.h"
2225

0 commit comments

Comments
 (0)