Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nrf_rpc: fix build error for C++ #1514

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions nrf_rpc/include/nrf_rpc.h
Original file line number Diff line number Diff line change
Expand Up @@ -520,10 +520,10 @@ static inline int nrf_rpc_cmd(const struct nrf_rpc_group *group, uint8_t cmd,
nrf_rpc_handler_t handler, void *handler_data)
{
int nrf_rpc_cmd_common(const struct nrf_rpc_group *group, uint32_t cmd,
uint8_t *packet, size_t len, void *ptr1,
uint8_t *packet, size_t len, uintptr_t ptr1,
void *ptr2);

return nrf_rpc_cmd_common(group, cmd, packet, len, handler,
return nrf_rpc_cmd_common(group, cmd, packet, len, (uintptr_t)handler,
handler_data);
}

Expand All @@ -532,10 +532,10 @@ static inline int nrf_rpc_cmd_rsp(const struct nrf_rpc_group *group,
const uint8_t **rsp_packet, size_t *rsp_len)
{
int nrf_rpc_cmd_common(const struct nrf_rpc_group *group, uint32_t cmd,
uint8_t *packet, size_t len, void *ptr1,
uint8_t *packet, size_t len, uintptr_t ptr1,
void *ptr2);

return nrf_rpc_cmd_common(group, cmd | 0x10000, packet, len, rsp_packet,
return nrf_rpc_cmd_common(group, cmd | 0x10000, packet, len, (uintptr_t)rsp_packet,
rsp_len);
}

Expand All @@ -546,9 +546,9 @@ static inline void nrf_rpc_cmd_no_err(const struct nrf_rpc_group *group,
{
void nrf_rpc_cmd_common_no_err(const struct nrf_rpc_group *group,
uint32_t cmd, uint8_t *packet,
size_t len, void *ptr1, void *ptr2);
size_t len, uintptr_t ptr1, void *ptr2);

nrf_rpc_cmd_common_no_err(group, cmd, packet, len, handler,
nrf_rpc_cmd_common_no_err(group, cmd, packet, len, (uintptr_t)handler,
handler_data);
}

Expand All @@ -560,9 +560,9 @@ static inline void nrf_rpc_cmd_rsp_no_err(const struct nrf_rpc_group *group,
{
void nrf_rpc_cmd_common_no_err(const struct nrf_rpc_group *group,
uint32_t cmd, uint8_t *packet,
size_t len, void *ptr1, void *ptr2);
size_t len, uintptr_t ptr1, void *ptr2);

nrf_rpc_cmd_common_no_err(group, cmd | 0x10000, packet, len, rsp_packet,
nrf_rpc_cmd_common_no_err(group, cmd | 0x10000, packet, len, (uintptr_t)rsp_packet,
rsp_len);
}

Expand Down
10 changes: 5 additions & 5 deletions nrf_rpc/nrf_rpc.c
Original file line number Diff line number Diff line change
Expand Up @@ -878,7 +878,7 @@ static void wait_for_response(const struct nrf_rpc_group *group, struct nrf_rpc_
}

int nrf_rpc_cmd_common(const struct nrf_rpc_group *group, uint32_t cmd,
uint8_t *packet, size_t len, void *ptr1, void *ptr2)
uint8_t *packet, size_t len, uintptr_t ptr1, void *ptr2)
{
int err;
struct header hdr;
Expand All @@ -894,16 +894,16 @@ int nrf_rpc_cmd_common(const struct nrf_rpc_group *group, uint32_t cmd,
NRF_RPC_ASSERT(group != NULL);
NRF_RPC_ASSERT((cmd & 0xFF) != NRF_RPC_ID_UNKNOWN);
NRF_RPC_ASSERT(packet_validate(packet));
NRF_RPC_ASSERT(ptr1 != NULL);
NRF_RPC_ASSERT(ptr1 != 0);

if (cmd & 0x10000) {
NRF_RPC_ASSERT(ptr2 != NULL);
rsp_packet = ptr1;
rsp_packet = (const uint8_t**)ptr1;
rsp_len = ptr2;
*rsp_packet = NULL;
*rsp_len = 0;
} else {
handler = ptr1;
handler = (nrf_rpc_handler_t)ptr1;
handler_data = ptr2;
}

Expand Down Expand Up @@ -939,7 +939,7 @@ int nrf_rpc_cmd_common(const struct nrf_rpc_group *group, uint32_t cmd,
}

void nrf_rpc_cmd_common_no_err(const struct nrf_rpc_group *group, uint32_t cmd,
uint8_t *packet, size_t len, void *ptr1,
uint8_t *packet, size_t len, uintptr_t ptr1,
void *ptr2)
{
int err;
Expand Down
Loading