0
0
mirror of https://github.com/Doodle3D/doodle3d-connect.git synced 2024-12-26 02:23:48 +01:00

Update README.md

This commit is contained in:
Rick Companje 2016-05-22 00:07:24 +02:00
parent cef57d117e
commit 29e9b77391

View File

@ -9,11 +9,13 @@ The following image shows a typical doodle3d-connect page. The most common way t
![connect.doodle3d.com](https://cloud.githubusercontent.com/assets/156066/15451030/645fd5ae-1fb0-11e6-9521-e2271c1d2bc5.png) ![connect.doodle3d.com](https://cloud.githubusercontent.com/assets/156066/15451030/645fd5ae-1fb0-11e6-9521-e2271c1d2bc5.png)
#Server #How does it work?
![Diagram of doodle3d-connect](https://cloud.githubusercontent.com/assets/156066/15450961/519baea0-1fad-11e6-9b58-9ca597db0a55.png) ![Diagram of doodle3d-connect](https://cloud.githubusercontent.com/assets/156066/15450961/519baea0-1fad-11e6-9b58-9ca597db0a55.png)
##Server
The Doodle3D connect server has an api with 2 methods: The Doodle3D connect server has an api with 2 methods:
##list ###list
Retrieve a list of connected WiFi-Boxes that are on the same remote IP and that signed-in less than an hour ago. The remote IP is the IP adres you're behind on the internet. Usually when you're on a network all devices on that network have the same remote IP. It returns the following information per WiFi-Box: Retrieve a list of connected WiFi-Boxes that are on the same remote IP and that signed-in less than an hour ago. The remote IP is the IP adres you're behind on the internet. Usually when you're on a network all devices on that network have the same remote IP. It returns the following information per WiFi-Box:
@ -26,7 +28,7 @@ data: Sign-in date.
Current url: http://connect.doodle3d.com/api/list.php Current url: http://connect.doodle3d.com/api/list.php
Example url: http://connect.doodle3d.com/api/list.example Example url: http://connect.doodle3d.com/api/list.example
##signin ###signin
Used to sign-in into the connect system. Requires: Used to sign-in into the connect system. Requires:
@ -34,7 +36,7 @@ localip: The local IP of the WiFi-Box on the local network.
wifiboxid: A custom human readable name to identify the WiFi-Box. wifiboxid: A custom human readable name to identify the WiFi-Box.
From the request it will determine the remote IP and the date. This request will also remove sign-ins from more than an hour ago. From the request it will determine the remote IP and the date. This request will also remove sign-ins from more than an hour ago.
#WiFi-Box ##WiFi-Box
The WiFi-Box will perform a scan for WiFi networks, when a known network is available it will join this network. When no known network is found it will become a access point. This means a fresh WiFi-Box will always become a access point. The WiFi-Box will perform a scan for WiFi networks, when a known network is available it will join this network. When no known network is found it will become a access point. This means a fresh WiFi-Box will always become a access point.
When a WiFi network is joined the WiFi-Box will attempt to Sign-in, when this fails it will retry a couple of times. From then on it will attempt a sign-in every 15 minutes. It also attempt a sign-in when the wifibox id is changed. When a WiFi network is joined the WiFi-Box will attempt to Sign-in, when this fails it will retry a couple of times. From then on it will attempt a sign-in every 15 minutes. It also attempt a sign-in when the wifibox id is changed.
@ -42,6 +44,6 @@ The WiFi-Box has a couple of API methods required for the connect system:
network/alive. A very simple method that doesn't contain any logic or info. It's just something (Web)App's can query to check whether there is something behind a local IP adres. Similar to a ping. network/alive. A very simple method that doesn't contain any logic or info. It's just something (Web)App's can query to check whether there is something behind a local IP adres. Similar to a ping.
#(Web)App ##(Web)App
(Web)Apps can use the connect system to find WiFi-Boxes on the same network. (Web)Apps can use the connect system to find WiFi-Boxes on the same network.
They continuely query the list api method to retrieve local WiFi-Boxes information. Because the server can't know their current status the (Wep)App should query the alive api method of the WiFi-Boxes. When it get's a valid response the WiFi-Box can be shown to the user. Besides querying the boxes it retrieves through the list api The Web(App) should also continuesly query the alive method of boxes that are already shown. To make this easier for (Wep)App developers we created a JavaScript library that handles this; ConnectAPI.js. They continuely query the list api method to retrieve local WiFi-Boxes information. Because the server can't know their current status the (Wep)App should query the alive api method of the WiFi-Boxes. When it get's a valid response the WiFi-Box can be shown to the user. Besides querying the boxes it retrieves through the list api The Web(App) should also continuesly query the alive method of boxes that are already shown. To make this easier for (Wep)App developers we created a JavaScript library that handles this; ConnectAPI.js.