1# NetConn_NetConnCallback
2
3## Overview
4
5Defines network status callbacks.
6
7**Since**: 12
8
9**Related module**: [NetConnection](_net_connection.md)
10
11
12## Summary
13
14### Member Variables
15
16| Name| Description|
17| -------- | -------- |
18| [onNetworkAvailable](#onnetworkavailable) | Called when the network is available.|
19| [onNetCapabilitiesChange](#onnetcapabilitieschange) | Called when the network capabilities change.|
20| [onConnetionProperties](#onconnetionproperties) | Called when network connection properties change.|
21| [onNetLost](#onnetlost) | Called when the network is disconnected.|
22| [onNetUnavailable](#onnetunavailable) | Called when the network is unavailable. This callback is triggered when the network is not activated within the specified timeout interval. If the timeout interval is not set, this callback is not triggered.|
23
24
25## Member Variable Description
26
27
28### onNetworkAvailable
29
30```
31typedef void (*OH_NetConn_NetworkAvailable)(NetConn_NetHandle *netHandle)
32```
33
34**Description**
35
36Called when the network is available.
37
38**Description**
39
40After the callback is complete, the parameter memory is automatically cleared and therefore the parameter pointer should be released.
41
42**Parameters**
43
44| Name| Description|
45| -------- | -------- |
46| netHandle | Network handle.|
47
48### onNetCapabilitiesChange
49
50```
51typedef void (*OH_NetConn_NetCapabilitiesChange)(NetConn_NetHandle *netHandle, NetConn_NetCapabilities *netCapabilities)
52```
53
54**Description**
55
56Called when the network capabilities change.
57
58**Description**
59
60After the callback is complete, the parameter memory is automatically cleared and therefore the parameter pointer should be released.
61
62**Parameters**
63
64| Name| Description|
65| -------- | -------- |
66| netHandle | Network handle.|
67| netCapabilities | Network capabilities.|
68
69### onConnetionProperties
70
71```
72typedef void (*OH_NetConn_NetConnectionPropertiesChange)(NetConn_NetHandle *netHandle, NetConn_ConnectionProperties *connConnetionProperties)
73```
74
75**Description**
76
77Called when network connection properties change.
78
79**Description**
80
81After the callback is complete, the parameter memory is automatically cleared and therefore the parameter pointer should be released.
82
83**Parameters**
84
85| Name| Description|
86| -------- | -------- |
87| netHandle | Network handle.|
88| connConnetionProperties | Network connection properties.|
89
90### onNetLost
91
92```
93typedef void (*OH_NetConn_NetLost)(NetConn_NetHandle *netHandle)
94```
95
96**Description**
97
98Called when the network is disconnected.
99
100**Description**
101
102After the callback is complete, the parameter memory is automatically cleared and therefore the parameter pointer should be released.
103
104**Parameters**
105
106| Name| Description|
107| -------- | -------- |
108| netHandle | Network handle.|
109
110### onNetUnavailable
111
112```
113typedef void (*OH_NetConn_NetUnavailable)(void)
114```
115
116**Description**
117
118Called when the network is unavailable. This callback is triggered when the network is not activated within the specified timeout interval. If the timeout interval is not set, this callback is not triggered.
119