Skip to content

Commit

Permalink
Fix bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonPucheu authored Nov 19, 2022
1 parent 1054896 commit 7957756
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
2 changes: 2 additions & 0 deletions keywords.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ Bluetooth KEYWORD1

receive KEYWORD2
send KEYWORD2
empty KEYWORD2
read KEYWORD2
print KEYWORD2
println KEYWORD2

Expand Down
11 changes: 8 additions & 3 deletions src/Bluetooth.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

Bluetooth::Bluetooth(Stream *stream)
{
*serial = *stream;
serial = stream;
}

/**
Expand Down Expand Up @@ -41,6 +41,11 @@ bool Bluetooth::send()
print(".");
}

void Bluetooth::empty()
{
while (serial -> available()) read();
}

/**
* Function to read current char
*
Expand All @@ -56,7 +61,7 @@ char Bluetooth::read()
*
* @param String `data` to print on the bluetooth
*/
void Bluetooth::print(String data)
void Bluetooth::print(String data = "")
{
serial -> print(data);
}
Expand All @@ -66,7 +71,7 @@ void Bluetooth::print(String data)
*
* @return char the current character in the bluetooth buffer
*/
void Bluetooth::println(String data)
void Bluetooth::println(String data = "")
{
serial -> println(data);
}
4 changes: 2 additions & 2 deletions src/Bluetooth.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ class Bluetooth
bool receive();
bool send();
char read();
void print(String data);
void println(String data);
void print(String data = "");
void println(String data = "");
String message;
Stream *serial;
StaticJsonDocument<200> json;
Expand Down

0 comments on commit 7957756

Please sign in to comment.