-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Integrate KVS with device session tables #4976
Merged
+1,038
−92
Merged
Changes from 1 commit
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
06ed4d0
Integrate KVS with device session tables
pan-apple e528c49
Fix some build failures
pan-apple d9ecabc
Decouple code from platform header
pan-apple 2768687
Split code from the header file to fix build issues
pan-apple 4044b20
Address review comments
pan-apple 75dcab7
Rename SetDelegates to Init and check storage delegate
pan-apple 36cbd80
Use New<> and Delete, instead of MemoryAlloc and Free for session object
pan-apple 89a9614
Fix link issues for Darwin and QPG6100
pan-apple b33daa6
Add stubs for K32W & cc13x2_26x2
mspang File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev
Previous commit
Add stubs for K32W & cc13x2_26x2
commit b33daa615a4d972040512c7a9b0dbc31fe5354c3
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* | ||
* | ||
* Copyright (c) 2021 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. | ||
*/ | ||
|
||
/** | ||
* @file | ||
* Platform-specific key value storage implementation for K32W | ||
*/ | ||
|
||
#include <platform/KeyValueStoreManager.h> | ||
|
||
namespace chip { | ||
namespace DeviceLayer { | ||
namespace PersistedStorage { | ||
|
||
KeyValueStoreManagerImpl KeyValueStoreManagerImpl::sInstance; | ||
|
||
} // namespace PersistedStorage | ||
} // namespace DeviceLayer | ||
} // namespace chip |
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,80 @@ | ||
/* | ||
* | ||
* Copyright (c) 2021 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. | ||
*/ | ||
|
||
/** | ||
* @file | ||
* Platform-specific key value storage implementation for K32W | ||
*/ | ||
|
||
#pragma once | ||
|
||
namespace chip { | ||
namespace DeviceLayer { | ||
namespace PersistedStorage { | ||
|
||
class KeyValueStoreManagerImpl final : public KeyValueStoreManager | ||
{ | ||
// Allow the KeyValueStoreManager interface class to delegate method calls to | ||
// the implementation methods provided by this class. | ||
friend class KeyValueStoreManager; | ||
|
||
public: | ||
// NOTE: Currently this platform does not support partial and offset reads | ||
// these will return CHIP_ERROR_NOT_IMPLEMENTED. | ||
CHIP_ERROR _Get(const char * key, void * value, size_t value_size, size_t * read_bytes_size = nullptr, size_t offset = 0) | ||
{ | ||
return CHIP_ERROR_NOT_IMPLEMENTED; | ||
} | ||
|
||
CHIP_ERROR _Delete(const char * key) { return CHIP_ERROR_NOT_IMPLEMENTED; } | ||
|
||
CHIP_ERROR _Put(const char * key, const void * value, size_t value_size) { return CHIP_ERROR_NOT_IMPLEMENTED; } | ||
|
||
private: | ||
// ===== Members for internal use by the following friends. | ||
friend KeyValueStoreManager & KeyValueStoreMgr(); | ||
friend KeyValueStoreManagerImpl & KeyValueStoreMgrImpl(); | ||
|
||
static KeyValueStoreManagerImpl sInstance; | ||
}; | ||
|
||
/** | ||
* Returns the public interface of the KeyValueStoreManager singleton object. | ||
* | ||
* Chip applications should use this to access features of the KeyValueStoreManager object | ||
* that are common to all platforms. | ||
*/ | ||
inline KeyValueStoreManager & KeyValueStoreMgr(void) | ||
{ | ||
return KeyValueStoreManagerImpl::sInstance; | ||
} | ||
|
||
/** | ||
* Returns the platform-specific implementation of the KeyValueStoreManager singleton object. | ||
* | ||
* Chip applications can use this to gain access to features of the KeyValueStoreManager | ||
* that are specific to the ESP32 platform. | ||
*/ | ||
inline KeyValueStoreManagerImpl & KeyValueStoreMgrImpl(void) | ||
{ | ||
return KeyValueStoreManagerImpl::sInstance; | ||
} | ||
|
||
} // namespace PersistedStorage | ||
} // namespace DeviceLayer | ||
} // namespace chip |
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,34 @@ | ||
/* | ||
* | ||
* Copyright (c) 2021 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. | ||
*/ | ||
|
||
/** | ||
* @file | ||
* Platform-specific key value storage implementation for CC1352 | ||
*/ | ||
|
||
#include <platform/KeyValueStoreManager.h> | ||
|
||
namespace chip { | ||
namespace DeviceLayer { | ||
namespace PersistedStorage { | ||
|
||
KeyValueStoreManagerImpl KeyValueStoreManagerImpl::sInstance; | ||
|
||
} // namespace PersistedStorage | ||
} // namespace DeviceLayer | ||
} // namespace chip |
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,80 @@ | ||
/* | ||
* | ||
* Copyright (c) 2021 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. | ||
*/ | ||
|
||
/** | ||
* @file | ||
* Platform-specific key value storage implementation for CC1352. | ||
*/ | ||
|
||
#pragma once | ||
|
||
namespace chip { | ||
namespace DeviceLayer { | ||
namespace PersistedStorage { | ||
|
||
class KeyValueStoreManagerImpl final : public KeyValueStoreManager | ||
{ | ||
// Allow the KeyValueStoreManager interface class to delegate method calls to | ||
// the implementation methods provided by this class. | ||
friend class KeyValueStoreManager; | ||
|
||
public: | ||
// NOTE: Currently this platform does not support partial and offset reads | ||
// these will return CHIP_ERROR_NOT_IMPLEMENTED. | ||
CHIP_ERROR _Get(const char * key, void * value, size_t value_size, size_t * read_bytes_size = nullptr, size_t offset = 0) | ||
{ | ||
return CHIP_ERROR_NOT_IMPLEMENTED; | ||
} | ||
|
||
CHIP_ERROR _Delete(const char * key) { return CHIP_ERROR_NOT_IMPLEMENTED; } | ||
|
||
CHIP_ERROR _Put(const char * key, const void * value, size_t value_size) { return CHIP_ERROR_NOT_IMPLEMENTED; } | ||
|
||
private: | ||
// ===== Members for internal use by the following friends. | ||
friend KeyValueStoreManager & KeyValueStoreMgr(); | ||
friend KeyValueStoreManagerImpl & KeyValueStoreMgrImpl(); | ||
|
||
static KeyValueStoreManagerImpl sInstance; | ||
}; | ||
|
||
/** | ||
* Returns the public interface of the KeyValueStoreManager singleton object. | ||
* | ||
* Chip applications should use this to access features of the KeyValueStoreManager object | ||
* that are common to all platforms. | ||
*/ | ||
inline KeyValueStoreManager & KeyValueStoreMgr(void) | ||
{ | ||
return KeyValueStoreManagerImpl::sInstance; | ||
} | ||
|
||
/** | ||
* Returns the platform-specific implementation of the KeyValueStoreManager singleton object. | ||
* | ||
* Chip applications can use this to gain access to features of the KeyValueStoreManager | ||
* that are specific to the ESP32 platform. | ||
*/ | ||
inline KeyValueStoreManagerImpl & KeyValueStoreMgrImpl(void) | ||
{ | ||
return KeyValueStoreManagerImpl::sInstance; | ||
} | ||
|
||
} // namespace PersistedStorage | ||
} // namespace DeviceLayer | ||
} // namespace chip |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe this comment needs to be updated to state that every function returns NOT_IMPLEMENTED (same on other platforms), or maybe just a comment/TODO on the class to explain.