NUGU SDK Linux
1.7.6
|
The message object received from the server. More...
Typedefs | |
typedef struct _nugu_directive | NuguDirective |
Directive object. | |
typedef void(* | NuguDirectiveDataCallback) (NuguDirective *ndir, int seq, void *userdata) |
Callback prototype for receiving an attachment. | |
Enumerations | |
enum | nugu_directive_medium { NUGU_DIRECTIVE_MEDIUM_AUDIO = 0 , NUGU_DIRECTIVE_MEDIUM_VISUAL = 1 , NUGU_DIRECTIVE_MEDIUM_NONE = 2 , NUGU_DIRECTIVE_MEDIUM_ANY = 3 , NUGU_DIRECTIVE_MEDIUM_MAX } |
event types More... | |
Functions | |
NUGU_API int | nugu_directive_add_data (NuguDirective *ndir, size_t length, const unsigned char *data) |
Add attachment data to directive. (e.g. TTS payload) More... | |
NUGU_API int | nugu_directive_close_data (NuguDirective *ndir) |
Set the attachment data status to "Received all data". More... | |
NUGU_API enum nugu_directive_medium | nugu_directive_get_blocking_medium (const NuguDirective *ndir) |
Get the medium of BlockingPolicy for the directive. More... | |
NUGU_API const char * | nugu_directive_get_blocking_medium_string (const NuguDirective *ndir) |
Get the medium string of BlockingPolicy for the directive. More... | |
NUGU_API unsigned char * | nugu_directive_get_data (NuguDirective *ndir, size_t *length) |
Get the attachment data received so far. When this function is called, the internal receive buffer is cleared. More... | |
NUGU_API size_t | nugu_directive_get_data_size (const NuguDirective *ndir) |
Get the size of attachment data received so far. More... | |
NUGU_API int | nugu_directive_is_active (const NuguDirective *ndir) |
Get the active status of directive. "active" means the directive is added to the directive sequencer. More... | |
NUGU_API int | nugu_directive_is_blocking (const NuguDirective *ndir) |
Get the blocking status of BlockingPolicy for the directive. More... | |
NUGU_API int | nugu_directive_is_data_end (const NuguDirective *ndir) |
Get the attachment data status. More... | |
NUGU_API NuguDirective * | nugu_directive_new (const char *name_space, const char *name, const char *version, const char *msg_id, const char *dialog_id, const char *referrer_id, const char *json, const char *groups) |
Create new directive object. More... | |
NUGU_API const char * | nugu_directive_peek_dialog_id (const NuguDirective *ndir) |
Get the dialog-request-id of directive. More... | |
NUGU_API const char * | nugu_directive_peek_groups (const NuguDirective *ndir) |
Get the group of directive. More... | |
NUGU_API const char * | nugu_directive_peek_json (const NuguDirective *ndir) |
Get the payload of directive. More... | |
NUGU_API const char * | nugu_directive_peek_media_type (const NuguDirective *ndir) |
Get the attachment mime type. More... | |
NUGU_API const char * | nugu_directive_peek_msg_id (const NuguDirective *ndir) |
Get the message-id of directive. More... | |
NUGU_API const char * | nugu_directive_peek_name (const NuguDirective *ndir) |
Get the name of directive. More... | |
NUGU_API const char * | nugu_directive_peek_namespace (const NuguDirective *ndir) |
Get the namespace of directive. More... | |
NUGU_API const char * | nugu_directive_peek_referrer_id (const NuguDirective *ndir) |
Get the referer-dialog-request-id of directive. More... | |
NUGU_API const char * | nugu_directive_peek_version (const NuguDirective *ndir) |
Get the version of directive. More... | |
NUGU_API void | nugu_directive_ref (NuguDirective *ndir) |
Increment the reference count of the directive object. More... | |
NUGU_API int | nugu_directive_remove_data_callback (NuguDirective *ndir) |
Remove attachment received event callback. More... | |
NUGU_API int | nugu_directive_set_active (NuguDirective *ndir, int flag) |
Set the active status of directive. More... | |
NUGU_API int | nugu_directive_set_blocking_policy (NuguDirective *ndir, enum nugu_directive_medium medium, int is_block) |
Set the medium of BlockingPolicy for the directive. More... | |
NUGU_API int | nugu_directive_set_data_callback (NuguDirective *ndir, NuguDirectiveDataCallback callback, void *userdata) |
Set attachment received event callback. More... | |
NUGU_API int | nugu_directive_set_media_type (NuguDirective *ndir, const char *type) |
Set the attachment mime type. More... | |
NUGU_API void | nugu_directive_unref (NuguDirective *ndir) |
Decrement the reference count of the directive object. More... | |
The message object received from the server.
The directive refers to a message received from the server and consists of the following elements.
NUGU_API NuguDirective* nugu_directive_new | ( | const char * | name_space, |
const char * | name, | ||
const char * | version, | ||
const char * | msg_id, | ||
const char * | dialog_id, | ||
const char * | referrer_id, | ||
const char * | json, | ||
const char * | groups | ||
) |
Create new directive object.
[in] | name_space | capability name space (e.g. "TTS") |
[in] | name | capability name (e.g. "Speak") |
[in] | version | version string (e.g. "1.0") |
[in] | msg_id | unique message-id |
[in] | dialog_id | unique dialog-request-id |
[in] | referrer_id | referrer-dialog-request-id |
[in] | json | payload |
[in] | groups | groups |
NUGU_API void nugu_directive_ref | ( | NuguDirective * | ndir | ) |
Increment the reference count of the directive object.
[in] | ndir | directive object |
NUGU_API void nugu_directive_unref | ( | NuguDirective * | ndir | ) |
Decrement the reference count of the directive object.
[in] | ndir | directive object |
NUGU_API const char* nugu_directive_peek_namespace | ( | const NuguDirective * | ndir | ) |
Get the namespace of directive.
[in] | ndir | directive object |
NUGU_API const char* nugu_directive_peek_name | ( | const NuguDirective * | ndir | ) |
Get the name of directive.
[in] | ndir | directive object |
NUGU_API const char* nugu_directive_peek_groups | ( | const NuguDirective * | ndir | ) |
Get the group of directive.
[in] | ndir | directive object |
NUGU_API const char* nugu_directive_peek_version | ( | const NuguDirective * | ndir | ) |
Get the version of directive.
[in] | ndir | directive object |
NUGU_API const char* nugu_directive_peek_msg_id | ( | const NuguDirective * | ndir | ) |
Get the message-id of directive.
[in] | ndir | directive object |
NUGU_API const char* nugu_directive_peek_dialog_id | ( | const NuguDirective * | ndir | ) |
Get the dialog-request-id of directive.
[in] | ndir | directive object |
NUGU_API const char* nugu_directive_peek_referrer_id | ( | const NuguDirective * | ndir | ) |
Get the referer-dialog-request-id of directive.
[in] | ndir | directive object |
NUGU_API const char* nugu_directive_peek_json | ( | const NuguDirective * | ndir | ) |
Get the payload of directive.
[in] | ndir | directive object |
NUGU_API int nugu_directive_is_active | ( | const NuguDirective * | ndir | ) |
Get the active status of directive. "active" means the directive is added to the directive sequencer.
[in] | ndir | directive object |
1 | active |
0 | not active |
-1 | failure |
NUGU_API int nugu_directive_set_active | ( | NuguDirective * | ndir, |
int | flag | ||
) |
Set the active status of directive.
[in] | ndir | directive object |
[in] | flag | active status(1 = active, 0 = not active) |
0 | success |
-1 | failure |
NUGU_API int nugu_directive_add_data | ( | NuguDirective * | ndir, |
size_t | length, | ||
const unsigned char * | data | ||
) |
Add attachment data to directive. (e.g. TTS payload)
[in] | ndir | directive object |
[in] | length | length of data |
[in] | data | data |
0 | success |
-1 | failure |
NUGU_API int nugu_directive_close_data | ( | NuguDirective * | ndir | ) |
Set the attachment data status to "Received all data".
[in] | ndir | directive object |
0 | success |
-1 | failure |
NUGU_API int nugu_directive_is_data_end | ( | const NuguDirective * | ndir | ) |
Get the attachment data status.
[in] | ndir | directive object |
0 | Data receiving is not yet completed. |
1 | Received all data |
-1 | failure |
NUGU_API int nugu_directive_set_media_type | ( | NuguDirective * | ndir, |
const char * | type | ||
) |
Set the attachment mime type.
[in] | ndir | directive object |
[in] | type | mime type |
0 | success |
-1 | failure |
NUGU_API const char* nugu_directive_peek_media_type | ( | const NuguDirective * | ndir | ) |
Get the attachment mime type.
[in] | ndir | directive object |
NUGU_API unsigned char* nugu_directive_get_data | ( | NuguDirective * | ndir, |
size_t * | length | ||
) |
Get the attachment data received so far. When this function is called, the internal receive buffer is cleared.
[in] | ndir | directive object |
[out] | length | attachment length |
NUGU_API size_t nugu_directive_get_data_size | ( | const NuguDirective * | ndir | ) |
Get the size of attachment data received so far.
[in] | ndir | directive object |
NUGU_API int nugu_directive_set_blocking_policy | ( | NuguDirective * | ndir, |
enum nugu_directive_medium | medium, | ||
int | is_block | ||
) |
Set the medium of BlockingPolicy for the directive.
[in] | ndir | directive object |
[in] | medium | medium of BlockingPolicy |
[in] | is_block | blocking status (1 = block, 0 = non-block) |
0 | success |
-1 | failure |
NUGU_API enum nugu_directive_medium nugu_directive_get_blocking_medium | ( | const NuguDirective * | ndir | ) |
Get the medium of BlockingPolicy for the directive.
[in] | ndir | directive object |
NUGU_API const char* nugu_directive_get_blocking_medium_string | ( | const NuguDirective * | ndir | ) |
Get the medium string of BlockingPolicy for the directive.
[in] | ndir | directive object |
NUGU_API int nugu_directive_is_blocking | ( | const NuguDirective * | ndir | ) |
Get the blocking status of BlockingPolicy for the directive.
[in] | ndir | directive object |
0 | non-block |
1 | block |
-1 | failure |
NUGU_API int nugu_directive_set_data_callback | ( | NuguDirective * | ndir, |
NuguDirectiveDataCallback | callback, | ||
void * | userdata | ||
) |
Set attachment received event callback.
[in] | ndir | directive object |
[in] | callback | callback function |
[in] | userdata | data to pass to the user callback |
0 | success |
-1 | failure |
NUGU_API int nugu_directive_remove_data_callback | ( | NuguDirective * | ndir | ) |
Remove attachment received event callback.
[in] | ndir | directive object |
0 | success |
-1 | failure |