Skip to content
Snippets Groups Projects
CommsBehaviours.h 1.43 KiB
Newer Older
Joe Revans's avatar
Joe Revans committed
#ifndef COMMS_BEHAVIOUR_h
#define COMMS_BEHAVIOUR_h
#include "Arduino.h"
#include "Behaviours.h"
Joe Revans's avatar
Joe Revans committed
#include <VizBlocks.h>
Joe Revans's avatar
Joe Revans committed

/*
 * --------------------------------------------------
 * ---------------- SendCapabilities ----------------
 * --------------------------------------------------
 */

Matthew's avatar
Matthew committed
class SendCapabilities : public Behaviour
{
	VizBlocks* _node;
Joe Revans's avatar
Joe Revans committed

public:
	SendCapabilities(VizBlocks* node, String name = "SendCapabilities");
Matthew's avatar
Matthew committed
	/**
	   @brief What does this do?
	 */
	String start(String args);
Joe Revans's avatar
Joe Revans committed

};

/*
 * --------------------------------------------------
 * ---------------------- Link ----------------------
 * --------------------------------------------------
 */

Matthew's avatar
Matthew committed
class Link : public Behaviour
{
	VizBlocks* _node;
	String _peerId;
	const int _timeoutInterval = 5000;
	unsigned long _t = 0;
Joe Revans's avatar
Joe Revans committed

public:
	Link(VizBlocks* node, String name = "Link");
  /**
Matthew's avatar
Matthew committed
	   @brief What does this do?
	 */
	char* args();
Matthew's avatar
Matthew committed

Matthew's avatar
Matthew committed
	/**
	   @brief What does this do?
	 */
	String start(String args);
Matthew's avatar
Matthew committed

Matthew's avatar
Matthew committed
	/**
	   @brief What does this do?
	 */
	void update();
Joe Revans's avatar
Joe Revans committed

};

/*
 * --------------------------------------------------
 * ------------------- PingServer -------------------
 * --------------------------------------------------
 */

Matthew's avatar
Matthew committed
class PingServer : public Behaviour
{
	VizBlocks* _node;
	String str;
	const int _interval = 4000;
	unsigned long _t = 0;
Joe Revans's avatar
Joe Revans committed

public:
Matthew's avatar
Matthew committed
	PingServer(VizBlocks* node, String name = "PingServer");
	String start(String args);
	void update();
Joe Revans's avatar
Joe Revans committed

};

#endif