From 2c29852dba12dc7334c0cb9cd404a00ffdbb9b99 Mon Sep 17 00:00:00 2001 From: Mirela Chirica Date: Wed, 15 Aug 2018 09:32:47 +0300 Subject: [PATCH] Cellular: Added getters for device and serial to EasyCellularConnection --- .../easy_cellular/EasyCellularConnection.cpp | 10 ++++++++++ .../cellular/easy_cellular/EasyCellularConnection.h | 13 +++++++++++++ 2 files changed, 23 insertions(+) diff --git a/features/cellular/easy_cellular/EasyCellularConnection.cpp b/features/cellular/easy_cellular/EasyCellularConnection.cpp index 79a8fd3c87..204e4b7bff 100644 --- a/features/cellular/easy_cellular/EasyCellularConnection.cpp +++ b/features/cellular/easy_cellular/EasyCellularConnection.cpp @@ -336,6 +336,16 @@ NetworkStack *EasyCellularConnection::get_stack() } } +CellularDevice *EasyCellularConnection::get_device() +{ + return _cellularConnectionFSM->get_device(); +} + +UARTSerial *EasyCellularConnection::get_serial() +{ + return &_cellularSerial; +} + } // namespace #endif // CELLULAR_DEVICE diff --git a/features/cellular/easy_cellular/EasyCellularConnection.h b/features/cellular/easy_cellular/EasyCellularConnection.h index 396be5c5b8..036fa04a78 100644 --- a/features/cellular/easy_cellular/EasyCellularConnection.h +++ b/features/cellular/easy_cellular/EasyCellularConnection.h @@ -135,6 +135,19 @@ public: * @param plmn operator in numeric format. See more from 3GPP TS 27.007 chapter 7.3. */ void set_plmn(const char *plmn); + + /** Get the cellular device from the cellular state machine + * + * @return cellular device + */ + CellularDevice *get_device(); + + /** Get the UART serial file handle used by cellular subsystem + * + * @return address of cellular UART serial + */ + UARTSerial *get_serial(); + protected: /** Provide access to the NetworkStack object