VizBlocks
Public Member Functions | List of all members
VizBlocks Class Reference

#include <VizBlocks.hpp>

Public Member Functions

 VizBlocks (char *id, char *ssid="VizBlocksNet", char *wifi_pass="VizBlocksAP", char *server="172.20.10.8", int port=1883)
 
void command_callback (char *data, uint16_t len)
 What does this do? More...
 
void set_wifi (boolean v)
 What does this do? More...
 
void init ()
 
void add (Behaviour *b)
 
void run ()
 
void serial_command ()
 
void mqtt_command ()
 
String process (String input)
 
String input_event (String input)
 What does this do? More...
 
String process_command (String command, String args)
 
void MQTT_connect ()
 
void generateCapabilitiesJSON ()
 What does this do? More...
 
void announce (String doc)
 What does this do? More...
 
void announce_capabilities ()
 What does this do? More...
 
void setID (char *id)
 What does this do? More...
 
char * getId ()
 What does this do? More...
 

Constructor & Destructor Documentation

◆ VizBlocks()

VizBlocks::VizBlocks ( char *  id,
char *  ssid = "VizBlocksNet",
char *  wifi_pass = "VizBlocksAP",
char *  server = "172.20.10.8",
int  port = 1883 
)

Member Function Documentation

◆ add()

void VizBlocks::add ( Behaviour b)

Add a behaviour to the list of possible behaviours

◆ announce()

void VizBlocks::announce ( String  doc)

What does this do?

◆ announce_capabilities()

void VizBlocks::announce_capabilities ( )

What does this do?

◆ command_callback()

void VizBlocks::command_callback ( char *  data,
uint16_t  len 
)

What does this do?

◆ generateCapabilitiesJSON()

void VizBlocks::generateCapabilitiesJSON ( )

What does this do?

◆ getId()

char* VizBlocks::getId ( )

What does this do?

◆ init()

void VizBlocks::init ( )

Set up the VizBlocks node - WiFi, MQTT

◆ input_event()

String VizBlocks::input_event ( String  input)

What does this do?

◆ mqtt_command()

void VizBlocks::mqtt_command ( )

Read a command from the serial input and process it. It only waits for 50ms to allow other behaviours to continue.

◆ MQTT_connect()

void VizBlocks::MQTT_connect ( )

Function to connect and reconnect as necessary to the MQTT server.

◆ process()

String VizBlocks::process ( String  input)

Process a command. This means:

  • split the command name from the arguments
  • call process_command with the separated command and argument string

◆ process_command()

String VizBlocks::process_command ( String  command,
String  args 
)

Process a command and its arguments. This means:

  • look for a Behaviour with the right name
  • if found, then call that behaviour with the arguments (which are still a single string)

◆ run()

void VizBlocks::run ( )

This is the main loop. It should be called from within loop() - really this function is the only thing you should need to call. It will manage it's own delay, so you can call as often as possible.

◆ serial_command()

void VizBlocks::serial_command ( )

Read a command from the serial input and process it

◆ set_wifi()

void VizBlocks::set_wifi ( boolean  v)

What does this do?

◆ setID()

void VizBlocks::setID ( char *  id)

What does this do?


The documentation for this class was generated from the following file: