mirror of https://github.com/ARMmbed/mbed-os.git
Added cellular stack API
parent
60f7054a45
commit
db2c5cff20
|
@ -533,3 +533,8 @@ CellularDevice* CellularConnectionUtil::get_device()
|
|||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
NetworkStack *CellularConnectionUtil::get_stack()
|
||||
{
|
||||
return _cellularDevice->get_stack();
|
||||
}
|
||||
|
|
|
@ -76,6 +76,10 @@ protected:
|
|||
bool get_attach_network(CellularNetwork::AttachStatus &status);
|
||||
bool set_attach_network();
|
||||
|
||||
protected:
|
||||
friend class EasyCellularConnection;
|
||||
NetworkStack *get_stack();
|
||||
|
||||
private:
|
||||
void device_ready();
|
||||
void report_failure(const char* msg);
|
||||
|
|
|
@ -149,6 +149,6 @@ NetworkStack *EasyCellularConnection::get_stack()
|
|||
#if NSAPI_PPP_AVAILABLE
|
||||
return nsapi_ppp_get_stack();
|
||||
#else
|
||||
return NULL;//cellularConnection.get_network();
|
||||
return cellularConnection.get_stack();
|
||||
#endif // #if NSAPI_PPP_AVAILABLE
|
||||
}
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
#include "CellularPower.h"
|
||||
#include "CellularMultiplexer.h"
|
||||
#include "CellularInformation.h"
|
||||
#include "NetworkStack.h"
|
||||
|
||||
namespace mbed {
|
||||
|
||||
|
@ -114,6 +115,12 @@ public:
|
|||
* @param timeout milliseconds to wait response from modem
|
||||
*/
|
||||
virtual void set_timeout(int timeout) = 0;
|
||||
|
||||
/** Get network stack.
|
||||
*
|
||||
* @return network stack
|
||||
*/
|
||||
virtual NetworkStack *get_stack() = 0;
|
||||
};
|
||||
|
||||
} // namespace mbed
|
||||
|
|
|
@ -246,3 +246,11 @@ void AT_CellularDevice::set_timeout(int timeout)
|
|||
atHandler = atHandler->_nextATHandler;
|
||||
}
|
||||
}
|
||||
|
||||
NetworkStack *AT_CellularDevice::get_stack()
|
||||
{
|
||||
if (!_network) {
|
||||
return NULL;
|
||||
}
|
||||
return _network->get_stack();
|
||||
}
|
||||
|
|
|
@ -127,6 +127,12 @@ public: // CellularDevice
|
|||
*/
|
||||
virtual void set_timeout(int timeout);
|
||||
|
||||
/** Get network stack.
|
||||
*
|
||||
* @return network stack
|
||||
*/
|
||||
NetworkStack *get_stack();
|
||||
|
||||
protected:
|
||||
AT_CellularNetwork *_network;
|
||||
AT_CellularSMS *_sms;
|
||||
|
|
Loading…
Reference in New Issue