Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add getConnectionCount function #108

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/WebSerial.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,10 @@ void WebSerialClass::onMessage(WSLStringMessageHandler callback) {
};
}

bool WebSerialClass::getConnectionCount() {
return _ws->count();
}

// Print func
size_t WebSerialClass::write(uint8_t m) {
if (!_ws)
Expand Down
1 change: 1 addition & 0 deletions src/WebSerial.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ class WebSerialClass : public Print {
void setAuthentication(const String& username, const String& password);
void onMessage(WSLMessageHandler recv);
void onMessage(WSLStringMessageHandler recv);
bool getConnectionCount();
size_t write(uint8_t) override;
size_t write(const uint8_t* buffer, size_t size) override;

Expand Down