Updated module templates

pull/13/head
jgromes 2018-09-29 12:15:56 +02:00
rodzic fb32a8243b
commit 9c9d2b7ec4
2 zmienionych plików z 14 dodań i 5 usunięć

Wyświetl plik

@ -7,7 +7,7 @@
_mod = mod;
}
uint8_t <module_name>::begin() {
int16_t <module_name>::begin() {
/*
"begin" method implementation MUST call the "init" method with appropriate settings.
*/

Wyświetl plik

@ -4,7 +4,7 @@
Before opening pull request, please make sure that:
1. All files MUST be compiled without errors using default Arduino IDE settings.
2. Example sketches MUST be working correctly and MUST be stable enough to run for prolonged periods of time.
3. Writing style SHOULD be at least somewhat consistent.
3. Writing style SHOULD be consistent.
4. Comments SHOULD be in place for the most important chunks of code and SHOULD be free of typos.
5. To indent, 2 spaces MUST be used.
@ -28,6 +28,14 @@
*/
//#include "../protocols/TransportLayer.h"
/*
Only use the following include if the module implements methods for OSI physical layer control.
This concerns only modules similar to e.g. SX127x.
In this case, your class MUST implement all virtual methods of PhysicalLayer class.
*/
//#include "../protocols/PhysicalLayer.h"
/*
Register map
Definition of SPI/I2C register map MAY be placed here. The register map MAY have two parts:
@ -54,6 +62,7 @@
1 - ISerial: Interface for Arduino Serial class, intended as a thin wrapper for modules that directly take
Serial input (e.g. HC-05).
2 - TransportLayer: In case the module implements methods for OSI transport layer control (e.g. ESP8266).
3 - PhysicalLayer: In case the module implements methods for OSI physical layer control (e.g. SX127x).
*/
class <module_name> {
public:
@ -66,14 +75,14 @@ class <module_name> {
/*
The class MUST implement at least one basic method called "begin".
The "begin" method MUST initialize the module and return the status as uint8_t type.
The "begin" method MUST initialize the module and return the status as int16_t type.
*/
// basic methods
uint8_t begin();
int16_t begin();
/*
The class MAY implement additional methods.
All implemented methods SHOULD return the status as uint8_t type.
All implemented methods SHOULD return the status as int16_t type.
*/
private: