mirror of
https://github.com/kidfromjupiter/nearby.git
synced 2026-09-14 14:46:12 -04:00
Add BLE out-of-band connection metadata fields.
PiperOrigin-RevId: 835365782
This commit is contained in:
committed by
Copybara-Service
parent
49b2e371ab
commit
ccb180bc56
+5
-1
@@ -527,7 +527,7 @@ void NcInjectEndpoint(NC_INSTANCE instance, const NC_DATA* service_id,
|
||||
}
|
||||
|
||||
::nearby::connections::OutOfBandConnectionMetadata
|
||||
cpp_out_of_band_connection_metadata;
|
||||
cpp_out_of_band_connection_metadata{};
|
||||
cpp_out_of_band_connection_metadata.endpoint_id = metadata->endpoint_id;
|
||||
cpp_out_of_band_connection_metadata.endpoint_info = {
|
||||
metadata->endpoint_info.data,
|
||||
@@ -537,6 +537,10 @@ void NcInjectEndpoint(NC_INSTANCE instance, const NC_DATA* service_id,
|
||||
cpp_out_of_band_connection_metadata.remote_bluetooth_mac_address = {
|
||||
metadata->remote_bluetooth_mac_address.data,
|
||||
static_cast<size_t>(metadata->remote_bluetooth_mac_address.size)};
|
||||
cpp_out_of_band_connection_metadata.ble_peripheral_native_id = {
|
||||
metadata->ble_peripheral_native_id.data,
|
||||
static_cast<size_t>(metadata->ble_peripheral_native_id.size)};
|
||||
cpp_out_of_band_connection_metadata.psm = metadata->psm;
|
||||
|
||||
nc_context->core->InjectEndpoint(
|
||||
std::string(service_id->data, service_id->size),
|
||||
|
||||
@@ -305,6 +305,10 @@ typedef struct NC_OUT_OF_BAND_CONNECTION_METADATA {
|
||||
// generated such that no two IDs are identical.
|
||||
int endpoint_id;
|
||||
|
||||
//
|
||||
// Properties for BLUETOOTH out-of-band connections.
|
||||
//
|
||||
|
||||
// Endpoint info to use for the injected connection; will be included in the
|
||||
// endpoint_found_cb callback. Should uniquely identify the InjectEndpoint()
|
||||
// call so that the client which made the call can verify the endpoint
|
||||
@@ -315,6 +319,16 @@ typedef struct NC_OUT_OF_BAND_CONNECTION_METADATA {
|
||||
|
||||
// Used for Bluetooth connections.
|
||||
NC_DATA remote_bluetooth_mac_address;
|
||||
|
||||
//
|
||||
// Properties for BLE out-of-band connections.
|
||||
//
|
||||
|
||||
// The BLE peripheral native ID to use for the BLE connection.
|
||||
NC_DATA ble_peripheral_native_id;
|
||||
|
||||
// The Protocol/Service Multiplexer(psm) value to use for the BLE connection.
|
||||
int psm;
|
||||
} NC_OUT_OF_BAND_CONNECTION_METADATA, *PNC_OUT_OF_BAND_CONNECTION_METADATA;
|
||||
|
||||
// Defines the minimal function interface for reading phenotype flags. Callbacks
|
||||
|
||||
@@ -17,9 +17,7 @@
|
||||
#include <string>
|
||||
|
||||
#include "connections/medium_selector.h"
|
||||
#include "connections/strategy.h"
|
||||
#include "internal/platform/byte_array.h"
|
||||
#include "proto/connections_enums.pb.h"
|
||||
|
||||
namespace nearby {
|
||||
namespace connections {
|
||||
@@ -47,6 +45,19 @@ struct OutOfBandConnectionMetadata {
|
||||
|
||||
// Used for Bluetooth connections.
|
||||
ByteArray remote_bluetooth_mac_address;
|
||||
|
||||
//
|
||||
// Properties for BLE out-of-band connections.
|
||||
//
|
||||
|
||||
// The BLE peripheral native ID to use for the BLE connection.
|
||||
// On Apple platform, the native ID is NSUUID in string format like
|
||||
// "E621E1F8-C36C-495A-93FC-0C247A3E6E5F", other platform will be MAC address
|
||||
// as string format like "0C:24:7A:3E:6E:5F".
|
||||
std::string ble_peripheral_native_id;
|
||||
|
||||
// The Protocol/Service Multiplexer(psm) value to use for the BLE connection.
|
||||
int psm;
|
||||
};
|
||||
|
||||
} // namespace connections
|
||||
|
||||
Reference in New Issue
Block a user