1/* 2 * Copyright (C) 2022-2023 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16import { AsyncCallback, Callback } from "./@ohos.base"; 17import connection from "./@ohos.net.connection"; 18 19/** 20 * Provides network sharing related interfaces. 21 * @namespace sharing 22 * @syscap SystemCapability.Communication.NetManager.NetSharing 23 * @since 9 24 */ 25declare namespace sharing { 26 type NetHandle = connection.NetHandle; 27 /** 28 * Checks whether this device allows for network sharing. 29 * @permission ohos.permission.CONNECTIVITY_INTERNAL 30 * @param { AsyncCallback<boolean> } callback Returns {@code true} indicating network sharing is supported; 31 * returns {@code false} otherwise. 32 * @throws { BusinessError } 201 - Permission denied. 33 * @throws { BusinessError } 202 - Non-system applications use system APIs. 34 * @throws { BusinessError } 2200002 - Operation failed. Cannot connect to service. 35 * @throws { BusinessError } 2200003 - System internal error. 36 * @throws { BusinessError } 2202011 - Cannot get network sharing configuration. 37 * @syscap SystemCapability.Communication.NetManager.NetSharing 38 * @systemapi Hide this for inner system use. 39 * @since 9 40 */ 41 function isSharingSupported(callback: AsyncCallback<boolean>): void; 42 43 /** 44 * Checks whether this device allows for network sharing. 45 * @permission ohos.permission.CONNECTIVITY_INTERNAL 46 * @returns { Promise<boolean> } The promise returned by the function. 47 * @throws { BusinessError } 201 - Permission denied. 48 * @throws { BusinessError } 202 - Non-system applications use system APIs. 49 * @throws { BusinessError } 2200002 - Operation failed. Cannot connect to service. 50 * @throws { BusinessError } 2200003 - System internal error. 51 * @throws { BusinessError } 2202011 - Cannot get network sharing configuration. 52 * @syscap SystemCapability.Communication.NetManager.NetSharing 53 * @systemapi Hide this for inner system use. 54 * @since 9 55 */ 56 function isSharingSupported(): Promise<boolean>; 57 58 /** 59 * Return the global network sharing state. 60 * @permission ohos.permission.CONNECTIVITY_INTERNAL 61 * @param { AsyncCallback<boolean> } callback Returns {@code true} indicating network sharing is running; 62 * returns {@code false} otherwise. 63 * @throws { BusinessError } 201 - Permission denied. 64 * @throws { BusinessError } 202 - Non-system applications use system APIs. 65 * @throws { BusinessError } 2200002 - Operation failed. Cannot connect to service. 66 * @throws { BusinessError } 2200003 - System internal error. 67 * @throws { BusinessError } 2202011 - Cannot get network sharing configuration. 68 * @syscap SystemCapability.Communication.NetManager.NetSharing 69 * @systemapi Hide this for inner system use. 70 * @since 9 71 */ 72 function isSharing(callback: AsyncCallback<boolean>): void; 73 74 /** 75 * Return the global network sharing state. 76 * @permission ohos.permission.CONNECTIVITY_INTERNAL 77 * @returns { Promise<boolean> } The promise returned by the function. 78 * @throws { BusinessError } 201 - Permission denied. 79 * @throws { BusinessError } 202 - Non-system applications use system APIs. 80 * @throws { BusinessError } 2200002 - Operation failed. Cannot connect to service. 81 * @throws { BusinessError } 2200003 - System internal error. 82 * @throws { BusinessError } 2202011 - Cannot get network sharing configuration. 83 * @syscap SystemCapability.Communication.NetManager.NetSharing 84 * @systemapi Hide this for inner system use. 85 * @since 9 86 */ 87 function isSharing(): Promise<boolean>; 88 89 /** 90 * Start network sharing for given type. 91 * @permission ohos.permission.CONNECTIVITY_INTERNAL 92 * @param { SharingIfaceType } type Enumeration of shareable interface types. 93 * @param { AsyncCallback<void> } callback Returns the result. 94 * @throws { BusinessError } 201 - Permission denied. 95 * @throws { BusinessError } 202 - Non-system applications use system APIs. 96 * @throws { BusinessError } 401 - Parameter error. 97 * @throws { BusinessError } 2200001 - Invalid parameter value. 98 * @throws { BusinessError } 2200002 - Operation failed. Cannot connect to service. 99 * @throws { BusinessError } 2200003 - System internal error. 100 * @throws { BusinessError } 2202004 - Try to share an unavailable iface. 101 * @throws { BusinessError } 2202005 - WiFi sharing failed. 102 * @throws { BusinessError } 2202006 - Bluetooth sharing failed. 103 * @throws { BusinessError } 2202009 - Network share enable forwarding error. 104 * @throws { BusinessError } 2202011 - Cannot get network sharing configuration. 105 * @syscap SystemCapability.Communication.NetManager.NetSharing 106 * @systemapi Hide this for inner system use. 107 * @since 9 108 */ 109 function startSharing(type: SharingIfaceType, callback: AsyncCallback<void>): void; 110 111 /** 112 * Start network sharing for given type. 113 * @permission ohos.permission.CONNECTIVITY_INTERNAL 114 * @param { SharingIfaceType } type Enumeration of shareable interface types. 115 * @returns { Promise<void> } The promise returned by the function. 116 * @throws { BusinessError } 201 - Permission denied. 117 * @throws { BusinessError } 202 - Non-system applications use system APIs. 118 * @throws { BusinessError } 401 - Parameter error. 119 * @throws { BusinessError } 2200001 - Invalid parameter value. 120 * @throws { BusinessError } 2200002 - Operation failed. Cannot connect to service. 121 * @throws { BusinessError } 2200003 - System internal error. 122 * @throws { BusinessError } 2202004 - Try to share an unavailable iface. 123 * @throws { BusinessError } 2202005 - WiFi sharing failed. 124 * @throws { BusinessError } 2202006 - Bluetooth sharing failed. 125 * @throws { BusinessError } 2202009 - Network share enable forwarding error. 126 * @throws { BusinessError } 2202011 - Cannot get network sharing configuration. 127 * @syscap SystemCapability.Communication.NetManager.NetSharing 128 * @systemapi Hide this for inner system use. 129 * @since 9 130 */ 131 function startSharing(type: SharingIfaceType): Promise<void>; 132 133 /** 134 * Stop network sharing for given type. 135 * @permission ohos.permission.CONNECTIVITY_INTERNAL 136 * @param { SharingIfaceType } type Enumeration of shareable interface types. 137 * @param { AsyncCallback<void> } callback Returns the result. 138 * @throws { BusinessError } 201 - Permission denied. 139 * @throws { BusinessError } 202 - Non-system applications use system APIs. 140 * @throws { BusinessError } 401 - Parameter error. 141 * @throws { BusinessError } 2200001 - Invalid parameter value. 142 * @throws { BusinessError } 2200002 - Operation failed. Cannot connect to service. 143 * @throws { BusinessError } 2200003 - System internal error. 144 * @throws { BusinessError } 2202004 - Try to share an unavailable iface. 145 * @throws { BusinessError } 2202005 - WiFi sharing failed. 146 * @throws { BusinessError } 2202006 - Bluetooth sharing failed. 147 * @throws { BusinessError } 2202011 - Cannot get network sharing configuration. 148 * @syscap SystemCapability.Communication.NetManager.NetSharing 149 * @systemapi Hide this for inner system use. 150 * @since 9 151 */ 152 function stopSharing(type: SharingIfaceType, callback: AsyncCallback<void>): void; 153 154 /** 155 * Stop network sharing for given type. 156 * @permission ohos.permission.CONNECTIVITY_INTERNAL 157 * @param { SharingIfaceType } type Enumeration of shareable interface types. 158 * @returns { Promise<void> } The promise returned by the function. 159 * @throws { BusinessError } 201 - Permission denied. 160 * @throws { BusinessError } 202 - Non-system applications use system APIs. 161 * @throws { BusinessError } 401 - Parameter error. 162 * @throws { BusinessError } 2200001 - Invalid parameter value. 163 * @throws { BusinessError } 2200002 - Operation failed. Cannot connect to service. 164 * @throws { BusinessError } 2200003 - System internal error. 165 * @throws { BusinessError } 2202004 - Try to share an unavailable iface. 166 * @throws { BusinessError } 2202005 - WiFi sharing failed. 167 * @throws { BusinessError } 2202006 - Bluetooth sharing failed. 168 * @throws { BusinessError } 2202011 - Cannot get network sharing configuration. 169 * @syscap SystemCapability.Communication.NetManager.NetSharing 170 * @systemapi Hide this for inner system use. 171 * @since 9 172 */ 173 function stopSharing(type: SharingIfaceType): Promise<void>; 174 175 /** 176 * Obtains the number of downlink data bytes of the sharing network interfaces. 177 * @permission ohos.permission.CONNECTIVITY_INTERNAL 178 * @param { AsyncCallback<number> } callback Returns the number of downlink data bytes of the sharing network interfaces. 179 * @throws { BusinessError } 201 - Permission denied. 180 * @throws { BusinessError } 202 - Non-system applications use system APIs. 181 * @throws { BusinessError } 401 - Parameter error. 182 * @throws { BusinessError } 2200002 - Operation failed. Cannot connect to service. 183 * @throws { BusinessError } 2200003 - System internal error. 184 * @syscap SystemCapability.Communication.NetManager.NetSharing 185 * @systemapi Hide this for inner system use. 186 * @since 9 187 */ 188 function getStatsRxBytes(callback: AsyncCallback<number>): void; 189 190 /** 191 * Obtains the number of downlink data bytes of the sharing network interfaces. 192 * @permission ohos.permission.CONNECTIVITY_INTERNAL 193 * @returns { Promise<number> } The promise returned by the function. 194 * @throws { BusinessError } 201 - Permission denied. 195 * @throws { BusinessError } 202 - Non-system applications use system APIs. 196 * @throws { BusinessError } 401 - Parameter error. 197 * @throws { BusinessError } 2200002 - Operation failed. Cannot connect to service. 198 * @throws { BusinessError } 2200003 - System internal error. 199 * @syscap SystemCapability.Communication.NetManager.NetSharing 200 * @systemapi Hide this for inner system use. 201 * @since 9 202 */ 203 function getStatsRxBytes(): Promise<number>; 204 205 /** 206 * Obtains the number of uplink data bytes of the sharing network interfaces. 207 * @permission ohos.permission.CONNECTIVITY_INTERNAL 208 * @param { AsyncCallback<number> } callback Returns the number of uplink data bytes of the sharing network interfaces. 209 * @throws { BusinessError } 201 - Permission denied. 210 * @throws { BusinessError } 202 - Non-system applications use system APIs. 211 * @throws { BusinessError } 401 - Parameter error. 212 * @throws { BusinessError } 2200002 - Operation failed. Cannot connect to service. 213 * @throws { BusinessError } 2200003 - System internal error. 214 * @syscap SystemCapability.Communication.NetManager.NetSharing 215 * @systemapi Hide this for inner system use. 216 * @since 9 217 */ 218 function getStatsTxBytes(callback: AsyncCallback<number>): void; 219 220 /** 221 * Obtains the number of uplink data bytes of the sharing network interfaces. 222 * @permission ohos.permission.CONNECTIVITY_INTERNAL 223 * @returns { Promise<number> } The promise returned by the function. 224 * @throws { BusinessError } 201 - Permission denied. 225 * @throws { BusinessError } 202 - Non-system applications use system APIs. 226 * @throws { BusinessError } 401 - Parameter error. 227 * @throws { BusinessError } 2200002 - Operation failed. Cannot connect to service. 228 * @throws { BusinessError } 2200003 - System internal error. 229 * @syscap SystemCapability.Communication.NetManager.NetSharing 230 * @systemapi Hide this for inner system use. 231 * @since 9 232 */ 233 function getStatsTxBytes(): Promise<number>; 234 235 /** 236 * Obtains the number of total data bytes of the sharing network interfaces. 237 * @permission ohos.permission.CONNECTIVITY_INTERNAL 238 * @param { AsyncCallback<number> } callback Returns the number of total data bytes of the sharing network interfaces. 239 * @throws { BusinessError } 201 - Permission denied. 240 * @throws { BusinessError } 202 - Non-system applications use system APIs. 241 * @throws { BusinessError } 401 - Parameter error. 242 * @throws { BusinessError } 2200002 - Operation failed. Cannot connect to service. 243 * @throws { BusinessError } 2200003 - System internal error. 244 * @syscap SystemCapability.Communication.NetManager.NetSharing 245 * @systemapi Hide this for inner system use. 246 * @since 9 247 */ 248 function getStatsTotalBytes(callback: AsyncCallback<number>): void; 249 250 /** 251 * Obtains the number of total data bytes of the sharing network interfaces. 252 * @permission ohos.permission.CONNECTIVITY_INTERNAL 253 * @returns { Promise<number> } The promise returned by the function. 254 * @throws { BusinessError } 201 - Permission denied. 255 * @throws { BusinessError } 202 - Non-system applications use system APIs. 256 * @throws { BusinessError } 401 - Parameter error. 257 * @throws { BusinessError } 2200002 - Operation failed. Cannot connect to service. 258 * @throws { BusinessError } 2200003 - System internal error. 259 * @syscap SystemCapability.Communication.NetManager.NetSharing 260 * @systemapi Hide this for inner system use. 261 * @since 9 262 */ 263 function getStatsTotalBytes(): Promise<number>; 264 265 /** 266 * Obtains the names of interfaces in each sharing state. 267 * @permission ohos.permission.CONNECTIVITY_INTERNAL 268 * @param { SharingIfaceState } state Is the network sharing state. 269 * @param { AsyncCallback<Array<string>> } callback Returns an array of interface names that meet this status. 270 * @throws { BusinessError } 201 - Permission denied. 271 * @throws { BusinessError } 202 - Non-system applications use system APIs. 272 * @throws { BusinessError } 401 - Parameter error. 273 * @throws { BusinessError } 2200001 - Invalid parameter value. 274 * @throws { BusinessError } 2200002 - Operation failed. Cannot connect to service. 275 * @throws { BusinessError } 2200003 - System internal error. 276 * @syscap SystemCapability.Communication.NetManager.NetSharing 277 * @systemapi Hide this for inner system use. 278 * @since 9 279 */ 280 function getSharingIfaces(state: SharingIfaceState, callback: AsyncCallback<Array<string>>): void; 281 282 /** 283 * Obtains the names of interfaces in each sharing state. 284 * @permission ohos.permission.CONNECTIVITY_INTERNAL 285 * @param { SharingIfaceState } state Is the network sharing state. 286 * @returns { Promise<Array<string>> } The promise returned by the function. 287 * @throws { BusinessError } 201 - Permission denied. 288 * @throws { BusinessError } 202 - Non-system applications use system APIs. 289 * @throws { BusinessError } 401 - Parameter error. 290 * @throws { BusinessError } 2200001 - Invalid parameter value. 291 * @throws { BusinessError } 2200002 - Operation failed. Cannot connect to service. 292 * @throws { BusinessError } 2200003 - System internal error. 293 * @syscap SystemCapability.Communication.NetManager.NetSharing 294 * @systemapi Hide this for inner system use. 295 * @since 9 296 */ 297 function getSharingIfaces(state: SharingIfaceState): Promise<Array<string>>; 298 299 /** 300 * Obtains the network sharing state for given type. 301 * @permission ohos.permission.CONNECTIVITY_INTERNAL 302 * @param { SharingIfaceType } type Is the enumeration of shareable interface types. 303 * @param { AsyncCallback<SharingIfaceState> } callback Returns {@code SharingIfaceState}. 304 * @throws { BusinessError } 201 - Permission denied. 305 * @throws { BusinessError } 202 - Non-system applications use system APIs. 306 * @throws { BusinessError } 401 - Parameter error. 307 * @throws { BusinessError } 2200001 - Invalid parameter value. 308 * @throws { BusinessError } 2200002 - Operation failed. Cannot connect to service. 309 * @throws { BusinessError } 2200003 - System internal error. 310 * @syscap SystemCapability.Communication.NetManager.NetSharing 311 * @systemapi Hide this for inner system use. 312 * @since 9 313 */ 314 function getSharingState(type: SharingIfaceType, callback: AsyncCallback<SharingIfaceState>): void; 315 316 /** 317 * Obtains the network sharing state for given type. 318 * @permission ohos.permission.CONNECTIVITY_INTERNAL 319 * @param { SharingIfaceType } type Is the enumeration of shareable interface types. 320 * @returns { Promise<SharingIfaceState> } The promise returned by the function. 321 * @throws { BusinessError } 201 - Permission denied. 322 * @throws { BusinessError } 202 - Non-system applications use system APIs. 323 * @throws { BusinessError } 401 - Parameter error. 324 * @throws { BusinessError } 2200001 - Invalid parameter value. 325 * @throws { BusinessError } 2200002 - Operation failed. Cannot connect to service. 326 * @throws { BusinessError } 2200003 - System internal error. 327 * @syscap SystemCapability.Communication.NetManager.NetSharing 328 * @systemapi Hide this for inner system use. 329 * @since 9 330 */ 331 function getSharingState(type: SharingIfaceType): Promise<SharingIfaceState>; 332 333 /** 334 * Get a list regular expression that defines any interface that can support network sharing. 335 * @permission ohos.permission.CONNECTIVITY_INTERNAL 336 * @param { SharingIfaceType } type Is the enumeration of shareable interface types. 337 * @param { AsyncCallback<Array<string>> } callback - the callback of getSharableRegexes. 338 * @throws { BusinessError } 201 - Permission denied. 339 * @throws { BusinessError } 202 - Non-system applications use system APIs. 340 * @throws { BusinessError } 401 - Parameter error. 341 * @throws { BusinessError } 2200001 - Invalid parameter value. 342 * @throws { BusinessError } 2200002 - Operation failed. Cannot connect to service. 343 * @throws { BusinessError } 2200003 - System internal error. 344 * @syscap SystemCapability.Communication.NetManager.NetSharing 345 * @systemapi Hide this for inner system use. 346 * @since 9 347 */ 348 function getSharableRegexes(type: SharingIfaceType, callback: AsyncCallback<Array<string>>): void; 349 350 /** 351 * Get a list regular expression that defines any interface that can support network sharing. 352 * @permission ohos.permission.CONNECTIVITY_INTERNAL 353 * @param { SharingIfaceType } type Is the enumeration of shareable interface types. 354 * @returns { Promise<Array<string>> } The promise returned by the function. 355 * @throws { BusinessError } 201 - Permission denied. 356 * @throws { BusinessError } 202 - Non-system applications use system APIs. 357 * @throws { BusinessError } 401 - Parameter error. 358 * @throws { BusinessError } 2200001 - Invalid parameter value. 359 * @throws { BusinessError } 2200002 - Operation failed. Cannot connect to service. 360 * @throws { BusinessError } 2200003 - System internal error. 361 * @syscap SystemCapability.Communication.NetManager.NetSharing 362 * @systemapi Hide this for inner system use. 363 * @since 9 364 */ 365 function getSharableRegexes(type: SharingIfaceType): Promise<Array<string>>; 366 367 /** 368 * Register a callback for the global network sharing state change. 369 * @permission ohos.permission.CONNECTIVITY_INTERNAL 370 * @param { 'sharingStateChange' } type Indicates Event name. 371 * @param { Callback<boolean> } callback callback function that returns the status 372 * @throws { BusinessError } 201 Permission denied. 373 * @throws { BusinessError } 202 - Non-system applications use system APIs. 374 * @throws { BusinessError } 401 Parameter error. 375 * @syscap SystemCapability.Communication.NetManager.NetSharing 376 * @systemapi Hide this for inner system use. 377 * @since 9 378 */ 379 function on(type: 'sharingStateChange', callback: Callback<boolean>): void; 380 381 /** 382 * Unregister a callback for the global network sharing state change. 383 * @permission ohos.permission.CONNECTIVITY_INTERNAL 384 * @param { 'sharingStateChange' } type Indicates Event name. 385 * @param { Callback<boolean> } callback callback function that returns the status 386 * @throws { BusinessError } 201 Permission denied. 387 * @throws { BusinessError } 202 - Non-system applications use system APIs. 388 * @throws { BusinessError } 401 Parameter error. 389 * @syscap SystemCapability.Communication.NetManager.NetSharing 390 * @systemapi Hide this for inner system use. 391 * @since 9 392 */ 393 function off(type: 'sharingStateChange', callback?: Callback<boolean>): void; 394 395 /** 396 * Register a callback for the interface network sharing state change. 397 * @permission ohos.permission.CONNECTIVITY_INTERNAL 398 * @param { 'interfaceSharingStateChange' } type Indicates Event name. 399 * @param { Callback<{ type: SharingIfaceType, iface: string, state: SharingIfaceState }> } callback callback function that returns the message. 400 * @throws { BusinessError } 201 Permission denied. 401 * @throws { BusinessError } 202 - Non-system applications use system APIs. 402 * @throws { BusinessError } 401 Parameter error. 403 * @syscap SystemCapability.Communication.NetManager.NetSharing 404 * @systemapi Hide this for inner system use. 405 * @since 9 406 */ 407 function on(type: 'interfaceSharingStateChange', callback: Callback<{ type: SharingIfaceType, iface: string, state: SharingIfaceState }>): void; 408 409 /** 410 * Unregister a callback for the interface network sharing state change. 411 * @permission ohos.permission.CONNECTIVITY_INTERNAL 412 * @param { 'interfaceSharingStateChange' } type Indicates Event name. 413 * @param { Callback<{ type: SharingIfaceType, iface: string, state: SharingIfaceState }> } callback callback function that returns the message. 414 * @throws { BusinessError } 201 Permission denied. 415 * @throws { BusinessError } 202 - Non-system applications use system APIs. 416 * @throws { BusinessError } 401 Parameter error. 417 * @syscap SystemCapability.Communication.NetManager.NetSharing 418 * @systemapi Hide this for inner system use. 419 * @since 9 420 */ 421 function off(type: 'interfaceSharingStateChange', callback?: Callback<{ type: SharingIfaceType, iface: string, state: SharingIfaceState }>): void; 422 423 /** 424 * Register a callback for the sharing upstream network change. 425 * @permission ohos.permission.CONNECTIVITY_INTERNAL 426 * @param { 'sharingUpstreamChange' } type Indicates Event name. 427 * @param { Callback<NetHandle> } callback callback function that returns the network handle. 428 * @throws { BusinessError } 201 Permission denied. 429 * @throws { BusinessError } 202 - Non-system applications use system APIs. 430 * @throws { BusinessError } 401 Parameter error. 431 * @syscap SystemCapability.Communication.NetManager.NetSharing 432 * @systemapi Hide this for inner system use. 433 * @since 9 434 */ 435 function on(type: 'sharingUpstreamChange', callback: Callback<NetHandle>): void; 436 437 /** 438 * Unregister a callback for the sharing upstream network change. 439 * @permission ohos.permission.CONNECTIVITY_INTERNAL 440 * @param { 'sharingUpstreamChange' } type Indicates Event name. 441 * @param { Callback<NetHandle> } callback callback function that returns the network handle. 442 * @throws { BusinessError } 201 Permission denied. 443 * @throws { BusinessError } 202 - Non-system applications use system APIs. 444 * @throws { BusinessError } 401 Parameter error. 445 * @syscap SystemCapability.Communication.NetManager.NetSharing 446 * @systemapi Hide this for inner system use. 447 * @since 9 448 */ 449 function off(type: 'sharingUpstreamChange', callback?: Callback<NetHandle>): void; 450 451 /** 452 * Enumerates the network sharing states of an NIC. 453 * @enum {number} 454 * @syscap SystemCapability.Communication.NetManager.NetSharing 455 * @systemapi Hide this for inner system use. 456 * @since 9 457 */ 458 export enum SharingIfaceState { 459 /** 460 * Indicates the names of the NICs that are serving as network sharing. 461 * @syscap SystemCapability.Communication.NetManager.NetSharing 462 * @systemapi Hide this for inner system use. 463 * @since 9 464 */ 465 SHARING_NIC_SERVING = 1, 466 467 /** 468 * Indicates the names of the NICs that can serve as network sharing. 469 * @syscap SystemCapability.Communication.NetManager.NetSharing 470 * @systemapi Hide this for inner system use. 471 * @since 9 472 */ 473 SHARING_NIC_CAN_SERVER = 2, 474 475 /** 476 * Indicates the names of the NICs that serving error. 477 * @syscap SystemCapability.Communication.NetManager.NetSharing 478 * @systemapi Hide this for inner system use. 479 * @since 9 480 */ 481 SHARING_NIC_ERROR = 3 482 } 483 484 /** 485 * Enumerates the network sharing types of an NIC. 486 * @enum {number} 487 * @syscap SystemCapability.Communication.NetManager.NetSharing 488 * @systemapi Hide this for inner system use. 489 * @since 9 490 */ 491 export enum SharingIfaceType { 492 /** 493 * Network sharing type for Wi-Fi. 494 * @syscap SystemCapability.Communication.NetManager.NetSharing 495 * @systemapi Hide this for inner system use. 496 * @since 9 497 */ 498 SHARING_WIFI = 0, 499 500 /** 501 * Network sharing type for USB. 502 * @syscap SystemCapability.Communication.NetManager.NetSharing 503 * @systemapi Hide this for inner system use. 504 * @since 9 505 */ 506 SHARING_USB = 1, 507 508 /** 509 * Network sharing type for BLUETOOTH. 510 * @syscap SystemCapability.Communication.NetManager.NetSharing 511 * @systemapi Hide this for inner system use. 512 * @since 9 513 */ 514 SHARING_BLUETOOTH = 2 515 } 516} 517 518export default sharing;