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

[ncp] add joiner spinel support #2877

Merged
merged 2 commits into from Aug 8, 2018

Conversation

Projects
None yet
5 participants
@librasungirl
Contributor

librasungirl commented Jul 10, 2018

Show outdated Hide outdated src/ncp/spinel.h Outdated
Show outdated Hide outdated src/ncp/ncp_base_mtd.cpp Outdated
Show outdated Hide outdated src/ncp/changed_props_set.cpp Outdated

@jwhui jwhui requested a review from abtink Jul 23, 2018

Show outdated Hide outdated src/ncp/spinel.h Outdated
@@ -1010,6 +1010,38 @@ template <> otError NcpBase::HandlePropertyGet<SPINEL_PROP_THREAD_PENDING_DATASE
return EncodeOperationalDataset(dataset);
}
#if OPENTHREAD_ENABLE_JOINER

This comment has been minimized.

@abtink

abtink Jul 23, 2018

Member

Since this feature can be enabled/disabled on NCP/OT, how about we add a SPINEL_CAP_THREAD_JOINER in spinel.h and emit it from NcpBase::HandlePropertyGet<SPINEL_PROP_CAPS>? (so we can know in wpantund if this feature is present/enabled).

@abtink

abtink Jul 23, 2018

Member

Since this feature can be enabled/disabled on NCP/OT, how about we add a SPINEL_CAP_THREAD_JOINER in spinel.h and emit it from NcpBase::HandlePropertyGet<SPINEL_PROP_CAPS>? (so we can know in wpantund if this feature is present/enabled).

@abtink

LGTM. Some minor suggestions above. Thanks.

@librasungirl

This comment has been minimized.

Show comment
Hide comment
@librasungirl

librasungirl Aug 7, 2018

Contributor

Rebased and updated. Please help to review it.

Contributor

librasungirl commented Aug 7, 2018

Rebased and updated. Please help to review it.

@@ -1013,6 +1013,38 @@ template <> otError NcpBase::HandlePropertyGet<SPINEL_PROP_THREAD_PENDING_DATASE
return EncodeOperationalDataset(dataset);
}
#if OPENTHREAD_ENABLE_JOINER
template <> otError NcpBase::HandlePropertyGet<SPINEL_PROP_MESHCOP_JOINER_STATE>(void)

This comment has been minimized.

@bukepo

bukepo Aug 8, 2018

Member

Is it better to send notification of this state instead of provide a getter? We could remove memory used by joiner after thread started in future.

@bukepo

bukepo Aug 8, 2018

Member

Is it better to send notification of this state instead of provide a getter? We could remove memory used by joiner after thread started in future.

This comment has been minimized.

@librasungirl

librasungirl Aug 8, 2018

Contributor

There is async notification if successfully commissioned or fail after tried all available joiner routers HandleJoinerCallback_Jump(). Here just provides the freedom for the user to check the commissioning status especially that it may take a little bit more time for slow platforms to finish.

For the possible future update, do you mean the otJoinerGetState() would be removed as well?

@librasungirl

librasungirl Aug 8, 2018

Contributor

There is async notification if successfully commissioned or fail after tried all available joiner routers HandleJoinerCallback_Jump(). Here just provides the freedom for the user to check the commissioning status especially that it may take a little bit more time for slow platforms to finish.

For the possible future update, do you mean the otJoinerGetState() would be removed as well?

@@ -2125,6 +2133,14 @@ const char *spinel_status_to_cstr(spinel_status_t status)
ret = "STATUS_JOIN_INCOMPATIBLE";
break;
case SPINEL_STATUS_JOIN_RSP_TIMEOUT:

This comment has been minimized.

@bukepo

bukepo Aug 8, 2018

Member

SPINEL_STATUS_JOIN_RSP_TIMEOUT -> SPINEL_STATUS_JOIN_TIMEOUT?

@bukepo

bukepo Aug 8, 2018

Member

SPINEL_STATUS_JOIN_RSP_TIMEOUT -> SPINEL_STATUS_JOIN_TIMEOUT?

This comment has been minimized.

@librasungirl

librasungirl Aug 8, 2018

Contributor

Prefer to keep it as is as it corresponds to OT_ERROR_RESPONSE_TIMEOUT in core and more clearly in indicating the interim JOIN_FIN/JOIN_ENT process.

@librasungirl

librasungirl Aug 8, 2018

Contributor

Prefer to keep it as is as it corresponds to OT_ERROR_RESPONSE_TIMEOUT in core and more clearly in indicating the interim JOIN_FIN/JOIN_ENT process.

ret = "PROP_MESHCOP_JOINER_STATE";
break;
case SPINEL_PROP_MESHCOP_JOINER_COMMISSIONING:

This comment has been minimized.

@bukepo

bukepo Aug 8, 2018

Member

SPINEL_PROP_MESHCOP_JOINER_COMMISSIONING -> SPINEL_PROP_MESHCOP_JOINER_JOIN?

@bukepo

bukepo Aug 8, 2018

Member

SPINEL_PROP_MESHCOP_JOINER_COMMISSIONING -> SPINEL_PROP_MESHCOP_JOINER_JOIN?

This comment has been minimized.

@librasungirl

librasungirl Aug 8, 2018

Contributor

prefer to keep it as is - Here the wording COMMISSIONING is better in describe the thread commissioning process and as spinel is also part of wpantund which has wpanctl cmd join or other JOIN_EXISTING wording inside, the other purpose it to avoid possible confusion in understanding.

thoughts?

@librasungirl

librasungirl Aug 8, 2018

Contributor

prefer to keep it as is - Here the wording COMMISSIONING is better in describe the thread commissioning process and as spinel is also part of wpantund which has wpanctl cmd join or other JOIN_EXISTING wording inside, the other purpose it to avoid possible confusion in understanding.

thoughts?

Show outdated Hide outdated src/ncp/ncp_base_mtd.cpp Outdated
@abtink

abtink approved these changes Aug 8, 2018

LGTM.

@bukepo

bukepo approved these changes Aug 8, 2018

@jwhui

jwhui approved these changes Aug 8, 2018

@jwhui jwhui merged commit 90ee0a4 into openthread:master Aug 8, 2018

3 checks passed

cla/google All necessary CLAs are signed
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@librasungirl librasungirl deleted the librasungirl:ncp/joiner branch Aug 13, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment