ESP SDK C API
Functions
Subscription Options
Subscribing

Functions

ESPAPICALL EspSubscriberOptionsesp_subscriber_options_create (EspError *error)
ESPAPICALL int32_t esp_subscriber_options_free (EspSubscriberOptions *options, EspError *error)
ESPAPICALL int32_t esp_subscriber_options_set_access_mode (EspSubscriberOptions *options, ESP_ACCESS_MODE_T mode, EspError *error)
ESPAPICALL int32_t esp_subscriber_options_set_dispatcher (EspSubscriberOptions *options, const EspDispatcher *dispatcher, EspError *error)
ESPAPICALL int32_t esp_subscriber_options_set_updater (EspSubscriberOptions *options, const EspUpdater *updater, EspError *error)
ESPAPICALL int32_t esp_subscriber_options_set_flags (EspSubscriberOptions *options, uint32_t flags, EspError *error)
ESPAPICALL int32_t esp_subscriber_options_set_base_drain_timeout (EspSubscriberOptions *options, int32_t timeout, EspError *error)
ESPAPICALL int32_t esp_subscriber_options_set_pulsed (EspSubscriberOptions *options, int32_t interval, EspError *error)
ESPAPICALL int32_t esp_subscriber_options_set_queuesize (EspSubscriberOptions *options, int32_t size, EspError *error)

Function Documentation

ESPAPICALL EspSubscriberOptions* esp_subscriber_options_create ( EspError *  error)

Creates a new EspSubscriberOptions object.

Returns:
NULL on error.
ESPAPICALL int32_t esp_subscriber_options_free ( EspSubscriberOptions options,
EspError *  error 
)

Frees an EspSubscriberOptions object.

Returns:
0 on success.
ESPAPICALL int32_t esp_subscriber_options_set_access_mode ( EspSubscriberOptions options,
ESP_ACCESS_MODE_T  mode,
EspError *  error 
)

Set the access mode for the Subscriber that will be created using this options object. Default is DIRECT_ACCESS

Returns:
0 on success. Error details on error
Parameters:
optionsOptions object to modify
modeThe access mode to use
ESPAPICALL int32_t esp_subscriber_options_set_base_drain_timeout ( EspSubscriberOptions options,
int32_t  timeout,
EspError *  error 
)

Set the maximum time server will allow for the base data to be read. Values less than 1000 milliseconds have no effect. By default timeout is disabled.

Returns:
0 on success. Error details on error
Parameters:
optionsOptions object to modify
timeoutMaximum time in milliseconds
ESPAPICALL int32_t esp_subscriber_options_set_dispatcher ( EspSubscriberOptions options,
const EspDispatcher dispatcher,
EspError *  error 
)

Not used. Set a custom dispatcher for the subscriber that will be created.

Returns:
0 on success. Error details on error
Parameters:
optionsOptions object to modify
ESPAPICALL int32_t esp_subscriber_options_set_flags ( EspSubscriberOptions options,
uint32_t  flags,
EspError *  error 
)

Set subscription flags.

Returns:
0 on success. Error details on error
Parameters:
optionsOptions object to modify
flagsA bitwise OR'd ESP_SUBSCRIBER_FLAG_xxx values
ESPAPICALL int32_t esp_subscriber_options_set_pulsed ( EspSubscriberOptions options,
int32_t  interval,
EspError *  error 
)

Switch on pulsed subscription. Server consolidates rows for specified milliseconds before publishing the data to client. By default pulsing is disabled.

Returns:
0 on success. Error details on error
Parameters:
optionsOptions object to modify
intervalPulse interval in milliseconds.
ESPAPICALL int32_t esp_subscriber_options_set_queuesize ( EspSubscriberOptions options,
int32_t  size,
EspError *  error 
)

Set the subscriber queue size - the maximum number of records the server will queue up to publish to a client. Default is 0 - EspSubscriber does not change the queue size on the platform.

Returns:
0 on success. Error details on error
Parameters:
optionsOptions object to modify
sizeQueue size to set
ESPAPICALL int32_t esp_subscriber_options_set_updater ( EspSubscriberOptions options,
const EspUpdater updater,
EspError *  error 
)

Not used. Set a custom updater for the subscriber that will be created.

Returns:
0 on success. Error details on error
Parameters:
optionsOptions object to modify
 All Classes Variables