11.12.3.4.37. Function iot_agent_service_get_service_offset_by_id

11.12.3.4.37.1. Function Documentation

iot_agent_status_t iot_agent_service_get_service_offset_by_id(const iot_agent_datastore_t *ctx, uint64_t service_id, size_t *offset, nxp_iot_ServiceDescriptor *service_descriptor)

Get the offset and the service descriptor of a service specified by service_id.

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: The datastore to query for the service.

  • [in] service_id: ID of the service

  • [out] offset: The offset of the service descriptor within the datastore.

  • [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