Merge pull request #6329 from TeemuKultala/callback_changes

Cellular: add callback API
pull/6211/merge
Cruz Monrreal 2018-03-15 11:04:17 -05:00 committed by GitHub
commit 92bbdbb60a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 24 additions and 0 deletions

View File

@ -381,6 +381,30 @@ public:
* @return NSAPI_ERROR_OK on success, negative error code on failure
*/
virtual nsapi_error_t get_operator_params(int &format, operator_t &operator_params) = 0;
/** Register callback for status reporting
*
* The specified status callback function will be called on status changes
* on the network. The parameters on the callback are the event type and
* event-type dependent reason parameter.
*
* @param status_cb The callback for status changes
*/
virtual void attach(mbed::Callback<void(nsapi_event_t, intptr_t)> status_cb) = 0;
/** Get the connection status
*
* @return The connection status according to ConnectionStatusType
*/
virtual nsapi_connection_status_t get_connection_status() const = 0;
/** Set blocking status of connect() which by default should be blocking
*
* @param blocking true if connect is blocking
* @return 0 on success, negative error code on failure
*/
virtual nsapi_error_t set_blocking(bool blocking) = 0;
};
} // namespace mbed