Transition from NC Library to AC Library


With the NC library, you could change various settings and perform tasks related to connection/disconnection processes, such as:

The role of AC (Auto Connection) is to wrap NC APIs, read appropriate network configs, and monitor the connection state for reconnecting.

List of Individual API Support

This section contains a guide for individual APIs so that connection processing and monitoring APIs that use the NC library can be replaced with APIs in the AC library. Some of the replacement APIs in AC are provided for development usage and not intended to be included in the product. Exercise caution not to leave such APIs in the final binaries. To differentiate those APIs from others, applicable APIs indicate [DEV].

NC Configuration APIs

NCInit, NCClose

It is not necessary to call Init and Close as they are performed within AC. To use AC, the application must call nn::ac::Initialize and nn::ac::Finalize.


Because nn::ac::Connect takes care of the connection process that uses AdminState, it is not necessary to handle AdminState from the application.


nn::ac::Connect( nn::ac::Config* ) [DEV] that connects using a specific config is the equivalent of this API.

NCSetDNS, NCSetEthConfig, NCSetIfIPv4Info
NCSetInterfaceMTU, NCSetIPv4Info, NCSetProxyConfig, NCSetWifiConfig

These NC APIs are to write the running config; AC does not have counterpart APIs. However, nn::ac::Connect( nn::ac::Config* ) [DEV] that connects using a config created on memory is provided. A group of APIs to create a config on memory is provided. (The API group is created for development usage and cannot be included in the product either.)

NCGetDNS, NCGetEthConfig, NCGetIfIPv4Info, NCGetInterfaceMTU
NCGetIPv4Info, NCGetProfileState, NCGetProxyConfig, NCGetWifiConfig

These NC APIs are to read the running config; AC does not have any counterpart APIs.

NCReadAOSSConfig, NCWriteAOSSConfig

These APIs are to set/get AOSS configurations and not available in AC.

NCReadCompatProfileId, NCWriteCompatProfileId

These APIs are to set/get CompatProfileId and are not available in AC.


nn::ac::IsConfigExisting( nn::ac::ConfigId )[DEV] is provided.


This API is not available in AC.

NCSetStartupProfileID, NCGetStartupProfileID

nn::ac::SetStartupId( nn::ac::ConfigId )[DEV][DEV] and nn::ac::GetStartupId[DEV][DEV] are provided.

NCSetValidFlag, NCGetValidFlags

These APIs are not available in AC.


nn::ac::ReadConfig( nn::ac::ConfigId )[DEV] is provided.


To load any given slot into the running config to connect, nn::ac::Connect( nn::ac::ConfigId )[DEV] is provided.


This API is not available in AC.


nn::ac::WriteConfig( nn::ac::ConfigId, nn::ac::Config* )[DEV] is provided.


nn::ac::DeleteConfig( nn::ac::ConfigId )[DEV] is provided.

NC Monitoring API

NCGetLinkState, NCGetAdminState, NCGetOperState, NCGetIfState

Because the application does not need to call an API to check the state, these APIs are not provided.


AC internally interprets an error at the time of connecting and then returns it to the caller. A counterpart API is not provided because it is not necessary for the application to call such an API.


nn::ac::GetAssignedAddress is provided.


nn::ac::GetAssignedPreferedDns and nn::ac::GetAssignedAlternativeDns are provided.


nn::ac::GetAssignedGateway is provided.


nn::ac::GetAssignedSubnet is provided.


This API is not available in AC.


Slot Number Difference

NC indicates slot numbers in the NETCONF_PROFILE type using NETCONF_PROFILE0 ~ NETCONF_PROFILE5 (values: 0~5); AC uses nn::ac::CONFIG_ID_1~nn::ac::CONFIG_ID_6 (values: 1~6) in the nn::ac::ConfigId type. If you use simple casting during transition, an incorrect slot may be specified. The following macros are provided for your reference:

#define AC_CONVERT_NETCONF_PROFILE_TO_CONFIGID( net_id ) ( static_cast<nn::ac::ConfigId>((net_id)+1) )
#define AC_CONVERT_CONFIGID_TO_NETCONF_PROFILE( ac_id  ) ( (ac_id )-1 )

Internal Cache Coherency

To avoid reading data from NVRAM every time reconnecting after disconnection, AC has a cache on memory for the currently used slot number, valid flag state, and network profile. Along with AC APIs, if you use NC APIs to select a slot number, change the Valid flag state, or write the network profile to some slot, you may run the risk of disturbing the cache coherency.

In addition to the cache destruction caused by specifying a slot number or changing the valid flag, nn::ac::Connect(nn::ac::ConfigId) specifying an id, nn::ac::Connect(nn::ac::Config*) specifying a network profile, and nn::ac::CloseAll can clear the cache.

Revision History

2013/05/08 Automated cleanup pass.
2012/09/26 Modified for release.
2012/07/05 Modified for release.
2012/06/06 Initial version.