The Request class is used to handle the request from the client. It is used to get the request method, the request URI, the request body and the request headers.
Name | Type |
---|---|
temperature_1 | float |
temperature_2 | float |
humidity_1 | float |
humidity_2 | float |
soilMoisture_1 | float |
soilMoisture_2 | float |
statusPumpe | bool |
statusLufter_Low | bool |
statusLufter_High | bool |
statusLight | bool |
getRgbLed | char |
Name | Type |
---|---|
temperature_Min | int |
temperature_Avg | int |
temperature_Max | int |
soilMoisture_Min | int |
soilMoisture_Max | int |
setBrightness | int |
setLufter_Low | bool |
setLufter_High | bool |
setPumpe | bool |
setLight | bool |
setRgbLed | char |
setMatrixLed | char |
#include <Request.h>
#define TYPE DEF_SENSOR
Request Object("http://localhost:80", TYPE);
Object.start();
Object.get.temperature_1();
Object.set.temperature_1(20.0);
Object.post(false);
Object.end();
Parameters:
DEF_SETTINGS | DEF_SENSOR |
Example:
Request object("http://localhost:80", DEF_SETTINGS);
Returns:
Example:
object.start();
Parameters:
Returns:
Example:
object.post(false);
// or
object.post(true); // used for testing the response from the server
Example:
object.end();
Example:
object.get();
Returns:
value: int | bool | char | String - Variables from the SensorData struct |
Example:
object.get.temperature_1();
Returns:
value : int | bool | char | String - Variables from the SettingsData struct |
Example:
object.get.temperature_Min();
Example:
object.set();
Parameters:
value : int | bool | char | String - Set the variables from the SensorData struct |
Returns:
value : int | bool | char | String - Get the variables from the SensorData struct |
Example:
object.set.temperature_1(20.0);
Parameters:
value : int | bool | char | String - Set the variables from the SettingsData struct |
value : int | bool | char | String - Get the variables from the SettingsData struct |
Example:
object.set.temperature_Min(20);
Example:
object.getTest();
Example:
object.setTest();
Copyright 2023 the original author or authors.
Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.