op_hla_interaction_pk_register()
Note: Requires High-Level Architecture functionality
Abstract
Requests delivery of packets representing an interaction type to a specified object using a stream interrupt.
Syntax
op_hla_interaction_pk_register (objid, pk_format_name, stream_index)
| Argument | Type | Description |
|---|---|---|
objid |
Objid |
object ID of module where packets representing an interaction type should be delivered |
pk_format_name |
const char * |
Packet format specifying which interaction type should be delivered |
stream_index |
int |
Stream index where the packet is delivered (via a stream interrupt) |
Return Type
Compcode
Completion code indicating success or failure in queuing the request. The procedure returns OPC_COMPCODE_SUCCESS if the request was successfully queued for later processing by the HLA-PM. It returns OPC_COMPCODE_FAILURE if the request could not be queued.
Example
#define REQUEST_STRM 0
#define LEAVE_STRM 1
my_id = op_id_self ();
/* Register with the HLA-PM our desire to receive */
/* two interaction packets, using two distinct streams */ op_hla_interaction_pk_register (my_id,"Send_Info", REQUEST_STRM);
op_hla_interaction_pk_register (my_id,"Stop_Listening", LEAVE_STRM);
Details
When the HLA-PM receives an interaction, it converts the interaction to an appropriate packet format and delivers a copy of that packet to each module that was registered for the packet format. Each packet is delivered using a stream interrupt via the stream index specified in the KP.
Purpose
Provides a mechanism to have the HLA-PM deliver a packet representing an interaction type to a module, using a stream interrupt.
Errors
- Recoverable Error: Objid (
<objid>): Unable to queue registration for interaction (<packet_name>). (due to memory allocation failure)
Reference
- Use the KP op_hla_interaction_pk_deregister() to stop being notified of incoming interactions
- Use the KP op_hla_interaction_pk_struct_get() to extract blocks of data from an incoming interactions