Skip to content
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

Add support for persisting paired device information on CHIP controller #3284

Merged
merged 12 commits into from
Oct 20, 2020

Conversation

pan-apple
Copy link
Contributor

Problem

CHIP controller applications cannot persist paired device state across reboots.

Summary of Changes

CHIP Controller API did not provide a mechanism to save pairing state of a device/accessory.
This PR adds

  • the key value persistent API
  • updates CHIPController to use the API to store the state
  • and, a mechanism to serialize, deserialize Pairing state.

This PR is one step towards fixing #2797

@andy31415 andy31415 requested a review from rgoliver October 16, 2020 20:37
src/controller/CHIPDeviceController.cpp Show resolved Hide resolved
src/controller/CHIPDeviceController.cpp Show resolved Hide resolved
src/controller/CHIPDeviceController.cpp Outdated Show resolved Hide resolved
src/transport/SecurePairingSession.cpp Outdated Show resolved Hide resolved
src/transport/SecurePairingSession.cpp Show resolved Hide resolved
src/transport/SecurePairingSession.cpp Outdated Show resolved Hide resolved
src/controller/CHIPDeviceController.h Outdated Show resolved Hide resolved
@github-actions
Copy link

Size increase report for "esp32-example-build"

File Section File VM
chip-wifi-echo.elf .flash.text 64 64
chip-wifi-echo.elf .flash.rodata 8 8
Full report output
BLOAT REPORT

Files found only in the build output:
    report.csv

Comparing ./master_artifact/chip-wifi-echo.elf and ./pull_artifact/chip-wifi-echo.elf:

sections,vmsize,filesize
.debug_str,0,3444
.debug_line,0,2596
.debug_info,0,1318
.debug_loc,0,1276
.debug_abbrev,0,981
.debug_ranges,0,528
.strtab,0,77
.xt.prop._ZNSt8_Rb_treeIhSt4pairIKhN4chip18OptionalQRCodeInfoEESt10_Select1stIS4_ESt4lessIhESaIS4_EE14_M_create_nodeIJRKS4_EEEPSt13_Rb_tree_nodeIS4_EDpOT_$isra$255,0,76
.xt.prop._ZNSt8_Rb_treeIhSt4pairIKhN4chip27OptionalQRCodeInfoExtensionEESt10_Select1stIS4_ESt4lessIhESaIS4_EE13_M_clone_nodeINSA_11_Alloc_nodeEEEPSt13_Rb_tree_nodeIS4_EPKSE_RT_$isra$264,0,76
.debug_frame,0,72
.flash.text,64,64
.xt.lit._ZNK4chip8OptionalIyE5ValueEv,0,40
.symtab,0,32
.debug_aranges,0,24
.flash.rodata,8,8
[1 Others],0,-4
.xt.prop._ZN4chip16ReferenceCountedINS_28SecurePairingSessionDelegateEE7ReleaseEv,0,-12
.xt.prop._ZN4chip16ReferenceCountedINS_9Transport4BaseEE7ReleaseEv,0,-12
.xt.prop._ZN4chip8BufBound3PutEPKvj,0,-40
.xt.prop._ZNSt8_Rb_treeIhSt4pairIKhN4chip18OptionalQRCodeInfoEESt10_Select1stIS4_ESt4lessIhESaIS4_EE14_M_create_nodeIJRKS4_EEEPSt13_Rb_tree_nodeIS4_EDpOT_$isra$244,0,-76
.xt.prop._ZNSt8_Rb_treeIhSt4pairIKhN4chip27OptionalQRCodeInfoExtensionEESt10_Select1stIS4_ESt4lessIhESaIS4_EE13_M_clone_nodeINSA_11_Alloc_nodeEEEPSt13_Rb_tree_nodeIS4_EPKSE_RT_$isra$253,0,-76


src/controller/CHIPDeviceController.cpp Outdated Show resolved Hide resolved
src/controller/CHIPDeviceController.cpp Outdated Show resolved Hide resolved
@pan-apple pan-apple requested a review from mspang October 19, 2020 15:59
@pan-apple
Copy link
Contributor Author

@saurabhst, @jelderton, @BroderickCarlin do you have any feedback?

@pan-apple
Copy link
Contributor Author

@saurabhst, @jelderton, @BroderickCarlin do you have any feedback?

@mspang mspang merged commit f965d49 into project-chip:master Oct 20, 2020
@pan-apple pan-apple deleted the persistent_storage branch October 20, 2020 20:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants