Skip to content

Update nanostack-interface error mapping #10014

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

Merged
merged 1 commit into from
Mar 17, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions features/nanostack/nanostack-interface/Nanostack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ nsapi_error_t map_mesh_error(mesh_error_t err)
case MESH_ERROR_MEMORY:
return NSAPI_ERROR_NO_MEMORY;
case MESH_ERROR_PARAM:
return NSAPI_ERROR_UNSUPPORTED;
return NSAPI_ERROR_PARAMETER;
case MESH_ERROR_STATE:
return NSAPI_ERROR_DEVICE_ERROR;
default:
Expand Down Expand Up @@ -664,7 +664,7 @@ nsapi_size_or_error_t Nanostack::do_sendto(void *handle, const ns_address_t *add
nsapi_size_or_error_t Nanostack::socket_sendto(void *handle, const SocketAddress &address, const void *data, nsapi_size_t size)
{
if (address.get_ip_version() != NSAPI_IPv6) {
return NSAPI_ERROR_UNSUPPORTED;
return NSAPI_ERROR_PARAMETER;
}

ns_address_t ns_address;
Expand Down Expand Up @@ -736,7 +736,7 @@ nsapi_error_t Nanostack::socket_bind(void *handle, const SocketAddress &address)
addr_field = &ns_in6addr_any;
break;
default:
return NSAPI_ERROR_UNSUPPORTED;
return NSAPI_ERROR_PARAMETER;
}

NanostackLockGuard lock;
Expand Down Expand Up @@ -874,7 +874,7 @@ nsapi_error_t Nanostack::socket_connect(void *handle, const SocketAddress &addr)
NanostackLockGuard lock;

if (addr.get_ip_version() != NSAPI_IPv6) {
ret = NSAPI_ERROR_UNSUPPORTED;
ret = NSAPI_ERROR_PARAMETER;
goto out;
}

Expand Down Expand Up @@ -1006,3 +1006,4 @@ OnboardNetworkStack &OnboardNetworkStack::get_default_instance()
return Nanostack::get_instance();
}
#endif