Commit 3ab95016 authored by jdelange's avatar jdelange

* packet-store/pingme.c

   packet-store/pinger.c
   - Add specific code for sender/receiver

 * packet-store/software.aadl
   - Add an initialisation entrypoint to 
     create the packet store

 * packet-store/ping.c
   - Remove general ping.c, use pinger.c/pingme.c instead



git-svn-id: https://tecsw.estec.esa.int/svn/taste/trunk/po-hi-c@3512 129961e7-ef38-4bb5-a8f7-c9a525a55882
parent 1c99da7c
#include <stdio.h>
#include <po_hi_monitor.h>
#include <request.h>
#include <deployment.h>
__po_hi_request_t pkt;
void user_produce_pkts_init ()
{
printf ("*** INIT PACKET PRODUCER ***\n");
fflush (stdout);
}
void user_produce_pkts ()
{
static int p = 0;
pkt.vars.pinger_global_data_source.pinger_global_data_source = p;
pkt.port = pinger_global_data_source;
printf ("*** PRODUCE PKT WITH VALUE *** %d\n", p);
p++;
fflush (stdout);
......@@ -14,12 +29,7 @@ void user_produce_pkts ()
void user_do_ping_spg ()
{
printf ("*** SENDING PKT *** \n");
fflush (stdout);
}
void user_ping_spg (int i)
{
printf ("*** PING *** %d\n" ,i);
__po_hi_gqueue_store_out (node_a_pinger_k, pinger_local_data_source, &(pkt));
fflush (stdout);
}
......
#include <stdio.h>
void user_ping_spg (int i)
{
printf ("*** PING *** %d\n" ,i);
fflush (stdout);
}
void recover (void)
{
printf ("*** RECOVER ACTION ***\n");
fflush (stdout);
}
......@@ -24,18 +24,25 @@ end Simple_Type;
-- Subprograms --
-----------------
subprogram produce_packet_init_spg
properties
source_language => C;
source_name => "user_produce_pkts_init";
source_text => ("pinger.c");
end produce_packet_init_spg;
subprogram produce_packet_spg
properties
source_language => C;
source_name => "user_produce_pkts";
source_text => ("ping.c");
source_text => ("pinger.c");
end produce_packet_spg;
subprogram Do_Ping_Spg
properties
source_language => C;
source_name => "user_do_ping_spg";
source_text => ("ping.c");
source_text => ("pinger.c");
end Do_Ping_Spg;
subprogram Ping_Spg
......@@ -44,7 +51,7 @@ features
properties
source_language => C;
source_name => "user_ping_spg";
source_text => ("ping.c");
source_text => ("pingme.c");
end Ping_Spg;
......@@ -61,6 +68,7 @@ Mycalls: {
produce : subprogram produce_packet_spg;
};
properties
Initialize_Entrypoint => classifier (software::produce_packet_init_spg);
Dispatch_Protocol => Periodic;
Period => 500 Ms;
Deadline => 500 ms;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment