Defining Schema with Gateway
You need to define schemas to let the mobile app operate things.
This topic assumes that you have already understood the basic concepts of the schema, actions, action results, and thing states. See Schema to learn about these concepts.
The way to define schemas is the same as that in the scenario with stand-alone things. See Defining Schema to learn how to implement schemas.
Schema for Gateway
The gateway does not need to know actions and thing states because it only relays requests and responses. However, the schema needs to be formally defined.
Prepare an empty state class as below and define a schema without actions.
public class GatewayState extends TargetState {
}
// Create a schema builder with parameters.
SchemaBuilder sb = SchemaBuilder.newSchemaBuilder("gateway",
"Gateway-Sample",
1, GatewayState.class);
// Create a schema.
Schema schemaGateway = sb.build();
Schema for End Nodes
Define a schema by following the same steps for stand-alone things as end nodes need to handle commands and states.