Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. A single component cannot control multiple physical devices. The component must control a unique physical device, so it must have a "device_id" characteristic, instead of passing it as a parameter.
  2. The "api_region", "api_key", and "api_secret" parameters must also be characteristics of the component, since they are static data as well.
  3. Actions "turnOn" and "turnOff" will be implemented asynchronously for simplicity. In another section we will implement a asynchronous component.

Example IDL for a BACI compliant smart bulb ACS component

Code Block
languagecpp
titleidlTuyaBulbBaci/idl/TuyaBulbBaci.idl
linenumberstrue
#ifndef _TUYABULBBACI_IDL_
#define _TUYABULBBACI_IDL_
 
#pragma prefix "ACSIOT"
 
#include <acscomponent.idl>
#include <baci.idl>
 
module acsiot {
    interface TuyaBulbBaci : ACS::ACSComponent {
        void turnOn(in string api_region, in string api_key, in string api_secret);
        void turnOff(in string api_region, in string api_key, in string api_secret);
        ACS::ROboolean getStatus();
        readonly attribute ACS::ROboolean status;
    };
};

#endif