diff options
Diffstat (limited to 'src/components/include/transport_manager/transport_adapter/transport_adapter_event.h')
-rw-r--r-- | src/components/include/transport_manager/transport_adapter/transport_adapter_event.h | 50 |
1 files changed, 48 insertions, 2 deletions
diff --git a/src/components/include/transport_manager/transport_adapter/transport_adapter_event.h b/src/components/include/transport_manager/transport_adapter/transport_adapter_event.h index 7879a136b2..18f4ccb2d1 100644 --- a/src/components/include/transport_manager/transport_adapter/transport_adapter_event.h +++ b/src/components/include/transport_manager/transport_adapter/transport_adapter_event.h @@ -39,6 +39,27 @@ namespace transport_manager { +/** + * @enum Available types of events. + */ +enum class EventTypeEnum { + ON_SEARCH_DONE = 0, + ON_SEARCH_FAIL, + ON_DEVICE_LIST_UPDATED, + ON_FIND_NEW_APPLICATIONS_REQUEST, + ON_CONNECT_DONE, + ON_CONNECT_FAIL, + ON_DISCONNECT_DONE, + ON_DISCONNECT_FAIL, + ON_SEND_DONE, + ON_SEND_FAIL, + ON_RECEIVED_DONE, + ON_RECEIVED_FAIL, + ON_COMMUNICATION_ERROR, + ON_UNEXPECTED_DISCONNECT, + ON_TRANSPORT_SWITCH_REQUESTED +}; + class TransportAdapterEvent { public: TransportAdapterEvent() {} @@ -52,7 +73,7 @@ class TransportAdapterEvent { * @param data Smart pointer to the raw message. * @param error Error class that contains details of this error situation. */ - TransportAdapterEvent(int type, + TransportAdapterEvent(EventTypeEnum type, transport_adapter::TransportAdapter* adapter, const DeviceUID& device_handle, const ApplicationHandle& application_id, @@ -64,10 +85,35 @@ class TransportAdapterEvent { , transport_adapter(adapter) , event_data(data) , event_error(error) {} + + /** + * DEPRECATED + * @brief Constructor. + * + * @param type Event type. + * @param transport_adapter Transport adapter + * @param device_handle Handle of device. + * @param application_id Handle of application. + * @param data Smart pointer to the raw message. + * @param error Error class that contains details of this error situation. + */ + TransportAdapterEvent(int type, + transport_adapter::TransportAdapter* adapter, + const DeviceUID& device_handle, + const ApplicationHandle& application_id, + ::protocol_handler::RawMessagePtr data, + BaseErrorPtr error) + : event_type(static_cast<EventTypeEnum>(type)) + , application_id(application_id) + , device_uid(device_handle) + , transport_adapter(adapter) + , event_data(data) + , event_error(error) {} + /** * @brief Value that describe event type. */ - int event_type; + EventTypeEnum event_type; /** * @brief Handle of application */ |