op_radio_txch_rxgroup_set()
注意: 需要 Wireless 功能
摘要
将发射机信道的接收机组设置为指定的对象 ID 数组。
语法
op_radio_txch_rxgroup_set (txch_objid, count, rxgroup)
| 参数 | 类型 | 说明 |
|---|---|---|
txch_objid |
Objid |
被分配接收机组的发射机信道 |
count |
unsigned int |
rxgroup 数组中的元素个数 |
rxgroup |
Objid * |
接收信道对象 ID 数组 |
返回类型
Compcode
完成代码,指示设置接收机组是否成功。若成功设置接收机组,该过程返回 OPC_COMPCODE_SUCCESS;否则返回 OPC_COMPCODE_FAILURE。
示例
Objid receiver;
Objid receiver_array [2];
/* empty a receiver group */
op_radio_txch_rxgroup_set (txch, 0, OPC_NIL);
/* set the receiver group to one specific receiver */
receiver = ...;
op_radio_txch_rxgroup_set (txch2, 1, &receiver);
/* set the receiver group to a pair of receivers */
receiver_array [0] = ...;
receiver_array [1] = ...;
op_radio_txch_rxgroup_set (txch3, 2, receiver_array);
详情
该内核过程用 rxgroup 指示的集合替换发射机信道的当前接收机组;若 count 为 0,则清空当前接收机组。
如果 rxgroup 中包含重复的信道 ID,应用程序会将其消除并生成一个诊断错误。
用途
提供一种基于对象 ID 数组设置发射机信道接收机组的机制。
错误
- 可恢复错误:对象 ID (
<objid>) 不是发射机信道。 - 可恢复错误:发射机对象 ID (
<objid>) 指向受限对象。 - 可恢复错误:内部内存分配错误,接收机组未改变。
- 诊断错误:接收机组集合中存在重复的对象 ID (
<objid>)
参考
- 使用内核过程 op_radio_txch_rxgroup_compute() 可使用滤波器计算接收机组
- 使用内核过程 op_radio_txch_rxgroup_get() 可获取当前接收机组
- 使用内核过程 op_radio_txch_rxch_add() 可向发射机信道的组添加一个接收信道
- 使用内核过程 op_radio_txch_rxch_remove() 可从发射机信道的组中移除一个接收信道