Skip to content

dev about cli cmd set

yemao edited this page Jun 15, 2019 · 1 revision

中文 | EN

主页 | 产品 | 下载 | 开发指南 | FAQ | 联系我们 | 购买样品


开发指南 > FOTA


Content


Wlan Mode Control Command Set

  • net mode <mode>

    描述: 切换网络到指定的工作模式,如station模式,Hostap模式或者monitor模式
    Example:

    • net mode sta
    • net mode ap
    • net mode monitor

Wlan Station Control Command Set

  • net sta config <ssid> [psk]

    描述:配置ssid和密码 Example:

    • net sta config abcd
    • net sta config abcd 12345678

    注意:在配置完station的ssid和psk之后需要调用net sta enable命令才能启动连接,以下是示例**

    • net sta config abcd 12345678
    • net sta enable
  • net sta set <field> <value>

    描述:设置指定的工作模式

    • net sta set ssid ssid_example
    • net sta set psk psk_example
    • net sta set wep_key0 wep_key_example
    • net sta set wep_key1 wep_key_example
    • net sta set wep_key2 wep_key_example
    • net sta set wep_key3 wep_key_example
    • net sta set wep_key_index <0, 1, 2, 3>
    • net sta set key_mgmt {WPA-PSK, NONE}
    • net sta set pairwise {CCMP, TKIP, WEP40, WEP104, NONE}
    • net sta set group {CCMP, TKIP, WEP40, WEP104, NONE}
    • net sta set proto {WPA, RSN}
    • net sta set auth_alg {OPEN, SHARED}
    • net sta set ptk_rekey <seconds>
    • net sta set scan_ssid (0, 1)
  • net sta get <field>

    描述:获取详细的配置参数

    • net sta get ssid
    • net sta get psk
    • net sta get wep_key0
    • net sta get wep_key1
    • net sta get wep_key2
    • net sta get wep_key3
    • net sta get wep_key_index
    • net sta get key_mgmt
    • net sta get pairwise
    • net sta get group
    • net sta get proto
    • net sta get auth_alg
    • net sta get ptk_rekey
    • net sta get scan_ssid
  • net sta enable/disable

    描述:开启/关闭station功能,当配置好相关参数后可以通过调用enable命令来启动该模式开始工作

  • net sta scan once

    描述:启动一次扫描行为

  • net sta scan result <num>

    描述:获取扫描结果,num为指定的最多显示的结果数

  • net sta scan interval <sec>

    描述:设置扫描间隔,单位为秒

  • net sta connect

    描述:发起一次新的连接

  • net sta disconnect

    描述:断开当前的连接

  • net sta state

    描述:查看当前连接状态

  • net sta ap

    描述:查看当前连接的AP的状态

Wlan HostAP Control Command Set

  • net ap config <ssid> [psk]

    描述:配置AP模式下的SSID和密码 Example:

    • net ap config abcd
    • net ap config abcd 12345678

    注意:在配置完AP模式的ssid和psk之后需要调用net ap enable命令才能启动连接,以下是示例**

    • net ap config abcd 12345678
    • net ap enable
  • net ap set <field> <value>

    描述:配置AP模式下的相关参数

    • net ap set ssid ssid_example
    • net ap set psk psk_example
    • net ap set key_mgmt {WPA-PSK, NONE}
    • net ap set wpa {CCMP, TKIP, NONE}
    • net ap set rsn {CCMP, TKIP, NONE}
    • net ap set proto <NONE, {WPA, RSN}>
    • net ap set auth_alg {OPEN}
    • net ap set group_rekey <seconds>
    • net ap set strict_rekey <0, 1>
    • net ap set gmk_rekey <seconds>
    • net ap set ptk_rekey <seconds>
    • net ap set hw_mode <b, g>
    • net ap set 80211n <0, 1>
    • net ap set channel <1 ~ 13>
    • net ap set beacon_int <15 ~ 65535>
    • net ap set dtim <1 ~ 255>
    • net ap set max_num_sta <num>
  • net ap get <field>

    描述:获取当前AP模式下的配置参数

    • net ap get ssid
    • net ap get psk
    • net ap get key_mgmt
    • net ap get wpa
    • net ap get rsn
    • net ap get proto
    • net ap get auth_alg
    • net ap get group_rekey
    • net ap get strict_rekey
    • net ap get gmk_rekey
    • net ap get ptk_rekey
    • net ap get hw_mode
    • net ap get 80211n
    • net ap get channel
    • net ap get beacon_int
    • net ap get dtim
    • net ap get max_num_sta
  • net ap enable/disable/reload

    描述:AP模式开启,关闭,重启

  • net ap sta num

    描述:查看当前连接到此AP的设备数

  • net ap sta info <num>

    描述:查看当前连接到此AP的基站信息,其数量有num指定

Ping

  • net ping target_name <count>

    描述:发起一个ping操作到目标主机,时间由count指定,单位为秒 Example: net ping 192.168.1.1 10

iPerf

  • net iperf [-s|-c host] [options]

    描述:iperf为测试网络吞吐的工具,用于长度是TCP或者UDP模式下的网络传输性能,该命令参数与iperf工具保持一致

    Client/Server:

    -f, --format [kmKM] format to report: Kbits, Mbits, KBytes, MBytes
    -i, --interval # seconds between periodic bandwidth reports
    -p, --port # server port to listen on/connect to
    -u, --udp use UDP rather than TCP msgs

    Server specific:

    -s, --server run in server mode

    Client specific:

    -c, --client <host> run in client mode, connecting to <host>
    -t, --time # time in seconds to transmit for (default 10 secs)

    Example:
    net iperf -s -p 5002 -i 1 -f K
    net iperf -c 192.168.xxx.xxx -p 5003 -i 1 -f K -t 30

SNTP

  • net sntp

    描述:sntp工具用来获取网络时间 Example:
    #net sntp
    <ACK> 200 OK
    <net> <sntp> <request>
    <net> <sntp> <response : success>
    sntp(0 4 8 14:7:52 18) // the current time is 14:7:52 in April 8

nopoll

  • net nopoll srv|cli [options]

    描述:nopoll为开源websocket协议的实现,该命令用来简单测试一些操作 Usage: net nopoll srv|cli [options]

    Server specific:

    • net nopoll srv init d=<debug>
    • net nopoll srv deinit
      • debug: 0 - disable debug, 1 - enable debug
    • net nopoll srv open h=<host> p=<port> t=<tls> v=<verify>
    • net nopoll srv close
      • host: the server IP address
      • port: the server port number
      • tls: 0-disalbe tls/ssl, 1-enable tls/ssl
      • verify: 0-ignore the client cert, 1-verify the client cert
        Example:
        net nopoll srv open h=192.168.1.101 p=1234 t=0 v=0
        net nopoll srv open h=192.168.1.101 p=1234 t=1 v=0
        net nopoll srv open h=192.168.1.101 p=1234 t=1 v=1
    • net nopoll srv start
    • net nopoll srv stop

    Client specific:

    • net nopoll cli init d=<debug>
    • net nopoll cli deinit
    • net nopoll cli open h=<host> p=<port> t=<tls> v=<verify> c=<certificate>
      • host: the server IP address
      • port: the server port number
      • tls: 0-disalbe tls/ssl, 1-enable tls/ssl
      • verify: 0-ignore the client cert, 1-verify the client cert
      • certificate: 0-no certificate, 1-with certificate
    • net nopoll cli close
    • net nopoll cli start
    • net nopoll cli stop
    • net nopoll cli send s=
      • size: the size of the message you want to send. you must send the message within in 10 seconds.
        Example:
        #net nopoll cli send s=30
        #0123456789abcdefghij0123456789

Smart Link

  • net smartlink start

    Description: start SmartConfig and Airkiss simultaneously.

  • net smartlink stop

    Description: stop the running task.

  • net smartlink set_airkiss_key <key>
  • net smartlink set_smartconfig_key <key>

    Description: set the key used for smartconfig or airkiss.
    Note: if we want to set key, we have to execute set key command before "net smartlink start" command, and the key must be 16 characters. Example:

    • net smartlink set_airkiss_key 1234567812345678
    • net smartlink start

Smart Config

  • net smartconfig start

    Description: start a SmartConfig task.

  • net smartconfig stop

    Description: stop the running smartconfig task.

  • net smartconfig set_key <key>

    Description: set the key used for smartconfig.
    Note: if we want to set key, we have to execute set key command before "net smartconfig start" command, and the key must be 16 characters. Example:

    • net smartconfig set_key 1234567812345678
    • net smartconfig start

Airkiss

  • net airkiss start

    Description: start a airkiss task.

  • net airkiss stop

    Description: stop the running airkiss task.

  • net airkiss set_key <key>

    Description: set the key used for airkiss.
    Note: if we want to set key, we have to execute set key command before "net airkiss start" command, and the key must be 16 characters. Example:

    • net airkiss set_key 1234567812345678
    • net airkiss start

Memory Access

  • mem r8 <addr> <len>
  • mem r16 <addr> <len>
  • mem r32 <addr> <len>
  • mem w8 <addr> <data>
  • mem w16 <addr> <data>
  • mem w32 <addr> <data>

    Description: Read or write memory with 8/16/32 bit width.
    Example:
    $mem r32 0x4000B008 64
    address 0 4 8 C
    4000b008: 00000000 00000000 00010003 00000000
    4000b018: 00000000 00000000 00001000 00000000
    4000b028: 00003030 00000000 00000000 00000000
    4000b038: 00000000 00000000 00000000 6f0f6f0f
    $ mem w32 0x4000B008 0x55aa
    write 0x000055aa -> 0x4000B008

ADC

  • drv adc init f=<first-delay>
  • drv adc deinit

    Description: init/deinit the ADC controller.

    • first-delay: the number of useless data to be discarded.
  • drv adc conv-polling c=<channel> v=<voltage> d=<deviation>
  • drv adc config c=<channel> e=<enable> i=<irq-mode> l=<low-value> h=<high-value> v=<voltage> d=<deviation>

    Description: configure the ADC controller.

    • channel: {0|1|2|3|4|5|6|7}
    • voltage: {0-2500}
    • deviation: {0-2500}
    • channel: {0|1|2|3|4|5|6|7}
    • enable: {0|1}
    • irq-mode: {0|1}
    • low-value: {0 ~ 2^12-1}
    • high-value: {0 ~ 2^12-1}
  • drv adc conv-it-start
  • drv adc conv-it-stop

    Description: start/stop the convertion.

Examples:

  • (for poll mode)
    $ drv adc init f=0
    $ drv adc conv-polling c=6 v=1200 d=100
    $ drv adc deinit
  • (for it mode)
    $ drv adc init f=0
    $ drv adc config c=6 e=1 i=1 l=0 h=0 v=1200 d=100
    $ drv adc conv-it-start
    $ drv adc conv-it-stop
    $ drv adc deinit

CedarX

命令操作

  • 创建播放器

    命令: cedarx create

  • 销毁播放器

    命令: cedarx destroy

  • 播放

    命令: cedarx play

  • 停止

    命令: cedarx stop
    描述: 停止后,需要设置播放地址才可使用播放命令重新播放。

  • 暂停

    命令: cedarx pause
    描述: 暂停后,使用播放命令即可继续播放。

  • 设置播放地址

    命令: cedarx seturl <url>
    描述: 根据sdk中Platform_init的设置,可以支持本地音频和网络音频。网络播放需要先完成网络连接
    举例:
    cedarx seturl file://music/01.mp3
    cedarx seturl http://192.168.51.1/music/01.mp3

  • 获得当前播放位置

    命令: cedarx getpos
    描述: 以时间戳的形式,获得当前播放音频的位置,时间戳单位为ms.

  • 设置播放位置

    命令: cedarx seek <timestamp>
    描述: 以时间戳的形式,设置当前播放音频的位置,时间戳单位为ms.
    举例: 设置从6秒处开始播放
    cedarx seek 6000

  • 设置播放音量

    命令:cedarx setvol <volume>
    描述: volume的取值为0~31, 当前仅对默认的Speak模式有效.
    举例:
    cedarx setvol 19

  • 开始录音

    命令: cedarx rec <url>
    描述: 创建录音器,开始录音,把声音数据保存到指定位置.
    举列:
    cedarx rec file://record/wechat.amr

  • 停止录音

    命令: cedarx end
    描述: 停止录音,并销毁录音器

  • 输出CedarX版本信息

    命令: cedarx version

示例

  • 播放音频文件

    cedarx create #创建播放器
    cedarx seturl file://01.mp3 #设置音频文件地址,如果是网络地址,需要先完成网络连接操作
    cedarx play #开始播放,正常情况下有声音输出

  • 更换歌曲播放

    #在进行播放音频文件的状态下
    cedarx stop #停止当前歌曲播放
    cedarx seturl file://02.mp3 #设置新的音频文件地址
    cedarx play #开始播放,正常情况下有声音输出
    #注意:在当前歌曲完成播放的情况下,要重新播放同一个或另一个音频文件,同样需要进行上述操作。

  • 暂停和播放

    #在进行播放音频文件的状态下
    cedarx pause #暂停播放,声音停止
    cedarx play #在暂停的位置继续播放,再次有声音输出

  • 获取播放位置和设置播放位置

    #在进行播放音频文件的状态下
    cedarx getpos #打印输出播放音频文件的当前播放时间位置,例如:<ACK> 200 played time: 7143 ms
    cedarx seek 6000 #在6000ms的位置播放

  • 设置播放时的音量

    #在进行播放音频文件的状态下
    cedarx setvol 18 #立刻有音量大小的变化,当前仅对默认的Speak模式有效

  • 销毁播放器

    #在创建了播放器的情况下
    cedarx destory

  • 录音

    #录音过程与播放无关
    #rec命令包括了创建录音器、开始录音的操作
    #end命令包括停止录音、销毁录音器操作
    cedarx rec file://record.amr #输入此命令后,即可进行录音。
    cedarx end #完成录音,在rec指定的地址存有录音文件,可使用播放器重放

OTA

Power Management

  • pm config l= <Test_Level> d= <Delay_ms> u= <Buffer_len>

    Description: set the level of pm operation termination.

    • Test_Level: define in enum suspend_test_level_t enum suspend_test_level_t { TEST_NONE, TEST_CORE, TEST_PLATFORM, TEST_DEVICES, __TEST_AFTER_LAST ;
  • pm wk_timer <Seconds>

    Description: set the wakeup timer.
    Example:
    pm wk_timer 10

  • pm wk_io p= <Port_Num> m= <Mode> p= <Pull>

    Description: set the wakeup IO.

    • Port_Num: IO number, 0-9
    • Mode: wakeup mode,
      - 0: negative edge
      - 1: positive edge
      - 2: disable this port as wakeup io. Example:
      pm wk_io p=2 m=0 p=1
  • pm wk_event

    Description: get the wakeup event.

  • pm sleep|standby|hibernation|poweroff|shutdown

    Description: set the power mode and execute it immediately.
    Example:
    pm sleep
    pm hibernation
    pm shutdown