11.12.3.4.32. Function iot_agent_select_service_by_index

11.12.3.4.32.1. Function Documentation

iot_agent_status_t iot_agent_select_service_by_index(iot_agent_context_t *ctx, size_t index, nxp_iot_ServiceDescriptor *service_descriptor)

Select service by given index.

Pre

The configuration data associated to the context is valid.

Post

In case of success, the service_descriptor structure is filled and needs to be freed after usage by calling iot_agent_free_service_descriptor. In case of failure no freeing is required. Also in case of failures, the contents of service_descriptor are not guaranteed to remain intact.

See

iot_agent_is_service_configuration_data_valid

Parameters
  • [in] ctx: Context for the iot_agent.

  • [in] index: Index of the service

  • [out] service_descriptor: Structure for holding a service descriptor. Must point to a valid service descriptor object upon invocation. Any FT_POINTER fields in the service descriptor are freed before changing the contents to the service_descriptor of the selected service.

Return Value
  • IOT_AGENT_SUCCESS: Upon success