-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathcore-concepts.html
More file actions
24 lines (23 loc) · 2.56 KB
/
core-concepts.html
File metadata and controls
24 lines (23 loc) · 2.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
---
title: Core Concepts
layout: default
---
<section>
<!-- Core Concepts -->
<a name="coreconcepts-basics" id="coreconcepts-basics"></a>
<h1>Core Concepts</h1>
<p>The first class citizen in the Ninja Platform are devices. <strong>Devices</strong> are things like temperature sensors, LED lights, SMS, and can even be services such as Twitter and Facebook (anything really). These things can sense, actuate, and in some cases both.</p>
<p>Devices talk to the Ninja Platform via a hub which we call a 'block'. <strong>Blocks</strong> are essentially just gateways between your devices and our platform. They handle authentication, configuration, and routing to and from your devices.</p>
<p>As a developer, after you have been <a href="/rest/authentication.html">authorized</a> to access a user's device data, you will want to subscribe to this data. This is easily accomplished with <code>callbacks</code> (see <a href="/rest/device.html#device-create-callback">here</a>), a neat feature that allows you to register a URL against a device that we will POST to whenever data is received by that device. When working with callbacks as a third party application developer, we recommend <a href="http://requestb.in" target="_blank">requestb.in</a> to assist with troubleshooting.</p>
<p>Devices have numerous properties, but a few you will see over and over again:<br />
<ul>
<li><code>GUID</code> - the device's globally unique ID.</li>
<li><code>DA</code> - the data value being reported by the device</li>
<li><code>D</code> - the device ID, unique within a manufacturer's devices.</li>
<li><code>V</code> - the vendor ID of the device, unique to the manufacturer.</li>
<li><code>G</code> - a number corresponding to the port that the device is attached to.</li>
</ul></p>
<p>In some cases, you might have many things talking to 1 device, for example an RF module, or Blue Tooth dongle. In this case we allow for creating 'sub-devices'. <strong>Sub-devices</strong> can be either sensors or actuators, and essentially allow you to class data that might be sent/received by that device. For example, your RF module might report '101000001111101010000' when you press your door bell. Saving this value as a sensor sub-device allows the user a more human interaction. Depending on your application, you may never have to interact with sub-devices.</p>
<p>You can add web services as devices too, such as Twitter, Webhooks, Facebook, Email, Twilio, etc. The list can be found in <a href="https://a.ninja.is/networking">your account</a> page.</p>
<!-- /Core Concepts -->
</section>