Lines Matching refs:streamer

107 static inline int smp_write_hdr(struct smp_streamer *streamer, const struct smp_hdr *src_hdr)  in smp_write_hdr()  argument
109 memcpy(streamer->writer->nb->data, src_hdr, sizeof(*src_hdr)); in smp_write_hdr()
113 static int smp_build_err_rsp(struct smp_streamer *streamer, const struct smp_hdr *req_hdr, in smp_build_err_rsp() argument
117 struct cbor_nb_writer *nbw = streamer->writer; in smp_build_err_rsp()
142 smp_write_hdr(streamer, &rsp_hdr); in smp_build_err_rsp()
274 static int smp_handle_single_req(struct smp_streamer *streamer, const struct smp_hdr *req_hdr, in smp_handle_single_req() argument
278 struct cbor_nb_writer *nbw = streamer->writer; in smp_handle_single_req()
298 rc = smp_handle_single_payload(streamer, req_hdr); in smp_handle_single_req()
300 *rsn = MGMT_CTXT_RC_RSN(streamer); in smp_handle_single_req()
308 *rsn = MGMT_CTXT_RC_RSN(streamer); in smp_handle_single_req()
316 smp_write_hdr(streamer, &rsp_hdr); in smp_handle_single_req()
333 static void smp_on_err(struct smp_streamer *streamer, const struct smp_hdr *req_hdr, in smp_on_err() argument
347 cbor_nb_writer_init(streamer->writer, rsp); in smp_on_err()
350 rc = smp_build_err_rsp(streamer, req_hdr, status, rsn); in smp_on_err()
352 streamer->smpt->functions.output(rsp); in smp_on_err()
357 smp_free_buf(req, streamer->smpt); in smp_on_err()
358 smp_free_buf(rsp, streamer->smpt); in smp_on_err()
381 int smp_process_request_packet(struct smp_streamer *streamer, void *vreq) in smp_process_request_packet() argument
420 rsp = smp_alloc_rsp(req, streamer->smpt); in smp_process_request_packet()
426 cbor_nb_reader_init(streamer->reader, req); in smp_process_request_packet()
427 cbor_nb_writer_init(streamer->writer, rsp); in smp_process_request_packet()
430 rc = smp_handle_single_req(streamer, &req_hdr, &rsn); in smp_process_request_packet()
437 rc = streamer->smpt->functions.output(rsp); in smp_process_request_packet()
471 smp_on_err(streamer, &req_hdr, req, rsp, rc, rsn); in smp_process_request_packet()
487 smp_free_buf(req, streamer->smpt); in smp_process_request_packet()
488 smp_free_buf(rsp, streamer->smpt); in smp_process_request_packet()