Using this tool we can simulate the OCF resources either with the help of Resource Model(RAML) file provided or manually through GUI wizards. Client feature can be used to test new resources created thoroughly to make sure its OCF compliant.
IoTivity Simulator is an eclipse plugin tool. It provides two perspectives.
Below screenshot shows the “Service Provider Perspective” view. For details about the perspective, refer Simulator Eclipse Plug-In section.
Below screenshot shows the “Client Controller Perspective” view. For details about the perspective, refer Simulator Eclipse Plug-In section.
Using Simulator, you can test the working of an OCF device before purchasing the real hardware.
Two options are available to install the eclipse plugins. Choose any one of these options and proceed further as explained in the following sections.
Please ignore this step if PDE is already installed in eclipse.
Setting up and launching the Eclipse plug-in projects
Simulator Manager It manages creation/deletion of single or multiple simulated resources as per the configurations provided. It creates the simulator resource either with the information provided from RAML file or with the information provided through GUI wizards.
When you click on Create button in Resource Manager pane of Service Provider perspective, a dialog is shown where you can either select “Simple resource(From RAML)” and browse for a RAML file or you can select “Simple resource” and create it manually. Multi-instance creation support is available only while creating resource through RAML.
Now the list of resources created will be displayed in the Resource Manager pane. When a resource is selected, it shows the attributes and properties of the selected resource in Attribute Manager pane and Properties pane respectively as shown in the below screenshot.
If you wish to delete a resource, select the resource and right-click on it, which shows a menu to delete that resource. To delete one or more resource(s) at a time, click on the Delete button in Resource Manager pane which will open a dialog showing all resources, select the resources and click OK. Screenshot is shown below.
Simulator Resource Server It represents a simulated resource and handles all the requests received and sends proper responses to client. When server receives any GET/PUT/POST/OBSERVE requests, service provider perspective shows the log messages with the request information and sends appropriate responses as shown in below few screenshots. Also service provider perspective shows a list of observers for a selected resource in Resource Observers tab in Properties pane.
Double-clicking log entries opens a new dialog which shows more information such as payload.
Service Provider provides automation feature where all possible values for a given attribute or all attributes of a selected resource are changed sequentially as shown in below screenshots. To start attribute level automation, click on an attribute in Attribute Manager pane and tick the Automation column checkbox (by default it will be disabled), a dialog will be shown where you can input the type of automation you want - NORMAL (only once) or RECURRENT (in a loop) and choose a suitable Update Frequency (duration between updating values of an attribute) and click OK. This will trigger attribute-level automation. To start resource-level automation, right click a resource and select Start Automation. Select Automation type and update frequency and click OK. This triggers resource-level automation.
Simulator Client It searches for the resources available in the network based on the users interested resources type. To find resources in the network, click on Find Resources button of Client-Controller perspective and either select “All” to search for all available resources or perform a customized search by selecting “Specific Resource Types” and click OK.
Simulator Remote Resource It represents a remote server from client side and provides interface for sending different requests to server. Discovered resources are shown in Resource Manager panel. If you perform frequent operations on few specific resources, you can right click on each of them and click on Add to Favorites. These resources will be shown in Favorite Resources tab of Resource Manager pane. If you want to perform any operations on a found resource, select the resource and click on GET/PUT/POST buttons in Attribute Manager pane. A dialog will be shown where you can modify the values of attributes if required and click OK. This will send corresponding messages to Server and receive responses from server. Response payload will be shown in Simulator Log panel.
Client-Controller also supports Automation where GET/PUT/POST messages are automatically generated and set for all possible values of each attribute of a resource. To use this feature, RAML file must be loaded. To start using this feature, select a resource you want to automate to send requests and right-click on it which shows menu to load the RAML file. After loading the proper RAML file of the selected resource, automation button in Attribute Manager pane will be enabled.
Automation Settings dialog will be shown where you can select the request types you want to automate and click OK. Simulator Log pane displays the requests sent and responses received from server. Refer below screenshots.
Simulator User Guide can be downloaded from here.