Appearance
Device Connection API
API Overview
Function | Description |
---|---|
Qth.init() | Initializes QuecThing. |
Qth.start() | Connects the device to Developer Center. |
Qth.stop() | Disconnects the device from Developer Center. |
Qth.state() | Gets the connection status between the device and Developer Center. |
Qth.reset() | Resets the device. |
API Description
Qth.init
This function automatically calls the initialization functions of all component objects to initialize QuecThing SDK. This function must be called before other functions are used.
Prototype
python
Qth.init()
Parameter
Input Parameter
- None
Output Parameter
- None
Return Value
True
: Successful executionFalse
: Failed execution
Example
python
Qth.init()
Qth.start
This function connects the device to Developer Center with an automatic data call.
Prototype
python
Qth.start()
Parameter
Input Parameter
- None
Output Parameter
- None
Return Value
True
: Successful executionFalse
: Failed execution
Example
python
Qth.stop()
Qth.stop
This function disconnects the device from Developer Center.
Prototype
python
Qth.stop()
Parameter
Input Parameter
- None
Output Parameter
- None
Return Value
- None
Example
python
Qth.stop()
Qth.state
This function gets the connection status between the device and Developer Center.
Prototype
python
Qth.state()
Parameter
Input Parameter
- None
Output Parameter
- None
Return Value
True
: ConnectedFalse
: Disconnected
Example
python
ret = Qth.state()
print("ret:", ret)
Qth.reset
This function resets the device. After this function is called, the DeviceKey will be reset and the relationship between the user and the device will be unbound. The reset result will be sent in the registered callback function.
Prototype
python
Qth.reset()
Parameter
Input Parameter
- None
Output Parameter
- None
Return Value
- None
Example
python
Qth.reset()