forked from project-chip/connectedhomeip
-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for persisting paired device information on CHIP controll…
…er (project-chip#3284) * Add support for persisting paired device information on CHIP controller * Fix snprintf format error * Fix Android build issues * address review comments * another attempt to fix Android build * fix Android build * Fix secure pairing serialize * Fix mbedTLS based tests * Reduce stack needed for the test * Reduce size requirement for SecurePairingSessionSerialized * Fix stack overflow in tests when ran using QEMU * Address review comments
- Loading branch information
Showing
6 changed files
with
317 additions
and
23 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
/* | ||
* | ||
* Copyright (c) 2020 Project CHIP Authors | ||
* All rights reserved. | ||
* | ||
* 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. | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include <core/CHIPCore.h> | ||
#include <support/DLLUtil.h> | ||
|
||
namespace chip { | ||
namespace DeviceController { | ||
|
||
class DLL_EXPORT PersistentStorageDelegate | ||
{ | ||
public: | ||
virtual ~PersistentStorageDelegate() {} | ||
|
||
/** | ||
* @brief | ||
* Lookup the key and return it's stringified value | ||
* | ||
* @param[in] key Key to lookup | ||
* @return Value or nullptr if not found. Lifetime of the returned | ||
* buffer is tied to the delegate object. If the delegate is | ||
* freed, the returned value would be inaccessible. | ||
*/ | ||
virtual const char * GetKeyValue(const char * key) = 0; | ||
|
||
/** | ||
* @brief | ||
* Set the value for the key | ||
* | ||
* @param[in] key Key to be set | ||
* @param[in] value Value to be set | ||
* @return returns corresponding error if unsuccessful | ||
*/ | ||
virtual CHIP_ERROR SetKeyValue(const char * key, const char * value) = 0; | ||
|
||
/** | ||
* @brief | ||
* Deletes the value for the key | ||
* | ||
* @param[in] key Key to be deleted | ||
* @return returns corresponding error if unsuccessful | ||
*/ | ||
virtual CHIP_ERROR DeleteKeyValue(const char * key) = 0; | ||
}; | ||
|
||
} // namespace DeviceController | ||
} // namespace chip |
Oops, something went wrong.