This commit is contained in:
Nick Leeman 2021-04-04 00:01:06 +02:00
parent 69f48d65cd
commit 057cce2096
2 changed files with 10 additions and 4 deletions

View File

@ -1,6 +1,6 @@
{
"name": "SimpleSerialProtocol",
"version": "1.2.0",
"version": "1.3.0",
"description": "Easy-to-use serial protocol system for arduino type devices.",
"keywords": "Serial, Connectivity, USB, Simple",
"repository":

View File

@ -21,9 +21,9 @@
class SerialConnection
{
private:
byte serialBufferSize = 300;
char serialBuffer[300];
char serialData[300] = {0};
int serialBufferSize = 1024;
char serialBuffer[1024];
char serialData[1024] = {0};
const char packetStartMarker = '<';
const char packetEndMarker = '>';
@ -55,20 +55,26 @@ void SerialConnection::init(int serialIndex, unsigned long serialBaud) {
serialRefrence = &Serial;
}
#ifdef Serial1
else if (serialIndex == 1) {
Serial1.begin(serialBaud);
serialRefrence = &Serial1;
}
#endif
#ifdef Serial2
else if (serialIndex == 2) {
Serial2.begin(serialBaud);
serialRefrence = &Serial2;
}
#endif
#ifdef Serial3
else if (serialIndex == 3) {
Serial3.begin(serialBaud);
serialRefrence = &Serial3;
}
#endif
};
char* SerialConnection::handle() {