Contents Menu Expand Light mode Dark mode Auto light/dark, in light mode Auto light/dark, in dark mode Skip to content
nearlink-sdr 1.0.9 文档
nearlink-sdr 1.0.9 文档
  • 快速入门
  • 操作指南
    • 运行链路仿真
    • 添加新的调制方式
    • QoS 服务质量管理
    • 使用 SLE 节点实体
    • Rust 加速模块
    • SDR E310 部署规划
    • 构建文档
  • 技术参考
    • nearlink_sdr
      • nearlink_sdr.mac
        • nearlink_sdr.mac.access
        • nearlink_sdr.mac.broadcast
        • nearlink_sdr.mac.crypto
        • nearlink_sdr.mac.frame
        • nearlink_sdr.mac.link_control
        • nearlink_sdr.mac.link_manager
        • nearlink_sdr.mac.power_control
        • nearlink_sdr.mac.qos
        • nearlink_sdr.mac.scheduler
        • nearlink_sdr.mac.security
        • nearlink_sdr.mac.security_manager
        • nearlink_sdr.mac.signaling
        • nearlink_sdr.mac.smf
        • nearlink_sdr.mac.smf_scheduler
      • nearlink_sdr.sim
        • nearlink_sdr.sim.link_sim
        • nearlink_sdr.sim.usrp_sim
      • nearlink_sdr.common
        • nearlink_sdr.common.bch
        • nearlink_sdr.common.code_block_seg
        • nearlink_sdr.common.crc
        • nearlink_sdr.common.m_sequence
        • nearlink_sdr.common.mcs
        • nearlink_sdr.common.polar
        • nearlink_sdr.common.prbs
        • nearlink_sdr.common.scrambler
      • nearlink_sdr.phy
        • nearlink_sdr.phy.channel
        • nearlink_sdr.phy.control_info
        • nearlink_sdr.phy.data_link
        • nearlink_sdr.phy.equalizer
        • nearlink_sdr.phy.frame
        • nearlink_sdr.phy.freq_hopping
        • nearlink_sdr.phy.gfsk
        • nearlink_sdr.phy.mac_interface
        • nearlink_sdr.phy.measurement
        • nearlink_sdr.phy.measurement_frame
        • nearlink_sdr.phy.measurement_tx
        • nearlink_sdr.phy.mock_backend
        • nearlink_sdr.phy.multitone
        • nearlink_sdr.phy.pilot
        • nearlink_sdr.phy.pluto_backend
        • nearlink_sdr.phy.preamble
        • nearlink_sdr.phy.psk
        • nearlink_sdr.phy.rf_compliance
        • nearlink_sdr.phy.rx_pipeline
        • nearlink_sdr.phy.sdr_backend
        • nearlink_sdr.phy.sync_sequence
        • nearlink_sdr.phy.tx_pipeline
        • nearlink_sdr.phy.uhd_backend
        • nearlink_sdr.phy.usrp
        • nearlink_sdr.phy.uwb_measurement_security
        • nearlink_sdr.phy.uwb_pulse
      • nearlink_sdr.node
  • 设计说明
    • SparkLink SLE 协议总览
    • 物理层原理
    • 物理层详解
    • MAC 层详解
    • 安全子系统详解
    • 端到端数据流
    • 系统架构
    • 标准条款映射
  • 更新日志
  • API Reference
    • nearlink_sdr
      • nearlink_sdr.mac
        • nearlink_sdr.mac.access
        • nearlink_sdr.mac.broadcast
        • nearlink_sdr.mac.crypto
        • nearlink_sdr.mac.frame
        • nearlink_sdr.mac.link_control
        • nearlink_sdr.mac.link_manager
        • nearlink_sdr.mac.power_control
        • nearlink_sdr.mac.qos
        • nearlink_sdr.mac.scheduler
        • nearlink_sdr.mac.security
        • nearlink_sdr.mac.security_manager
        • nearlink_sdr.mac.signaling
        • nearlink_sdr.mac.smf
        • nearlink_sdr.mac.smf_scheduler
      • nearlink_sdr.sim
        • nearlink_sdr.sim.link_sim
        • nearlink_sdr.sim.usrp_sim
      • nearlink_sdr.common
        • nearlink_sdr.common.bch
        • nearlink_sdr.common.code_block_seg
        • nearlink_sdr.common.crc
        • nearlink_sdr.common.m_sequence
        • nearlink_sdr.common.mcs
        • nearlink_sdr.common.polar
        • nearlink_sdr.common.prbs
        • nearlink_sdr.common.scrambler
      • nearlink_sdr.phy
        • nearlink_sdr.phy.channel
        • nearlink_sdr.phy.control_info
        • nearlink_sdr.phy.data_link
        • nearlink_sdr.phy.equalizer
        • nearlink_sdr.phy.frame
        • nearlink_sdr.phy.freq_hopping
        • nearlink_sdr.phy.gfsk
        • nearlink_sdr.phy.mac_interface
        • nearlink_sdr.phy.measurement
        • nearlink_sdr.phy.measurement_frame
        • nearlink_sdr.phy.measurement_tx
        • nearlink_sdr.phy.mock_backend
        • nearlink_sdr.phy.multitone
        • nearlink_sdr.phy.pilot
        • nearlink_sdr.phy.pluto_backend
        • nearlink_sdr.phy.preamble
        • nearlink_sdr.phy.psk
        • nearlink_sdr.phy.rf_compliance
        • nearlink_sdr.phy.rx_pipeline
        • nearlink_sdr.phy.sdr_backend
        • nearlink_sdr.phy.sync_sequence
        • nearlink_sdr.phy.tx_pipeline
        • nearlink_sdr.phy.uhd_backend
        • nearlink_sdr.phy.usrp
        • nearlink_sdr.phy.uwb_measurement_security
        • nearlink_sdr.phy.uwb_pulse
      • nearlink_sdr.node
Back to top
View this page

nearlink_sdr.mac.power_control¶

功率控制信令 -- TXS-10002-2025 标准 7.2.13 / 7.3.2.27-29

提供三类功率控制信令的编解码以及功率控制状态管理:

  • PowerControlRequest (0x0019, 24 bits)

  • PowerControlResponse (0x001A, 32 bits)

  • PowerChangeIndication(0x001B, 32 bits)

Module Contents¶

Classes¶

Bandwidth

FreqDensity

PowerChangeIndication

功率变化指示信令。

PowerControlRequest

功率控制请求信令。

PowerControlResponse

功率控制响应信令。

PowerController

单链路功率控制状态管理。

Data¶

TX_POWER_STOP_MANAGEMENT

TX_POWER_UNAVAILABLE

API¶

nearlink_sdr.mac.power_control.TX_POWER_STOP_MANAGEMENT¶

126

nearlink_sdr.mac.power_control.TX_POWER_UNAVAILABLE¶

127

class nearlink_sdr.mac.power_control.Bandwidth[源代码]¶

Bases: enum.IntEnum

BW_1MHZ¶

0

BW_2MHZ¶

1

BW_4MHZ¶

2

RESERVED¶

3

class nearlink_sdr.mac.power_control.FreqDensity[源代码]¶

Bases: enum.IntEnum

RATIO_4_1¶

0

RATIO_8_1¶

1

RATIO_16_1¶

2

NO_PILOT¶

3

class nearlink_sdr.mac.power_control.PowerChangeIndication[源代码]¶

功率变化指示信令。

字段顺序:

  • frame_type: 4 bits, 无线帧类型指示

  • bandwidth: 2 bits, 带宽指示

  • freq_density: 2 bits, 导频密度指示

  • sender_min_power: 1 bit

  • sender_max_power: 1 bit

  • reserved: 6 bits

  • tx_power_change: 8 bits, 有符号, 本次功率变化值 (dB)

  • sender_tx_power: 8 bits, 有符号, 变更后发射功率 (dBm)

frame_type: int¶

None

bandwidth: int¶

None

freq_density: int¶

None

sender_min_power: bool¶

None

sender_max_power: bool¶

None

tx_power_change: int¶

None

sender_tx_power: int¶

None

DATA_TYPE_INDEX¶

27

BYTE_LENGTH¶

4

pack() → bytes[源代码]¶

编码为 4 字节。

classmethod unpack(data: bytes) → nearlink_sdr.mac.power_control.PowerChangeIndication[源代码]¶

从 4 字节解码。

class nearlink_sdr.mac.power_control.PowerControlRequest[源代码]¶

功率控制请求信令。

字段顺序 (MSB → LSB 按标准比特排列):

  • frame_type: 4 bits, 无线帧类型指示 (0-15)

  • bandwidth: 2 bits, 带宽指示 (Bandwidth 枚举)

  • freq_density: 2 bits, 频密度指示 (FreqDensity 枚举)

  • tx_power_change: 8 bits, 有符号, 要求接收方发射功率变化值 (dB)

  • sender_tx_power: 8 bits, 有符号, 发送方发射功率 (dBm)

frame_type: int¶

None

bandwidth: int¶

None

freq_density: int¶

None

tx_power_change: int¶

None

sender_tx_power: int¶

None

DATA_TYPE_INDEX¶

25

BYTE_LENGTH¶

3

pack() → bytes[源代码]¶

编码为 3 字节。

classmethod unpack(data: bytes) → nearlink_sdr.mac.power_control.PowerControlRequest[源代码]¶

从 3 字节解码。

class nearlink_sdr.mac.power_control.PowerControlResponse[源代码]¶

功率控制响应信令。

字段顺序:

  • sender_min_power: 1 bit, 置 1 表示发送端以最小功率发送

  • sender_max_power: 1 bit, 置 1 表示发送端以最大功率发送

  • reserved: 6 bits

  • tx_power_change: 8 bits, 有符号, 本端实际功率变化值 (dB)

  • sender_tx_power: 8 bits, 有符号, 发送端发射功率 (dBm)

  • acceptable_power_reduction: 8 bits, 无符号, 可接受的功率减少量 (dB)

sender_min_power: bool¶

None

sender_max_power: bool¶

None

tx_power_change: int¶

None

sender_tx_power: int¶

None

acceptable_power_reduction: int¶

None

DATA_TYPE_INDEX¶

26

BYTE_LENGTH¶

4

pack() → bytes[源代码]¶

编码为 4 字节。

classmethod unpack(data: bytes) → nearlink_sdr.mac.power_control.PowerControlResponse[源代码]¶

从 4 字节解码。

class nearlink_sdr.mac.power_control.PowerController(tx_power_dbm: float = 0.0, min_power_dbm: float = -127.0, max_power_dbm: float = 20.0)[源代码]¶

单链路功率控制状态管理。

管理本端发射功率, 处理对端发来的功率控制请求/响应/变化指示, 并生成需要发送给对端的信令。

参数

tx_power_dbm : 当前发射功率 (dBm) min_power_dbm : 最小支持发射功率 (dBm) max_power_dbm : 最大支持发射功率 (dBm)

Initialization

property is_at_min_power: bool¶
property is_at_max_power: bool¶
property acceptable_power_reduction: int¶

可接受的功率减少量 (dB), 0-255 范围。

handle_request(req: nearlink_sdr.mac.power_control.PowerControlRequest) → nearlink_sdr.mac.power_control.PowerControlResponse[源代码]¶

处理对端的功率控制请求, 调整本端功率并返回响应。

create_request(requested_change_db: int, frame_type: int = 0, bandwidth: int = Bandwidth.BW_1MHZ, freq_density: int = FreqDensity.RATIO_4_1) → nearlink_sdr.mac.power_control.PowerControlRequest[源代码]¶

生成功率控制请求信令。

apply_response(resp: nearlink_sdr.mac.power_control.PowerControlResponse) → None[源代码]¶

处理对端的功率控制响应, 可据此调整本端策略。

场景 b: 根据对端反馈的 acceptable_power_reduction 调整本端功率。

start_power_management() → None[源代码]¶

启动功率等级管理。

stop_power_management() → None[源代码]¶

停止功率等级管理。

property power_management_active: bool¶
create_change_indication(actual_change_db: int, frame_type: int = 0, bandwidth: int = Bandwidth.BW_1MHZ, freq_density: int = FreqDensity.RATIO_4_1) → nearlink_sdr.mac.power_control.PowerChangeIndication[源代码]¶

生成功率变化指示信令 (场景 c)。

create_query_request(frame_type: int = 0, bandwidth: int = Bandwidth.BW_1MHZ, freq_density: int = FreqDensity.RATIO_4_1) → nearlink_sdr.mac.power_control.PowerControlRequest[源代码]¶

生成功率查询请求 (tx_power_change=0)。

Next
nearlink_sdr.mac.qos
Previous
nearlink_sdr.mac.link_manager
Copyright ©
Made with Sphinx and @pradyunsg's Furo
On this page
  • nearlink_sdr.mac.power_control
    • Module Contents
      • Classes
      • Data
      • API
        • TX_POWER_STOP_MANAGEMENT
        • TX_POWER_UNAVAILABLE
        • Bandwidth
          • Bandwidth.BW_1MHZ
          • Bandwidth.BW_2MHZ
          • Bandwidth.BW_4MHZ
          • Bandwidth.RESERVED
        • FreqDensity
          • FreqDensity.RATIO_4_1
          • FreqDensity.RATIO_8_1
          • FreqDensity.RATIO_16_1
          • FreqDensity.NO_PILOT
        • PowerChangeIndication
          • PowerChangeIndication.frame_type
          • PowerChangeIndication.bandwidth
          • PowerChangeIndication.freq_density
          • PowerChangeIndication.sender_min_power
          • PowerChangeIndication.sender_max_power
          • PowerChangeIndication.tx_power_change
          • PowerChangeIndication.sender_tx_power
          • PowerChangeIndication.DATA_TYPE_INDEX
          • PowerChangeIndication.BYTE_LENGTH
          • PowerChangeIndication.pack()
          • PowerChangeIndication.unpack()
        • PowerControlRequest
          • PowerControlRequest.frame_type
          • PowerControlRequest.bandwidth
          • PowerControlRequest.freq_density
          • PowerControlRequest.tx_power_change
          • PowerControlRequest.sender_tx_power
          • PowerControlRequest.DATA_TYPE_INDEX
          • PowerControlRequest.BYTE_LENGTH
          • PowerControlRequest.pack()
          • PowerControlRequest.unpack()
        • PowerControlResponse
          • PowerControlResponse.sender_min_power
          • PowerControlResponse.sender_max_power
          • PowerControlResponse.tx_power_change
          • PowerControlResponse.sender_tx_power
          • PowerControlResponse.acceptable_power_reduction
          • PowerControlResponse.DATA_TYPE_INDEX
          • PowerControlResponse.BYTE_LENGTH
          • PowerControlResponse.pack()
          • PowerControlResponse.unpack()
        • PowerController
          • PowerController.is_at_min_power
          • PowerController.is_at_max_power
          • PowerController.acceptable_power_reduction
          • PowerController.handle_request()
          • PowerController.create_request()
          • PowerController.apply_response()
          • PowerController.start_power_management()
          • PowerController.stop_power_management()
          • PowerController.power_management_active
          • PowerController.create_change_indication()
          • PowerController.create_query_request()