Skip to content

Commit dc32a21

Browse files
authored
Merge pull request #116 from Mia1234567890/main
[EG915UEUABR03A01M08_OCPU_QPY]新增NAT相关接口
2 parents 3dc9a96 + e569ae6 commit dc32a21

File tree

2 files changed

+116
-0
lines changed

2 files changed

+116
-0
lines changed

en-us/api/QuecPythonClasslib.md

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5211,6 +5211,65 @@ USBNET.open()
52115211

52125212

52135213

5214+
###### get the status of NAT enablement
5215+
5216+
> **USBNET.getNat(simid, pid)**
5217+
5218+
get the status of NAT enablement(Whether IPV6 is supported)(supported only on 8910)
5219+
5220+
* Parameter
5221+
5222+
| Parameter | Type | Description |
5223+
| -------- | -------- | ----------------------------------------------------- |
5224+
| simid | int | simid,value:0/1 ,(only SIM0 is supported now) |
5225+
| pid | int | PDP context index ,range:1-7 |
5226+
5227+
* Return Value
5228+
5229+
success:return the status of NAT enablement
5230+
0:enabled,means:IPV6 is supported
5231+
1:disabled,means:IPV6 is not supported
5232+
5233+
failed: return -1
5234+
5235+
* Example
5236+
5237+
```python
5238+
from misc import USBNET
5239+
USBNET.getNat(0, 1)
5240+
0
5241+
```
5242+
5243+
5244+
5245+
###### set NAT
5246+
5247+
> **USBNET.setNat(simid, pid, Nat)**
5248+
5249+
set NAT,Restart takes effect (supported only on 8910)
5250+
(8910 platform: Usbnet.set_worktype () API will make the corresponding Nat value set to 1, so that the pid cannot dial up IPV6, so after close USBnet, you can use this interface to disable NAT and make IPV6 function normal)
5251+
5252+
* Parameter
5253+
5254+
| Parameter | Type | Description |
5255+
| -------- | -------- | ----------------------------------------------------- |
5256+
| simid | int | simid,value:0/1 ,(only SIM0 is supported now) |
5257+
| pid | int | PDP context index ,range:1-7 |
5258+
| Nat | int | Nat,value:0/10IPV6 is supported;1IPV6 is not supported |
5259+
5260+
* Return Value
5261+
5262+
Return 0 if successful, otherwise return -1
5263+
5264+
* Example
5265+
5266+
```python
5267+
USBNET.setNat(0, 1, 0)
5268+
0
5269+
```
5270+
5271+
5272+
52145273
##### Diversity antenna configuration API
52155274

52165275
> **misc.antennaSecRXOffCtrl(\*args)**

zh-cn/api/QuecPythonClasslib.md

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5755,6 +5755,63 @@ USBNET.open()
57555755

57565756

57575757

5758+
###### 获取Nat使能情况
5759+
5760+
> **USBNET.getNat(simid, pid)**
5761+
5762+
获取某一路网卡的Nat使能情况(是否支持ipv6拨号)(仅在8910平台支持)
5763+
5764+
* 参数
5765+
5766+
| 参数 | 参数类型 | 参数说明 |
5767+
| ----- | -------- | ------------------------------ |
5768+
| simid | int | simid,范围:0/1 ,目前仅支持0 |
5769+
| pid | int | PDP索引, 展锐平台范围1-7 |
5770+
5771+
* 返回值
5772+
5773+
成功:返回Nat使能情况,整型0/10:使能,支持ipv6拨号;1:未使能,不支持ipv6拨号
5774+
5775+
失败:返回整型-1
5776+
5777+
* 示例
5778+
5779+
```python
5780+
from misc import USBNET
5781+
USBNET.getNat(0, 1)
5782+
0
5783+
```
5784+
5785+
5786+
5787+
###### Nat设置
5788+
5789+
> **USBNET.setNat(simid, pid, Nat)**
5790+
5791+
Nat设置,设置成功后重启生效(仅在8910平台支持)
5792+
8910平台USBNET.set_worktype()接口调用的时候会使对应的Nat值变为1,使得该pid无法IPV6拨号,所以在close USBnet后,可以使用该接口关闭NAT,使IPV6功能正常)
5793+
5794+
* 参数
5795+
5796+
| 参数 | 参数类型 | 参数说明 |
5797+
| ----- | -------- | -------------------------------------------------- |
5798+
| simid | int | simid,范围:0/1,目前仅支持0 |
5799+
| pid | int | PDP索引, 展锐平台范围1-7 |
5800+
| Nat | int | Nat,范围:0/10:支持ipv6拨号;1:不支持ipv6拨号 |
5801+
5802+
* 返回值
5803+
5804+
设置成功返回整型0,设置失败返回整型-1
5805+
5806+
* 示例
5807+
5808+
```python
5809+
USBNET.setNat(0, 1, 0)
5810+
0
5811+
```
5812+
5813+
5814+
57585815
##### 分集天线配置接口
57595816

57605817
> **misc.antennaSecRXOffCtrl(\*args)**

0 commit comments

Comments
 (0)