Skip to content

Commit

Permalink
Merge 4ecc918 into bbd9e6e
Browse files Browse the repository at this point in the history
  • Loading branch information
paul-szczepanek-arm authored Jun 8, 2022
2 parents bbd9e6e + 4ecc918 commit 1046671
Show file tree
Hide file tree
Showing 15 changed files with 434 additions and 89 deletions.
1 change: 1 addition & 0 deletions src/platform/openiotsdk/CHIPDevicePlatformConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

/**
* @file
* Platform-specific configuration overrides for the chip Device Layer
Expand Down
17 changes: 13 additions & 4 deletions src/platform/openiotsdk/ConfigurationManagerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,22 @@

/**
* @file
* Provides the implementation of the Device Layer Configuration Manager class
* for Open IOT SDK platform.
* Provides the implementation of the Device Layer ConfigurationManager object
* for Open IOT SDK platforms.
*/
/* this file behaves like a config.h, comes first */

#include <platform/ConfigurationManager.h>
// FIXME: Undefine the `sleep()` function included by the CHIPDeviceLayer.h
// from unistd.h to avoid a conflicting declaration with the `sleep()` provided
// by Mbed-OS in mbed_power_mgmt.h.
#define sleep unistd_sleep
#include <platform/internal/CHIPDeviceLayerInternal.h>
#undef sleep

#include <platform/internal/GenericConfigurationManagerImpl.ipp>

#include <platform/ConfigurationManager.h>

namespace chip {
namespace DeviceLayer {

Expand Down Expand Up @@ -150,7 +158,8 @@ void ConfigurationManagerImpl::DoFactoryReset(intptr_t arg)

// Restart the system.
ChipLogProgress(DeviceLayer, "System restarting");
// ToDo reset system
// TODO: implement system_reset()
// system_reset();
}

} // namespace DeviceLayer
Expand Down
4 changes: 2 additions & 2 deletions src/platform/openiotsdk/ConfigurationManagerImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@

/**
* @file
* Provides an implementation of the Configuration Manager class
* for Open IOT SDK platform.
* Provides an implementation of the ConfigurationManager object
* for Open IOT SDK platforms.
*/

#pragma once
Expand Down
6 changes: 1 addition & 5 deletions src/platform/openiotsdk/ConnectivityManagerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
* Provides the implementation of the Device Layer Connectivity Manager class
* for Open IOT SDK platform.
*/
/* this file behaves like a config.h, comes first */

#include <platform/internal/CHIPDeviceLayerInternal.h>

Expand Down Expand Up @@ -59,10 +60,5 @@ void ConnectivityManagerImpl::AddTask(AsyncWorkFunct workFunct, intptr_t arg)
PlatformMgr().ScheduleWork(workFunct, arg);
}

void ConnectivityManagerImpl::AddQueueEvent(void * event)
{
// ToDo add event to queue
}

} // namespace DeviceLayer
} // namespace chip
5 changes: 2 additions & 3 deletions src/platform/openiotsdk/ConnectivityManagerImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
/**
* @file
* Provides the implementation of the Device Layer Connectivity Manager class
* for Open IOT SDK platform.
* for Open IOT SDK platforms.
*/

#pragma once
Expand All @@ -36,7 +36,7 @@ namespace chip {
namespace DeviceLayer {

/**
* Concrete implementation of the ConnectivityManager singleton object for Open IOT SDK platform.
* Concrete implementation of the ConnectivityManager singleton object for Open IoT SDK platforms.
*/
class ConnectivityManagerImpl final : public ConnectivityManager,
public Internal::GenericConnectivityManagerImpl<ConnectivityManagerImpl>,
Expand All @@ -61,7 +61,6 @@ class ConnectivityManagerImpl final : public ConnectivityManager,
public:
CHIP_ERROR PostEvent(const ChipDeviceEvent * event, bool die);
void AddTask(AsyncWorkFunct workFunct, intptr_t arg);
void AddQueueEvent(void * event);
};

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@

#include <lib/support/logging/CHIPLogging.h>
#include <platform/openiotsdk/DeviceNetworkProvisioningDelegateImpl.h>
#include <platform/openiotsdk/NetworkCommissioningDriver.h>

using namespace ::chip::DeviceLayer::NetworkCommissioning;

namespace chip {
namespace DeviceLayer {
Expand Down
1 change: 1 addition & 0 deletions src/platform/openiotsdk/DiagnosticDataProviderImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include <platform/internal/CHIPDeviceLayerInternal.h>

#include <lib/support/logging/CHIPLogging.h>
#include <platform/DiagnosticDataProvider.h>
#include <platform/openiotsdk/DiagnosticDataProviderImpl.h>

namespace chip {
Expand Down
2 changes: 2 additions & 0 deletions src/platform/openiotsdk/Logging.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
#include <stdio.h>
#include <string.h>

#define DEFAULT_TRACE_FILTER_LENGTH 24

namespace chip {
namespace DeviceLayer {

Expand Down
2 changes: 0 additions & 2 deletions src/platform/openiotsdk/NetworkCommissioningDriver.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ namespace chip {
namespace DeviceLayer {
namespace NetworkCommissioning {

// TODO

class OpenIoTSDKEthernetDriver final : public EthernetDriver
{
public:
Expand Down
11 changes: 8 additions & 3 deletions src/platform/openiotsdk/NetworkCommissioningEthernetDriver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
* for Open IOT SDK platform.
*/

#include <lwip/netif.h>
#include <platform/CHIPDeviceLayer.h>
#include <platform/openiotsdk/NetworkCommissioningDriver.h>

Expand All @@ -36,9 +37,13 @@ namespace NetworkCommissioning {
NetworkIterator * OpenIoTSDKEthernetDriver::GetNetworks()
{
auto ret = new EthernetNetworkIterator();
// TODO fill in
// memcpy(ret->interfaceName, src, len);
// ret->interfaceNameLen = len;

ifname[NETIF_NAMESIZE];
ifname = netif_index_to_name(0, ifname);

ret->interfaceNameLen = strlen(ifname);
memcpy(ret->interfaceName, ifname, ret->interfaceNameLen);

return ret;
}

Expand Down
Loading

0 comments on commit 1046671

Please sign in to comment.