Commit 1c99da7c authored by jdelange's avatar jdelange

* packet-store/software.aadl

   packet-store/ping.aadl
   packet-store/ping.c
     - Change the example to prepare the test with the packet store service



git-svn-id: https://tecsw.estec.esa.int/svn/taste/trunk/po-hi-c@3511 129961e7-ef38-4bb5-a8f7-c9a525a55882
parent a7fa7ead
......@@ -44,6 +44,7 @@ end A;
process implementation A.Impl
subcomponents
Pinger : thread Software::P.Impl;
produce_pkts : thread software::packet_producer.i;
connections
port Pinger.Data_Source -> Out_Port;
end A.Impl;
......
#include <stdio.h>
#include <po_hi_monitor.h>
int p=0;
void user_do_ping_spg (int *v)
void user_produce_pkts ()
{
printf ("*** SENDING PING *** %d\n", p);
*v=p;
static int p = 0;
printf ("*** PRODUCE PKT WITH VALUE *** %d\n", p);
p++;
fflush (stdout);
}
if ((p % 5) == 0)
{
__po_hi_monitor_report_failure_device (device_a_device_id, po_hi_monitor_failure_unknown);
}
if ((p % 7) == 0)
{
__po_hi_monitor_recover_device (device_a_device_id);
}
p++;
void user_do_ping_spg ()
{
printf ("*** SENDING PKT *** \n");
fflush (stdout);
}
......
......@@ -24,9 +24,14 @@ end Simple_Type;
-- Subprograms --
-----------------
subprogram produce_packet_spg
properties
source_language => C;
source_name => "user_produce_pkts";
source_text => ("ping.c");
end produce_packet_spg;
subprogram Do_Ping_Spg
features
Data_Source : out parameter Simple_Type;
properties
source_language => C;
source_name => "user_do_ping_spg";
......@@ -47,6 +52,21 @@ end Ping_Spg;
-- Threads --
-------------
thread packet_producer
end packet_producer;
thread implementation packet_producer.i
calls
Mycalls: {
produce : subprogram produce_packet_spg;
};
properties
Dispatch_Protocol => Periodic;
Period => 500 Ms;
Deadline => 500 ms;
Priority => 2;
end packet_producer.i;
thread P
features
Data_Source : out event data port Simple_Type;
......@@ -57,8 +77,6 @@ calls
Mycalls: {
P_Spg : subprogram Do_Ping_Spg;
};
connections
parameter P_Spg.Data_Source -> Data_Source;
properties
Recover_Entrypoint_Source_Text => "recover";
Dispatch_Protocol => Periodic;
......
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