Commit a3de00b7 authored by julien.delange's avatar julien.delange

* define sender function for device drivers



git-svn-id: https://tecsw.estec.esa.int/svn/taste/trunk/po-hi-c@559 129961e7-ef38-4bb5-a8f7-c9a525a55882
parent 77b4cec8
......@@ -17,6 +17,8 @@ void __po_hi_c_driver_serial_linux_poller (void);
void __po_hi_c_driver_serial_linux_init (void);
int __po_hi_c_driver_serial_linux_sender (__po_hi_task_id task, __po_hi_port_t port);
#endif
#endif
......
......@@ -17,6 +17,8 @@ void __po_hi_c_driver_serial_rasta_poller (void);
void __po_hi_c_driver_serial_rasta_init (void);
int __po_hi_c_driver_serial_rasta_sender (const __po_hi_task_id task_id, const __po_hi_port_t port);
#endif
#endif
......
......@@ -167,6 +167,7 @@ endif
clean: target-clean
@-rm -f *~ *.o *.al temp.* *.metrix $(BINARY) $(BINARY).bin $(BINARY).bt $(BINARY).num $(BINARY).nxe
@-rm -rf drivers
if test ! "$(CLEANDIRS)" = ""; then \
rm -rf $(CLEANDIRS); \
fi
......@@ -8,7 +8,7 @@
#include <drivers/po_hi_driver_linux_serial.h>
#ifdef __PO_HI_NEED_SERIAL_LINUX
#ifdef __PO_HI_NEED_DRIVER_SERIAL_LINUX
#include <stdio.h>
......@@ -20,7 +20,12 @@ void __po_hi_c_driver_serial_linux_poller (void)
void __po_hi_c_driver_serial_linux_init (void)
{
printf ("Hello, i'm the serial driver, i'm initializing the whole thing\n");
printf ("Hello, i'm the serial driver, i'm initializing the whole thing\n");
}
int __po_hi_c_driver_serial_linux_sender (__po_hi_task_id task, __po_hi_port_t port)
{
return 1;
}
#endif
......
......@@ -8,7 +8,7 @@
#include <drivers/po_hi_driver_rasta_serial.h>
#ifdef __PO_HI_NEED_SERIAL_RASTA
#ifdef __PO_HI_NEED_DRIVER_SERIAL_RASTA
void __po_hi_c_driver_serial_rasta_poller (void)
{
......@@ -18,5 +18,10 @@ void __po_hi_c_driver_serial_rasta_init (void)
{
}
int __po_hi_c_driver_serial_rasta_sender (const __po_hi_task_id task_id, const __po_hi_port_t port)
{
return 1;
}
#endif
......@@ -256,7 +256,7 @@ int __po_hi_driver_sockets_send (__po_hi_entity_t from,
if (nodes[node].socket == -1 )
{
#ifdef __PO_HI_DEBUG
__DEBUGMSG ("... failure ...\n");
__DEBUGMSG (" [... failure ...]\n");
#endif
return __PO_HI_ERROR_TRANSPORT_SEND;
}
......@@ -274,7 +274,7 @@ int __po_hi_driver_sockets_send (__po_hi_entity_t from,
if (getsockopt (nodes[node].socket, SOL_SOCKET, SO_ERROR, &optval, &optlen) == -1)
{
__DEBUGMSG ("Error %s, %d\n", __FILE__, __LINE__);
__DEBUGMSG (" [error getsockopt() in file %s, line%d ]\n", __FILE__, __LINE__);
close (nodes[node].socket);
nodes[node].socket = -1;
return __PO_HI_ERROR_TRANSPORT_SEND;
......@@ -282,7 +282,7 @@ int __po_hi_driver_sockets_send (__po_hi_entity_t from,
if (optval != 0)
{
__DEBUGMSG ("Error %s, %d", __FILE__, __LINE__);
__DEBUGMSG (" [error getsockopt() return code in file %s, line%d ]\n", __FILE__, __LINE__);
close (nodes[node].socket);
nodes[node].socket = -1;
return __PO_HI_ERROR_TRANSPORT_SEND;
......@@ -292,7 +292,7 @@ int __po_hi_driver_sockets_send (__po_hi_entity_t from,
if (signal (SIGPIPE, SIG_IGN) == SIG_ERR)
{
__DEBUGMSG ("Error %s, %d", __FILE__, __LINE__);
__DEBUGMSG (" [error signal() return code in file %s, line%d ]\n", __FILE__, __LINE__);
close (nodes[node].socket);
nodes[node].socket = -1;
return __PO_HI_ERROR_TRANSPORT_SEND;
......@@ -306,13 +306,13 @@ int __po_hi_driver_sockets_send (__po_hi_entity_t from,
if (len != size_to_write)
{
__DEBUGMSG ("Error %s, %d", __FILE__, __LINE__);
__DEBUGMSG (" [error write() length in file %s, line%d ]\n", __FILE__, __LINE__);
close (nodes[node].socket);
nodes[node].socket = -1;
return __PO_HI_ERROR_TRANSPORT_SEND;
}
__DEBUGMSG (" ... success ... \n");
__DEBUGMSG (" [SUCCESS]\n");
return __PO_HI_SUCCESS;
}
......
......@@ -20,7 +20,6 @@
#include <deployment.h>
#include <activity.h>
#include <request.h>
#include <marshallers.h>
/* Headers from the generated code */
#include <string.h>
......
......@@ -47,7 +47,7 @@ int __po_hi_transport_send_default (__po_hi_task_id id, __po_hi_port_t port)
__po_hi_uint8_t i;
__po_hi_local_port_t local_port;
#if __PO_HI_NB_NODES > 1
#if defined (__PO_HI_NEED_DRIVER_SOCKETS) && (__PO_HI_NB_NODES > 1)
int error;
#endif
......@@ -72,7 +72,7 @@ int __po_hi_transport_send_default (__po_hi_task_id id, __po_hi_port_t port)
for (i=0;i<ndest;i++)
{
#ifdef __PO_HI_DEBUG
__DEBUGMSG ("\t%d (entity=%d)\n",
__DEBUGMSG ("\t%d (entity=%d)",
destinations[i],
__po_hi_port_global_to_entity[destinations[i]]);
#endif
......@@ -83,13 +83,13 @@ int __po_hi_transport_send_default (__po_hi_task_id id, __po_hi_port_t port)
if (__po_hi_transport_get_node_from_entity (__po_hi_get_entity_from_global_port (port)) ==
__po_hi_transport_get_node_from_entity (__po_hi_get_entity_from_global_port (destinations[i])))
{
__DEBUGMSG ("[deliver locally]");
__DEBUGMSG (" [deliver locally]\n");
__po_hi_main_deliver (request);
}
#if defined (__PO_HI_NEED_DRIVER_SOCKETS) && (__PO_HI_NB_NODES > 1)
else
{
__DEBUGMSG ("[deliver using network sockets]");
__DEBUGMSG (" [deliver using network sockets]");
__po_hi_marshall_request (request, &msg);
error =__po_hi_driver_sockets_send (__po_hi_port_global_to_entity[port],
......
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