mirror of
https://github.com/kidfromjupiter/nearby.git
synced 2026-09-15 07:06:11 -04:00
Merge branch 'google3'
Change-Id: I8b28b1d3a5280581f20e4edf9144641a12df8879
This commit is contained in:
@@ -14,6 +14,7 @@ cc_library(
|
||||
"//platform:types",
|
||||
"//platform:utils",
|
||||
"//platform/api",
|
||||
"//platform/impl/shared:file",
|
||||
"//platform/impl/shared/sample:sample_wifi_medium",
|
||||
"//platform/port:string",
|
||||
"//absl/time",
|
||||
|
||||
@@ -12,6 +12,7 @@ target_link_libraries(platform_impl_sample
|
||||
PUBLIC
|
||||
absl::time
|
||||
platform_api
|
||||
platform_impl_shared_file
|
||||
platform_port_string
|
||||
platform_types
|
||||
platform_utils
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
#include "platform/cancelable.h"
|
||||
#include "platform/impl/sample/atomic_reference_impl.h"
|
||||
#include "platform/impl/sample/settable_future_impl.h"
|
||||
#include "platform/impl/shared/file_impl.h"
|
||||
#include "platform/impl/shared/sample/sample_wifi_medium.h"
|
||||
#include "platform/port/string.h"
|
||||
#include "platform/ptr.h"
|
||||
@@ -30,6 +31,12 @@ namespace location {
|
||||
namespace nearby {
|
||||
namespace platform {
|
||||
|
||||
namespace {
|
||||
std::string getPayloadPath(std::int64_t payload_id) {
|
||||
return "/tmp/sample-" + std::to_string(payload_id);
|
||||
}
|
||||
} // namespace
|
||||
|
||||
Ptr<ScheduledExecutor> ImplementationPlatform::createScheduledExecutor() {
|
||||
return Ptr<ScheduledExecutor>{};
|
||||
}
|
||||
@@ -80,6 +87,16 @@ Ptr<AtomicBoolean> ImplementationPlatform::createAtomicBoolean(
|
||||
return Ptr<AtomicBoolean>{};
|
||||
}
|
||||
|
||||
Ptr<InputFile> ImplementationPlatform::createInputFile(
|
||||
std::int64_t payload_id, std::int64_t total_size) {
|
||||
return MakePtr(new InputFileImpl(getPayloadPath(payload_id), total_size));
|
||||
}
|
||||
|
||||
Ptr<OutputFile> ImplementationPlatform::createOutputFile(
|
||||
std::int64_t payload_id) {
|
||||
return MakePtr(new OutputFileImpl(getPayloadPath(payload_id)));
|
||||
}
|
||||
|
||||
Ptr<BluetoothClassicMedium>
|
||||
ImplementationPlatform::createBluetoothClassicMedium() {
|
||||
return Ptr<BluetoothClassicMedium>();
|
||||
@@ -116,10 +133,6 @@ Ptr<HashUtils> ImplementationPlatform::createHashUtils() {
|
||||
|
||||
std::string ImplementationPlatform::getDeviceId() { return "sample"; }
|
||||
|
||||
std::string ImplementationPlatform::getPayloadPath(int64_t payload_id) {
|
||||
return "/tmp/sample-" + std::to_string(payload_id);
|
||||
}
|
||||
|
||||
} // namespace platform
|
||||
} // namespace nearby
|
||||
} // namespace location
|
||||
|
||||
Reference in New Issue
Block a user