Skip to content

Commit 0160cfa

Browse files
committed
add base block class
1 parent ce97499 commit 0160cfa

File tree

2 files changed

+69
-0
lines changed

2 files changed

+69
-0
lines changed

src/blocks/AdafruitIO_Block.cpp

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
//
2+
// Adafruit invests time and resources providing this open source code.
3+
// Please support Adafruit and open source hardware by purchasing
4+
// products from Adafruit!
5+
//
6+
// Copyright (c) 2015-2016 Adafruit Industries
7+
// Authors: Tony DiCola, Todd Treece
8+
// Licensed under the MIT license.
9+
//
10+
// All text above must be included in any redistribution.
11+
//
12+
#include "AdafruitIO_Block.h"
13+
14+
AdafruitIO_Block::AdafruitIO_Block(AdafruitIO_Dashboard *d, AdafruitIO_Feed *f)
15+
{
16+
_dashboard = d;
17+
_feed = f;
18+
}
19+
20+
AdafruitIO_Block::~AdafruitIO_Block(){}
21+
22+
String AdafruitIO_Block::properties()
23+
{
24+
String props = "";
25+
return props;
26+
}
27+
28+
bool AdafruitIO_Block::save()
29+
{
30+
Serial.println(properties());
31+
}

src/blocks/AdafruitIO_Block.h

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
//
2+
// Adafruit invests time and resources providing this open source code.
3+
// Please support Adafruit and open source hardware by purchasing
4+
// products from Adafruit!
5+
//
6+
// Copyright (c) 2015-2016 Adafruit Industries
7+
// Authors: Tony DiCola, Todd Treece
8+
// Licensed under the MIT license.
9+
//
10+
// All text above must be included in any redistribution.
11+
//
12+
#ifndef ADAFRUITIO_BLOCK_H
13+
#define ADAFRUITIO_BLOCK_H
14+
15+
#include "Arduino.h"
16+
#include "AdafruitIO_Definitions.h"
17+
18+
class AdafruitIO_Dashboard;
19+
class AdafruitIO_Feed;
20+
21+
class AdafruitIO_Block {
22+
23+
public:
24+
AdafruitIO_Block(AdafruitIO_Dashboard *d, AdafruitIO_Feed *f);
25+
~AdafruitIO_Block();
26+
27+
virtual String properties();
28+
29+
bool save();
30+
31+
private:
32+
AdafruitIO_Dashboard *_dashboard;
33+
AdafruitIO_Feed *_feed;
34+
const char *_visual_type = "block";
35+
36+
};
37+
38+
#endif // ADAFRUITIO_BLOCK_H

0 commit comments

Comments
 (0)