Infuse-IoT SDK API 0.0.1
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
packet.h File Reference

ePacket packet APIs More...

#include <stdint.h>
#include <zephyr/kernel.h>
#include <zephyr/device.h>
#include <zephyr/toolchain.h>
#include <zephyr/net_buf.h>
#include <zephyr/bluetooth/bluetooth.h>
#include <infuse/types.h>
#include <infuse/epacket/interface.h>

Go to the source code of this file.

Data Structures

union  epacket_interface_address
 
struct  epacket_tx_metadata
 
struct  epacket_rx_metadata
 
struct  epacket_key_ids_data
 Format of INFUSE_KEY_IDS packet. More...
 
struct  epacket_rate_limit_req
 Magic two byte packet that requests a pause in data transmission. More...
 
struct  epacket_rate_throughput_req
 Magic three byte packet that sets a target data throughput. More...
 
struct  epacket_interface_address_bt_le
 Format of BLE address in INFUSE_RECEIVED_EPACKET and INFUSE_EPACKET_FORWARD. More...
 
struct  epacket_received_common_header
 Common header for INFUSE_RECEIVED_EPACKET. More...
 
struct  epacket_received_decrypted_header
 Header for INFUSE_RECEIVED_EPACKET where packet was decrypted. More...
 
struct  epacket_forward_header
 Common header for INFUSE_EPACKET_FORWARD. More...
 
struct  epacket_forward_auto_conn_header
 Common header for INFUSE_EPACKET_FORWARD_AUTO_CONN. More...
 
struct  epacket_conn_terminated
 Packet for INFUSE_EPACKET_CONN_TERMINATED. More...
 

Macros

#define EPACKET_ADDR_ALL   ((union epacket_interface_address){0})
 
#define EPACKET_KEY_ID_REQ_MAGIC   0x4D
 If a single byte payload with this value is received on an interface, respond with a INFUSE_KEY_IDS packet.
 
#define EPACKET_RATE_LIMIT_REQ_MAGIC   0x4E
 Magic value for epacket_rate_limit_req.
 

Typedefs

typedef void(* epacket_tx_done_cb) (const struct device *dev, struct net_buf *pkt, int result, void *user_data)
 Callback run when packet is transmitted.
 

Enumerations

enum  epacket_auth { EPACKET_AUTH_FAILURE = 0 , EPACKET_AUTH_REMOTE_ENCRYPTED = 0 , EPACKET_AUTH_NETWORK = 1 , EPACKET_AUTH_DEVICE = 2 }
 
enum  epacket_flags {
  EPACKET_FLAGS_ENCRYPTION_DEVICE = BIT(15) , EPACKET_FLAGS_ENCRYPTION_NETWORK = 0 , EPACKET_FLAGS_ACK_REQUEST = BIT(14) , EPACKET_FLAGS_CLOUD_FORWARDING = BIT(13) ,
  EPACKET_FLAGS_CLOUD_SELF = BIT(12) , EPACKET_FLAGS_INTERFACE_MASK = 0x00FF
}
 
enum  epacket_forward_auto_conn_flags { EPACKET_FORWARD_AUTO_CONN_SINGLE_RPC = BIT(0) , EPACKET_FORWARD_AUTO_CONN_SUB_DATA = BIT(1) , EPACKET_FORWARD_AUTO_CONN_DC_NOTIFICATION = BIT(2) , EPACKET_FORWARD_AUTO_CONN_PRIORITISE_UPLINK = BIT(3) }
 

Functions

void epacket_rate_limit_reset (void)
 Reset any active rate limits.
 
void epacket_rate_limit_tx (k_ticks_t *last_call, uint16_t bytes_transmitted)
 Limit the transmission rate of bulk data paths.
 
void epacket_global_flags_set (uint16_t flags)
 Set global flags for all transmitted packets.
 
uint16_t epacket_global_flags_get (void)
 Get the current global flags value.
 
int epacket_num_buffers_free_tx (void)
 Query the number of free TX buffers.
 
int epacket_num_buffers_free_rx (void)
 Query the number of free RX buffers.
 
struct net_buf * epacket_alloc_tx (k_timeout_t timeout)
 Allocate ePacket TX buffer.
 
struct net_buf * epacket_alloc_rx (k_timeout_t timeout)
 Allocate ePacket RX buffer.
 
static struct net_buf * epacket_alloc_tx_for_interface (const struct device *dev, k_timeout_t timeout)
 Allocate ePacket TX buffer for a specific interface.
 
static void epacket_set_tx_metadata (struct net_buf *buf, enum epacket_auth auth, uint16_t flags, enum infuse_type type, union epacket_interface_address dest)
 Set metadata on a packet.
 
static void epacket_set_tx_callback (struct net_buf *buf, epacket_tx_done_cb tx_done, void *user_data)
 Set callback to be run after packet sent.
 
int epacket_received_packet_append (struct net_buf *storage_buf, struct net_buf *received_buf)
 Append received packet to storage buffer.
 

Detailed Description

ePacket packet APIs

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

SPDX-License-Identifier: FSL-1.1-ALv2

Structures for ePacket packets