Class ControlCenter


  • public class ControlCenter
    extends BaseComponent
    central control module
    Version:
    1.0.0
    Author:
    wmy
    • Constructor Detail

      • ControlCenter

        public ControlCenter()
    • Method Detail

      • setStateCallback

        public void setStateCallback​(ControlCenterStateCallback callback)
        Instance of implementing the event callback interface of the central control module
        Parameters:
        callback - Central control module event callback interface instance
      • onThingPost

        public void onThingPost​(ThingLevel level,
                                int code,
                                int alarm,
                                java.lang.String fileName)
        Called back when event report is received

        Callbacks from the SDK itself

        Parameters:
        level - Reported event level
        code - Reported event code
        alarm - The code of the "alarm" in "params"
        fileName - The value of the "file_name" in "params"
      • onOperateReply

        public void onOperateReply​(ServiceCode code,
                                   ServiceResult result)
        Called back when feedback is received from the service

        Callbacks from the SDK itself

        Parameters:
        code - Device Service Code
        result - Feedback result of service delivery
      • onGetConfigVersionInfoReply

        public void onGetConfigVersionInfoReply​(int version,
                                                int paramNum)
        Called back when receiving feedback on a configuration parameter version information access request

        Callbacks from the SDK itself

        Parameters:
        version - Parameter configuration version
        paramNum - Number of configurable parameters
      • onGetConfigReply

        public void onGetConfigReply​(ServiceResult result,
                                     ConfigParameter paramIndex,
                                     int value)
        Called back when receiving feedback on a configuration parameter access request

        Callbacks from the SDK itself

        Parameters:
        result - Feedback result of service delivery
        paramIndex - Parameter Sequence Number
        value - Parameter value
      • onSetConfigReply

        public void onSetConfigReply​(ServiceResult result,
                                     ConfigParameter paramIndex,
                                     ConfigFailReason reason)
        Called back when receiving feedback on configuration parameter settings

        Callbacks from the SDK itself

        Parameters:
        result - Feedback result of service delivery
        paramIndex - Parameter Sequence Number
        reason - Reasons for failure to set configuration parameters
      • resetSystem

        public void resetSystem()
        System Reset
      • OneClickFlightPreparation

        public void OneClickFlightPreparation()
        One-click flight preparation.
      • OneClickFlightPreparationStop

        public void OneClickFlightPreparationStop()
        Stop one-click flight preparation.
      • OneClickCharging

        public void OneClickCharging()
        One-click charging.
      • OneClickChargingStop

        public void OneClickChargingStop()
        Stop one-click charging.
      • OneClickChargingEnforcedly

        public void OneClickChargingEnforcedly()
        One-click charging enforcedly.
      • sendAnAlert

        public void sendAnAlert​(ServiceCode serviceCode)
        Send an alert to the alerter.
        Parameters:
        serviceCode - Device Service Code
      • getConfigVersionInfo

        public void getConfigVersionInfo()
        Get parameter version information
      • getConfigParameter

        public void getConfigParameter​(ConfigParameter parameter)
        Get configuration parameter values
        Parameters:
        parameter - Parameter Sequence Number
      • setConfigParameter

        public void setConfigParameter​(ConfigParameter parameter,
                                       int value)
        Set parameter values
        Parameters:
        parameter - Parameter Sequence Number
        value - Parameter value
      • getThing

        public Thing getThing()
        Get the entity of the latest received thing.
        Returns:
        the latest received thing