From 9619bf20fc5cfb6b2387474aa539dabb74d86a2e Mon Sep 17 00:00:00 2001 From: Jerry Johns Date: Thu, 7 Jul 2022 12:02:46 -0700 Subject: [PATCH] Fix build --- src/controller/python/chip/native/CommonStackInit.cpp | 9 +++++---- src/controller/python/chip/native/__init__.py | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/controller/python/chip/native/CommonStackInit.cpp b/src/controller/python/chip/native/CommonStackInit.cpp index a6a9b3e455899e..36242ee7bdd2d0 100644 --- a/src/controller/python/chip/native/CommonStackInit.cpp +++ b/src/controller/python/chip/native/CommonStackInit.cpp @@ -36,16 +36,17 @@ #include #include #include +#include static_assert(std::is_same::value, "python assumes CHIP_ERROR maps to c_uint32"); extern "C" { -CHIP_ERROR pychip_CommonStackInit() +chip::ChipError::StorageType pychip_CommonStackInit() { - ReturnErrorOnFailure(chip::Platform::MemoryInit()); - ReturnErrorOnFailure(chip::DeviceLayer::PlatformMgr().InitChipStack()); - return CHIP_NO_ERROR; + ReturnErrorOnFailure(chip::Platform::MemoryInit().AsInteger()); + ReturnErrorOnFailure(chip::DeviceLayer::PlatformMgr().InitChipStack().AsInteger()); + return CHIP_NO_ERROR.AsInteger(); } void pychip_CommonStackShutdown() diff --git a/src/controller/python/chip/native/__init__.py b/src/controller/python/chip/native/__init__.py index e147f684f605e3..44b4ccd89f015e 100644 --- a/src/controller/python/chip/native/__init__.py +++ b/src/controller/python/chip/native/__init__.py @@ -76,7 +76,7 @@ def GetLibraryHandle() -> ctypes.CDLL: if _nativeLibraryHandle is None: _nativeLibraryHandle = ctypes.CDLL(FindNativeLibraryPath()) setter = NativeLibraryHandleMethodArguments(_nativeLibraryHandle) - setter.Set("pychip_CommonStackInit", None, []) + setter.Set("pychip_CommonStackInit", ctypes.c_uint32, []) # # We've a split initialization model with some init happening here and some other