Logo
UNICENS V2.1.0-3491
User Manual and API Reference
Ucs_Return_t Ucs_Rm_SetNodeAvailable ( Ucs_Inst_t self,
Ucs_Rm_Node_t node_ptr,
bool  available 
)

Sets the availability attribute (available or not available) of the given node and triggers the routing process to handle attached route(s).

In case of available the function starts the routing process that checks whether there are endpoints to build on this node. In case of unavailable the function informs sub modules like XRM to check whether there are resources to release and simultaneously unlock suspended routes that link to this node.

Parameters
selfThe UNICENS instance
node_ptrReference to the node to be looked for.
availableSpecifies whether the node is available or not
Returns
Possible return values are shown in the table below.
Value Description
UCS_RET_SUCCESS No error
UCS_RET_ERR_ALREADY_SET Node is already set to "available" or "not available"
UCS_RET_ERR_PARAM At least one parameter is NULL.
UCS_RET_ERR_NOT_INITIALIZED UNICENS is not initialized
UCS_RET_ERR_NOT_AVAILABLE The function cannot be processed because the network is not available
Note
All nodes present in the routing system will be automatically set to Unavailable after the network has been shutdown respectively after transition from Available to Not available. This in turn means that the user has to set the corresponding nodes to Available after network started up respectively after the network transition from NotAvailable to Available.



Example

// Sets the amplifier node to "available" or "not available"
static void App_SetAmplNodeAvailability(bool available)
{
Ucs_Return_t ret_value;
ret_value = Ucs_Rm_SetNodeAvailable(ucs_inst_ptr, &ampl_node, available);
if (ret_value != UCS_RET_SUCCESS)
{
// Do whatever is necessary here
}
}
// Main function
void main(uint8_t argc, char *argv[])
{
// ...
if (amplifier_programming_completed)
{
App_SetAmplNodeAvailability(true);
}
// ...
if (amplifier_is_unavailable)
{
App_SetAmplNodeAvailability(false);
}
}