SingingCat 0
application
Data Structures | Macros | Typedefs | Functions
queue.c File Reference

code to queue outbound commands. this is the "normal" way of sending out commands More...

#include <main-header.h>
#include <queue.h>
#include <command-parser.h>
#include <command-handler.h>
#include <multiram.h>
#include <routing.h>
#include <config.h>
#include "espressif/esp8266_cloud.h"
#include <ti1101.h>
#include <route_command.h>
#include "metrics/metrics.h"

Go to the source code of this file.

Data Structures

struct  queue_entry
 

Macros

#define COM_QUEUE_SIZE   80
 
#define COMMAND_AGE_BEFORE_GC   120
 maximum amount of time a packet may remain allocated More...
 
#define MAX_COM_RETRIES   30
 
#define SEND_BUF_RESERVED1   1
 
#define SEND_BUF_RESERVED2   2
 
#define SEND_COM_FAILED_TO_ENCODE   7
 
#define SEND_COM_INVALID   13
 
#define SEND_COM_NOT_ENCODED   12
 
#define SEND_COM_STILL_INVALID   14
 
#define SEND_DEVICE_BUSY   -113
 
#define SEND_FAILURE_NODEV   16
 
#define SEND_NO_CLOUD   3
 
#define SEND_NO_RECIPIENT   6
 
#define SEND_NO_TARGET   5
 

Typedefs

typedef struct queue_entry _queue_entry
 

Functions

struct commandalloc_command ()
 allocate a free command More...
 
struct commandalloc_command_with_minfree (int minfree)
 
void clear_outbound_queue ()
 clear the outbound queue any commands within the queue are silently discarded More...
 
int deliver_command (struct command *com, pkt_callback cb)
 deliver a command to a module More...
 
void free_command (struct command *com)
 free a command More...
 
void free_commands (int index)
 free commands by index (-1 for all) More...
 
struct commandget_data_reply (struct command *com)
 allocates and initializes a packet to be send as "data" to the command typically you'd add some data to it and pass it to send_command(). after send_command() you'll need to free it More...
 
int get_outbound_command_count_important ()
 return number of commands to be delivered (apart from announce/noop) More...
 
void print_outbound_queue ()
 
void process_command_queue ()
 this gets called when we got some cpu cycles spare we then send out commands and timeout other commands and so on More...
 
int process_queue_reply (struct command *ack)
 process a reply More...
 
void queue_init ()
 
void request_route (long nodeid)
 send an arp request (equivalent) More...
 
int send_command (struct command *com)
 send a command to another module (or broadcast) More...
 
int send_command_fw_info (struct command *com, int err)
 send a reply to a command More...
 
int send_command_quietly (struct command *com)
 
int send_command_reply (struct command *com, byte flags)
 send a reply to a command More...
 
int send_command_reply_with_args (struct command *com, byte flags, const char *format,...)
 send a reply to a command More...
 
int send_data (struct command *com, const char *format,...)
 send the format string as data in response to command "com" More...
 

Detailed Description

code to queue outbound commands. this is the "normal" way of sending out commands

Definition in file queue.c.

Macro Definition Documentation

◆ MAX_COM_RETRIES

#define MAX_COM_RETRIES   30

Definition at line 13 of file queue.c.

◆ SEND_BUF_RESERVED1

#define SEND_BUF_RESERVED1   1

Definition at line 19 of file queue.c.

◆ SEND_BUF_RESERVED2

#define SEND_BUF_RESERVED2   2

Definition at line 20 of file queue.c.

◆ SEND_COM_FAILED_TO_ENCODE

#define SEND_COM_FAILED_TO_ENCODE   7

Definition at line 24 of file queue.c.

◆ SEND_COM_INVALID

#define SEND_COM_INVALID   13

Definition at line 26 of file queue.c.

◆ SEND_COM_NOT_ENCODED

#define SEND_COM_NOT_ENCODED   12

Definition at line 25 of file queue.c.

◆ SEND_COM_STILL_INVALID

#define SEND_COM_STILL_INVALID   14

Definition at line 27 of file queue.c.

◆ SEND_DEVICE_BUSY

#define SEND_DEVICE_BUSY   -113

Definition at line 30 of file queue.c.

◆ SEND_FAILURE_NODEV

#define SEND_FAILURE_NODEV   16

Definition at line 28 of file queue.c.

◆ SEND_NO_CLOUD

#define SEND_NO_CLOUD   3

Definition at line 21 of file queue.c.

◆ SEND_NO_RECIPIENT

#define SEND_NO_RECIPIENT   6

Definition at line 23 of file queue.c.

◆ SEND_NO_TARGET

#define SEND_NO_TARGET   5

Definition at line 22 of file queue.c.