|
Infuse-IoT SDK API 0.0.1
A Scalable Open Source RTOS
|
RPC command implementation API . More...
Macros | |
| #define | RPC_REQUEST_VAR_LEN(request, type) |
| Get the size of the variable component of the INFUSE_RPC_CMD packet. | |
| #define | RPC_DATA_VAR_LEN(data) |
| Get the size of the variable component of the INFUSE_RPC_DATA packet. | |
Functions | |
| struct net_buf * | rpc_response_simple_if (const struct device *interface, int16_t rc, void *response, size_t len) |
| Create an INFUSE_RPC_RSP packet buffer for an interface. | |
| struct net_buf * | rpc_response_simple_req (struct net_buf *request, int16_t rc, void *response, size_t len) |
| Create an INFUSE_RPC_RSP packet buffer from a request. | |
| struct net_buf * | rpc_server_pull_data (uint32_t request_id, uint32_t expected_offset, int *err, k_timeout_t timeout) |
| Attempt to pull INFUSE_RPC_DATA packet from queue. | |
| void | rpc_server_ack_data_ready (const struct device *interface, union epacket_interface_address address, uint32_t request_id) |
| Send initial INFUSE_RPC_DATA_ACK to signify we are ready for data. | |
| void | rpc_server_ack_data (const struct device *interface, union epacket_interface_address address, uint32_t request_id, uint32_t offset, uint8_t ack_period) |
| Acknowledge received data packets. | |
| void | rpc_server_watchdog_feed (void) |
| Feed the RPC server watchdog from a RPC implementation. | |
| uint8_t * | rpc_server_command_working_mem (size_t *size) |
| Retrieve working memory for an RPC. | |
RPC command implementation API .
| #define RPC_DATA_VAR_LEN | ( | data | ) |
#include <infuse/rpc/commands.h>
Get the size of the variable component of the INFUSE_RPC_DATA packet.
| #define RPC_REQUEST_VAR_LEN | ( | request, | |
| type ) |
#include <infuse/rpc/commands.h>
Get the size of the variable component of the INFUSE_RPC_CMD packet.
| struct net_buf * rpc_response_simple_if | ( | const struct device * | interface, |
| int16_t | rc, | ||
| void * | response, | ||
| size_t | len ) |
#include <infuse/rpc/commands.h>
Create an INFUSE_RPC_RSP packet buffer for an interface.
| interface | Interface response will be sent on |
| rc | Return code of the RPC |
| response | RPC response struct |
| len | Size of RPC response struct |
| struct net_buf * rpc_response_simple_req | ( | struct net_buf * | request, |
| int16_t | rc, | ||
| void * | response, | ||
| size_t | len ) |
#include <infuse/rpc/commands.h>
Create an INFUSE_RPC_RSP packet buffer from a request.
| request | INFUSE_RPC_CMD packet to respond to |
| rc | Return code of the RPC |
| response | RPC response struct |
| len | Size of RPC response struct |
| void rpc_server_ack_data | ( | const struct device * | interface, |
| union epacket_interface_address | address, | ||
| uint32_t | request_id, | ||
| uint32_t | offset, | ||
| uint8_t | ack_period ) |
#include <infuse/rpc/commands.h>
Acknowledge received data packets.
| interface | ePacket interface |
| address | Address to send DATA_ACK to |
| request_id | RPC request ID |
| offset | Offset of the received data |
| ack_period | RX acknowledgment period |
| void rpc_server_ack_data_ready | ( | const struct device * | interface, |
| union epacket_interface_address | address, | ||
| uint32_t | request_id ) |
#include <infuse/rpc/commands.h>
Send initial INFUSE_RPC_DATA_ACK to signify we are ready for data.
| interface | ePacket interface |
| address | Address to send DATA_ACK to |
| request_id | RPC request ID |
| uint8_t * rpc_server_command_working_mem | ( | size_t * | size | ) |
#include <infuse/rpc/commands.h>
Retrieve working memory for an RPC.
| size | Size of the working memory buffer |
| struct net_buf * rpc_server_pull_data | ( | uint32_t | request_id, |
| uint32_t | expected_offset, | ||
| int * | err, | ||
| k_timeout_t | timeout ) |
#include <infuse/rpc/commands.h>
Attempt to pull INFUSE_RPC_DATA packet from queue.
| request_id | RPC request ID |
| expected_offset | Expected data offset |
| err | Error code when function returned NULL |
| timeout | Duration to wait for packet |
| buf | INFUSE_RPC_DATA packet on success |
| NULL | on error |
| void rpc_server_watchdog_feed | ( | void | ) |
#include <infuse/rpc/commands.h>
Feed the RPC server watchdog from a RPC implementation.