callback API added

pull/6329/head
Teemu Kultala 2018-03-12 11:51:27 +02:00
parent f67fe4a7a3
commit bd75d5327f
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