You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
tests: nrf_cloud: codec/cbor: Fix build after REST removal
The CBOR codec unit-test PR (#27892) and the REST removal PR (#28522)
were merged independently and produced a semantic conflict that left
net.lib.nrf_cloud.codec.cbor failing to build on main:
* The test referenced REST types (nrf_cloud_rest_agnss_request,
nrf_cloud_rest_pgps_request, nrf_cloud_rest_agnss_result,
NRF_CLOUD_REST_AGNSS_REQ_*, nrf_cloud_rest_fota_execution_decode)
that were renamed to their nrf_cloud_coap_* counterparts by the
REST removal.
* The REST removal made coap_codec.h transitively pull in
net/nrf_cloud_coap.h. Its CoAP-disabled fallback redefined
enum coap_content_format, conflicting with zephyr/net/coap.h that
the test (and the codec source) include directly.
* struct nrf_cloud_coap_pgps_request was gated on
CONFIG_NRF_CLOUD_COAP in net/nrf_cloud_pgps.h, so building any
codec consumer with PGPS but without COAP left the struct
undeclared.
Fixes applied:
* Rename REST types in the test sources to their nrf_cloud_coap_*
equivalents.
* In nrf_cloud_coap.h, include zephyr/net/coap.h unconditionally so
enum coap_content_format always comes from the canonical Zephyr
header. Only zephyr/net/coap_client.h stays gated on
CONFIG_NRF_CLOUD_COAP since it requires CONFIG_COAP_CLIENT_*.
* In nrf_cloud_pgps.h, define struct nrf_cloud_coap_pgps_request
unconditionally - it is a pure data carrier and does not require
any CoAP machinery.
Verified: net.lib.nrf_cloud.codec.cbor and net.lib.nrf_cloud.codec.json
both pass on native_sim and qemu_cortex_m3 (266/266 test cases).
Signed-off-by: Pascal Hernandez <pascal.hernandez@nordicsemi.no>
0 commit comments