This page documents the embeNET Border Router C API. The API consists of the following parts:
◆ EMBENET_BR_Init()
Initializes the border router network process.
◆ EMBENET_BR_Deinit()
void EMBENET_BR_Deinit | ( | void | | ) | |
Deinitializes the border router network process.
◆ EMBENET_BR_Proc()
void EMBENET_BR_Proc | ( | void | | ) | |
Runs the border router process.
- Note
- This function MUST be called repeatedly e.g. in loop or as a thread body
◆ EMBENET_BR_StartNetwork()
Starts network operation.
- Parameters
-
[in] | config | network configuration structure (see EMBENET_BR_Config) |
[in] | eventHandlers | an optional set of event handlers that will be called upon specific network-related events |
[in] | timeoutMs | operation timeout [ms]. When non-zero, the communication check with network interfaces will be performed, thus the function will block for at most timeout ms; otherwise the function is non-blocking |
- Returns
- EMBENET_RESULT_OK if the network was started successfully, or appropriate error status
◆ EMBENET_BR_StopNetwork()
void EMBENET_BR_StopNetwork | ( | void | | ) | |
Stops the network operation User will no longer be able to send and/or receive packets from the network. The list of connected nodes and registered multicast groups will be cleared List of join rules will not be cleared
◆ EMBENET_BR_GetOwnUid()
Returns the UID of the node physically connected to the Border Router.
- Returns
- UID of this node or invalid value if the associated node is not initialized
◆ EMBENET_BR_GetNetworkPrefix()
Gets the IPv6 Network Prefix (First 8 Bytes)
- Returns
- Network prefix
◆ EMBENET_BR_AddJoinRule()
Adds a constrained join rule, governing the joining process of remote nodes. See EMBENET_BR_JoinRule for more information on how joining rules work.
- Parameters
-
[in] | rule | pointer to a structure describing the rule to be added. The rule's storage duration may be automatic, as its content will be copied to internal storage |
- Returns
- EMBENET_RESULT_OK if the rule was successfully added
- EMBENET_RESULT_JOIN_RULE_REGISTER_FULL when there is no more space to store the rule
- EMBENET_RESULT_JOIN_RULE_ALREADY_EXISTS when the rule is already present
- EMBENET_RESULT_INVALID_ARGUMENT when nullptr was passed
◆ EMBENET_BR_RemoveJoinRule()
Removes a constrained join rule from the list of rules. See EMBENET_BR_JoinRule for more information on joining rules.
- Parameters
-
[in] | rule | to a structure describing the rule to be removed. The rule's storage duration may be automatic |
- Returns
- EMBENET_RESULT_OK if the rule was successfully removed
- EMBENET_RESULT_JOIN_RULE_NOT_FOUND when given rule was not found
- EMBENET_RESULT_INVALID_ARGUMENT when nullptr was passed
◆ EMBENET_BR_GetJoinRulesCount()
size_t EMBENET_BR_GetJoinRulesCount | ( | void | | ) | |
Gets the number of constrained join rules currently added to the list of rules. See EMBENET_BR_JoinRule for more information on joining rules.
- Returns
- number of rules currently on the rule list
◆ EMBENET_BR_GetJoinRuleByIndex()
Gets the join rule from the list under a given index. See Join rules management for more information on joining rules.
- Parameters
-
[in] | index | zero-based rule list index |
- Returns
- pointer to a structure describing the joining rule under given index or NULL if there is no rule under given index
◆ EMBENET_BR_GetJoinedNodesCount()
size_t EMBENET_BR_GetJoinedNodesCount | ( | void | | ) | |
Gets the total number of network nodes (remote devices) joined to this instance of border router.
- Returns
- number of network nodes joined to this border router
◆ EMBENET_BR_GetJoinedNodeUidByIndex()
Gets the descriptor of the joined node by index.
- Parameters
-
◆ EMBENET_BR_IsNodeJoined()
Checks if the node is joined or not.
- Parameters
-
[in] | uid | Unique Identifier of node to check |
- Returns
- true when node is connected; false otherwise
◆ EMBENET_BR_GetGroupCount()
size_t EMBENET_BR_GetGroupCount | ( | void | | ) | |
Gets the number of multicast groups currently registered in the network
- Returns
- number of Multicast groups currently registered in the network
◆ EMBENET_BR_GetGroupIdByIndex()
◆ EMBENET_BR_GetGroupCountForNode()
Returns amount of multicast groups joined by the node with given UID.
- Parameters
-
[in] | uid | UID of the node to check |
- Returns
- number of joined multicast groups
◆ EMBENET_BR_GetGroupIdForNodeByIndex()
Returns Mutlicast Group ID at given index from UID joined group list The maximum allowed index can be retrieved by calling EMBENET_BR_GetJoinedNodeMulticastGroupCount.
- Parameters
-
[in] | uid | UID of the node |
[in] | index | index of Group ID to get |
- Returns
- GID