# 2.0版本星型单板AT指令配置 (2W 600MHz版本)
board_type: "2.0_star_2w_600"
description: "2.0版本星型单板AT指令集 (2W 600MHz版本)"
version: "2.0"

commands:
  # 基础功能命令
  get_device_info:
    at_command: "AT^DGMR?"
    description: "查询本端版本信息"
    response_format: "text"

  get_access_state:
    at_command: "AT^DACS?"
    description: "获取接入状态"
    response_format: "text"

  set_access_state:
    at_command: "AT^DACS=%d"
    description: "设置接入状态上报"
    parameters:
      - name: "n"
        type: "int"
        values: [0, 1, 2]
        description: "0: 关闭, 1: 开启, 2: WEBUI上报"

  get_radio_params:
    at_command: "AT^DRPC?"
    description: "获取无线参数配置"
    response_format: "text"

  test_radio_params:
    at_command: "AT^DRPC=?"
    description: "测试无线参数配置支持"
    response_format: "text"

  set_radio_params:
    at_command: "AT^DRPC=%d,%d,%s,%d"
    description: "设置无线参数（实时配置，保存到NVRAM）"
    parameters:
      - name: "freq"
        type: "int"
        description: "频点频率(100KHz)，范围根据NVRAM设置，默认为(14200-15299,5660-6779)"
      - name: "bandwidth"
        type: "int"
        values: [0, 1, 2, 3, 5]
        description: "带宽(0:1.4M, 1:3M, 2:5M, 3:10M, 4:15M不支持, 5:20M)"
      - name: "power"
        type: "string"
        description: "中心节点的固定功率，单位dBm，范围\"-40\"到25"
      - name: "cellid"
        type: "int"
        values: [0, 1]
        description: "物理小区ID(0:主小区Pcell, 1:辅小区Scell)，可选参数"
        optional: true

  get_radio_params_store:
    at_command: "AT^DRPS?"
    description: "获取存储的无线参数"
    response_format: "text"

  set_radio_params_store:
    at_command: "AT^DRPS=%d,%d,\"%s\",%d"
    description: "存储无线参数到NVRAM"
    parameters:
      - name: "freq"
        type: "int"
        description: "频点频率(100KHz)"
      - name: "bandwidth"
        type: "int"
        description: "带宽(0:1.4M, 1:3M, 2:5M, 3:10M, 4:15M, 5:20M)"
      - name: "power"
        type: "string"
        description: "发射功率(dBm), 范围-40到40"
      - name: "cellid"
        type: "int"
        values: [0, 1]
        description: "物理小区ID(0:主小区, 1:辅小区)"

  # 从节点最大发射功率设置
  # 注意：board_2.0_star_2w_600设备处于Slave Node状态时，设置发送功率时，
  # 不管是CA模式或MIMO模式，AT^DSSMTP格式为：AT^DSSMTP="X","Y"，两个通道都要设置
  get_slave_max_tx_power:
    at_command: "AT^DSSMTP?"
    description: "获取从节点最大发射功率"
    response_format: "text"

  set_slave_max_tx_power:
    at_command: "AT^DSSMTP=\"%s\",\"%s\""
    description: "设置从节点最大发射功率（Slave Node状态下，CA模式或MIMO模式都需要设置两个通道）"
    parameters:
      - name: "power"
        type: "string"
        description: "主小区(pcell)最大发射功率(dBm), 范围-40到50"
      - name: "scell_power"
        type: "string"
        description: "辅小区(scell)最大发射功率(dBm), 范围-40到50"

  get_radio_param_report:
    at_command: "AT^DRPR?"
    description: "获取无线参数上报状态"
    response_format: "text"

  set_radio_param_report:
    at_command: "AT^DRPR=%d"
    description: "设置无线参数上报"
    parameters:
      - name: "n"
        type: "int"
        values: [0, 1, 2]
        description: "0:关闭, 1:开启, 2:WEBUI上报"

  # 注释掉中心节点专用的所有接入节点无线参数上报命令
  # get_all_radio_param_report:
  #   at_command: "AT^DAPR?"
  #   description: "获取所有接入节点无线参数上报状态"
  #   response_format: "text"

  # set_all_radio_param_report:
  #   at_command: "AT^DAPR=%d"
  #   description: "设置所有接入节点无线参数上报"
  #   parameters:
  #     - name: "n"
  #       type: "int"
  #       values: [0, 1, 2]
  #       description: "0:关闭, 1:开启, 2:WEBUI上报"

  get_device_type:
    at_command: "AT^DDTC?"
    description: "获取设备类型配置"
    response_format: "text"

  set_device_type:
    at_command: "AT^DDTC=%d"
    description: "设置设备类型"
    parameters:
      - name: "type"
        type: "int"
        values: [1, 2]
        description: "1:中心节点, 2:接入节点"

  get_encryption_algorithm:
    at_command: "AT^DCIAC?"
    description: "获取加密算法配置"
    response_format: "text"

  set_encryption_algorithm:
    at_command: "AT^DCIAC=%d"
    description: "设置加密算法"
    parameters:
      - name: "algorithm"
        type: "int"
        values: [0, 1, 2, 3]
        description: "加密算法(0:无加密, 1:SNOW3G, 2:AES, 3:ZUC)"

  get_access_password:
    at_command: "AT^DAPI?"
    description: "获取接入秘钥配置"
    response_format: "text"

  set_access_password:
    at_command: "AT^DAPI=\"%s\""
    description: "设置接入秘钥"
    parameters:
      - name: "password_id"
        type: "string"
        pattern: "[0-9A-Fa-f]+"
        description: "接入秘钥，HEX格式，最长32字节（64个字符）"

  set_encryption_key:
    at_command: "AT^DAPI=\"%s\""
    description: "设置加密密钥"
    parameters:
      - name: "key"
        type: "string"
        pattern: "[0-9A-Fa-f]+"
        description: "加密密钥，HEX格式，最长32字节（64个字符）"

  # TDD配置命令
  get_tdd_config:
    at_command: "AT^DSTC?"
    description: "获取TDD配置"
    response_format: "text"

  get_tdd_mode:
    at_command: "AT^DSONTDL?"
    description: "获取TDD距离模式（0:近距离模式, 1:远距离模式）"
    response_format: "text"

  test_tdd_config:
    at_command: "AT^DSTC=?"
    description: "测试TDD配置支持"
    response_format: "text"

  # 设备状态检查命令
  check_device_status:
    at_command: "AT"
    description: "检查设备基本状态"
    response_format: "text"

  set_tdd_config:
    at_command: "AT^DSTC=%d"
    description: "设置TDD配置"
    parameters:
      - name: "config"
        type: "int"
        values: [0, 3]
        description: "TDD配置(0:2D3U, 3:1D4U)"

  get_frequency_hopping:
    at_command: "AT^DFHC?"
    description: "获取跳频控制状态"
    response_format: "text"

  set_frequency_hopping:
    at_command: "AT^DFHC=%d"
    description: "设置跳频控制"
    parameters:
      - name: "n"
        type: "int"
        values: [0, 1]
        description: "0:关闭跳频, 1:开启跳频"

  get_band_config:
    at_command: "AT^DAOCNDI?"
    description: "获取工作频段配置"
    response_format: "text"

  set_band_config:
    at_command: "AT^DAOCNDI=%s[,%s]"
    description: "设置工作频段配置"
    parameters:
      - name: "pcell_band_bitmap"
        type: "string"
        description: "主小区频段位图，十六进制格式"
      - name: "scell_band_bitmap"
        type: "string"
        description: "辅小区频段位图，十六进制格式（可选）"

  get_network_config:
    at_command: "AT^NETIFCFG?"
    description: "获取网络接口配置"
    response_format: "text"

  set_network_config:
    at_command: "AT^NETIFCFG=%d,%s,%s,%s"
    description: "设置网络接口配置"
    parameters:
      - name: "type"
        type: "int"
        values: [2, 3, 4]
        description: "2:IP, 3:IP+MASK, 4:IP+MASK+GATEWAY"
      - name: "master_ip"
        type: "string"
        description: "主IP地址"
      - name: "sub_mask"
        type: "string"
        description: "子网掩码"
      - name: "gateway"
        type: "string"
        description: "网关地址"

  set_powerctl:
    at_command: "AT^POWERCTL=%d"
    description: "模块重启"
    parameters:
      - name: "value"
        type: "int"
        values: [1]
        description: "1:重启"

  get_ca_mimo_capability:
    at_command: "AT^DSONSCAP?"
    description: "获取CA/MIMO能力配置"
    response_format: "text"

  test_ca_mimo_capability:
    at_command: "AT^DSONSCAP=?"
    description: "测试CA/MIMO能力配置支持"
    response_format: "text"

  set_ca_mimo_capability:
    at_command: "AT^DSONSCAP=%d"
    description: "设置CA/MIMO能力配置"
    parameters:
      - name: "mode"
        type: "int"
        values: [0, 1, 2, 3]
        description: "0:不支持CA MIMO, 1:支持CA, 2:支持MIMO, 3:支持CA MIMO"

  set_recovset:
    at_command: "AT^RECOVSET=%d"
    description: "恢复出厂设置"
    parameters:
      - name: "type"
        type: "int"
        values: [1]
        description: "1:恢复出厂设置"

  # 子频段范围配置
  get_sub_band_range:
    at_command: "AT^DSONSBR?"
    description: "获取子频段范围配置"
    response_format: "text"

  set_sub_band_range:
    at_command: "AT^DSONSBR=%d,%d,%d"
    description: "设置子频段范围"
    parameters:
      - name: "band"
        type: "int"
        values: [64, 65, 66, 67, 69, 70, 71, 73]
        description: "子频段编号"
      - name: "earfcn_start"
        type: "int"
        description: "起始频点号"
      - name: "earfcn_end"
        type: "int"
        description: "结束频点号"

  # 1.4GHz频段子频段范围配置 (BAND66: 14200-15299)
  get_1_4g_sub_band_range:
    at_command: "AT^DSONSBR?"
    description: "获取1.4GHz子频段范围配置"
    response_format: "text"

  set_1_4g_sub_band_range:
    at_command: "AT^DSONSBR=66,%d,%d"
    description: "设置1.4GHz子频段范围"
    parameters:
      - name: "earfcn_start"
        type: "int"
        description: "起始频点号(14200-15299)"
      - name: "earfcn_end"
        type: "int"
        description: "结束频点号(14200-15299)"

  # 600MHz频段子频段范围配置 (BAND71: 5660-6779)
  get_600m_sub_band_range:
    at_command: "AT^DSONSBR?"
    description: "获取600MHz子频段范围配置"
    response_format: "text"

  set_600m_sub_band_range:
    at_command: "AT^DSONSBR=71,%d,%d"
    description: "设置600MHz子频段范围"
    parameters:
      - name: "earfcn_start"
        type: "int"
        description: "起始频点号(5660-6779)"
      - name: "earfcn_end"
        type: "int"
        description: "结束频点号(5660-6779)"

  # ELog功能配置
  get_elog_function:
    at_command: "AT^ELFUN?"
    description: "获取ELog功能配置"
    response_format: "text"

  set_elog_function:
    at_command: "AT^ELFUN=%d"
    description: "设置ELog功能"
    parameters:
      - name: "mode"
        type: "int"
        values: [0, 1]
        description: "0:关闭ELog, 1:开启ELog"

  # 移除不存在的温度命令
  # get_temperature:
  #   at_command: "AT^TEMP?"
  #   description: "获取设备温度"
  #   response_format: "text"

