-
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
Adds RendezvousSession inside src/transport #2508
Adds RendezvousSession inside src/transport #2508
Conversation
44c9814
to
4abce27
Compare
|
||
mRendezvousSession = new RendezvousSession(this, RendezvousParameters(setupPINCode).SetLocalNodeId(kLocalNodeId)); | ||
err = mRendezvousSession->Init(); | ||
SuccessOrExit(err); |
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.
this is a no-op because the very next instruction is exit: ? I'm ok with this for uniformity's sake, but would you also do this at line 66 in such case?
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 like to do it at the end in case someone is adding code after it. But you're right that I need to stay consistent. Will fix this one or line 66.
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.
Fixed.
src/transport/SecurePairingSession.h
Outdated
* | ||
* @return Optional<NodeId> The associated peer NodeId | ||
*/ | ||
const Optional<NodeId> & GetPeerNodeId() const { return mPeerNodeId; }; |
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 unfamiliar with this syntax, is better than returning nullptr if mPeerNodeId?
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 think there will be more code changes as I would need to change mPeerNodeId to be a pointer otherwise.
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.
Fixed.
LGTM fails on ../../src/platform/Linux/ThreadStackManagerImpl.h:26:10: fatal error: dbus/client/thread_api_dbus.hpp: No such file or directory |
4abce27
to
2c4e7a4
Compare
|
||
using namespace ::chip; | ||
|
||
class RendezvousDeviceDelegate : public RendezvousSessionDelegate |
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.
Might be outside the scope of this PR, but I'm wondering if this class should purely be getPinCode(), onOpen(), onClose(), and onError()
callbacks. The Sending and Receiving of Messages can eventually be handled internally within CHIP as it might be common for most accessories right?
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 think it's mainly driven by the separation of handling of WiFi credentials on the device side.
@vivien-apple we should eventually move the logic to handle IP address processing (on controller side) to |
The controller side code that received the IP will be removed once there is a mechanism to discover the device on the network. |
2c4e7a4
to
f3345a9
Compare
I wonder if a rebase will address that. We don't have a way to land this without Admin help unless LGTM passes. |
Let me have a look. It may be my bad after all. It seems like the inclusion of CHIPDeviceLayer in src/transport/BLE.cpp trigger that.
|
f3345a9
to
611d988
Compare
RendezvousSession manages the initial connection between a commissioner and a device. During rendezvous a key pair is generated by SecurePairingSession under the hood. Embedders can listen to the different states of Rendezvous by implementing the RendezvousSessionCallback interface. The differents events are: * OnRendezvousConnectionOpened(); * OnRendezvousConnectionClosed(); * OnRendezvousError(CHIP_ERROR err); * OnRendezvousMessageReceived(System::PacketBuffer * buffer);
611d988
to
e8acc46
Compare
RendezvousSession manages the initial connection between a commissioner and a device.
During rendezvous a key pair is generated by SecurePairingSession under the hood.
Embedders can listen to the different states of Rendezvous by implementing
the RendezvousSessionCallback interface. The differents events are:
fixes #2394