This page documents the embeNET Border Router C API. The API consists of the following parts:
Border router process control | |
---|---|
EMBENET_BR_Init | Initializes the border router network process. |
EMBENET_BR_Deinit | Deinitializes the border router network process. |
EMBENET_BR_Proc | Advances (runs) the border router network process. |
Network management | |
---|---|
EMBENET_BR_StartNetwork | Starts the network. |
EMBENET_BR_StopNetwork | Stops the network. |
EMBENET_BR_GetOwnUid | Gets own UID. |
EMBENET_BR_GetNetworkPrefix | Gets the network prefix. |
Join rules management | |
---|---|
EMBENET_BR_AddJoinRule | Adds a join rule. |
EMBENET_BR_RemoveJoinRule | Removes the join rule. |
EMBENET_BR_GetJoinRulesCount | Gets the number of rules defined. |
EMBENET_BR_GetJoinRuleByIndex | Gets a rule based on its index. |
List of joined devices | |
---|---|
EMBENET_BR_GetJoinedNodesCount | Gets the number of joined nodes. |
EMBENET_BR_GetJoinedNodeUidByIndex | Gets the UID of the joined node by its index. |
EMBENET_BR_IsNodeJoined | Checks if a given node is joined. |
List of groups | |
---|---|
EMBENET_BR_GetGroupCount | Gets the number of groups in the network. |
EMBENET_BR_GetGroupIdByIndex | Gets the groupId based on the index. |
EMBENET_BR_GetGroupCountForNode | Gets the number of groups joined by the node. |
EMBENET_BR_GetGroupIdForNodeByIndex | Gets the groupId of a group joined by the node by the index. |
Data Structures | |
struct | EMBENET_BR_Config |
Stores Border Router configuration needed to start the network. More... | |
struct | EMBENET_BR_JoinRule |
Single rule that governs the constrained join process. More... | |
EMBENET_Result EMBENET_BR_Init | ( | void | ) |
Initializes the border router network process.
void EMBENET_BR_Deinit | ( | void | ) |
Deinitializes the border router network process.
void EMBENET_BR_Proc | ( | void | ) |
Runs the border router process.
EMBENET_Result EMBENET_BR_StartNetwork | ( | EMBENET_BR_Config const * | config, |
EMBENET_BR_EventHandlers const * | eventHandlers, | ||
unsigned | timeoutMs | ||
) |
Starts network operation.
[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 |
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_EUI64 EMBENET_BR_GetOwnUid | ( | void | ) |
Returns the UID of the node physically connected to the Border Router.
EMBENET_NetworkPrefix EMBENET_BR_GetNetworkPrefix | ( | void | ) |
Gets the IPv6 Network Prefix (First 8 Bytes)
EMBENET_Result EMBENET_BR_AddJoinRule | ( | EMBENET_BR_JoinRule * | rule | ) |
Adds a constrained join rule, governing the joining process of remote nodes. See EMBENET_BR_JoinRule for more information on how joining rules work.
[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 |
EMBENET_Result EMBENET_BR_RemoveJoinRule | ( | EMBENET_BR_JoinRule * | rule | ) |
Removes a constrained join rule from the list of rules. See EMBENET_BR_JoinRule for more information on joining rules.
[in] | rule | to a structure describing the rule to be removed. The rule's storage duration may be automatic |
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.
const EMBENET_BR_JoinRule * EMBENET_BR_GetJoinRuleByIndex | ( | size_t | index | ) |
Gets the join rule from the list under a given index. See Join rules management for more information on joining rules.
[in] | index | zero-based rule list index |
size_t EMBENET_BR_GetJoinedNodesCount | ( | void | ) |
Gets the total number of network nodes (remote devices) joined to this instance of border router.
EMBENET_EUI64 EMBENET_BR_GetJoinedNodeUidByIndex | ( | size_t | index | ) |
Gets the descriptor of the joined node by index.
[in] | index | zero-based |
bool EMBENET_BR_IsNodeJoined | ( | EMBENET_EUI64 | uid | ) |
Checks if the node is joined or not.
[in] | uid | Unique Identifier of node to check |
size_t EMBENET_BR_GetGroupCount | ( | void | ) |
Gets the number of multicast groups currently registered in the network
EMBENET_GroupId EMBENET_BR_GetGroupIdByIndex | ( | size_t | index | ) |
Gets the Multicast Group Identifier by index Last index shall be computed as EMBENET_BR_GetGroupCount() - 1
size_t EMBENET_BR_GetGroupCountForNode | ( | EMBENET_EUI64 | uid | ) |
Returns amount of multicast groups joined by the node with given UID.
[in] | uid | UID of the node to check |
EMBENET_GroupId EMBENET_BR_GetGroupIdForNodeByIndex | ( | EMBENET_EUI64 | uid, |
size_t | index | ||
) |
Returns Mutlicast Group ID at given index from UID joined group list The maximum allowed index can be retrieved by calling EMBENET_BR_GetJoinedNodeMulticastGroupCount.
[in] | uid | UID of the node |
[in] | index | index of Group ID to get |
Any question or remarks? Just write us a message!
Feel free to get in touch