Skip to content

Commit

Permalink
Update Pigweed 53f260084d0 (#12336)
Browse files Browse the repository at this point in the history
  • Loading branch information
rgoliver authored Dec 1, 2021
1 parent 31156c4 commit 53a5d1e
Show file tree
Hide file tree
Showing 16 changed files with 42 additions and 42 deletions.
1 change: 1 addition & 0 deletions config/mbed/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,7 @@ target_include_directories(${APP_TARGET} PRIVATE
${PIGWEED_ROOT}/pw_log_basic/public_overrides
${PIGWEED_ROOT}/pw_span/public_overrides
${PIGWEED_ROOT}/pw_span/public
${PIGWEED_ROOT}/pw_sync/public
${PIGWEED_ROOT}/pw_polyfill/public
${PIGWEED_ROOT}/pw_polyfill/standard_library_public
${PIGWEED_ROOT}/pw_polyfill/public_overrides
Expand Down
2 changes: 1 addition & 1 deletion examples/common/pigweed/mbed/Rpc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ namespace rpc {
class MbedButton final : public Button
{
public:
pw::Status Event(ServerContext &, const chip_rpc_ButtonEvent & request, pw_protobuf_Empty & response)
pw::Status Event(const chip_rpc_ButtonEvent & request, pw_protobuf_Empty & response)
{
GetAppTask().ButtonEventHandler(request.idx, request.pushed);
return pw::OkStatus();
Expand Down
7 changes: 3 additions & 4 deletions examples/common/pigweed/rpc_console/py/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
import("//build_overrides/chip.gni")
import("//build_overrides/pigweed.gni")

import("$dir_pw_build/mirror_tree.gni")
import("$dir_pw_build/python.gni")
import("$dir_pw_build/python_dist.gni")
import("${chip_root}/examples/common/pigweed/pigweed_rpcs.gni")

pw_python_package("chip_rpc") {
Expand Down Expand Up @@ -46,8 +46,7 @@ pw_python_package("chip_rpc") {
]
}

pw_mirror_tree("chip_rpc_wheel") {
path_data_keys = [ "pw_python_package_wheels" ]
deps = [ ":chip_rpc.wheel" ]
pw_python_wheels("chip_rpc_wheel") {
packages = [ ":chip_rpc" ]
directory = "$root_out_dir/chip_rpc_console_wheels"
}
4 changes: 2 additions & 2 deletions examples/common/pigweed/rpc_services/Attributes.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ namespace rpc {
class Attributes : public generated::Attributes<Attributes>
{
public:
::pw::Status Write(ServerContext &, const chip_rpc_AttributeWrite & request, pw_protobuf_Empty & response)
::pw::Status Write(const chip_rpc_AttributeWrite & request, pw_protobuf_Empty & response)
{
const void * data;
switch (request.data.which_data)
Expand Down Expand Up @@ -70,7 +70,7 @@ class Attributes : public generated::Attributes<Attributes>
return pw::OkStatus();
}

::pw::Status Read(ServerContext &, const chip_rpc_AttributeMetadata & request, chip_rpc_AttributeData & response)
::pw::Status Read(const chip_rpc_AttributeMetadata & request, chip_rpc_AttributeData & response)
{
void * data;
size_t size = 0;
Expand Down
2 changes: 1 addition & 1 deletion examples/common/pigweed/rpc_services/Button.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class Button : public generated::Button<Button>
public:
virtual ~Button() = default;

virtual pw::Status Event(ServerContext &, const chip_rpc_ButtonEvent & request, pw_protobuf_Empty & response)
virtual pw::Status Event(const chip_rpc_ButtonEvent & request, pw_protobuf_Empty & response)
{
return pw::Status::Unimplemented();
}
Expand Down
12 changes: 6 additions & 6 deletions examples/common/pigweed/rpc_services/Device.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,24 +35,24 @@ class Device : public generated::Device<Device>
public:
virtual ~Device() = default;

virtual pw::Status FactoryReset(ServerContext & ctx, const pw_protobuf_Empty & request, pw_protobuf_Empty & response)
virtual pw::Status FactoryReset(const pw_protobuf_Empty & request, pw_protobuf_Empty & response)
{
DeviceLayer::ConfigurationMgr().InitiateFactoryReset();
return pw::OkStatus();
}

virtual pw::Status Reboot(ServerContext & ctx, const pw_protobuf_Empty & request, pw_protobuf_Empty & response)
virtual pw::Status Reboot(const pw_protobuf_Empty & request, pw_protobuf_Empty & response)
{
return pw::Status::Unimplemented();
}

virtual pw::Status TriggerOta(ServerContext & ctx, const pw_protobuf_Empty & request, pw_protobuf_Empty & response)
virtual pw::Status TriggerOta(const pw_protobuf_Empty & request, pw_protobuf_Empty & response)
{
// TODO: auto err = DeviceLayer::SoftwareUpdateMgr().CheckNow();
return pw::Status::Unimplemented();
}

virtual pw::Status GetDeviceState(ServerContext &, const pw_protobuf_Empty & request, chip_rpc_DeviceState & response)
virtual pw::Status GetDeviceState(const pw_protobuf_Empty & request, chip_rpc_DeviceState & response)
{
uint64_t time_since_boot_sec;
DeviceLayer::GetDiagnosticDataProvider().GetUpTime(time_since_boot_sec);
Expand All @@ -71,7 +71,7 @@ class Device : public generated::Device<Device>
return pw::OkStatus();
}

virtual pw::Status GetDeviceInfo(ServerContext &, const pw_protobuf_Empty & request, chip_rpc_DeviceInfo & response)
virtual pw::Status GetDeviceInfo(const pw_protobuf_Empty & request, chip_rpc_DeviceInfo & response)
{

uint16_t vendor_id;
Expand Down Expand Up @@ -127,7 +127,7 @@ class Device : public generated::Device<Device>
return pw::OkStatus();
}

virtual pw::Status SetPairingInfo(ServerContext &, const chip_rpc_PairingInfo & request, pw_protobuf_Empty & response)
virtual pw::Status SetPairingInfo(const chip_rpc_PairingInfo & request, pw_protobuf_Empty & response)
{
if (DeviceLayer::ConfigurationMgr().StoreSetupPinCode(request.code) != CHIP_NO_ERROR ||
DeviceLayer::ConfigurationMgr().StoreSetupDiscriminator(request.discriminator) != CHIP_NO_ERROR)
Expand Down
4 changes: 2 additions & 2 deletions examples/common/pigweed/rpc_services/Lighting.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class Lighting : public generated::Lighting<Lighting>

virtual ~Lighting() = default;

virtual pw::Status Set(ServerContext &, const chip_rpc_LightingState & request, pw_protobuf_Empty & response)
virtual pw::Status Set(const chip_rpc_LightingState & request, pw_protobuf_Empty & response)
{
uint8_t on = request.on;
RETURN_STATUS_IF_NOT_OK(
Expand Down Expand Up @@ -63,7 +63,7 @@ class Lighting : public generated::Lighting<Lighting>
return pw::OkStatus();
}

virtual pw::Status Get(ServerContext &, const pw_protobuf_Empty & request, chip_rpc_LightingState & response)
virtual pw::Status Get(const pw_protobuf_Empty & request, chip_rpc_LightingState & response)
{
uint8_t on;
uint8_t level;
Expand Down
4 changes: 2 additions & 2 deletions examples/common/pigweed/rpc_services/Locking.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@ class Locking final : public generated::Locking<Locking>
public:
virtual ~Locking() = default;

virtual pw::Status Set(ServerContext &, const chip_rpc_LockingState & request, pw_protobuf_Empty & response)
virtual pw::Status Set(const chip_rpc_LockingState & request, pw_protobuf_Empty & response)
{
bool locked = request.locked;
RETURN_STATUS_IF_NOT_OK(app::Clusters::OnOff::Attributes::OnOff::Set(kEndpoint, locked));
return pw::OkStatus();
}

virtual pw::Status Get(ServerContext &, const pw_protobuf_Empty & request, chip_rpc_LockingState & response)
virtual pw::Status Get(const pw_protobuf_Empty & request, chip_rpc_LockingState & response)
{
bool locked;
RETURN_STATUS_IF_NOT_OK(app::Clusters::OnOff::Attributes::OnOff::Get(kEndpoint, &locked));
Expand Down
22 changes: 11 additions & 11 deletions examples/ipv6only-app/esp32/include/wifi_service.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class Wifi final : public generated::Wifi<Wifi>

// The following functions are the RPC handlers

pw::Status GetChannel(ServerContext &, const pw_protobuf_Empty & request, chip_rpc_Channel & response)
pw::Status GetChannel(const pw_protobuf_Empty & request, chip_rpc_Channel & response)
{
uint8_t channel = 0;
wifi_second_chan_t second;
Expand All @@ -55,7 +55,7 @@ class Wifi final : public generated::Wifi<Wifi>
return pw::OkStatus();
}

pw::Status GetSsid(ServerContext &, const pw_protobuf_Empty & request, chip_rpc_Ssid & response)
pw::Status GetSsid(const pw_protobuf_Empty & request, chip_rpc_Ssid & response)
{
wifi_config_t config;
PW_TRY(EspToPwStatus(esp_wifi_get_config(WIFI_IF_STA, &config)));
Expand All @@ -65,7 +65,7 @@ class Wifi final : public generated::Wifi<Wifi>
return pw::OkStatus();
}

pw::Status GetState(ServerContext &, const pw_protobuf_Empty & request, chip_rpc_State & response)
pw::Status GetState(const pw_protobuf_Empty & request, chip_rpc_State & response)
{
wifi_ap_record_t ap_info;
esp_err_t err = esp_wifi_sta_get_ap_info(&ap_info);
Expand All @@ -74,31 +74,31 @@ class Wifi final : public generated::Wifi<Wifi>
return pw::OkStatus();
}

pw::Status GetMacAddress(ServerContext &, const pw_protobuf_Empty & request, chip_rpc_MacAddress & response)
pw::Status GetMacAddress(const pw_protobuf_Empty & request, chip_rpc_MacAddress & response)
{
uint8_t mac[6];
PW_TRY(EspToPwStatus(esp_wifi_get_mac(WIFI_IF_STA, mac)));
sprintf(response.mac_address, "%02x:%02x:%02x:%02x:%02x:%02x", mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
return pw::OkStatus();
}

pw::Status GetWiFiInterface(ServerContext &, const pw_protobuf_Empty & request, chip_rpc_WiFiInterface & response)
pw::Status GetWiFiInterface(const pw_protobuf_Empty & request, chip_rpc_WiFiInterface & response)
{
wifi_ap_record_t ap_info;
PW_TRY(EspToPwStatus(esp_wifi_sta_get_ap_info(&ap_info)));
sprintf(response.interface, "STA");
return pw::OkStatus();
}

pw::Status GetIP4Address(ServerContext &, const pw_protobuf_Empty & request, chip_rpc_IP4Address & response)
pw::Status GetIP4Address(const pw_protobuf_Empty & request, chip_rpc_IP4Address & response)
{
esp_netif_ip_info_t ip_info;
PW_TRY(EspToPwStatus(esp_netif_get_ip_info(esp_netif_, &ip_info)));
sprintf(response.address, IPSTR, IP2STR(&ip_info.ip));
return pw::OkStatus();
}

pw::Status GetIP6Address(ServerContext &, const pw_protobuf_Empty & request, chip_rpc_IP6Address & response)
pw::Status GetIP6Address(const pw_protobuf_Empty & request, chip_rpc_IP6Address & response)
{
esp_ip6_addr_t ip6{ 0 };
PW_TRY(EspToPwStatus(esp_netif_get_ip6_linklocal(esp_netif_, &ip6)));
Expand All @@ -108,17 +108,17 @@ class Wifi final : public generated::Wifi<Wifi>

// NOTE: Currently this is blocking, it can be made non-blocking if needed
// but would require another worker thread to handle the scanning.
void StartScan(ServerContext &, const chip_rpc_ScanConfig & request, ServerWriter<chip_rpc_ScanResults> & writer);
void StartScan(const chip_rpc_ScanConfig & request, ServerWriter<chip_rpc_ScanResults> & writer);

pw::Status StopScan(ServerContext &, const pw_protobuf_Empty & request, pw_protobuf_Empty & response)
pw::Status StopScan(const pw_protobuf_Empty & request, pw_protobuf_Empty & response)
{
esp_wifi_scan_stop();
return pw::OkStatus();
}

pw::Status Connect(ServerContext &, const chip_rpc_ConnectionData & request, chip_rpc_ConnectionResult & response);
pw::Status Connect(const chip_rpc_ConnectionData & request, chip_rpc_ConnectionResult & response);

pw::Status Disconnect(ServerContext &, const pw_protobuf_Empty & request, pw_protobuf_Empty & response)
pw::Status Disconnect(const pw_protobuf_Empty & request, pw_protobuf_Empty & response)
{
PW_TRY(EspToPwStatus(esp_wifi_disconnect()));
return pw::OkStatus();
Expand Down
4 changes: 2 additions & 2 deletions examples/ipv6only-app/esp32/main/wifi_service.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ pw::Status Wifi::Init()
return pw::OkStatus();
}

pw::Status Wifi::Connect(ServerContext &, const chip_rpc_ConnectionData & request, chip_rpc_ConnectionResult & response)
pw::Status Wifi::Connect(const chip_rpc_ConnectionData & request, chip_rpc_ConnectionResult & response)
{
wifi_config_t wifi_config {
.sta = {
Expand Down Expand Up @@ -263,7 +263,7 @@ pw::Status Wifi::Connect(ServerContext &, const chip_rpc_ConnectionData & reques
return pw::OkStatus();
}

void Wifi::StartScan(ServerContext &, const chip_rpc_ScanConfig & request, ServerWriter<chip_rpc_ScanResults> & writer)
void Wifi::StartScan(const chip_rpc_ScanConfig & request, ServerWriter<chip_rpc_ScanResults> & writer)
{
wifi_scan_config_t scan_config{ 0 };
if (request.ssid_count != 0)
Expand Down
4 changes: 2 additions & 2 deletions examples/platform/efr32/Rpc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ namespace rpc {
class Efr32Button final : public Button
{
public:
pw::Status Event(ServerContext &, const chip_rpc_ButtonEvent & request, pw_protobuf_Empty & response) override
pw::Status Event(const chip_rpc_ButtonEvent & request, pw_protobuf_Empty & response) override
{
GetAppTask().ButtonEventHandler(SL_SIMPLE_BUTTON_INSTANCE(request.idx) /* PB 0 or PB 1 */, request.pushed);
return pw::OkStatus();
Expand All @@ -62,7 +62,7 @@ class Efr32Button final : public Button
class Efr32Device final : public Device
{
public:
pw::Status Reboot(ServerContext & ctx, const pw_protobuf_Empty & request, pw_protobuf_Empty & response) override
pw::Status Reboot(const pw_protobuf_Empty & request, pw_protobuf_Empty & response) override
{
mRebootTimer = xTimerCreateStatic("Reboot", kRebootTimerPeriodTicks, false, nullptr, RebootHandler, &mRebootTimerBuffer);
xTimerStart(mRebootTimer, 0);
Expand Down
4 changes: 2 additions & 2 deletions examples/platform/esp32/Rpc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ namespace rpc {
class Esp32Button final : public Button
{
public:
pw::Status Event(ServerContext &, const chip_rpc_ButtonEvent & request, pw_protobuf_Empty & response) override
pw::Status Event(const chip_rpc_ButtonEvent & request, pw_protobuf_Empty & response) override
{
#if CONFIG_DEVICE_TYPE_M5STACK
if (request.pushed)
Expand All @@ -78,7 +78,7 @@ class Esp32Button final : public Button
class Esp32Device final : public Device
{
public:
pw::Status Reboot(ServerContext & ctx, const pw_protobuf_Empty & request, pw_protobuf_Empty & response) override
pw::Status Reboot(const pw_protobuf_Empty & request, pw_protobuf_Empty & response) override
{
mRebootTimer = xTimerCreateStatic("Reboot", kRebootTimerPeriodTicks, false, nullptr, RebootHandler, &mRebootTimerBuffer);
xTimerStart(mRebootTimer, 0);
Expand Down
4 changes: 2 additions & 2 deletions examples/platform/nrfconnect/Rpc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ K_TIMER_DEFINE(reboot_timer, reboot_timer_handler, NULL);
class NrfDevice final : public Device
{
public:
pw::Status Reboot(ServerContext & ctx, const pw_protobuf_Empty & request, pw_protobuf_Empty & response) override
pw::Status Reboot(const pw_protobuf_Empty & request, pw_protobuf_Empty & response) override
{
k_timer_start(&reboot_timer, K_SECONDS(1), K_FOREVER);
return pw::OkStatus();
Expand All @@ -74,7 +74,7 @@ class NrfDevice final : public Device
class NrfButton final : public Button
{
public:
pw::Status Event(ServerContext &, const chip_rpc_ButtonEvent & request, pw_protobuf_Empty & response) override
pw::Status Event(const chip_rpc_ButtonEvent & request, pw_protobuf_Empty & response) override
{
GetAppTask().ButtonEventHandler(request.pushed << request.idx /* button_state */, 1 << request.idx /* has_changed */);
return pw::OkStatus();
Expand Down
6 changes: 3 additions & 3 deletions src/test_driver/efr32/py/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import("//build_overrides/chip.gni")
import("//build_overrides/pigweed.gni")

import("$dir_pw_build/python.gni")
import("$dir_pw_build/python_dist.gni")
import("${chip_root}/examples/common/pigweed/pigweed_rpcs.gni")

pw_python_package("nl_test_runner") {
Expand All @@ -34,8 +35,7 @@ pw_python_package("nl_test_runner") {
]
}

pw_mirror_tree("nl_test_runner_wheel") {
path_data_keys = [ "pw_python_package_wheels" ]
deps = [ ":nl_test_runner.wheel" ]
pw_python_wheels("nl_test_runner_wheel") {
packages = [ ":nl_test_runner" ]
directory = "$root_out_dir/chip_nl_test_runner_wheels"
}
2 changes: 1 addition & 1 deletion src/test_driver/efr32/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ namespace chip::rpc {
class NlTest : public generated::NlTest<NlTest>
{
public:
void Run(ServerContext &, const pw_protobuf_Empty & request, ServerWriter<chip_rpc_Event> & writer)
void Run(const pw_protobuf_Empty & request, ServerWriter<chip_rpc_Event> & writer)
{
stream_writer = &writer;
nlTestSetLogger(&nl_test_logger);
Expand Down
2 changes: 1 addition & 1 deletion third_party/pigweed/repo
Submodule repo updated 707 files

0 comments on commit 53a5d1e

Please sign in to comment.