op_hla_interaction_pk_deregister()
注意: 需要 High-Level Architecture 功能
摘要
当收到相应的 RTI 交互时,取消向某个对象投递相应的数据包。
语法
op_hla_interaction_pk_deregister (objid, pk_format_name)
| 参数 | 类型 | 说明 |
|---|---|---|
objid |
Objid |
不再投递交互的模块的对象 ID |
pk_format_name |
const char * |
用于投递交互的数据包格式名称 |
返回类型
Compcode
完成代码,指示请求入队的成功或失败。如果请求已成功排队以供 HLA-PM 后续处理,该内核过程返回 OPC_COMPCODE_SUCCESS;如果请求无法入队,则返回 OPC_COMPCODE_FAILURE。
示例
static void deregister (void)
{
/* After receiving an interaction packet requesting the process to stop */
/* listening for incoming interaction packets, deregister with the */
/* HLA interface. */
op_sim_message (“Received order to stop listening”, “Deregistering for
interaction packets”);
op_hla_interaction_pk_deregister (my_id, “Send_Info”);
op_hla_interaction_pk_deregister (my_id, “Stop_Listening”);
}
详情
当收到 RTI 交互时,它会被转换为匹配的数据包格式,并将该数据包的副本投递给每个通过 op_hla_interaction_pk_register() 注册过的进程模型。使用该内核过程可停止向特定对象投递某种类型的数据包。
用途
提供了一种取消向模块投递 RTI 交互的机制。
错误
- 可恢复错误:Objid(
<objid>):无法将交互(<packet_name>)的注销请求入队。(由于内存分配失败)
参考
- 使用内核过程 op_hla_interaction_pk_register() 接收传入交互的通知
- 使用内核过程 op_hla_interaction_pk_struct_get() 从传入交互中提取数据块