我们如何编写自己的自定义 AT 命令?

How can we write our own custom AT commands?

有没有办法为 unetstack/subnero 调制解调器编写自定义 AT 命令?我参考了 Chapter 12 但找不到此信息。

AT 命令shells(和Groovyshells)可以用shell扩展。 Shell 扩展实现了 Unet 手册的 org.arl.fjage.shell.ShellExtension tag interface. Static methods (and attributes) of the shell extension class are made available in the shell as commands (and variables/constants). In the AT command shell, they are called using AT commands as briefly described in section 12.3

例如,手册显示了通过以下方式加载 PhysicalShellExt 的示例:

AT~EXT=org.arl.unet.phy.PhysicalShellExt

加载后,可以使用 AT 命令访问此 class 的静态方法。例如,方法:

  static def plvl() {
    // code to get power level here
  }

  static String plvl(float p) {
    // code to set power level here
  }

被访问为:

AT~PLVL
AT~PLVL=-3

分别