Commit 7f226dd8 authored by jdelange's avatar jdelange

* src/po_hi_transport.c

   src/po_hi_transport.h
   - Add the __po_hi_transport_get_n_accessed_buses and 
     __po_hi_transport_get_accessed_buses functions

 * include/po_hi_returns.h
   - Add __PO_HI_TOOMANY value



git-svn-id: https://tecsw.estec.esa.int/svn/taste/trunk/po-hi-c@3479 129961e7-ef38-4bb5-a8f7-c9a525a55882
parent 5fd802f7
......@@ -16,6 +16,7 @@
#define __PO_HI_SUCCESS 1
#define __PO_HI_UNAVAILABLE 2
#define __PO_HI_INVALID 5
#define __PO_HI_TOOMANY 6
/* Errors from the API */
#define __PO_HI_ERROR_CREATE_TASK -10
......
......@@ -33,15 +33,40 @@ typedef struct
typedef uint8_t __po_hi_queue_id;
__po_hi_node_t __po_hi_transport_get_node_from_entity (const __po_hi_entity_t entity);
/*
* Returns the node identifier that corresponds to an entity.
/**
* \fn __po_hi_transport_get_n_accessed_buses
*
* \brief Return the number of buses associated with a device.
* If no bus is connected to the device or if the device
* is invalid, the function returns 0. Otherwise, a positive value is
* returned.
*/
uint32_t __po_hi_transport_get_n_accessed_buses (const __po_hi_device_id device);
/**
* \fn __po_hi_transport_get_accessed_buses
*
* \brief Return a pointer to an array that contains all buses identifiers
* accessed by the device passed as argument. If the argument is an invalid
* device-id or if the device does not access any bus, NULL is returned.
* The size of the array can be retrieved by the __po_hi_get_n_accessed_buses
* function.
*/
__po_hi_bus_id* __po_hi_transport_get_accessed_buses (const __po_hi_device_id device);
/**
* \fn __po_hi_get_node_from_entity
*
* \brief Returns the node identifier that corresponds to an entity.
*/
__po_hi_node_t __po_hi_transport_get_node_from_entity (const __po_hi_entity_t entity);
__po_hi_entity_t __po_hi_get_entity_from_global_port (const __po_hi_port_t port);
/*
* Return the entity identifier that own the port in parameters.
* \fn __po_hi_get_entity_from_global_port
*
* \brief Return the entity identifier that own the port in parameters.
*/
__po_hi_entity_t __po_hi_get_entity_from_global_port (const __po_hi_port_t port);
/*
* \fn __po_hi_transport_send_default
......
......@@ -43,6 +43,8 @@ extern __po_hi_port_t __po_hi_devices_to_nodes[__PO_HI_NB_DEVICES];
extern __po_hi_device_id __po_hi_port_to_device[__PO_HI_NB_PORTS];
extern char* __po_hi_devices_naming[__PO_HI_NB_DEVICES];
extern __po_hi_uint32_t* __po_hi_devices_configuration_values[__PO_HI_NB_DEVICES];
extern __po_hi_uint32_t __po_hi_devices_nb_accessed_buses[__PO_HI_NB_DEVICES];
extern __po_hi_bus_id* __po_hi_devices_accessed_buses[__PO_HI_NB_DEVICES];
#endif
#if __PO_HI_NB_PROTOCOLS > 0
......@@ -190,6 +192,26 @@ __po_hi_uint8_t __po_hi_get_endianness (const __po_hi_node_t node)
}
#if __PO_HI_NB_DEVICES > 0
__po_hi_bus_id* __po_hi_transport_get_accessed_buses (const __po_hi_device_id device)
{
if ((device < 0) || (device >= __PO_HI_NB_DEVICES))
{
return NULL;
}
return __po_hi_devices_accessed_buses[device];
}
uint32_t __po_hi_transport_get_n_accessed_buses (const __po_hi_device_id device)
{
if ((device < 0) || (device >= __PO_HI_NB_DEVICES))
{
return 0;
}
return __po_hi_devices_nb_accessed_buses[device];
}
char* __po_hi_get_device_naming (const __po_hi_device_id dev)
{
return __po_hi_devices_naming[dev];
......
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