3.3. Migrating From the UdsNode Network Management API to the LocalNetwork Mesh API

UdsNode, which was previously used for local communications, has been deprecated. This page describes how to migrate an application developed using UdsNode to the LocalNetwork mesh API.

Note:LocalNetwork is used with PiaSession. For more information about PiaSession, see 6. PiaSession Guide.

Note: For more information about migrating to LocalNetwork and the session API, see 3.4. Migrating From the Mesh API to the Session API (PiaLocal).

Initializing and Finalizing

See 6.19.3. Directly Controlling Meshes for Local Communications.

Creating, Destroying, Searching, Connecting to, and Disconnecting From Networks

See 6.19.3. Directly Controlling Meshes for Local Communications.

Getting the Connection Status

There are no APIs equivalent to UdsNode::GetState() and UdsNode::GetConnectionStatus().

Check the connection status by calling the LocalNetwork::IsConnected() function. If the function returns true, you can check whether the local network is a host or client by calling the LocalNetwork::IsHost() and LocalNetwork::IsClient() functions. Check for the maximum number of participants with the Transport::GetMaxStationNum() function, and check for the current number of participants with the Mesh::GetStationNum() function.

Connection State Update Event Callback

The connection state update event callback cannot be configured. Use the session state change event callback for PiaSession when necessary.

Sending and Receiving Threads

The application does not need to prepare for send and receive threads because send and receive data is performed with Pia send and receive threads.

Host Migration

Call the LocalNetwork::DisconnectNetwork() function to make the host start host migration manually. Advance the host migration process by calling the common::Scheduler::Dispatch() function.

Nearby Network Search Feature

To enable this feature, set m_IsEnableAroundNetworkSearch to true for the UdsNetworkSetting instance passed when the LocalNetwork::Initialize() function is called.