Skip to content

Commit

Permalink
fixup! api: refactor coap_receive
Browse files Browse the repository at this point in the history
  • Loading branch information
Danielius1922 committed Aug 8, 2023
1 parent 50117e4 commit 950aa1a
Show file tree
Hide file tree
Showing 18 changed files with 1,830 additions and 848 deletions.
9 changes: 7 additions & 2 deletions api/client/oc_client_cb.c
Original file line number Diff line number Diff line change
Expand Up @@ -323,11 +323,17 @@ ri_get_ocf_version(oc_content_format_t cf)
return OCF_VER_1_0_0;
}

#ifdef OC_BLOCK_WISE
static oc_client_response_t
ri_prepare_client_response(const coap_packet_t *packet,
oc_blockwise_state_t **response_state,
oc_client_cb_t *cb, oc_endpoint_t *endpoint,
oc_content_format_t cf)
#else /* !OC_BLOCK_WISE */
static oc_client_response_t
ri_prepare_client_response(const coap_packet_t *packet, oc_client_cb_t *cb,
oc_endpoint_t *endpoint, oc_content_format_t cf)
#endif /* OC_BLOCK_WISE */
{
oc_client_response_t client_response;
memset(&client_response, 0, sizeof(oc_client_response_t));
Expand All @@ -351,7 +357,6 @@ ri_prepare_client_response(const coap_packet_t *packet,
}
}
#else /* !OC_BLOCK_WISE */
(void)response_state;
coap_options_get_observe(packet, &client_response.observe_option);
#endif /* OC_BLOCK_WISE */

Expand Down Expand Up @@ -406,7 +411,7 @@ oc_client_cb_invoke(const coap_packet_t *response, oc_client_cb_t *cb,
ri_prepare_client_response(response, response_state, cb, endpoint, cf);
#else /* !OC_BLOCK_WISE */
oc_client_response_t client_response =
ri_prepare_client_response(response, NULL, cb, endpoint, cf);
ri_prepare_client_response(response, cb, endpoint, cf);
#endif /* OC_BLOCK_WISE */

#if defined(OC_OSCORE) && defined(OC_SECURITY)
Expand Down
4 changes: 4 additions & 0 deletions api/client/oc_client_cb_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@
#include "oc_ri.h"
#include "util/oc_compiler.h"

#ifdef OC_BLOCK_WISE
#include "api/oc_blockwise_internal.h"
#endif /* OC_BLOCK_WISE */

#include <stdbool.h>

#ifdef __cplusplus
Expand Down
1 change: 1 addition & 0 deletions api/cloud/oc_cloud_apis.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#include "oc_cloud_internal.h"
#include "oc_cloud_store_internal.h"
#include "oc_core_res.h"
#include "port/oc_connectivity.h"
#include "port/oc_log_internal.h"
#include "rd_client_internal.h"

Expand Down
Loading

0 comments on commit 950aa1a

Please sign in to comment.