oms_aa_address_handle_get()
摘要
返回用于分配某一特定类型地址的地址句柄。
语法
oms_aa_address_handle_get (address_category, attribute_name)
| 参数 | 类型 | 说明 |
|---|---|---|
address_category |
string |
正在注册的地址类型(例如 “MAC Addresses”) [长度必须不超过 128 个字符] |
attribute_name |
string |
地址属性的名称(例如 “MAC Address”) [长度必须不超过 128 个字符] |
返回类型
OmsT_Aa_Address_Handle
由 address_category 和 attribute_name 参数所指定的地址列表的句柄
详细说明
对象在注册地址之前,必须先获取相应地址列表的句柄。该过程返回由 address_category 和 attribute_name 参数指定的地址列表的句柄。如果该地址列表不存在,该过程会创建一个新列表并返回其句柄。
示例
来自 eth_mac_v2 进程模型的 function block 中的 ethernet_mac_sv_init() 函数:
/* Obtain the node's object identifier. */
own_node_objid = op_topo_parent (my_objid);
/* Obtain the process's process handle. */
own_prohandle = op_pro_self ();
/* Obtain the address handle assigned to this node. The string */
/* "MAC Addresses" rendezvous with other MACs to guarantee */
/* unique addresses across all MAC types. The OMS_AA package */
/* handles this feature. */
oms_aa_handle = oms_aa_address_handle_get ("MAC Addresses", "station_address");