From bbcfc99a0d2201d62fcc96f6a5368aa89b8c4ab6 Mon Sep 17 00:00:00 2001 From: Rodrigo Alfonso Date: Sun, 18 Aug 2024 01:46:09 -0300 Subject: [PATCH] Renaming isConnected() => isP2PConnected() --- README.md | 2 +- examples/LinkMobile_demo/src/main.cpp | 4 ++-- lib/LinkMobile.hpp | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index ab756e5..0e79d03 100644 --- a/README.md +++ b/README.md @@ -450,7 +450,7 @@ Name | Return type | Description `getState()` | **LinkMobile::State** | Returns the current state (one of `LinkMobile::State::NEEDS_RESET`, `LinkMobile::State::PINGING`, `LinkMobile::State::WAITING_TO_START`, `LinkMobile::State::STARTING_SESSION`, `LinkMobile::State::ACTIVATING_SIO32`, `LinkMobile::State::WAITING_32BIT_SWITCH`, `LinkMobile::State::READING_CONFIGURATION`, `LinkMobile::State::SESSION_ACTIVE`, `LinkMobile::State::CALL_REQUESTED`, `LinkMobile::State::CALLING`, `LinkMobile::State::CALL_ESTABLISHED`, `LinkMobile::State::SESSION_ACTIVE_ISP`, `LinkMobile::State::SHUTDOWN_REQUESTED`, `LinkMobile::State::ENDING_SESSION`, `LinkMobile::State::WAITING_8BIT_SWITCH`, or `LinkMobile::State::SHUTDOWN`). `getRole()` | **LinkMobile::Role** | Returns the current role in the P2P connection (one of `LinkMobile::Role::NO_P2P_CONNECTION`, `LinkMobile::Role::CALLER`, or `LinkMobile::Role::RECEIVER`). `isConfigurationValid()` | **int** | Returns whether the adapter has been configured or not. Returns `1` = yes, `0` = no, `-1` = unknown (no session active). -`isConnected()` | **bool** | Returns `true` if a P2P call is established (the state is `CALL_ESTABLISHED`). +`isP2PConnected()` | **bool** | Returns `true` if a P2P call is established (the state is `CALL_ESTABLISHED`). `isSessionActive()` | **bool** | Returns `true` if the session is active. `canShutdown()` | **bool** | Returns `true` if there's an active session and there's no previous shutdown requests. `getDataSize()` | **LinkSPI::DataSize** | Returns the current operation mode (`LinkSPI::DataSize`). diff --git a/examples/LinkMobile_demo/src/main.cpp b/examples/LinkMobile_demo/src/main.cpp index 92d546b..95844ed 100644 --- a/examples/LinkMobile_demo/src/main.cpp +++ b/examples/LinkMobile_demo/src/main.cpp @@ -88,14 +88,14 @@ start: output += "\nR = Call someone\n"; output += "\n (A = ok)\n (SELECT = stop)"; } else { - if (linkMobile->isConnected()) { + if (linkMobile->isP2PConnected()) { output += "\n (A = send)"; output += "\n (L = hang up)"; } output += "\n (SELECT = stop)"; } - if (linkMobile->isConnected()) { + if (linkMobile->isP2PConnected()) { if (!isConnected) { isConnected = true; outgoingData = linkMobile->getRole() == LinkMobile::Role::CALLER diff --git a/lib/LinkMobile.hpp b/lib/LinkMobile.hpp index e5ee945..41f504d 100644 --- a/lib/LinkMobile.hpp +++ b/lib/LinkMobile.hpp @@ -18,7 +18,7 @@ // // (do something until `linkMobile->isSessionActive()` returns `true`) // - 4) Call someone: // linkMobile->call("127000000001"); -// // (do something until `linkMobile->isConnected()` returns `true`) +// // (do something until `linkMobile->isP2PConnected()` returns `true`) // - 5) Send/receive data: // LinkMobile::DataTransfer dataTransfer = { .size = 5 }; // for (u32 i = 0; i < 5; i++) @@ -371,7 +371,7 @@ class LinkMobile { * @brief Returns `true` if a P2P call is established (the state is * `CALL_ESTABLISHED`). */ - [[nodiscard]] bool isConnected() { return state == CALL_ESTABLISHED; } + [[nodiscard]] bool isP2PConnected() { return state == CALL_ESTABLISHED; } /** * @brief Returns `true` if the session is active.