/* This function is called when user wants to accept a connection being established.  */
static int winc1500_accept(struct net_context *context, net_tcp_accept_cb_t cb, int32_t timeout, void *user_data)
/* This function is called when user wants to accept a connection being established.  */
static int winc1500_accept(struct net_context *context, net_tcp_accept_cb_t cb, int32_t timeout, void *user_data)
{
	SOCKET socket = (int)context->offload_context;
	int ret;
	w1500_data.socket_data[socket].accept_cb = cb;
	w1500_data.socket_data[socket].accept_user_data = user_data;
	ret = accept(socket, NULL, 0);
	if (ret) {
		LOG_ERR("accept error %d %s!",
			ret, socket_error_string(ret));
		return ret;
	}
	if (timeout) {
		if (k_sem_take(&w1500_data.socket_data[socket].wait_sem,
			       K_MSEC(timeout))) {
			return -ETIMEDOUT;
		}
	}
	return w1500_data.socket_data[socket].ret_code;
}