ESP SDK C API
| Entities/Objects | Functions
Project

 Project Options
 Project Deployment Information
 Project Events

Entities/Objects

typedef struct EspDeployment EspDeployment
typedef struct EspProjectEvent EspProjectEvent
typedef struct EspProjectOptions EspProjectOptions
typedef struct EspProject EspProject
typedef void(* PROJECT_CALLBACK_T )(const EspProjectEvent *event, void *user_data)

Functions

ESPAPICALL EspProjectesp_project_get (const EspUri *uri, const EspCredentials *creds, const EspProjectOptions *project_options, EspError *error)
ESPAPICALL EspProjectesp_project_get_standalone (const char *host, const int32_t port, const EspCredentials *creds, const EspProjectOptions *project_options, EspError *error)
ESPAPICALL int32_t esp_project_connect (EspProject *project, EspError *error)
ESPAPICALL int32_t esp_project_disconnect (EspProject *project, EspError *error)
ESPAPICALL int32_t esp_project_close (EspProject *project, EspError *error)
ESPAPICALL EspServeresp_project_get_server (EspProject *project, EspError *error)
ESPAPICALL EspSubscriberesp_project_create_subscriber (EspProject *project, const EspSubscriberOptions *options, EspError *error)
ESPAPICALL EspPublisheresp_project_create_publisher (EspProject *project, const EspPublisherOptions *options, EspError *error)
ESPAPICALL int32_t esp_project_get_stream_names (EspProject *project, ESP_STRING_ARRAY *names, EspError *error)
ESPAPICALL int32_t esp_project_get_model_stream_names (EspProject *project, EspList *stream_list, EspError *error)
ESPAPICALL int32_t esp_project_get_intermediate_stream_names (EspProject *project, EspList *stream_list, EspError *error)
ESPAPICALL int32_t esp_project_get_system_stream_names (EspProject *project, EspList *stream_list, EspError *error)
ESPAPICALL int32_t esp_project_get_error_stream_names (EspProject *project, EspList *stream_list, EspError *error)
ESPAPICALL const EspStreamesp_project_get_stream (EspProject *project, const char *stream, EspError *error)
ESPAPICALL int32_t esp_project_is_connected (EspProject *project, int32_t *connected, EspError *error)
ESPAPICALL int32_t esp_project_is_quiesced (EspProject *project, int32_t *quiesced, EspError *error)
ESPAPICALL int32_t esp_project_set_callback (EspProject *project, uint32_t events, PROJECT_CALLBACK_T callback, void *data, EspError *error)
ESPAPICALL int32_t esp_project_select_with (EspProject *project, EspSelector *selector, uint32_t events, EspError *error)

Function Documentation

ESPAPICALL int32_t esp_project_close ( EspProject project,
EspError *  error 
)

Once closed this project object is no longer available for interaction In DIRECT access mode, call returns when EspProject closes. In CALLBACK/SELECT it returns immediately. Completion is indicated by an ESP_PROJECT_EVENT_CLOSED event.

Returns:
0 on success.
ESPAPICALL int32_t esp_project_connect ( EspProject project,
EspError *  error 
)

Establishes a connection to the project specified in the URI when creating the object. In DIRECT access mode, call returns when the connection is established. In CALLBACK/SELECT it returns immediately. Completion is indicated by an ESP_PROJECT_EVENT_CONNECTED event.

Returns:
0 on success.
ESPAPICALL EspPublisher* esp_project_create_publisher ( EspProject project,
const EspPublisherOptions options,
EspError *  error 
)

Creates a publisher for this project. The returned EspPublisher should not be freed explicitly. The lifetime is managed by the SDK.

Returns:
NULL on error.
Parameters:
projectEspProject to create a publisher on
optionsEspPublisher options or NULL for defaults
ESPAPICALL EspSubscriber* esp_project_create_subscriber ( EspProject project,
const EspSubscriberOptions options,
EspError *  error 
)

Creates an EspSubscriber for this project. The returned EspSubscriber should not be freed explicitly. The lifetime is managed by the SDK.

Returns:
NULL on error.
Parameters:
projectEspProject to create a subscriber on
optionsEspSubscriberOptions or NULL for defaults
ESPAPICALL int32_t esp_project_disconnect ( EspProject project,
EspError *  error 
)

Disconnects from a connected project. In DIRECT access mode, call returns when EspProject disconnects. In CALLBACK/SELECT returns immediately. Completion is indicated by an ESP_PROJECT_EVENT_DISCONNECTED event.

Returns:
0 on success
ESPAPICALL EspProject* esp_project_get ( const EspUri uri,
const EspCredentials creds,
const EspProjectOptions project_options,
EspError *  error 
)

Retrieves a project object corresponding to the URI.

Returns:
NULL in case of error.
Parameters:
uriuri for the project to retrieve
credsvalid EspCredentials for authorisation, NULL for no authorisation
project_optionsvalid EspProjectOption or NULL for defaults
ESPAPICALL int32_t esp_project_get_error_stream_names ( EspProject project,
EspList stream_list,
EspError *  error 
)

Retrieve the list of errror streams names.

Returns:
0 on success.
Parameters:
projectEspProject to query
stream_listPointer to an EspList that will contain the streams on return
ESPAPICALL int32_t esp_project_get_intermediate_stream_names ( EspProject project,
EspList stream_list,
EspError *  error 
)

Retrieve the list of streams that have been generated by the compiler.

Returns:
0 on success.
Parameters:
projectEspProject to query
stream_listPointer to an EspList that will contain the streams on return
ESPAPICALL int32_t esp_project_get_model_stream_names ( EspProject project,
EspList stream_list,
EspError *  error 
)

Retrieve the list of streams that are explicitly modeled in the current project.

Returns:
0 on success.
Parameters:
projectEspProject to query
stream_listPointer to an EspList that will contain the streams on return
ESPAPICALL EspServer* esp_project_get_server ( EspProject project,
EspError *  error 
)

Retrieve the parent EspServer for this project.

Returns:
NULL on error.
ESPAPICALL EspProject* esp_project_get_standalone ( const char *  host,
const int32_t  port,
const EspCredentials creds,
const EspProjectOptions project_options,
EspError *  error 
)

Retrieves a project object to connect to a standalone project started outside the server framework.

Returns:
NULL if error.
Parameters:
hostHost name where the standalone project is running
portCommand and control port for the standalone project
credsvalid EspCredentials for authorization, NULL for no authorization
project_optionsvalid EspProjectOption or NULL for defaults
ESPAPICALL const EspStream* esp_project_get_stream ( EspProject project,
const char *  stream,
EspError *  error 
)

Retrieve an EspStream object for the corresponding stream name.

Returns:
EspStream object, NULL in case of error.
Parameters:
projectEspProject to query
streamStream name to retrieve
ESPAPICALL int32_t esp_project_get_stream_names ( EspProject project,
ESP_STRING_ARRAY names,
EspError *  error 
)

Retrieves a list of streams that are publicly accessible in the project. ESP_ARRAY_FREE should be called to free the memory used by the ESP_STRING_ARRAY structure.

NOTE: This call has been deprecated. Use esp_project_get_model_stream_names()

Returns:
0 on success.
ESPAPICALL int32_t esp_project_get_system_stream_names ( EspProject project,
EspList stream_list,
EspError *  error 
)

Retrieve the list of system streams names.

Returns:
0 on success.
Parameters:
projectEspProject to query
stream_listPointer to an EspList that will contain the streams on return
ESPAPICALL int32_t esp_project_is_connected ( EspProject project,
int32_t *  connected,
EspError *  error 
)

Check if this EspProject is connected to the backend.

Returns:
0 on success.
Parameters:
projectEspProject to query
connectedPointer to store the state, non-zero if still connected
ESPAPICALL int32_t esp_project_is_quiesced ( EspProject project,
int32_t *  quiesced,
EspError *  error 
)

Check if the backed project is quiesced.

Returns:
0 on success
Parameters:
projectEspProject to query
quiescedPointer to store quiesced state, non-zero if quiesced
ESPAPICALL int32_t esp_project_select_with ( EspProject project,
EspSelector selector,
uint32_t  events,
EspError *  error 
)

Registers this EspProject with the specified EspSelector. Waiting on the selector will return when the events registered for are triggered. Details in case of error

Parameters:
projectThe EspProject object to monitor for events
selectorThe EspSelector to use for monitoring
eventsThe events to monitor for
ESPAPICALL int32_t esp_project_set_callback ( EspProject project,
uint32_t  events,
PROJECT_CALLBACK_T  callback,
void *  data,
EspError *  error 
)

Registers a callback handler for the project in CALLBACK access mode.

Returns:
0 on success.
Parameters:
projectPointer to a valid EspProject object
eventsBitwise OR'd value of ESP_PROJECT_EVENT_XXX types of interest
callbackPointer to the callback handler function
dataPointer to arbitrary data which will be passed back to callback handler
 All Classes Variables