Package 

Interface IThingGateway


  • 
    public interface IThingGateway
    
                        

    The gateway class encapsulates the related operations of the Zigbee gateway, including controlling, querying sub-devices, and monitoring the status of the sub-devices.

    • Method Detail

      • publishDps

         abstract void publishDps(String nodeId, String dps, IResultCallback callback)

        Publish commands to a single sub-device.

        Parameters:
        nodeId - Sub-device nodeId, nodeId field in sub-device's DeviceBean
        dps - List of function points to be controlled, formatted as json string
        callback - Send success or failure callback.
      • publishDpsByMqtt

         abstract void publishDpsByMqtt(String nodeId, String dps, IResultCallback callback)

        Publish commands to a single sub-device by MQTT.

        Parameters:
        nodeId - Sub-device nodeId, nodeId field in sub-device's DeviceBean
        dps - List of function points to be controlled, formatted as json string
        callback - Send success or failure callback.
      • publishDpsByHttp

         abstract void publishDpsByHttp(String nodeId, String dps, IResultCallback callback)

        Use http to send control commands.

        Parameters:
        nodeId - Sub-device nodeId, nodeId field in sub-device's DeviceBean
        dps - List of function points to be controlled, formatted as json string
        callback - Send success or failure callback.
      • isMqttConnect

        @Deprecated() abstract boolean isMqttConnect()

        Whether the MQTT is connected.

        Not recommended, it is recommended to use another interface isServerConnect, such as {@code ThingHomeSdk.getServerInstance().isServerConnect()}

      • broadcastDps

         abstract void broadcastDps(String dps, IResultCallback callback)

        Publish commands to all sub-devices under the gateway.

        Parameters:
        dps - List of function points to be controlled, formatted as json string
        callback - Send success or failure callback.
      • multicastDps

         abstract void multicastDps(String nodeId, String dps, IResultCallback callback)

        Publish commands to all devices in the same group as this sub-device.

        Parameters:
        nodeId - Sub-device nodeId, nodeId field in sub-device's DeviceBean
        dps - List of function points to be controlled, formatted as json string
        callback - Send success or failure callback.
      • registerSubDevListener

         abstract void registerSubDevListener(ISubDevListener listener)

        Register the sub-devices status change listener.

        The sub-devices related information (dp data, device name, device online status and device removal),which will be synchronized here in real time.

        Parameters:
        listener - The listener ISubDevListener
      • onDestroy

         abstract void onDestroy()

        Recycle and release the resources.