In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-08 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly explains "the development of ServerSuperIO service interface and the method of two-way interaction with the cloud". The content of the article is simple and clear, and it is easy to learn and understand. please follow the editor's train of thought to study and learn "the development of ServerSuperIO service interface and the method of two-way interaction with the cloud".
twelve。 Development of service interfaces and two-way interaction with the cloud
12.1 Overview
Service interface IService is a special application scenario in addition to the device driver interface IRunDevice, such as SMS alarm, LED output, analog acquisition, OPC server / client, data cascade forwarding, and other special applications. It is based on the powerful extension of the device driver interface IRunDevice, which makes the function of the framework more rich and powerful.
This article focuses on data forwarding and control services, and other service developers are similar. If the development based on ServerSuperIO service interface has the ability of data forwarding and control, then it will have the ability of unlimited cascade transmission and control of data in the construction of the Internet of things, and a set of framework will be used to form a set of solutions. The schematic diagram is as follows:
12.2 equipment linker
The IRunDevice device driver interface inherits the IServiceConnectorDevice interface of the service, and the device driver implements the RunServiceConnector interface function, which represents that the data information passed from the service instance can be received or run. The code is defined as follows:
+ View Code
12.3 Service Linker
The IService interface inherits from the IServiceConnector service linker and represents that the service has two major functions: 1. Send commands or information to the device driver. 2. Receive the result of the device driver processing the command or information. The code is as follows:
+ View Code
12.4 scenario hypothesis
The device driver collects the data information of the sensor in real time, then transmits the data information to the service instance UpdateDevice interface function through the OnDeviceObjectChanged event interface, and then carries on the data cache. Open the service thread, connect to the cloud service and upload the sensor data information regularly. The cloud service issues the control instruction command:control:1, and then the device driver sends the command to the sensor, and finally returns the result to the service instance.
12.5 device driver development and matters needing attention
1. Pass data information to the service instance through the OnDeviceObjectChanged event. The code is as follows:
+ View Code
two。 Receive commands and information passed by the service instance. The code is as follows:
+ View Code
12.6 Service instance development and matters needing attention
The main functions of service instances are to cache data, connect cloud services and send data regularly, receive cloud command information and transmit it to device drivers, and receive the results of driver execution command information.
Cache data, the code is as follows:
+ View Code
two。 Connect to the cloud service and send data regularly. The code is as follows:
+ View Code
3. Receive the cloud command information and pass it to the device driver
+ View Code
4. Receive the result of the driver execution command information
+ View Code
12.7 considerations for host program service instance configuration
+ View Code
12.8 running effect
1. Picture
Thank you for reading, the above is the content of "the development of ServerSuperIO service interface and the method of two-way interaction with the cloud". After the study of this article, I believe you have a deeper understanding of the development of ServerSuperIO service interface and the method of two-way interaction with the cloud, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.