NUGU SDK Linux
1.7.6
|
The message object sent to the server. More...
Typedefs | |
typedef struct _nugu_event | NuguEvent |
Event object. | |
Enumerations | |
enum | nugu_event_type { NUGU_EVENT_TYPE_DEFAULT , NUGU_EVENT_TYPE_WITH_ATTACHMENT } |
event types More... | |
Functions | |
NUGU_API void | nugu_event_free (NuguEvent *nev) |
Destroy the event object. More... | |
NUGU_API char * | nugu_event_generate_payload (NuguEvent *nev) |
Generate JSON payload using nugu_event attributes. More... | |
NUGU_API int | nugu_event_get_seq (NuguEvent *nev) |
Get the current sequence number of attachment data. More... | |
NUGU_API enum nugu_event_type | nugu_event_get_type (NuguEvent *nev) |
Get the type of NuguEvent. More... | |
NUGU_API int | nugu_event_increase_seq (NuguEvent *nev) |
Increase the sequence number. More... | |
NUGU_API NuguEvent * | nugu_event_new (const char *name_space, const char *name, const char *version) |
Create new event object. More... | |
NUGU_API const char * | nugu_event_peek_context (NuguEvent *nev) |
Get the context of event. More... | |
NUGU_API const char * | nugu_event_peek_dialog_id (NuguEvent *nev) |
Get the dialog-request-id of event. More... | |
NUGU_API const char * | nugu_event_peek_json (NuguEvent *nev) |
Get the payload of event. More... | |
NUGU_API const char * | nugu_event_peek_mime_type (NuguEvent *nev) |
Get the attachment mime type of NuguEvent. More... | |
NUGU_API const char * | nugu_event_peek_msg_id (NuguEvent *nev) |
Get the message-id of event. More... | |
NUGU_API const char * | nugu_event_peek_name (NuguEvent *nev) |
Get the name of event. More... | |
NUGU_API const char * | nugu_event_peek_namespace (NuguEvent *nev) |
Get the namespace of event. More... | |
NUGU_API const char * | nugu_event_peek_referrer_id (NuguEvent *nev) |
Get the referer-dialog-request-id of event. More... | |
NUGU_API const char * | nugu_event_peek_version (NuguEvent *nev) |
Get the version of event. More... | |
NUGU_API int | nugu_event_set_context (NuguEvent *nev, const char *context) |
Set text context of event. More... | |
NUGU_API int | nugu_event_set_dialog_id (NuguEvent *nev, const char *dialog_id) |
Set the dialog-request-id of event. More... | |
NUGU_API int | nugu_event_set_json (NuguEvent *nev, const char *json) |
Set the payload of event. More... | |
NUGU_API int | nugu_event_set_mime_type (NuguEvent *nev, const char *type) |
Set the attachment mime type of NuguEvent. More... | |
NUGU_API int | nugu_event_set_referrer_id (NuguEvent *nev, const char *referrer_id) |
Set the referer-dialog-request-id of event. More... | |
NUGU_API int | nugu_event_set_type (NuguEvent *nev, enum nugu_event_type type) |
Set the type of NuguEvent. More... | |
The message object sent to the server.
An event is a message sent to the server and consists of the following elements:
enum nugu_event_type |
NUGU_API NuguEvent* nugu_event_new | ( | const char * | name_space, |
const char * | name, | ||
const char * | version | ||
) |
Create new event object.
[in] | name_space | capability name space (e.g. "ASR") |
[in] | name | capability name (e.g. "Recognize") |
[in] | version | version string (e.g. "1.0") |
NUGU_API void nugu_event_free | ( | NuguEvent * | nev | ) |
NUGU_API const char* nugu_event_peek_namespace | ( | NuguEvent * | nev | ) |
Get the namespace of event.
[in] | nev | event object |
NUGU_API const char* nugu_event_peek_name | ( | NuguEvent * | nev | ) |
Get the name of event.
[in] | nev | event object |
NUGU_API const char* nugu_event_peek_version | ( | NuguEvent * | nev | ) |
Get the version of event.
[in] | nev | event object |
NUGU_API const char* nugu_event_peek_msg_id | ( | NuguEvent * | nev | ) |
Get the message-id of event.
[in] | nev | event object |
NUGU_API int nugu_event_set_context | ( | NuguEvent * | nev, |
const char * | context | ||
) |
Set text context of event.
[in] | nev | event object |
[in] | context | json type context information |
0 | success |
-1 | failure |
NUGU_API const char* nugu_event_peek_context | ( | NuguEvent * | nev | ) |
Get the context of event.
[in] | nev | event object |
NUGU_API int nugu_event_set_json | ( | NuguEvent * | nev, |
const char * | json | ||
) |
Set the payload of event.
[in] | nev | event object |
[in] | json | json type payload |
0 | success |
-1 | failure |
NUGU_API const char* nugu_event_peek_json | ( | NuguEvent * | nev | ) |
Get the payload of event.
[in] | nev | event object |
NUGU_API int nugu_event_set_dialog_id | ( | NuguEvent * | nev, |
const char * | dialog_id | ||
) |
Set the dialog-request-id of event.
[in] | nev | event object |
[in] | dialog_id | dialog-request-id |
0 | success |
-1 | failure |
NUGU_API const char* nugu_event_peek_dialog_id | ( | NuguEvent * | nev | ) |
Get the dialog-request-id of event.
[in] | nev | event object |
NUGU_API int nugu_event_set_referrer_id | ( | NuguEvent * | nev, |
const char * | referrer_id | ||
) |
Set the referer-dialog-request-id of event.
[in] | nev | event object |
[in] | referrer_id | referrer-dialog-request-id |
0 | success |
-1 | failure |
NUGU_API const char* nugu_event_peek_referrer_id | ( | NuguEvent * | nev | ) |
Get the referer-dialog-request-id of event.
[in] | nev | event object |
NUGU_API int nugu_event_set_type | ( | NuguEvent * | nev, |
enum nugu_event_type | type | ||
) |
Set the type of NuguEvent.
[in] | nev | event object |
[in] | type | event type |
0 | success |
-1 | failure |
NUGU_API enum nugu_event_type nugu_event_get_type | ( | NuguEvent * | nev | ) |
Get the type of NuguEvent.
[in] | nev | event object |
NUGU_API int nugu_event_get_seq | ( | NuguEvent * | nev | ) |
Get the current sequence number of attachment data.
[in] | nev | event object |
NUGU_API int nugu_event_increase_seq | ( | NuguEvent * | nev | ) |
Increase the sequence number.
[in] | nev | event object |
0 | success |
-1 | failure |
NUGU_API char* nugu_event_generate_payload | ( | NuguEvent * | nev | ) |
Generate JSON payload using nugu_event attributes.
[in] | nev | event object |
NULL | failure |
NUGU_API int nugu_event_set_mime_type | ( | NuguEvent * | nev, |
const char * | type | ||
) |
Set the attachment mime type of NuguEvent.
[in] | nev | event object |
[in] | type | attachment type. e.g. "application/octet-stream" |
0 | success |
-1 | failure |
NUGU_API const char* nugu_event_peek_mime_type | ( | NuguEvent * | nev | ) |
Get the attachment mime type of NuguEvent.
[in] | nev | event object |