Skip to content
Snippets Groups Projects
Commit 8d9b9148 authored by Matthew's avatar Matthew
Browse files

sweep for missing ; and unmoved constructors

parent a8ba5728
No related branches found
No related tags found
3 merge requests!4Joe merge,!3Doxygen Documentation,!2Docs
......@@ -68,6 +68,10 @@ char * ButtonPressed::args()
return "<String buttonId>";
};
ButtonTick::ButtonTick(VizBlocks* node, String name = "ButtonTick") :
Behaviour(name), _node(node)
{ }
int ButtonTick::start(String args)
{
//This is where you do your stuff for a simple behaviour
......
......@@ -14,10 +14,10 @@ class ButtonPressed : public Behaviour
VizBlocks* _node;
public:
ButtonPressed(VizBlocks* node, String name = "ButtonPressed")
ButtonPressed(VizBlocks* node, String name = "ButtonPressed");
char* args();
String start(String args);
}
};
class ButtonReleased : public Behaviour
{
......@@ -30,8 +30,8 @@ class ButtonReleased : public Behaviour
public:
ButtonReleased(VizBlocks* node, String name = "ButtonReleased");
char* args()
String start(String args)
char* args();
String start(String args);
};
class ButtonClicked : public Behaviour
......@@ -45,7 +45,7 @@ class ButtonClicked : public Behaviour
public:
ButtonClicked(VizBlocks* node, String name = "ButtonClicked");
char* args()
char* args();
String start(String args);
};
......@@ -59,26 +59,16 @@ class ButtonHeld : public Behaviour
VizBlocks* _node;
public:
ButtonHeld(VizBlocks* node, String name = "ButtonHeld")
ButtonHeld(VizBlocks* node, String name = "ButtonHeld");
/**
@brief What does this do?
*/
char* args()
{
return "<String buttonId>";
};
char* args();
/**
@brief What does this do?
*/
String start(String args)
{
//This is where you do your stuff for a simple behaviour
String str = "{\"id\":\"" + String(_node->getId()) + "\",\"Input\":{\"type\":\"" + String(name()) + "\",\"button\":\"" + args + "\"}}";
_node->announce(str);
return "ButtonHeld behaviour " + _name + " with (" + args + ")";
}
String start(String args);
};
class ButtonTick : public Behaviour
......@@ -91,17 +81,12 @@ class ButtonTick : public Behaviour
VizBlocks* _node;
public:
ButtonTick(VizBlocks* node, String name = "ButtonTick") :
Behaviour(name), _node(node)
{ }
ButtonTick(VizBlocks* node, String name = "ButtonTick");
/**
@brief What does this do?
*/
char* args()
{
return "<String buttonId>";
};
char* args();
String start(String args);
};
......
SendCapabilities::SendCapabilities(VizBlocks* node, String name = "SendCapabilities") :
Behaviour(name), _node(node)
{ }
int SendCapabilities::start(String args)
{
//This is where you do your stuff for a simple behaviour
......@@ -31,6 +35,12 @@ int PingServer::start(String args)
return "Pinging server";
};
Link:: Link(VizBlocks* node, String name = "Link") : Behaviour(name), _node(node)
{
_background = true;
}
void Link::update()
{
if (millis() > (_t+_timeoutInterval))
......
......@@ -15,20 +15,11 @@ class SendCapabilities : public Behaviour
VizBlocks* _node;
public:
SendCapabilities(VizBlocks* node, String name = "SendCapabilities") :
Behaviour(name), _node(node)
{ }
SendCapabilities(VizBlocks* node, String name = "SendCapabilities");
/**
@brief What does this do?
*/
String start(String args)
{
//This is where you do your stuff for a simple behaviour
_node->announce_capabilities();
return "SendCapabilities behaviour " + _name;
}
String start(String args);
};
......@@ -46,59 +37,21 @@ class Link : public Behaviour
unsigned long _t = 0;
public:
Link(VizBlocks* node, String name = "Link") : Behaviour(name), _node(node)
{
_background = true;
}
/**
Link(VizBlocks* node, String name = "Link");
/**
@brief What does this do?
*/
char* args()
{
return "<String peerId>";
};
char* args();
/**
@brief What does this do?
*/
String start(String args)
{
_running = true;
if (args == name() || args.indexOf(" ")>0)
{
return "Invalid args (" + args + ") in behaviour " + name();
}
_t = millis();
if (args == _peerId)
{
return "Link ping from (" + _peerId + ")";
}
_peerId = args;
String str = "{\"id\":\"" + String(_node->getId()) + "\",\"Link\":{\"peerId\":\"" + _peerId + "\"}}";
_node->announce(str);
return "New link with (" + _peerId + ")";
}
String start(String args);
/**
@brief What does this do?
*/
void update()
{
if (millis() > (_t+_timeoutInterval))
{
String str = "{\"id\":\"" + String(_node->getId()) + "\",\"Unlink\":{\"peerId\":\"" + _peerId + "\"}}";
_node->announce(str);
_peerId = "";
_running = false;
}
}
void update();
};
......
......@@ -32,7 +32,7 @@ public:
/**
@brief What does this do?
*/
String start(String args)
String start(String args);
};
......@@ -48,9 +48,7 @@ class BreathingLEDs : public Behaviour
int _direction = 1;
public:
BreathingLEDs(Adafruit_NeoPixel* strip, String name = "BreathingLEDs", uint32_t hue=0, uint32_t sat=0) :
Behaviour(name), _strip(strip), _hue(hue * 255), _sat(sat)
{ }
BreathingLEDs(Adafruit_NeoPixel* strip, String name = "BreathingLEDs", uint32_t hue=0, uint32_t sat=0);
char* args();
/**
@brief What does this do?
......
......@@ -43,10 +43,7 @@ class NameDictionary
int _arraySize;
public:
NameDictionary()
{
_arraySize = sizeof(data) / sizeof(keyValuePair);
};
NameDictionary();
/**
@brief What does this do?
*/
......
......@@ -19,9 +19,7 @@ class PotentiometerUpdated : public Behaviour
VizBlocks* _node;
public:
PotentiometerUpdated(VizBlocks* node, String name = "PotentiometerUpdated") :
Behaviour(name), _node(node)
{ }
PotentiometerUpdated(VizBlocks* node, String name = "PotentiometerUpdated");
/**
@brief What does this do?
*/
......
......@@ -82,15 +82,8 @@ public:
//Public Functions:
RotaryEncoder(int pinA, int pinB, int id = 99) : _pinA(pinA), _pinB(pinB), _id(id)
{
pinMode(_pinA, INPUT_PULLUP);
pinMode(_pinB, INPUT_PULLUP);
_previousTimer = millis();
_setState(digitalRead(_pinA), digitalRead(_pinB));
setPosition(0);
}
RotaryEncoder(int pinA, int pinB, int id = 99);
/**
@brief What does this do?
*/
......
......@@ -19,7 +19,7 @@ class RotaryEncoderUpdated : public Behaviour
VizBlocks* _node;
public:
RotaryEncoderUpdated(VizBlocks* node, String name = "RotaryEncoderUpdated")
RotaryEncoderUpdated(VizBlocks* node, String name = "RotaryEncoderUpdated");
/**
@brief What does this do?
*/
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment