This repository has been archived by the owner on Jul 5, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRestService.h
52 lines (48 loc) · 1.84 KB
/
RestService.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/**
* RestService
* @author Curt Henrichs
* @date 1-21-18
*
* REST API and single client server module to expose LED controller
* functionality to the network. The functionality is broken down to setting
* state of the controller either through a raw byte command or sending
* a message to a valid route. The other functionality is server specific such
* as displaying documentation, routing, and state cache.
*
* The following is the HTTP REST API for the LED Service
* GET : / : Argument[none]
* GET : /routes : Argument[none]
* GET : /cached-state : Argument[none]
*
* The following is the HTTP REST API for the LED Controller
* GET, POST : /raw : Argument["raw"=<byte>,"documentation"=<bool>]
* GET, POST : /brightness : Argument["brightness"=<string>,"documentation"=<bool>]
* GET, POST : /power : Argument["power"=<string>,"documentation"=<bool>]
* GET, POST : /function : Argument["function"=<string>,"documentation"=<bool>]
* GET, POST : /color : Argument["color"=<string>,"documentation"=<bool>]
*
* Note that this module makes no guarantee to the actual state of the LED
* controller.
*
* The REST API is inspired and devloped after the LED Controller's IR remote.
* Thus the features on the remote are exposed as routes in the service.
*/
#ifndef RESTSERVICE_H
#define RESTSERVICE_H
//==============================================================================
// Public Function Prototypes
//==============================================================================
/**
* Initialize IR LED controller REST service. Note that WIFI must be enabled
* before calling this function.
*/
void rs_init(void);
/**
* Periodically update server to service single client connected.
*/
void rs_update(void);
/**
* Stop REST server. This typically is called if Wifi is down.
*/
void rs_stop(void);
#endif