WISE-Agent Sample Handler
Contents
Introduction
In WISE Agent, we implement several Software Modules to access sensor data or control target device, we called Plugins (or Handlers we called before).
Each plugin is designed to handle specific jobs, such as:
- Sensor Plugin: the plugin access sensor data through Sensor driver or 3rd party library, or
- Remote Control Plugin: the plugin execute remote command on target device.
To support customized plugins, we also defined a set of APIs, called Plugin (Handler) APIs.
User can implement their own Handler with these Plugin (Handler) APIs to access their sensor data or control their devices and plugged by WISE Agent to communicate with RMM Server.
Architecture
In Plugin (Handler) Architecture, the Plugin (Handler) APIs is the skin of Plugin. The WISE Agent Handler loader will link the pre-defined APIs dynamically.
The Handler Kernel Library is the bone of the Plugin. This library will handle most of the functions in a Plugin, Such as: Gat Capability, Auto Report Start/Stop, Get/Set Sensor Data and basic Threshold Rule support.
The Message Structure is the main structure to describe the sensor data and interact between Handler Kernel and Custom Data Access. In Handler Kernel, the library will generate the handshake message based on the Message Structure.
The Message Generator library provides several APIs to describe the custom sensor data in a Message Structure.
In the Custom Data Access block, user needs to implement the function to access data from 3rd party library or drivers in platform. And update the sensor data in Message Structure to report those data to the RMM Server through Handler Kernel.
Plugin (Handler) APIs
int Handler_Initialize( HANDLER_INFO *handler );
Description
- This function initializes any objects or variables of this handler
Parameters
- handler [POINTER]
- the structure to exchange the handler information between WISE Agent and Handler.
Return Values
- handler_success
- handler_fail
int Handler_Get_Status( HANDLER_THREAD_STATUS * pOutStatus );
Description
- This function will retrieve Handler Threads Status. Agent will restart current Handler or restart Agent self if busy.
Parameters
- pOutStatus [POINTER]
- the return status of handerl, the enumerate:
- handler_status_no_init = -1,
- handler_status_init,
- handler_status_start,
- handler_status_stop,
- handler_status_busy
- the return status of handerl, the enumerate:
Return Values
- handler_success
- handler_fail