Skip to content

Device Discovery Agent

ARIbemoss edited this page May 11, 2017 · 1 revision

[Back to BEMOSS OS & Framework Layer]

Device Discovery Agent thread path of execution

discoveryagent201.jpg

Fig.1 Agent thread path of execution

Device Discovery Behavior

discoveragent202.jpg

The discovery cycle starts by assigning a DB_updated variable a value of zero. This variable acts as a flag to determine at the end of the cycle if any update has been made in the bemossdb database during the discovery cycle. The discovery agent starts with the list of supported device types and follows discovery process for each device type.

For each device type, the discovery agent detects the presence of devices of the same type by following its broadcast and detection procedure. Once the devices of the same type have been detected, the agent queries each of them for their MAC address or UUID, if it has not already been received with the detection method. Now, the agent can check if the detected MAC address or a UUID exists in the database or not. If a MAC address exists in the database, it means the device was previously discovered.

If the detected device’s MAC address/UUID does not exist in the database, then it means it is a newly discovered device. For such a device, the agent queries the device for device model information. It then looks up the list of supported devices to see if the device is supported and API is available. Then, it creates a unique ID for the device (containing device type and MAC address) and queries the device for initial data. Finally, the agent creates a new entry in the database with this unique ID and fills up both device_info and current_status tables for the device. The discovery agent also creates a control agent with the API of the device.


[Back to BEMOSS OS & Framework Layer]

Clone this wiki locally