mirror of
https://github.com/afska/gba-link-connection.git
synced 2026-10-01 21:36:53 -05:00
Renaming isConnected() => isP2PConnected()
This commit is contained in:
@@ -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`).
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user