mirror of
https://github.com/kidfromjupiter/nearby.git
synced 2026-09-16 15:36:12 -04:00
Roll forward to cl/314747126
Signed-off-by: Alexey Polyudov <apolyudov@google.com> Change-Id: Ie19e006429b138b3768e97dae971a43fdc5ef8bf
This commit is contained in:
@@ -75,7 +75,8 @@ ExceptionOrOfflineFrame OfflineFrames::fromBytes(
|
||||
ConstPtr<ByteArray> offline_frame_bytes) {
|
||||
auto offline_frame = std::make_unique<OfflineFrame>();
|
||||
|
||||
if (!offline_frame->ParseFromString(offline_frame_bytes->asString())) {
|
||||
if (!offline_frame->ParseFromArray(offline_frame_bytes->getData(),
|
||||
offline_frame_bytes->size())) {
|
||||
return ExceptionOrOfflineFrame(Exception::INVALID_PROTOCOL_BUFFER);
|
||||
}
|
||||
|
||||
@@ -92,6 +93,7 @@ V1Frame::FrameType OfflineFrames::getFrameType(
|
||||
return V1Frame::UNKNOWN_FRAME_TYPE;
|
||||
}
|
||||
|
||||
// TODO(b/155752436): Use byte array endpoint_info instead of endpoint_name.
|
||||
ConstPtr<ByteArray> OfflineFrames::forConnectionRequest(
|
||||
const std::string &endpoint_id, const std::string &endpoint_name,
|
||||
std::int32_t nonce,
|
||||
@@ -99,6 +101,7 @@ ConstPtr<ByteArray> OfflineFrames::forConnectionRequest(
|
||||
auto connection_request = std::make_unique<ConnectionRequestFrame>();
|
||||
connection_request->set_endpoint_id(endpoint_id);
|
||||
connection_request->set_endpoint_name(endpoint_name);
|
||||
connection_request->set_endpoint_info(endpoint_name);
|
||||
connection_request->set_nonce(nonce);
|
||||
|
||||
for (std::vector<proto::connections::Medium>::const_iterator it =
|
||||
|
||||
Reference in New Issue
Block a user