Infuse-IoT SDK API 0.0.1
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
command_runner.h File Reference
#include <zephyr/device.h>
#include <zephyr/kernel.h>
#include <zephyr/net_buf.h>
#include <infuse/epacket/packet.h>

Go to the source code of this file.

Functions

void rpc_command_runner (struct net_buf *request)
 Execute a command contained in the buffer.
 
void rpc_command_runner_request_unref (struct net_buf *request)
 Free the request buffer inside the RPC implementation.
 
void rpc_command_runner_early_response (const struct device *interface, union epacket_interface_address address, enum epacket_auth auth, uint32_t request_id, uint16_t command_id, struct net_buf *response)
 Send the response buffer before returning from the RPC implementation.
 

Detailed Description

Author
Jordan Yates jorda.nosp@m.n@em.nosp@m.beint.nosp@m..com

SPDX-License-Identifier: FSL-1.1-ALv2

Function Documentation

◆ rpc_command_runner()

void rpc_command_runner ( struct net_buf * request)

Execute a command contained in the buffer.

Parameters
requestCommand request

◆ rpc_command_runner_early_response()

void rpc_command_runner_early_response ( const struct device * interface,
union epacket_interface_address address,
enum epacket_auth auth,
uint32_t request_id,
uint16_t command_id,
struct net_buf * response )

Send the response buffer before returning from the RPC implementation.

Send the response buffer before the RPC implementation returns. This allows RPCs with long post-processing steps to signal the result early, allowing the command initiator to move onto future work while this device finishes up.

Note
If used, the RPC implementation must return NULL.
Parameters
interfaceInterface to send response on
addressAddress to send response to
authAuthentication level of response
request_idRequest ID associated with the response
command_idCommand ID associated with the response
responseResponse message to send

◆ rpc_command_runner_request_unref()

void rpc_command_runner_request_unref ( struct net_buf * request)

Free the request buffer inside the RPC implementation.

Free the request buffer inside the RPC implementation instead of relying on the server to free the buffer after the command returns. This is useful for long running commands with INFUSE_RPC_DATA packets.

Parameters
requestRequest message to free