Detailed Description
Data Structures | |
struct | EnmsService |
struct | EnmsIndicationPolicy |
struct | EnmsNode |
Macro Definition Documentation
◆ ENMS_NODE_MAX_SERVICES
#define ENMS_NODE_MAX_SERVICES 10 |
Maximum number of services that can be registered.
◆ ENMS_DEFAULT_PORT
#define ENMS_DEFAULT_PORT UINT16_C(0xf0b1) |
Default UDP port number for the ENMS service.
Enumeration Type Documentation
◆ EnmsNodeResult
enum EnmsNodeResult |
Possible ENMS Node function results.
Function Documentation
◆ ENMS_NODE_Init()
EnmsNodeResult ENMS_NODE_Init | ( | EnmsNode * | enmsNode, |
uint16_t | port, | ||
const uint8_t | hwId[16], | ||
const EnmsIndicationPolicy * | indicationPolicy | ||
) |
Initializes the ENMS Node service.
This function initializes the ENMS Node service. It registers a UDP socket for communication with the ENMS BR service running typically in the border router. It also creates a task that is responsible for periodic sending of ENSM-BASIC-INFO messages.
- Parameters
-
[in] enmsNode ENMS Node service instance [in] port UDP port number over which the service will communicate, provide 0 to use default port value 0xF0B1 [in] hwId hardware identifier [in] indicationPolicy indication policy defining when and how often the indications should be sent (NULL to use default policy)
- Return values
-
ENMS_NODE_RESULT_OK if the service was initialized successfully ENMS_NODE_RESULT_INVALID_INPUT_ARGUMENT if at least one of the input arguments was invalid ENMS_NODE_RESULT_FAILED_TO_REGISTER_UDP_SOCKET if the service failed to register a UDP socket ENMS_NODE_RESULT_FAILED_TO_CREATE_TASK if the service failed to create a task
◆ ENMS_NODE_Deinit()
EnmsNodeResult ENMS_NODE_Deinit | ( | EnmsNode * | enmsNode | ) |
Deinitializes the ENMS Node service
- Parameters
-
[in] enmsNode ENMS Node service instance
- Return values
-
ENMS_NODE_RESULT_OK if the service was deinitialized successfully ENMS_NODE_RESULT_INVALID_INPUT_ARGUMENT if at least one of the input arguments was invalid
◆ ENMS_NODE_Start()
EnmsNodeResult ENMS_NODE_Start | ( | EnmsNode * | enmsNode | ) |
Starts the ENMS Node service.
This function starts the ENMS Node service. It is typically called in reaction to the event that the node has joined a network. It schedules a task that periodically sends ENSM-BASIC-INFO messages.
- Parameters
-
[in] enmsNode ENMS Node service instance
- Return values
-
ENMS_NODE_RESULT_OK if the service was started successfully ENMS_NODE_RESULT_INVALID_INPUT_ARGUMENT if at least one of the input arguments was invalid ENMS_NODE_RESULT_FAILED_TO_RUN_TASK if the service was unable to run a task
◆ ENMS_NODE_Stop()
EnmsNodeResult ENMS_NODE_Stop | ( | EnmsNode * | enmsNode | ) |
Stops the ENMS Node service.
This function stops the ENMS Node service. It is typically called in reaction to the event that the node has left a network. The service can be restarted by a call to ENMS_NODE_Start.
- Parameters
-
[in] enmsNode ENMS Node service instance
- Return values
-
ENMS_NODE_RESULT_OK if the service was stopped successfully ENMS_NODE_RESULT_INVALID_INPUT_ARGUMENT if at least one of the input arguments was invalid
◆ ENMS_NODE_RegisterService()
EnmsNodeResult ENMS_NODE_RegisterService | ( | EnmsNode * | enmsNode, |
const char * | serviceName, | ||
uint8_t | serviceState | ||
) |
Registers a service.
This function is used to tell the ENSM NODE service that other service runs in the node. Each service is described by:
- a name (up to 15 characters + trailing '/0')
- an unsigned integer (8 bit) that denotes the state of the service (0 usually means that the service is not active) Once the service is registered, its state can be changed by a call to ENMS_NODE_SetServiceState
- Return values
-
ENMS_NODE_RESULT_OK if the service was registered ENMS_NODE_RESULT_INVALID_INPUT_ARGUMENT if at least one of the input arguments was invalid ENMS_NODE_RESULT_FAILED_TO_REGISTER_SERVICE if the service was not registered (probably exceeded the number of services that can be handled - see ENMS_NODE_MAX_SERVICES)
◆ ENMS_NODE_SetServiceState()
EnmsNodeResult ENMS_NODE_SetServiceState | ( | EnmsNode * | enmsNode, |
const char * | serviceName, | ||
uint8_t | serviceState | ||
) |
Sets service state.
This function is used to update the state of a service, previously registered by a call to ENMS_NODE_RegisterService.
- Return values
-
ENMS_NODE_RESULT_OK if the service state was updated ENMS_NODE_RESULT_INVALID_INPUT_ARGUMENT if at least one of the input arguments was invalid
Generated on Tue Nov 21 2023 20:54:59 for ENMS embeNET Management Service by 1.9.6