Conversation
3ca3257 to
ff05ccf
Compare
4cf1673 to
3cef3ac
Compare
3cef3ac to
d74c71a
Compare
| #define _NRF_RPC_HEADER_SIZE 4 | ||
|
|
||
| #ifndef NRF_RPC_TR_MAX_HEADER_SIZE | ||
| #define NRF_RPC_TR_MAX_HEADER_SIZE 0 |
There was a problem hiding this comment.
Don't define them here. Transport header file is responsible for defining it.
The same for NRF_RPC_TR_AUTO_FREE_RX_BUF.
There was a problem hiding this comment.
This is ifdef def, so if transport have not defined anything the values of macros are set to default.
nrf_rpc/nrf_rpc.c
Outdated
| #include "nrf_rpc_os.h" | ||
| #include <nrf_rpc.h> | ||
| #include <nrf_rpc_tr.h> | ||
| #include <nrf_rpc_os.h> |
There was a problem hiding this comment.
I tried to make it consistent with nrt_rpc.h
nrf_rpc/nrf_rpc.c
Outdated
| return err; | ||
| } | ||
|
|
||
|
|
There was a problem hiding this comment.
Remove unnecessary line
| @@ -0,0 +1,3 @@ | |||
| #include "sm_ipt_backend.h" | |||
There was a problem hiding this comment.
Add copyright comment at the beginning of a file.
nrf_rpc/template/nrf_rpc_os_tmpl.h
Outdated
| * @return 0 on success or negative error code. | ||
| */ | ||
| int nrf_rpc_os_init(nrf_rpc_os_work_t callback); | ||
| int nrf_rpc_os_init(nrf_rpc_os_work_t callback, void *user_data); |
There was a problem hiding this comment.
user_data is not longer needed. Right?
| help | ||
| If enabled selects shared memory as a transport layer for nRF PRC. | ||
| It requires additional API implemented in nrf_rpc_os.h file. | ||
|
|
There was a problem hiding this comment.
We are using SM IPT module, so we can use its name instead of just shared memory.
| * a newly allocated packet buffer. | ||
| * @param[in] _len Requested length of the packet. | ||
| */ | ||
| #ifdef nrf_rpc_tr_alloc_tx_buf |
There was a problem hiding this comment.
Maybe it is better to explain this #ifdef, because it is not obvious.
/* If nrf_rpc_tr_alloc_tx_buf is a macro, put it directly, because it may allocate memory on stack. */
nrf_rpc/nrf_rpc.c
Outdated
|
|
||
| static void cmd_ctx_free(struct nrf_rpc_cmd_ctx *ctx) | ||
| { | ||
| NRF_RPC_DBG("Command context %d free", ctx->id); |
There was a problem hiding this comment.
This line can be deleted, it is not related to this PR.
c887491 to
636f1b5
Compare
nrf_rpc/CMakeLists.txt
Outdated
| @@ -1,14 +1,15 @@ | |||
| # | |||
| # Copyright (c) 2020 Nordic Semiconductor | |||
| # Copyright (c) 2020-2021 Nordic Semiconductor | |||
nrf_rpc/Kconfig
Outdated
| @@ -1,5 +1,5 @@ | |||
| # | |||
| # Copyright (c) 2020 Nordic Semiconductor | |||
| # Copyright (c) 2020-2021 Nordic Semiconductor | |||
nrf_rpc/include/nrf_rpc.h
Outdated
| @@ -1,5 +1,5 @@ | |||
| /* | |||
| * Copyright (c) 2020 Nordic Semiconductor ASA | |||
| * Copyright (c) 2020-2021 Nordic Semiconductor ASA | |||
nrf_rpc/include/nrf_rpc_cbor.h
Outdated
| @@ -1,5 +1,5 @@ | |||
| /* | |||
| * Copyright (c) 2020 Nordic Semiconductor ASA | |||
| * Copyright (c) 2020-2021 Nordic Semiconductor ASA | |||
There was a problem hiding this comment.
No needed. Please remove licence changes also in other files
nrf_rpc/CMakeLists.txt
Outdated
|
|
||
| zephyr_library_sources_ifdef(CONFIG_NRF_RPC_CBOR nrf_rpc_cbor.c) | ||
| zephyr_library_sources_ifdef(CONFIG_NRF_RPC_TR_SHMEM sm_ipt_backend.c) | ||
| zephyr_library_sources_ifdef(CONFIG_NRF_RPC nrf_rpc.c) |
There was a problem hiding this comment.
Do you have any reason to add this source conditionally ?
| zephyr_library_sources_ifdef(CONFIG_NRF_RPC nrf_rpc.c) | |
| zephyr_library_sources(nrf_rpc.c) |
nrf_rpc/nrf_rpc.c
Outdated
| { | ||
| uint8_t *packet; | ||
|
|
||
| NRF_RPC_ASSERT(len < 0x70000000); |
There was a problem hiding this comment.
Size limit check. Changed to define now.
| NRF_RPC_ASSERT(len < 0x70000000); | ||
|
|
||
| nrf_rpc_tr_alloc_tx_buf(&packet, _NRF_RPC_HEADER_SIZE + len); | ||
| return &packet[_NRF_RPC_HEADER_SIZE]; |
|
|
||
| void _nrf_rpc_cbor_prepare(struct nrf_rpc_cbor_ctx *ctx, size_t len) | ||
| { | ||
| #ifndef nrf_rpc_tr_alloc_tx_buf |
There was a problem hiding this comment.
Transport layer provides this function (nrf_rpc_tr.h). Here it is as a template (*_tmpl.h)
SM_IPT is OS independent shared memory communication protocol, which works on shared memory and provides os-porting header templates. Signed-off-by: Dominik Chat <dominik.chat@nordicsemi.no> Co-authored-by: Dominik Kilian <Dominik.Kilian@nordicsemi.no>
636f1b5 to
6cc6ece
Compare
Added support for sm_ipt backend Updated templates, updated Kconfig to support sm_ipt. Signed-off-by: Dominik Chat <dominik.chat@nordicsemi.no> Co-authored-by: Dominik Kilian <Dominik.Kilian@nordicsemi.no>
6cc6ece to
0167f65
Compare
tejlmand
left a comment
There was a problem hiding this comment.
Why is this in nrfxlib and not in sdk-nrf/lib ?
I don't see any prebuilt libraries in this PR, which is usually the case for nrfxlib libs.
@tejlmand, just FYI, the Edit: After reconsideration, I see now that it is not very clear if |
Added support for sm_ipt backend
Updated templates, updated Kconfig
to support sm_ipt.
Depends on #524
Signed-off-by: Dominik Chat dominik.chat@nordicsemi.no
Co-authored-by: Dominik Kilian Dominik.Kilian@nordicsemi.no