API Classes in SDKs
The mobile app uses these two SDKs to access the gateway and end nodes.
Kii Cloud SDK
You use this SDK to get an access token of the owner of the gateway and end nodes. Users and groups can be the owner.
Thing-IF SDK
You use this SDK to onboard the gateway and end nodes and to handle commands and states.
The API of this SDK are defined with the below two classes:
ThingIFAPI
This API class is used to access Thing Interaction Framework from the mobile app.
This API class has methods to work with Thing Interaction Framework. For example, you use this API class to onboard things and send commands to end nodes based on the functional model.
GatewayAPI
This API class is used to access the gateway agent from the mobile app. Access this API class via a local area network such as Wi-Fi.
This API class has methods to manage the gateway. For example, you use this API class to obtain end nodes which are yet to onboard and get informed of completed initialization of end nodes.
Instance Management
You need to have instances of the ThingIFAPI
and GatewayAPI
to operate end nodes.
Access to Gateway
You handle one
ThingIFAPI
instance and oneGatewayAPI
instance for one gateway to access it.Access to End Nodes
You handle as many
ThingIFAPI
instances as the number of end nodes to operate. Call the method of theThingIFAPI
instance used for onboarding the end node to operate a specific end node.
The below figure illustrates the API classes in handling two end nodes. One ThingIFAPI
instance is initialized for each end node and one ThingIFAPI
instance and one GatewayAPI
instance are initialized for the gateway.
For example, in order to send a command to the LED2
end node, you will call the method to send a command to the second ThingIFAPI
instance which is associated with the end node.