节点模型 aaa_polling_node
![这里写图片描述](https://img-blog.csdn.net/20170120103033745?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvUmljYXJkbzE5OTE=/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast)
进程模型 aaa_polling_node_process
![这里写图片描述](https://img-blog.csdn.net/20170120103055367?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvUmljYXJkbzE5OTE=/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast)
SV
![这里写图片描述](https://img-blog.csdn.net/20170120103122070?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvUmljYXJkbzE5OTE=/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast)
TV
char node_name [128];
char module_name [128];
int namelength;
int i;
int i_temp;
HB
#define IN_STRM 0
#define ACK_STRM 1
#define OUT_STRM 0
#define INTRPT_ACK ((op_intrpt_type() == OPC_INTRPT_STRM) && (op_intrpt_strm() == ACK_STRM) )
#define INTRPT_SRC ((op_intrpt_type() == OPC_INTRPT_STRM) && (op_intrpt_strm() == IN_STRM) )
Init
my_id = op_id_self ();
p_id = op_topo_parent(my_id);
op_ima_obj_attr_get (p_id, "name", node_name);
op_ima_obj_attr_get (my_id, "name", module_name);
printf("%s ",node_name);
printf("%s ",module_name);
printf("initing...\n");
namelength = strlen(node_name);
nodenum = 0;
i_temp = 0;
for(i=5;i<=namelength - 1;i++)
{
i_temp = node_name[i] - '0';
nodenum = 10*nodenum + i_temp;
}
Strm
Packet* pkptr;
int node_flag;
int node_src;
pkptr = op_pk_get(ACK_STRM);
op_pk_nfd_get_int32 (pkptr, "flag", &node_flag);
if(node_flag == 4)
{
op_pk_nfd_get_int32 (pkptr, "dest", &node_src);
if(node_src == nodenum)
{
printf("polling packet have been received!\n");
op_pk_send(op_pk_get(IN_STRM),OUT_STRM);
}
}
op_pk_destroy(pkptr);
st_3
//op_pk_print(op_pk_get(IN_STRM));
//printf("ack packet arrived!");