Logo
UNICENS V2.1.0-3491
User Manual and API Reference
typedef Ucs_Nd_CheckResult_t(* Ucs_Nd_EvalCb_t)(Ucs_Signature_t *signature, void *user_ptr)

Function signature of node evaluation callback used by Node Discovery service.

The Node Discovery service announces the signature of each node it has found to the application via the evaluation function. In this function the application decides how the Node Discovery service shall proceed with the node. The application maintains two lists:

set_list

Contains the signatures of the nodes the system shall contain

device_list
Contains the signatures of the nodes detected in the system

The evaluation has to follow these rules:

  • If the node is not part of the set_list, it is regarded as unknown (UCS_ND_CHK_UNKNOWN) and will be ignored.
  • If the node is part of the set_list and is not yet in the device_list, the Node Discovery Service shall try to add the node to network (UCS_ND_CHK_WELCOME).
  • If the node is already part of the device_list, there are two possibilities: the node in the device_list experienced a reset or there are two nodes with the same signature. Evaluation result is UCS_ND_CHK_UNIQUE. The Node Discovery service will perform further tests.
Parameters
signatureSignature of the respective node
user_ptrUser reference provided in Ucs_InitData_t::user_ptr
Returns
UCS_ND_CHK_WELCOME Node is ok, try to add it to the network.
UCS_ND_CHK_UNIQUE Test if this node is unique.
UCS_ND_CHK_UNKNOWN Node is unknown, no further action.