|
FastLED 3.9.15
|
Example demonstrating HTTP streaming RPC client.
This example shows how to:
Prerequisites:
Definition in file RpcClient.ino.
#include <FastLED.h>#include "fl/remote/remote.h"#include "fl/remote/rpc/response_send.h"#include "fl/stl/unique_ptr.h"#include "fl/net/http/stream_client.h"#include "fl/net/http/stream_client.cpp.hpp"#include "fl/net/http/stream_transport.cpp.hpp"#include "fl/stl/asio/http/connection.cpp.hpp"#include "fl/net/http/chunked_encoding.cpp.hpp"#include "fl/stl/asio/http/http_parser.cpp.hpp"#include "fl/stl/asio/http/native_client.cpp.hpp"
Include dependency graph for RpcClient.ino:Go to the source code of this file.
Macros | |
| #define | DATA_PIN 3 |
| #define | NUM_LEDS 10 |
| #define | SERVER_HOST "localhost" |
| #define | SERVER_PORT 8080 |
Enumerations | |
| enum | TestMode { TEST_SYNC , TEST_ASYNC , TEST_ASYNC_STREAM } |
Functions | |
| void | handleResponse (const fl::json &response) |
| void | loop () |
| void | sendAsyncRequest () |
| void | sendAsyncStreamRequest () |
| void | sendSyncRequest () |
| void | setup () |
Variables | |
| const uint32_t | CALL_INTERVAL = 5000 |
| TestMode | currentMode = TEST_SYNC |
| int | expectedRequestId = -1 |
| uint32_t | lastCallTime = 0 |
| CRGB | leds [NUM_LEDS] |
| fl::unique_ptr< fl::Remote > | remote |
| int | requestId = 1 |
| fl::unique_ptr< fl::net::http::HttpStreamClient > | transport |
| bool | waitingForResponse = false |