Skip to content

Commit 28693ac

Browse files
committed
Added Version 1.0
1 parent 2e1332d commit 28693ac

7 files changed

Lines changed: 125 additions & 3 deletions

File tree

.gitignore

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# ---> C++
2+
# Prerequisites
3+
*.d
4+
5+
# Compiled Object files
6+
*.slo
7+
*.lo
8+
*.o
9+
*.obj
10+
11+
# Precompiled Headers
12+
*.gch
13+
*.pch
14+
15+
# Compiled Dynamic libraries
16+
*.so
17+
*.dylib
18+
*.dll
19+
20+
# Fortran module files
21+
*.mod
22+
*.smod
23+
24+
# Compiled Static libraries
25+
*.lai
26+
*.la
27+
*.a
28+
*.lib
29+
30+
# Executables
31+
*.exe
32+
*.out
33+
*.app
34+
35+
# ---> VisualStudioCode
36+
.vscode/*
37+
!.vscode/settings.json
38+
!.vscode/tasks.json
39+
!.vscode/launch.json
40+
!.vscode/extensions.json
41+

LICENSE

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@
186186
same "printed page" as the copyright notice for easier
187187
identification within third-party archives.
188188

189-
Copyright [yyyy] [name of copyright owner]
189+
Copyright 2019 Jan-Eric Schober
190190

191191
Licensed under the Apache License, Version 2.0 (the "License");
192192
you may not use this file except in compliance with the License.
@@ -198,4 +198,4 @@
198198
distributed under the License is distributed on an "AS IS" BASIS,
199199
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200200
See the License for the specific language governing permissions and
201-
limitations under the License.
201+
limitations under the License.

README.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,13 @@
11
# ArduinoStreamCommander-MessageTypes
2-
ArduinoStreamCommander-MessageTypes contains a set of standard message types used by the ArduinoStreamCommander.
2+
ArduinoStreamCommander-MessageTypes contains a set of standard message types used by the [https://github.com/je-s/ArduinoStreamCommander](ArduinoStreamCommander).
3+
4+
The `MessageType`-Class can be resused in other software written in C++, since it is also compatible to ISO-C++'s `std::string`-container.
5+
# Folder structure
6+
* `src` contains the source code.
7+
# Installing and using ArduinoStreamCommander-MessageTypes with the Arduino IDE
8+
* To install the library either clone and ZIP the folder, or download one of the releases. After that follow the instructions [https://www.arduino.cc/en/Guide/Libraries#toc2](here).
9+
* In order to use ArduinoStreamCommander-MessageTypes, `<MessageTypes.hpp>` needs to be included.
10+
# Usage
11+
The name (as `String` [Arduino Environment] or as `std::string` [in ISO-C++]) of a particular message type can be accessed by (for example): `MessageType::PING`.
12+
13+
For further information regarding the meanings/intentions of the different message types, please see the [https://github.com/je-s/ArduinoStreamCommander](ArduinoStreamCommander) README file.

keywords.txt

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Syntax Coloring Map For StreamCommander
2+
3+
# Datatypes (KEYWORD1)
4+
MessageType KEYWORD1
5+
6+
# Methods and Functions (KEYWORD2)
7+
# none
8+
9+
# Instances (KEYWORD2)
10+
# none
11+
12+
# Constants (LITERAL1)
13+
RESPONSE LITERAL1
14+
INFO LITERAL1
15+
ERROR LITERAL1
16+
STATUS LITERAL1
17+
ID LITERAL1
18+
ACTIVE LITERAL1
19+
ECHO LITERAL1
20+
COMMANDS LITERAL1
21+
COMMAND LITERAL1

library.properties

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
name=StreamCommander-MessageTypes
2+
version=1.0.0
3+
author=Jan-Eric Schober <je@schober.industries>
4+
maintainer=Jan-Eric Schober <je@schober.industries>
5+
sentence=A class containing all standard message types of the StreamCommander.
6+
paragraph=A class containing all standard message types of the StreamCommander.
7+
category=Communication
8+
url=https://je.schober.industries.com/
9+
includes=MessageTypes.hpp

src/MessageTypes.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#include "MessageTypes.hpp"
2+
3+
const T_STRING MessageType::RESPONSE = "response";
4+
const T_STRING MessageType::INFO = "info";
5+
const T_STRING MessageType::ERROR = "error";
6+
const T_STRING MessageType::PING = "ping";
7+
const T_STRING MessageType::STATUS = "status";
8+
const T_STRING MessageType::ID = "id";
9+
const T_STRING MessageType::ACTIVE = "active";
10+
const T_STRING MessageType::ECHO = "echo";
11+
const T_STRING MessageType::COMMANDS = "commands";
12+
const T_STRING MessageType::COMMAND = "command";

src/MessageTypes.hpp

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#ifndef MESSAGETYPES_HPP
2+
#define MESSAGETYPES_HPP
3+
4+
// Check whether we're in an Arduino-Environment or not
5+
#ifdef ARDUINO
6+
#include "WString.h"
7+
#define T_STRING String
8+
#else
9+
#include <string>
10+
#define T_STRING std::string
11+
#endif
12+
13+
class MessageType
14+
{
15+
public:
16+
static const T_STRING RESPONSE;
17+
static const T_STRING INFO;
18+
static const T_STRING ERROR;
19+
static const T_STRING PING;
20+
static const T_STRING STATUS;
21+
static const T_STRING ID;
22+
static const T_STRING ACTIVE;
23+
static const T_STRING ECHO;
24+
static const T_STRING COMMANDS;
25+
static const T_STRING COMMAND;
26+
};
27+
28+
#endif // MESSAGETYPES_HPP

0 commit comments

Comments
 (0)