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

* remove transport_dummy, not useful

 * begin to separate sockets interface with the transport layer
 


git-svn-id: https://tecsw.estec.esa.int/svn/taste/trunk/po-hi-c@513 129961e7-ef38-4bb5-a8f7-c9a525a55882
parent 375c3735
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
/* Success return code */ /* Success return code */
#define __PO_HI_SUCCESS 1 #define __PO_HI_SUCCESS 1
#define __PO_HI_UNAVAILABLE 2
/* Errors from the API */ /* Errors from the API */
#define __PO_HI_ERROR_CREATE_TASK -10 #define __PO_HI_ERROR_CREATE_TASK -10
......
AUTOMAKE_OPTIONS = no-dependencies AUTOMAKE_OPTIONS = no-dependencies
C_FILES = $(srcdir)/po_hi_task.c $(srcdir)/po_hi_main.c \ C_FILES = $(srcdir)/po_hi_task.c \
$(srcdir)/po_hi_marshallers.c $(srcdir)/po_hi_messages.c \ $(srcdir)/po_hi_main.c \
$(srcdir)/po_hi_gqueue.c $(srcdir)/po_hi_giop.c \ $(srcdir)/po_hi_marshallers.c \
$(srcdir)/po_hi_protected.c $(srcdir)/po_hi_protocols.c \ $(srcdir)/po_hi_messages.c \
$(srcdir)/po_hi_transport.c $(srcdir)/po_hi_transport_dummy.c \ $(srcdir)/po_hi_gqueue.c \
$(srcdir)/po_hi_transport_sockets.c $(srcdir)/po_hi_types.c \ $(srcdir)/po_hi_giop.c \
$(srcdir)/po_hi_utils.c $(srcdir)/po_hi_simulink.c \ $(srcdir)/po_hi_protected.c \
$(srcdir)/po_hi_time.c $(srcdir)/po_hi_protocols.c \
$(srcdir)/po_hi_transport.c \
$(srcdir)/po_hi_transport_dummy.c \
$(srcdir)/po_hi_transport_sockets.c \
$(srcdir)/po_hi_types.c \
$(srcdir)/po_hi_utils.c \
$(srcdir)/po_hi_simulink.c \
$(srcdir)/po_hi_time.c
csrc = ${shell $(CYGPATH_U) '$(OCARINA_RUNTIME)/polyorb-hi-c/src'} csrc = ${shell $(CYGPATH_U) '$(OCARINA_RUNTIME)/polyorb-hi-c/src'}
......
...@@ -170,7 +170,7 @@ int __po_hi_giop_send (__po_hi_entity_t from, ...@@ -170,7 +170,7 @@ int __po_hi_giop_send (__po_hi_entity_t from,
__po_hi_giop_print_msg(&smsg); __po_hi_giop_print_msg(&smsg);
#endif #endif
return __po_hi_transport_low_level_send (from, to, &smsg); return __po_hi_sockets_send (from, to, &smsg);
} }
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
#include <po_hi_task.h> #include <po_hi_task.h>
#include <po_hi_protected.h> #include <po_hi_protected.h>
#if __PO_HI_NB_NODES > 1 #if __PO_HI_NB_PORTS > 1
#include <po_hi_transport.h> #include <po_hi_transport.h>
#include <po_hi_transport_sockets.h> #include <po_hi_transport_sockets.h>
#endif #endif
...@@ -45,7 +45,7 @@ int __po_hi_initialize () ...@@ -45,7 +45,7 @@ int __po_hi_initialize ()
*/ */
nb_tasks_to_init = __PO_HI_NB_TASKS + 1; nb_tasks_to_init = __PO_HI_NB_TASKS + 1;
#if __PO_HI_NB_NODES > 1 #if __PO_HI_NB_PORTS > 1
if (__PO_HI_TRANSPORT_SOCKET_NEED_RECEIVER_TASK ()) if (__PO_HI_TRANSPORT_SOCKET_NEED_RECEIVER_TASK ())
{ {
nb_tasks_to_init++; nb_tasks_to_init++;
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
#include <po_hi_types.h> #include <po_hi_types.h>
#include <po_hi_debug.h> #include <po_hi_debug.h>
#include <po_hi_transport.h> #include <po_hi_transport.h>
#include <po_hi_transport_sockets.h>
#include <po_hi_giop.h> #include <po_hi_giop.h>
#include <po_hi_messages.h> #include <po_hi_messages.h>
#include <po_hi_returns.h> #include <po_hi_returns.h>
...@@ -31,7 +32,7 @@ entity_table[__PO_HI_NB_ENTITIES]; ...@@ -31,7 +32,7 @@ entity_table[__PO_HI_NB_ENTITIES];
void __po_hi_initialize_transport () void __po_hi_initialize_transport ()
{ {
#if __PO_HI_NB_NODES > 1 #if __PO_HI_NB_NODES > 1
__po_hi_initialize_transport_low_level (); __po_hi_sockets_initialize ();
#endif #endif
} }
...@@ -47,12 +48,15 @@ int __po_hi_transport_send (__po_hi_entity_t from, ...@@ -47,12 +48,15 @@ int __po_hi_transport_send (__po_hi_entity_t from,
__po_hi_main_deliver(msg); __po_hi_main_deliver(msg);
return __PO_HI_SUCCESS; return __PO_HI_SUCCESS;
} }
#if __PO_HI_NB_NODES > 1
else else
{ {
#ifdef __PO_HI_USE_GIOP #ifdef __PO_HI_USE_GIOP
return __po_hi_giop_send (from, to, msg); return __po_hi_giop_send (from, to, msg);
#else #else
return __po_hi_transport_low_level_send (from, to, msg); return __po_hi_sockets_send (from, to, msg);
#endif #endif
} }
#endif
return __PO_HI_UNAVAILABLE;
} }
/*
* This is a part of PolyORB-HI-C distribution, a minimal
* middleware written for generated code from AADL models.
* You should use it with the Ocarina toolsuite.
*
* For more informations, please visit http://ocarina.enst.fr
*
* Copyright (C) 2009, GET-Telecom Paris.
*/
#include <po_hi_returns.h>
#include <deployment.h>
#include <activity.h>
/*
* This files provides a dummy implementation of low level transport,
* for nodes that do not require transport.
*/
void __po_hi_initialize_transport_low_level ()
{
}
int __po_hi_transport_low_level_send (__po_hi_entity_t from,
__po_hi_entity_t to,
__po_hi_msg_t* msg)
{
return __PO_HI_SUCCESS;
}
...@@ -73,8 +73,6 @@ int __po_hi_queue_put (__po_hi_queue_id queue_id, ...@@ -73,8 +73,6 @@ int __po_hi_queue_put (__po_hi_queue_id queue_id,
__po_hi_msg_t* msg); __po_hi_msg_t* msg);
void* __po_hi_receiver_task (void);
typedef struct typedef struct
{ {
int socket; int socket;
...@@ -91,7 +89,7 @@ typedef struct ...@@ -91,7 +89,7 @@ typedef struct
__po_hi_inetnode_t nodes[__PO_HI_NB_NODES]; __po_hi_inetnode_t nodes[__PO_HI_NB_NODES];
__po_hi_inetnode_t rnodes[__PO_HI_NB_NODES]; __po_hi_inetnode_t rnodes[__PO_HI_NB_NODES];
void __po_hi_initialize_transport_low_level () void __po_hi_sockets_initialize (void)
{ {
int i; int i;
int ret; int ret;
...@@ -154,7 +152,7 @@ void __po_hi_initialize_transport_low_level () ...@@ -154,7 +152,7 @@ void __po_hi_initialize_transport_low_level ()
*/ */
__po_hi_create_generic_task __po_hi_create_generic_task
(-1, 0,__PO_HI_MAX_PRIORITY, 0, __po_hi_receiver_task); (-1, 0,__PO_HI_MAX_PRIORITY, 0, __po_hi_sockets_receiver_task);
} }
...@@ -244,7 +242,7 @@ void __po_hi_initialize_transport_low_level () ...@@ -244,7 +242,7 @@ void __po_hi_initialize_transport_low_level ()
} }
} }
int __po_hi_transport_low_level_send (__po_hi_entity_t from, int __po_hi_sockets_send (__po_hi_entity_t from,
__po_hi_entity_t to, __po_hi_entity_t to,
__po_hi_msg_t* msg) __po_hi_msg_t* msg)
{ {
...@@ -321,7 +319,7 @@ int __po_hi_transport_low_level_send (__po_hi_entity_t from, ...@@ -321,7 +319,7 @@ int __po_hi_transport_low_level_send (__po_hi_entity_t from,
} }
void* __po_hi_receiver_task (void) void* __po_hi_sockets_receiver_task (void)
{ {
socklen_t socklen = sizeof (struct sockaddr); socklen_t socklen = sizeof (struct sockaddr);
/* See ACCEPT (2) for details on initial value of socklen */ /* See ACCEPT (2) for details on initial value of socklen */
......
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