int connectNode(struct _follower *follower, int thing_id)
Connecting with other objects in the boundary around thing_id
follower - A list of other things connected to things
thing_id - Thing number
RETURN - number of connected things
void connectAroundNode()
Run connectNode() on all things
int addNode(struct _follower *follower, struct _follower *around_node)
Add information about the object
follower - List of connected things
around_node - Information of the thing to be connected
RETURN - Successful - 0
struct _follower* newNode()
Generate new connection information
RETURN - new connection information
struct _follower* copyNode(struct _follower *around_node)
Copy the connection information of a things
around_node - About the connection of things to be copied
RETURN - Connection information for copied things
int addClusterNode(struct _cluster_info *cinfo, struct _cluster_info *around_cinfo)
Add cluster leader information to connect
cinfo - Linked leader list
around_cinfo - List of leaders to connect
RETURN - Successful - 0
struct _cluster_info* newClusterNode()
Generate new connection information
RETURN - new connection information
struct _cluster_info* copyClusterNode(struct _cluster_info *cinfo)
Copy the leader's connection information
cinfo - About the connection of things to be copied
RETURN - Connection information for copied things
void initConnectedList(int *connected_list)
Initializing the associated management list
connected_list - management arrangement of connected things
void getConnectedNodesList(struct _follower *follower_list, int *connected_list)
Return to an array of numbers for all things registered in the follower list
follower_list - Information of connected things
void getConnectedClusterList(struct _cluster_info *cinfo, *connected_list)
Return to an array of numbers for all things registered in the cinfo list
cinfo - Information of connected things
int getConnectedRandomNode(struct _follower *follower_list)
Return random thing number connected to the follower list
follower_list - Information of connected things
RETURN - Return random number of connected things
int searchNodeByThingID(struct _follower *follower_list, int thing_id)
Verify that the thing number is in the follower list
follower_list - Information of connected things
thing_id - The thing number to find
RETURN - TRUE(found), FALSE(not found)
int searchNodeBySensorName(struct _follower *follower_list, char *sensor_name)
Search for connected things with specific sensors
follower_list - Information of connected follower list
sensor_name - Sensor name to find
RETURN - Thing number(found), -1(not found)
int searchNodeToExternalClusterBySensorName(struct _cluster_info *cinfo, char *sensor_name)
Search for connected external things with specific sensors
cinfo -Information of connected leader list
sensor_name - Sensor name to find
RETURN - Thing number(found), -1(not found)
int searchNodeToExternalClusterByThingID(struct _cluster_info *cinfo, int thing_id)
Verify that the thing number is in the external cinfo list
cinfo - Information of connected leader list
thing_id - Thing number to find
RETURN - Thing number(found), -1(not found)
void freeConnectedNodes(struct _follower* follower_list)
Free resources about connected things information
follower_list - Connected follower information to free
void freeConnectedLeaderNodes(struct _cluster_info* cinfo)
Free resources about connected things information
cinfo - Connected leader information to free
int printConnectedNodes(struct _follower* follower_list)
Print connected thing information
follower_list - Connected follower information to print
RETURN - number of connected followers
int printConnectedAroundLeaderNodes(struct _cluster_info* cinfo)
Print connected leader information
cinfo - Connected leader information to print
RETURN - number of connected leaders
void printAllConnectedNodes(TCB* tcb)
Print all connected thing information
tcb - Thing information