module IoTivity::Client

Overview

An IoTivity client.

Included Modules

Defined in:

Constant Summary

Log = ::Log.for("IoTivity::Client")

Instance Method Summary

Instance Method Detail

def closing? #

Indicates the client is about to quit.


def discover(resource_type : String) #

Searches the network for a resource_type by invoking oc_do_ip_discovery. When a resource is found that has the resource_type listed in its rt array, a Discovery event is triggered.


def discover_all #

Searches the network for all available resouces by invoking oc_do_ip_discovery_all. When a resource is found, a Discovery event is triggered.


def discover_myself #

def discovered #

A list of all devices discovered.


def discovered=(discovered) #

A list of all devices discovered.


def myself #

The device associated with the client itself. Needed for onboarding.


def myself=(myself) #

The device associated with the client itself. Needed for onboarding.


def quit_client #

Stops the IoTivity client.


def run_client(storage_dir) #

Sets up and runs the IoTivity client. storage_dir should name a path - either absolute or relative to the current working directory - in which IoTivity will load/store credentials, certificates and authentication info.


def send_GET(to uri, at endpoints : IoTivity::ListOfEndpoints, query = nil, qos = OC::QoS::Low) #

Sends a GET request via an invocation of oc_do_get. When a response from the server arrives, a Response event is emitted.


def send_POST(payload, to uri, at endpoints : IoTivity::ListOfEndpoints, query = nil, qos = OC::QoS::Low) #

Sends a POST request via an invocation of oc_init_post/oc_do_post. When a response from the server arrives, a Response event is emitted.