Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pull latest pigweed version. #20158

Merged
merged 10 commits into from
Jun 30, 2022
6 changes: 3 additions & 3 deletions examples/common/pigweed/RpcService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@

#include "RpcService.h"

#include "pw_span/span.h"
#include <array>
#include <span>
#include <string_view>

#include "pw_hdlc/rpc_channel.h"
Expand Down Expand Up @@ -56,7 +56,7 @@ class ChipRpcChannelOutput : public pw::rpc::ChannelOutput
pw::rpc::ChannelOutput(channel_name), mWriter(writer), mAddress(address)
{}

pw::Status Send(std::span<const std::byte> buffer) override
pw::Status Send(pw::span<const std::byte> buffer) override
{
if (buffer.empty())
{
Expand Down Expand Up @@ -102,7 +102,7 @@ void Start(void (*RegisterServices)(pw::rpc::Server &), ::chip::rpc::Mutex * uar
{
uart_mutex->Lock();
}
pw::hdlc::WriteUIFrame(1, std::as_bytes(std::span(log)), sysIoWriter);
pw::hdlc::WriteUIFrame(1, pw::as_bytes(pw::span(log)), sysIoWriter);
if (uart_mutex)
{
uart_mutex->Unlock();
Expand Down
4 changes: 2 additions & 2 deletions examples/common/pigweed/mbed/Rpc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,10 @@ Thread * Init()

ChipLogProgress(NotSpecified, "RPC service starting...\r\n");

auto error = rpcThread.start(RunRpcService);
long error = rpcThread.start(RunRpcService);
if (error != osOK)
{
ChipLogError(NotSpecified, "Run RPC service failed[%d]", error);
ChipLogError(NotSpecified, "Run RPC service failed[%ld]", error);
return NULL;
}

Expand Down
2 changes: 1 addition & 1 deletion examples/common/pigweed/system_rpc_server.cc
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ void Init()
{
// Send log messages to HDLC address 1. This prevents logs from interfering
// with pw_rpc communications.
pw::log_basic::SetOutput([](std::string_view log) { pw::hdlc::WriteUIFrame(1, std::as_bytes(std::span(log)), writer); });
pw::log_basic::SetOutput([](std::string_view log) { pw::hdlc::WriteUIFrame(1, pw::as_bytes(pw::span(log)), writer); });
}

rpc::Server & Server()
Expand Down
4 changes: 2 additions & 2 deletions examples/platform/ameba/PigweedLogger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
#include <pw_hdlc/encoder.h>
#include <pw_stream/sys_io_stream.h>

#include "pw_span/span.h"
#include <assert.h>
#include <span>

namespace PigweedLogger {
namespace {
Expand All @@ -41,7 +41,7 @@ bool uartInitialised;

void send()
{
pw::hdlc::WriteUIFrame(kLogHdlcAddress, std::as_bytes(std::span(sWriteBuffer, sWriteBufferPos)), sWriter);
pw::hdlc::WriteUIFrame(kLogHdlcAddress, pw::as_bytes(pw::span(sWriteBuffer, sWriteBufferPos)), sWriter);
sWriteBufferPos = 0;
}

Expand Down
4 changes: 2 additions & 2 deletions examples/platform/ameba/pw_sys_io/sys_io_ameba.cc
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,13 @@ Status WriteByte(std::byte b)
StatusWithSize WriteLine(const std::string_view & s)
{
size_t chars_written = 0;
StatusWithSize result = WriteBytes(std::as_bytes(std::span(s)));
StatusWithSize result = WriteBytes(pw::as_bytes(pw::span(s)));
if (!result.ok())
{
return result;
}
chars_written += result.size();
result = WriteBytes(std::as_bytes(std::span("\r\n", 2)));
result = WriteBytes(pw::as_bytes(pw::span("\r\n", 2)));
chars_written += result.size();

return StatusWithSize(result.status(), chars_written);
Expand Down
4 changes: 2 additions & 2 deletions examples/platform/bouffalolab/bl602/PigweedLogger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@
#include <pw_stream/sys_io_stream.h>
#include <pw_sys_io_efr32/init.h>

#include "pw_span/span.h"
#include <cassert>
#include <cstdint>
#include <span>
#include <string_view>

namespace PigweedLogger {
Expand All @@ -52,7 +52,7 @@ static char sWriteBuffer[kWriteBufferSize];

static void send(void)
{
pw::hdlc::WriteUIFrame(kLogHdlcAddress, std::as_bytes(std::span(sWriteBuffer, sWriteBufferPos)), sWriter);
pw::hdlc::WriteUIFrame(kLogHdlcAddress, pw::as_bytes(pw::span(sWriteBuffer, sWriteBufferPos)), sWriter);
sWriteBufferPos = 0;
}

Expand Down
4 changes: 2 additions & 2 deletions examples/platform/bouffalolab/bl602/pw_sys_io/sys_io_efr32.cc
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,13 @@ Status WriteByte(std::byte b)
StatusWithSize WriteLine(const std::string_view & s)
{
size_t chars_written = 0;
StatusWithSize result = WriteBytes(std::as_bytes(std::span(s)));
StatusWithSize result = WriteBytes(pw::as_bytes(pw::span(s)));
if (!result.ok())
{
return result;
}
chars_written += result.size();
result = WriteBytes(std::as_bytes(std::span("\r\n", 2)));
result = WriteBytes(pw::as_bytes(pw::span("\r\n", 2)));
chars_written += result.size();

return StatusWithSize(result.status(), chars_written);
Expand Down
4 changes: 2 additions & 2 deletions examples/platform/efr32/PigweedLogger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@
#include <pw_stream/sys_io_stream.h>
#include <pw_sys_io_efr32/init.h>

#include "pw_span/span.h"
#include <cassert>
#include <cstdint>
#include <span>
#include <string_view>

namespace PigweedLogger {
Expand All @@ -52,7 +52,7 @@ static char sWriteBuffer[kWriteBufferSize];

static void send(void)
{
pw::hdlc::WriteUIFrame(kLogHdlcAddress, std::as_bytes(std::span(sWriteBuffer, sWriteBufferPos)), sWriter);
pw::hdlc::WriteUIFrame(kLogHdlcAddress, pw::as_bytes(pw::span(sWriteBuffer, sWriteBufferPos)), sWriter);
sWriteBufferPos = 0;
}

Expand Down
4 changes: 2 additions & 2 deletions examples/platform/efr32/pw_sys_io/sys_io_efr32.cc
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,13 @@ Status WriteByte(std::byte b)
StatusWithSize WriteLine(const std::string_view & s)
{
size_t chars_written = 0;
StatusWithSize result = WriteBytes(std::as_bytes(std::span(s)));
StatusWithSize result = WriteBytes(pw::as_bytes(pw::span(s)));
if (!result.ok())
{
return result;
}
chars_written += result.size();
result = WriteBytes(std::as_bytes(std::span("\r\n", 2)));
result = WriteBytes(pw::as_bytes(pw::span("\r\n", 2)));
chars_written += result.size();

return StatusWithSize(result.status(), chars_written);
Expand Down
2 changes: 1 addition & 1 deletion examples/platform/esp32/PigweedLogger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ bool uartInitialised;

void send()
{
pw::hdlc::WriteUIFrame(kLogHdlcAddress, std::as_bytes(std::span(sWriteBuffer, sWriteBufferPos)), sWriter);
pw::hdlc::WriteUIFrame(kLogHdlcAddress, pw::as_bytes(pw::span(sWriteBuffer, sWriteBufferPos)), sWriter);
sWriteBufferPos = 0;
}

Expand Down
4 changes: 2 additions & 2 deletions examples/platform/esp32/pw_sys_io/sys_io_esp32.cc
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,13 @@ Status WriteByte(std::byte b)
StatusWithSize WriteLine(const std::string_view & s)
{
size_t chars_written = 0;
StatusWithSize result = WriteBytes(std::as_bytes(std::span(s)));
StatusWithSize result = WriteBytes(pw::as_bytes(pw::span(s)));
if (!result.ok())
{
return result;
}
chars_written += result.size();
result = WriteBytes(std::as_bytes(std::span("\r\n", 2)));
result = WriteBytes(pw::as_bytes(pw::span("\r\n", 2)));
chars_written += result.size();

return StatusWithSize(result.status(), chars_written);
Expand Down
4 changes: 2 additions & 2 deletions examples/platform/mbed/pw_sys_io/sys_io_mbed.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,15 @@ Status WriteByte(std::byte b)
StatusWithSize WriteLine(const std::string_view & s)
{
size_t chars_written = 0;
StatusWithSize result = WriteBytes(std::as_bytes(std::span(s)));
StatusWithSize result = WriteBytes(pw::as_bytes(pw::span(s)));
if (!result.ok())
{
return result;
}
chars_written += result.size();

// Write trailing newline.
result = WriteBytes(std::as_bytes(std::span("\r\n", 2)));
result = WriteBytes(pw::as_bytes(pw::span("\r\n", 2)));
chars_written += result.size();

return StatusWithSize(result.status(), chars_written);
Expand Down
2 changes: 1 addition & 1 deletion examples/platform/mbed/util/PigweedLogger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ char sWriteBuffer[kWriteBufferSize];

void send()
{
pw::hdlc::WriteUIFrame(kLogHdlcAddress, std::as_bytes(std::span(sWriteBuffer, sWriteBufferPos)), sWriter);
pw::hdlc::WriteUIFrame(kLogHdlcAddress, pw::as_bytes(pw::span(sWriteBuffer, sWriteBufferPos)), sWriter);
sWriteBufferPos = 0;
}

Expand Down
4 changes: 2 additions & 2 deletions examples/platform/nrfconnect/pw_sys_io/sys_io_nrfconnect.cc
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,15 @@ Status WriteByte(std::byte b)
StatusWithSize WriteLine(const std::string_view & s)
{
size_t chars_written = 0;
StatusWithSize result = WriteBytes(std::as_bytes(std::span(s)));
StatusWithSize result = WriteBytes(pw::as_bytes(pw::span(s)));
if (!result.ok())
{
return result;
}
chars_written += result.size();

// Write trailing newline.
result = WriteBytes(std::as_bytes(std::span("\r\n", 2)));
result = WriteBytes(pw::as_bytes(pw::span("\r\n", 2)));
chars_written += result.size();

return StatusWithSize(result.status(), chars_written);
Expand Down
4 changes: 2 additions & 2 deletions examples/platform/nrfconnect/util/PigweedLogger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@
#include <pw_stream/sys_io_stream.h>
#include <pw_sys_io_nrfconnect/init.h>

#include "pw_span/span.h"
#include <cassert>
#include <cstdint>
#include <span>
#include <string_view>

namespace PigweedLogger {
Expand All @@ -61,7 +61,7 @@ bool sIsPanicMode;

void flush()
{
pw::hdlc::WriteUIFrame(kLogHdlcAddress, std::as_bytes(std::span(sWriteBuffer, sWriteBufferPos)), sWriter);
pw::hdlc::WriteUIFrame(kLogHdlcAddress, pw::as_bytes(pw::span(sWriteBuffer, sWriteBufferPos)), sWriter);
sWriteBufferPos = 0;
}

Expand Down
4 changes: 2 additions & 2 deletions examples/platform/qpg/PigweedLogger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@
#include <pw_stream/sys_io_stream.h>
#include <pw_sys_io_qpg/init.h>

#include "pw_span/span.h"
#include <cassert>
#include <cstdint>
#include <span>
#include <string_view>

namespace PigweedLogger {
Expand All @@ -54,7 +54,7 @@ static char sWriteBuffer[kWriteBufferSize];

static void send(void)
{
pw::hdlc::WriteUIFrame(kLogHdlcAddress, std::as_bytes(std::span(sWriteBuffer, sWriteBufferPos)), sWriter);
pw::hdlc::WriteUIFrame(kLogHdlcAddress, pw::as_bytes(pw::span(sWriteBuffer, sWriteBufferPos)), sWriter);
sWriteBufferPos = 0;
}

Expand Down
4 changes: 2 additions & 2 deletions examples/platform/qpg/pw_sys_io/sys_io_qpg.cc
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,13 @@ Status WriteByte(std::byte b)
StatusWithSize WriteLine(const std::string_view & s)
{
size_t chars_written = 0;
StatusWithSize result = WriteBytes(std::as_bytes(std::span(s)));
StatusWithSize result = WriteBytes(pw::as_bytes(pw::span(s)));
if (!result.ok())
{
return result;
}
chars_written += result.size();
result = WriteBytes(std::as_bytes(std::span("\r\n", 2)));
result = WriteBytes(pw::as_bytes(pw::span("\r\n", 2)));
chars_written += result.size();

return StatusWithSize(result.status(), chars_written);
Expand Down
4 changes: 2 additions & 2 deletions src/platform/bouffalolab/BL602/KeyValueStoreManagerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ CHIP_ERROR KeyValueStoreManagerImpl::_Delete(const char * key)
// size_t offset_bytes) const
// {
// assert(CHIP_KVS_AVAILABLE);
// auto status_and_size = mKvs.Get(key, std::span<std::byte>(reinterpret_cast<std::byte *>(value), value_size), offset_bytes);
// auto status_and_size = mKvs.Get(key, pw::span<std::byte>(reinterpret_cast<std::byte *>(value), value_size), offset_bytes);
// if (read_bytes_size)
// {
// *read_bytes_size = status_and_size.size();
Expand Down Expand Up @@ -139,7 +139,7 @@ CHIP_ERROR KeyValueStoreManagerImpl::_Delete(const char * key)
// CHIP_ERROR KeyValueStoreManagerImpl::_Put(const char * key, const void * value, size_t value_size)
// {
// assert(CHIP_KVS_AVAILABLE);
// auto status = mKvs.Put(key, std::span<const std::byte>(reinterpret_cast<const std::byte *>(value), value_size));
// auto status = mKvs.Put(key, pw::span<const std::byte>(reinterpret_cast<const std::byte *>(value), value_size));
// switch (status.code())
// {
// case pw::OkStatus().code():
Expand Down
2 changes: 1 addition & 1 deletion third_party/pigweed/repo
Submodule repo updated 425 files