-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Handle Thread Association Request in rendezvous session #3303
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
Handle Thread Association Request in rendezvous session #3303
Conversation
} | ||
} | ||
|
||
return CHIP_ERROR_INCORRECT_STATE; |
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.
would NOT_FOUND be a more accurate return code? or is this really about state?
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.
yeah, I also felt CHIP_ERROR_INCORRECT_STATE might not be accurate as it suggests an application error, but I couldn't find a generic NOT_FOUND in the error list. Do you think I should add CHIP_ERROR_NOT_FOUND?
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.
Yes, I thought one existed (almost any error code list has such a thing, along with things like 'invalid argument' or 'out of range'). I am very surprised we do not have one :( maybe we should add it, since really this is a search that returns not found.
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.
I found CHIP_DEVICE_ERROR_CONFIG_NOT_FOUND which seems suitable so I used it here. Let me know if that's better.
@@ -34,7 +33,16 @@ using namespace ::chip::DeviceLayer; | |||
|
|||
namespace chip { | |||
|
|||
RendezvousServer::RendezvousServer() : mRendezvousSession(this) {} | |||
void AccessoryNetworkProvisioningDelegate::ProvisionThread(const DeviceLayer::Internal::DeviceNetworkInfo & threadData) |
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.
Rename to AccessoryNetworkProvisioningDelegate.cpp
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.
I'm not sure I understand. Would you like me to move the class to a new header/source file?
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.
I modified it a bit 8000 so that RendezvousServer implements DeviceNetworkProvisioningDelegate directly. Is it OK now?
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.
LGTM:+1:
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.
LGTM 👍
@@ -22,6 +22,11 @@ | |||
|
|||
namespace chip { | |||
|
|||
class AccessoryNetworkProvisioningDelegate : public DeviceNetworkProvisioningDelegate | |||
{ | |||
void ProvisionThread(const DeviceLayer::Internal::DeviceNetworkInfo & threadData) override; |
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.
nit:
void ProvisionThread(const DeviceLayer::Internal::DeviceNetworkInfo & threadData) override; | |
public: | |
void ProvisionThread(const DeviceLayer::Internal::DeviceNetworkInfo & threadData) override; |
e9b3fb1
to
f75b8d7
Compare
Size increase report for "nrfconnect-example-build"
Full report output
|
@Damian-Nordic Can you address the merge conflicts? Should be good to go after that |
Currently, NetworkProvisioning class, which takes part in rendezvous over BLE session, only supports WiFi provisioning and Thread provisioning is partially implemented in RendezvousServer (Application layer). Move the Thread provisioning code to the BLE transport layer to process both network types in the same way. Also reply to Thread Association request with SLAAC/On-Mesh IPv6 Address once that is assigned so that the controller knows that provisioning completed successfully and how to reach the device.
More and more CHIP components rely on CHIP memory allocator. Also PlatformManager::AddEventHandler() used in this PR needs dynamic memory allocation. Run MemoryInit() on the app startup.
b036978
to
bf4739e
Compare
Yes. I've rebased the changes. |
Size increase report for "nrfconnect-example-build" from 5ba0597
Full report output
|
Problem
Currently, NetworkProvisioning class, which takes part in Rendezvous over BLE session, only supports WiFi provisioning and Thread provisioning is partially implemented in RendezvousServer (Application layer).
Proposed Solution
Fixes #3302