-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a src/platform/Darwin and get it to link with the iOS demo app
- Loading branch information
1 parent
10be6f0
commit be56b90
Showing
19 changed files
with
1,434 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/* | ||
* | ||
* Copyright (c) 2020 Project CHIP Authors | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
/** | ||
* @file | ||
* Platform-specific configuration overrides for the CHIP BLE | ||
* Layer on Darwin platforms. | ||
* | ||
*/ | ||
|
||
#ifndef BLE_PLATFORM_CONFIG_H | ||
#define BLE_PLATFORM_CONFIG_H | ||
|
||
// ==================== Platform Adaptations ==================== | ||
|
||
#define BLE_CONNECTION_OBJECT uint16_t | ||
#define BLE_CONNECTION_UNINITIALIZED ((uint16_t) -1) | ||
#define BLE_MAX_RECEIVE_WINDOW_SIZE 5 | ||
|
||
// ========== Platform-specific Configuration Overrides ========= | ||
|
||
/* none so far */ | ||
|
||
#endif // BLE_PLATFORM_CONFIG_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
/* | ||
* | ||
* Copyright (c) 2020 Project CHIP Authors | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
/** | ||
* @file | ||
* Platform-specific configuration overrides for the chip Device Layer | ||
* on Darwin platforms. | ||
*/ | ||
|
||
#ifndef CHIP_DEVICE_PLATFORM_CONFIG_H | ||
#define CHIP_DEVICE_PLATFORM_CONFIG_H | ||
|
||
// ==================== Platform Adaptations ==================== | ||
|
||
#define CHIP_DEVICE_CONFIG_ENABLE_WIFI_STATION 0 | ||
#define CHIP_DEVICE_CONFIG_ENABLE_WIFI_AP 0 | ||
|
||
#define CHIP_DEVICE_CONFIG_ENABLE_THREAD 0 | ||
|
||
#define CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE 0 | ||
|
||
#define CHIP_DEVICE_CONFIG_ENABLE_CHIP_TIME_SERVICE_TIME_SYNC 0 | ||
#define CHIP_DEVICE_CONFIG_ENABLE_SERVICE_DIRECTORY_TIME_SYNC 0 | ||
|
||
#define CHIP_DEVICE_CONFIG_PERSISTED_STORAGE_CRIT_EIDC_KEY 2 | ||
#define CHIP_DEVICE_CONFIG_PERSISTED_STORAGE_PROD_EIDC_KEY 3 | ||
#define CHIP_DEVICE_CONFIG_PERSISTED_STORAGE_INFO_EIDC_KEY 4 | ||
#define CHIP_DEVICE_CONFIG_PERSISTED_STORAGE_DEBUG_EIDC_KEY 5 | ||
|
||
// ========== Platform-specific Configuration ========= | ||
|
||
// These are configuration options that are unique to Darwin platforms. | ||
// These can be overridden by the application as needed. | ||
|
||
/** | ||
* @def CHIP_DEVICE_LAYER_BLE_OBSERVER_PRIORITY | ||
* | ||
* The priority of the SoftDevice observer event handler registered by the | ||
* CHIP BleLayer. | ||
*/ | ||
#ifndef CHIP_DEVICE_LAYER_BLE_OBSERVER_PRIORITY | ||
#define CHIP_DEVICE_LAYER_BLE_OBSERVER_PRIORITY 3 | ||
#endif // CHIP_DEVICE_LAYER_BLE_OBSERVER_PRIORITY | ||
|
||
/** | ||
* @def CHIP_DEVICE_LAYER_BLE_CONN_CFG_TAG | ||
* | ||
* The SoftDevice BLE connection configuration tag used by the CHIP | ||
* BleLayer. | ||
*/ | ||
#ifndef CHIP_DEVICE_LAYER_BLE_CONN_CFG_TAG | ||
#define CHIP_DEVICE_LAYER_BLE_CONN_CFG_TAG 1 | ||
#endif // CHIP_DEVICE_LAYER_BLE_CONN_CFG_TAG | ||
|
||
// ========== Platform-specific Configuration Overrides ========= | ||
|
||
#ifndef CHIP_DEVICE_CONFIG_CHIP_TASK_STACK_SIZE | ||
#define CHIP_DEVICE_CONFIG_CHIP_TASK_STACK_SIZE 8192 | ||
#endif // CHIP_DEVICE_CONFIG_CHIP_TASK_STACK_SIZE | ||
|
||
#ifndef CHIP_DEVICE_CONFIG_THREAD_TASK_STACK_SIZE | ||
#define CHIP_DEVICE_CONFIG_THREAD_TASK_STACK_SIZE 8192 | ||
#endif // CHIP_DEVICE_CONFIG_THREAD_TASK_STACK_SIZE | ||
|
||
#define CHIP_DEVICE_CONFIG_ENABLE_WIFI_TELEMETRY 0 | ||
#define CHIP_DEVICE_CONFIG_ENABLE_THREAD_TELEMETRY 0 | ||
#define CHIP_DEVICE_CONFIG_ENABLE_THREAD_TELEMETRY_FULL 0 | ||
#define CHIP_DEVICE_CONFIG_ENABLE_TUNNEL_TELEMETRY 0 | ||
|
||
// TODO: CHIP has redesigned the crypto interface, pending on the final version of CHIP HASH APIs | ||
#define CHIP_DEVICE_CONFIG_LOG_PROVISIONING_HASH 0 | ||
|
||
#endif // CHIP_DEVICE_PLATFORM_CONFIG_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
/* | ||
* | ||
* Copyright (c) 2020 Project CHIP Authors | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
/** | ||
* @file | ||
* Defines platform-specific event types and data for the chip | ||
* Device Layer on Darwin platforms. | ||
*/ | ||
|
||
#ifndef CHIP_DEVICE_PLATFORM_EVENT_H | ||
#define CHIP_DEVICE_PLATFORM_EVENT_H | ||
|
||
#include <platform/CHIPDeviceEvent.h> | ||
|
||
namespace chip { | ||
namespace System { | ||
class PacketBuffer; | ||
} | ||
} // namespace chip | ||
|
||
namespace chip { | ||
namespace DeviceLayer { | ||
|
||
namespace DeviceEventType { | ||
|
||
/** | ||
* Enumerates platform-specific event types that are visible to the application. | ||
*/ | ||
enum PublicPlatformSpecificEventTypes | ||
{ | ||
/* None currently defined */ | ||
}; | ||
|
||
/** | ||
* Enumerates platform-specific event types that are internal to the chip Device Layer. | ||
*/ | ||
enum InternalPlatformSpecificEventTypes | ||
{ | ||
kPlatformDarwinEvent = kRange_InternalPlatformSpecific, | ||
kPlatformDarwinBleC1WriteEvent, | ||
kPlatformDarwinBleOutOfBuffersEvent, | ||
}; | ||
|
||
} // namespace DeviceEventType | ||
|
||
/** | ||
* Represents platform-specific event information for Linux platforms. | ||
*/ | ||
struct ChipDevicePlatformEvent final | ||
{ | ||
union | ||
{ | ||
struct | ||
{ | ||
uint16_t ConnId; | ||
::chip::System::PacketBuffer * Data; | ||
} BleC1WriteEvent; | ||
}; | ||
}; | ||
|
||
} // namespace DeviceLayer | ||
} // namespace chip | ||
|
||
#endif // CHIP_DEVICE_PLATFORM_EVENT_H |
Oops, something went wrong.