diff --git a/features/cellular/framework/API/CellularContext.h b/features/cellular/framework/API/CellularContext.h index 9107d585e6..dd76ac353c 100644 --- a/features/cellular/framework/API/CellularContext.h +++ b/features/cellular/framework/API/CellularContext.h @@ -106,6 +106,16 @@ public: // from NetworkInterface virtual nsapi_error_t set_blocking(bool blocking) = 0; virtual NetworkStack *get_stack() = 0; virtual const char *get_ip_address() = 0; + + /** Register callback for status reporting. + * + * The specified status callback function will be called on the network and cellular device status changes. + * The parameters on the callback are the event type and event-type dependent reason parameter. + * + * @remark deleting CellularDevice/CellularContext in callback not allowed. + * + * @param status_cb The callback for status changes. + */ virtual void attach(mbed::Callback status_cb) = 0; virtual nsapi_error_t connect() = 0; virtual nsapi_error_t disconnect() = 0; diff --git a/features/cellular/framework/API/CellularDevice.h b/features/cellular/framework/API/CellularDevice.h index 4dc952f863..48803a1a1e 100644 --- a/features/cellular/framework/API/CellularDevice.h +++ b/features/cellular/framework/API/CellularDevice.h @@ -104,9 +104,8 @@ public: /** Start the interface * * Power on the device and does the initializations for communication with the modem.. - * By default this API is synchronous. API can be set to asynchronous with method set_blocking(...). - * In synchronous and asynchronous mode application can get result in from callback which is set with - * attach(...) + * API is asynchronous. Application can get results from CellularContext callback which is set + * with attach(...) or callback which is set by attach(...) in this class. * * @return NSAPI_ERROR_OK on success * NSAPI_ERROR_NO_MEMORY on case of memory failure @@ -116,9 +115,8 @@ public: /** Start the interface * * Attempts to open the sim. - * By default this API is synchronous. API can be set to asynchronous with method set_blocking(...). - * In synchronous and asynchronous mode application can get result in from callback which is set with - * attach(...) + * API is asynchronous. Application can get results from CellularContext callback which is set + * with attach(...) or callback which is set by attach(...) in this class. * * @return NSAPI_ERROR_OK on success * NSAPI_ERROR_NO_MEMORY on case of memory failure @@ -128,9 +126,8 @@ public: /** Start the interface * * Attempts to register the device to cellular network. - * By default this API is synchronous. API can be set to asynchronous with method set_blocking(...). - * In synchronous and asynchronous mode application can get result in from callback which is set with - * attach(...) + * API is asynchronous. Application can get results from CellularContext callback which is set + * with attach(...) or callback which is set by attach(...) in this class. * * @return NSAPI_ERROR_OK on success * NSAPI_ERROR_NO_MEMORY on case of memory failure @@ -140,9 +137,8 @@ public: /** Start the interface * * Attempts to attach the device to cellular network. - * By default this API is synchronous. API can be set to asynchronous with method set_blocking(...). - * In synchronous and asynchronous mode application can get result in from callback which is set with - * attach(...) + * API is asynchronous. Application can get results from CellularContext callback which is set + * with attach(...) or callback which is set by attach(...) in this class. * * @return NSAPI_ERROR_OK on success * NSAPI_ERROR_NO_MEMORY on case of memory failure