module IoTivity::Client

Overview

An IoTivity client.

Included Modules

Defined in:

client.cr

Constant Summary

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

Instance Method Summary

Instance Method Detail

def closing? #

Indicates the client is about to quit.


[View source]
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.


[View source]
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.


[View source]
def discover_myself #

[View source]
def discovered #

A list of all devices discovered.


[View source]
def discovered=(discovered) #

A list of all devices discovered.


[View source]
def myself #

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


[View source]
def myself=(myself) #

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


[View source]
def observe(uri, at endpoints : IoTivity::ListOfEndpoints, query = nil, qos = OC::QoS::Low) #

[View source]
def quit_client #

Stops the IoTivity client.


[View source]
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.


[View source]
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.


[View source]
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.


[View source]
def stop_observing(uri, at endpoints : IoTivity::ListOfEndpoints) #

[View source]