nRF Connect SDK API 0.1.0
Loading...
Searching...
No Matches

◆ ssf_client_send_request()

int ssf_client_send_request ( const struct ssf_client_srvc srvc,
void *  req,
void *  decoded_rsp,
const uint8_t **  rsp_pkt 
)

Send a request and wait for a response.

Note
The req structure is encoded with the service definition's req_encode function before it is passed to the underlying transport. The response is decoded with the service definition's rsp_decode function.
Parameters
[in]srvcA pointer to a service definition object.
[in]reqA pointer to the (zcbor) structure holding the request to be sent.
[out]decoded_rspA pointer to a (zcbor) structure, allocated by the caller, that the response will be decoded into.
[out]rsp_pktHolds the address of the response packet upon return. Used with ssf_client_decode_done to free the response packet. This is only necessary if the response contains a CBOR bstr or tstr. If the response does not contain a CBOR bstr or tstr, set this to NULL to have the function free the response before returning.
Returns
0 on success -SSF_EINVAL if parameters are invalid. -SSF_EBUSY if transport is not initialized. -SSF_EPROTO if encode or decode fails. Either on client or server side. -SSF_ENOMEM if allocation of transport layer buffer fails. -SSF_EIO if sending with underlying transport fails. -SSF_EMSGSIZE if message is too long. -SSF_EPERM if mismatching domain id on server side. -SSF_ENOTSUP if service version number on client and server side does not match. -SSF_EPROTONOSUPPORT if the service is not found on server side.