17 #ifndef __NUGU_NETWORK_MANAGER_H__
18 #define __NUGU_NETWORK_MANAGER_H__
124 NuguEvent *nev,
int is_end,
size_t length,
unsigned char *data,
134 const char *dialog_id,
135 int code,
void *userdata);
143 int success,
const char *event_msg_id,
const char *event_dialog_id,
144 const char *json,
void *userdata);
158 const char *parent_msg_id,
int seq,
int is_end,
const char *media_type,
159 size_t length,
const void *data,
void *userdata);
173 #define NUGU_NETWORK_MAX_ADDRESS 255
318 unsigned char *data);
432 const char *additional_info);
struct _nugu_directive NuguDirective
Directive object.
Definition: nugu_directive.h:48
struct _nugu_event NuguEvent
Event object.
Definition: nugu_event.h:59
NUGU_API int nugu_network_manager_set_handoff_status_callback(NuguNetworkManagerHandoffStatusCallback callback, void *userdata)
Set handoff status callback.
nugu_network_handoff_status
network handoff status
Definition: nugu_network_manager.h:93
NUGU_API int nugu_network_manager_set_directive_callback(NuguNetworkManagerDirectiveCallback callback, void *userdata)
Set directive receive callback.
void(* NuguNetworkManagerEventDataSendNotifyCallback)(NuguEvent *nev, int is_end, size_t length, unsigned char *data, void *userdata)
Callback prototype for notification of event data sending requests.
Definition: nugu_network_manager.h:123
void(* NuguNetworkManagerEventResponseCallback)(int success, const char *event_msg_id, const char *event_dialog_id, const char *json, void *userdata)
Callback prototype for directive response of event request.
Definition: nugu_network_manager.h:142
nugu_network_protocol
network protocols
Definition: nugu_network_manager.h:164
void(* NuguNetworkManagerHandoffStatusCallback)(NuguNetworkHandoffStatus status, void *userdata)
Callback prototype for handoff status events.
Definition: nugu_network_manager.h:107
void(* NuguNetworkManagerEventSendNotifyCallback)(NuguEvent *nev, void *userdata)
Callback prototype for notification of event sending requests.
Definition: nugu_network_manager.h:115
NUGU_API int nugu_network_manager_set_event_response_callback(NuguNetworkManagerEventResponseCallback callback, void *userdata)
Set event response callback.
NUGU_API int nugu_network_manager_force_close_event(NuguEvent *nev)
Force close the NUGU_EVENT_TYPE_WITH_ATTACHMENT type event.
NUGU_API int nugu_network_manager_initialize(void)
Initialize the network manager.
NUGU_API int nugu_network_manager_send_event_data(NuguEvent *nev, int is_end, size_t length, unsigned char *data)
Send the attachment data of event to server.
struct nugu_network_server_policy NuguNetworkServerPolicy
Server policy information used for network connections.
NUGU_API int nugu_network_manager_disconnect(void)
Disconnect from server.
void(* NuguNetworkManagerEventResultCallback)(int success, const char *msg_id, const char *dialog_id, int code, void *userdata)
Callback prototype for result of event transfer request.
Definition: nugu_network_manager.h:132
NUGU_API const char * nugu_network_manager_peek_token(void)
Get the access token value.
NUGU_API const char * nugu_network_manager_peek_last_asr_time(void)
Get the last ASR event time information.
NUGU_API int nugu_network_manager_connect(void)
Connect to server.
NUGU_API int nugu_network_manager_set_event_data_send_notify_callback(NuguNetworkManagerEventDataSendNotifyCallback callback, void *userdata)
Set event data send notify callback.
NUGU_API int nugu_network_manager_set_connection_type(NuguNetworkConnectionType ctype)
Set the connection type.
NUGU_API int nugu_network_manager_reset_connection(void)
Immediately disconnect the current connection and reconnect.
NUGU_API int nugu_network_manager_send_event(NuguEvent *nev)
Send the event to server.
NUGU_API const char * nugu_network_manager_peek_useragent(void)
Get the UserAgent information.
NUGU_API int nugu_network_manager_set_status(NuguNetworkStatus network_status)
Set the current network status.
NUGU_API int nugu_network_manager_set_event_result_callback(NuguNetworkManagerEventResultCallback callback, void *userdata)
Set event send result callback.
NUGU_API int nugu_network_manager_set_useragent(const char *app_version, const char *additional_info)
Set the HTTP header UserAgent information.
nugu_network_connection_type
network connection type
Definition: nugu_network_manager.h:76
NUGU_API NuguNetworkStatus nugu_network_manager_get_status(void)
Get the current network status.
NUGU_API int nugu_network_manager_set_event_send_notify_callback(NuguNetworkManagerEventSendNotifyCallback callback, void *userdata)
Set event send notify callback.
NUGU_API void nugu_network_manager_deinitialize(void)
De-initialize the network manager.
nugu_network_status
network status
Definition: nugu_network_manager.h:62
NUGU_API int nugu_network_manager_set_token(const char *token)
Set the access token value.
void(* NuguNetworkManagerDirectiveCallback)(NuguDirective *ndir, void *userdata)
Callback prototype for receiving directive.
Definition: nugu_network_manager.h:150
NUGU_API int nugu_network_manager_set_attachment_callback(NuguNetworkManagerAttachmentCallback callback, void *userdata)
Set attachment of directive receive callback.
#define NUGU_NETWORK_MAX_ADDRESS
maximum size of address
Definition: nugu_network_manager.h:173
void(* NuguNetworkManagerAttachmentCallback)(const char *parent_msg_id, int seq, int is_end, const char *media_type, size_t length, const void *data, void *userdata)
Callback prototype for receiving directive attachment.
Definition: nugu_network_manager.h:157
NUGU_API NuguNetworkConnectionType nugu_network_manager_get_connection_type(void)
Get the connection type.
NUGU_API int nugu_network_manager_set_status_callback(NuguNetworkManagerStatusCallback callback, void *userdata)
Set network status callback.
NUGU_API int nugu_network_manager_set_registry_url(const char *urlname)
Set the device gateway registry url.
enum nugu_network_status NuguNetworkStatus
network status
NUGU_API int nugu_network_manager_handoff(const NuguNetworkServerPolicy *policy)
Handoff the current connection to new server.
enum nugu_network_connection_type NuguNetworkConnectionType
network connection type
enum nugu_network_handoff_status NuguNetworkHandoffStatus
network handoff status
void(* NuguNetworkManagerStatusCallback)(NuguNetworkStatus status, void *userdata)
Callback prototype for receiving network status events.
Definition: nugu_network_manager.h:85
NUGU_API const char * nugu_network_manager_peek_registry_url(void)
Get the device gateway registry url.
@ NUGU_NETWORK_HANDOFF_READY
Definition: nugu_network_manager.h:97
@ NUGU_NETWORK_HANDOFF_COMPLETED
Definition: nugu_network_manager.h:100
@ NUGU_NETWORK_HANDOFF_FAILED
Definition: nugu_network_manager.h:94
@ NUGU_NETWORK_PROTOCOL_H2
Definition: nugu_network_manager.h:165
@ NUGU_NETWORK_PROTOCOL_UNKNOWN
Definition: nugu_network_manager.h:167
@ NUGU_NETWORK_PROTOCOL_H2C
Definition: nugu_network_manager.h:166
@ NUGU_NETWORK_CONNECTION_ONDEMAND
Definition: nugu_network_manager.h:78
@ NUGU_NETWORK_CONNECTION_ORIENTED
Definition: nugu_network_manager.h:77
@ NUGU_NETWORK_READY
Definition: nugu_network_manager.h:65
@ NUGU_NETWORK_FAILED
Definition: nugu_network_manager.h:67
@ NUGU_NETWORK_TOKEN_ERROR
Definition: nugu_network_manager.h:68
@ NUGU_NETWORK_CONNECTING
Definition: nugu_network_manager.h:64
@ NUGU_NETWORK_CONNECTED
Definition: nugu_network_manager.h:66
@ NUGU_NETWORK_DISCONNECTED
Definition: nugu_network_manager.h:63
Server policy information used for network connections.
Definition: nugu_network_manager.h:179
int is_charge
Definition: nugu_network_manager.h:185
int retry_count_limit
Definition: nugu_network_manager.h:183
enum nugu_network_protocol protocol
Definition: nugu_network_manager.h:180
int port
Definition: nugu_network_manager.h:182
int connection_timeout_ms
Definition: nugu_network_manager.h:184
char hostname[255+1]
Definition: nugu_network_manager.h:181