mirror of
https://github.com/kidfromjupiter/nearby.git
synced 2026-09-15 07:06:11 -04:00
Create v3 ConnectionResponseInfo
PiperOrigin-RevId: 533518921
This commit is contained in:
committed by
Copybara-Service
parent
f80a50f402
commit
f727d00ad1
@@ -3,7 +3,7 @@ cc_library(
|
||||
hdrs = [
|
||||
"bandwidth_info.h",
|
||||
"connection_listening_options.h",
|
||||
"connection_resolution.h",
|
||||
"connection_result.h",
|
||||
"connections_device.h",
|
||||
"connections_device_provider.h",
|
||||
"listeners.h",
|
||||
|
||||
@@ -12,8 +12,10 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#ifndef THIRD_PARTY_NEARBY_CONNECTIONS_V3_CONNECTION_RESOLUTION_H_
|
||||
#define THIRD_PARTY_NEARBY_CONNECTIONS_V3_CONNECTION_RESOLUTION_H_
|
||||
#ifndef THIRD_PARTY_NEARBY_CONNECTIONS_V3_CONNECTION_RESULT_H_
|
||||
#define THIRD_PARTY_NEARBY_CONNECTIONS_V3_CONNECTION_RESULT_H_
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "connections/status.h"
|
||||
|
||||
@@ -25,8 +27,18 @@ struct ConnectionResult {
|
||||
nearby::connections::Status status;
|
||||
};
|
||||
|
||||
// These fields should never be empty.
|
||||
struct InitialConnectionInfo {
|
||||
// 4-digit authentication code shown to user derived by UKEY2.
|
||||
std::string authentication_digits;
|
||||
// Raw 32-byte authentication token derived by UKEY2.
|
||||
std::string raw_authentication_token;
|
||||
// Specifies if the connection is incoming or outgoing.
|
||||
bool is_incoming_connection = false;
|
||||
};
|
||||
|
||||
} // namespace v3
|
||||
} // namespace connections
|
||||
} // namespace nearby
|
||||
|
||||
#endif // THIRD_PARTY_NEARBY_CONNECTIONS_V3_CONNECTION_RESOLUTION_H_
|
||||
#endif // THIRD_PARTY_NEARBY_CONNECTIONS_V3_CONNECTION_RESULT_H_
|
||||
@@ -18,7 +18,7 @@
|
||||
#include "absl/functional/any_invocable.h"
|
||||
#include "connections/listeners.h"
|
||||
#include "connections/v3/bandwidth_info.h"
|
||||
#include "connections/v3/connection_resolution.h"
|
||||
#include "connections/v3/connection_result.h"
|
||||
#include "internal/interop/device.h"
|
||||
|
||||
namespace nearby {
|
||||
@@ -44,8 +44,9 @@ struct ConnectionListener {
|
||||
// remote_device - The identifier for the remote endpoint.
|
||||
// info - Other relevant information about the connection.
|
||||
absl::AnyInvocable<void(const NearbyDevice& remote_device,
|
||||
const ConnectionResponseInfo& info)>
|
||||
initiated_cb = [](const NearbyDevice&, const ConnectionResponseInfo&) {};
|
||||
const v3::InitialConnectionInfo& info)>
|
||||
initiated_cb =
|
||||
[](const NearbyDevice&, const v3::InitialConnectionInfo&) {};
|
||||
|
||||
// Called when both sides have accepted or either side has rejected the
|
||||
// connection. If the {@link ConnectionResolution}'s status is {@link
|
||||
|
||||
Reference in New Issue
Block a user