在我的代理的启动方法中,我得到物理代理的代理ID,如:
phy = agentForService(Services.PHYSICAL)
然后,我尝试了不同的方法来设置powerLevel,但通常如下所示:
phy.send(new ParameterReq().set(PhysicalChannelParam.powerLevel, -20))
phy.send(new ParameterReq().set(PhysicalChannelParam.powerLevel, [-20 -20 -20])) phy.set(PhysicalChannelParam.powerLevel, [-20 -20 -20]
这两种都不管用。
我想这是因为有多个物理通道(控制,数据)。
如何指定要更改电源级别的哪种信道类型?
编辑:
一个解决方案显然是直接更改参数:
control_channel = phy[1]
control_channel.powerLevel = -20
然而,这似乎违反了Fj ge背后的基本理念。
发布于 2020-11-26 01:00:52
phy[1].powerLevel = -20语法只是一个语法糖,大致上是这样的:
def phy = agentForService(Services.PHYSICAL)
def req = new ParameterReq(phy)
req.setIndex(1)
req.set(PhysicalChannelParam.powerLevel, -20)
def rsp = request(req, 1000)
assert rsp?.get(PhysicalChannelParam.powerLevel) == -20req.setIndex(1)是你丢失的神奇成分。
另见:ParameterReq API文档。
https://stackoverflow.com/questions/65006976
复制相似问题