Packages

Erlang client library for the AT&T M2X (http://m2x.att.com) API. AT&T M2X is a cloud-based fully managed time-series data storage service for network connected machine-to-machine (M2M) devices and the Internet of Things (IoT).

Current section

Files

Jump to
m2x_erlang src m2x_device_command.erl
Raw

src/m2x_device_command.erl

-module(m2x_device_command).
%% API
-export([view/3 ]).
-export([process/3, process/4]).
-export([reject/3, reject/4 ]).
%% @doc Get details of a command as received by this device.
%% https://m2x.att.com/developer/documentation/v2/commands#Device-s-View-of-Command-Details
view(Client, Device, Command) -> Client({get, <<"/devices/", Device/binary, "/commands/", Command/binary>>}).
%% @doc Mark a command as processed by this device.
%% https://m2x.att.com/developer/documentation/v2/device#Device-Marks-a-Command-as-Processed
process(Client, Device, Command) -> Client({post, <<"/devices/", Device/binary, "/commands/", Command/binary, "/process">>}).
process(Client, Device, Command, Params) -> Client({post, <<"/devices/", Device/binary, "/commands/", Command/binary, "/process">>, Params}).
%% @doc Mark a command as rejected by this device.
%% https://m2x.att.com/developer/documentation/v2/device#Device-Marks-a-Command-as-Rejected
reject(Client, Device, Command) -> Client({post, <<"/devices/", Device/binary, "/commands/", Command/binary, "/reject">>}).
reject(Client, Device, Command, Params) -> Client({post, <<"/devices/", Device/binary, "/commands/", Command/binary, "/reject">>, Params}).