Skip to content

Commit c1a809e

Browse files
committed
Enable RainMaker on all chips
1 parent 3775b93 commit c1a809e

21 files changed

+101
-44
lines changed

libraries/RainMaker/examples/RMakerCustom/.skip.esp32c3

Whitespace-only changes.

libraries/RainMaker/examples/RMakerCustom/.skip.esp32s2

Whitespace-only changes.

libraries/RainMaker/examples/RMakerCustom/.skip.esp32s3

Whitespace-only changes.

libraries/RainMaker/examples/RMakerSonoffDualR3/.skip.esp32c3

Whitespace-only changes.

libraries/RainMaker/examples/RMakerSonoffDualR3/.skip.esp32s2

Whitespace-only changes.

libraries/RainMaker/examples/RMakerSonoffDualR3/.skip.esp32s3

Whitespace-only changes.

libraries/RainMaker/examples/RMakerSwitch/.skip.esp32c3

Whitespace-only changes.

libraries/RainMaker/examples/RMakerSwitch/.skip.esp32s2

Whitespace-only changes.

libraries/RainMaker/examples/RMakerSwitch/.skip.esp32s3

Whitespace-only changes.

libraries/RainMaker/src/RMaker.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
#include "RMaker.h"
2-
#if ESP_IDF_VERSION_MAJOR >= 4 && CONFIG_ESP_RMAKER_TASK_STACK && CONFIG_IDF_TARGET_ESP32
32
#include <esp_rmaker_schedule.h>
43
#include <esp_rmaker_utils.h>
54
bool wifiLowLevelInit(bool persistent);
65
static esp_err_t err;
76

8-
static void event_handler(void *arg, esp_event_base_t event_base, int event_id, void *event_data)
7+
static void event_handler(void *arg, esp_event_base_t event_base, int32_t event_id, void *event_data)
98
{
109
if (event_base == RMAKER_EVENT) {
1110
switch (event_id) {
@@ -113,4 +112,3 @@ esp_err_t RMakerClass::enableOTA(ota_type_t type, const char *cert)
113112
}
114113

115114
RMakerClass RMaker;
116-
#endif

libraries/RainMaker/src/RMaker.h

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,18 @@
1+
// Copyright 2015-2020 Espressif Systems (Shanghai) PTE LTD
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
#pragma once
115
#include "esp_system.h"
2-
#if ESP_IDF_VERSION_MAJOR >= 4 && CONFIG_ESP_RMAKER_TASK_STACK && CONFIG_IDF_TARGET_ESP32
3-
416
#include "Arduino.h"
517
#include "RMakerNode.h"
618
#include "RMakerQR.h"
@@ -26,5 +38,3 @@ class RMakerClass
2638
};
2739

2840
extern RMakerClass RMaker;
29-
30-
#endif

libraries/RainMaker/src/RMakerDevice.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#include "RMakerDevice.h"
2-
#if ESP_IDF_VERSION_MAJOR >= 4 && CONFIG_ESP_RMAKER_TASK_STACK && CONFIG_IDF_TARGET_ESP32
32

43
static esp_err_t err;
54
typedef void (*deviceWriteCb)(Device*, Param*, const param_val_t val, void *priv_data, write_ctx_t *ctx);
@@ -205,5 +204,3 @@ esp_err_t Device::updateAndReportParam(const char *param_name, const char *my_va
205204
}
206205
return ESP_OK;
207206
}
208-
209-
#endif

libraries/RainMaker/src/RMakerDevice.h

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,18 @@
1+
// Copyright 2015-2020 Espressif Systems (Shanghai) PTE LTD
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
#pragma once
115
#include "esp_system.h"
2-
#if ESP_IDF_VERSION_MAJOR >= 4 && CONFIG_ESP_RMAKER_TASK_STACK && CONFIG_IDF_TARGET_ESP32
3-
416
#include "RMakerParam.h"
517
#include <esp_rmaker_standard_devices.h>
618
#include <esp_rmaker_standard_params.h>
@@ -150,5 +162,3 @@ class TemperatureSensor : public Device
150162
}
151163
}
152164
};
153-
154-
#endif

libraries/RainMaker/src/RMakerNode.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#include "RMakerNode.h"
2-
#if ESP_IDF_VERSION_MAJOR >= 4 && CONFIG_ESP_RMAKER_TASK_STACK && CONFIG_IDF_TARGET_ESP32
32
static esp_err_t err;
43

54
esp_err_t Node::addDevice(Device device)
@@ -38,4 +37,3 @@ esp_err_t Node::addNodeAttr(const char *attr_name, const char *val)
3837
}
3938
return err;
4039
}
41-
#endif

libraries/RainMaker/src/RMakerNode.h

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,18 @@
1+
// Copyright 2015-2020 Espressif Systems (Shanghai) PTE LTD
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
#pragma once
115
#include "esp_system.h"
2-
#if ESP_IDF_VERSION_MAJOR >= 4 && CONFIG_ESP_RMAKER_TASK_STACK && CONFIG_IDF_TARGET_ESP32
3-
416
#include "RMakerDevice.h"
517

618
class Node
@@ -29,5 +41,3 @@ class Node
2941
node_info_t *getNodeInfo();
3042
esp_err_t addNodeAttr(const char *attr_name, const char *val);
3143
};
32-
33-
#endif

libraries/RainMaker/src/RMakerParam.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#include "RMakerParam.h"
2-
#if ESP_IDF_VERSION_MAJOR >= 4 && CONFIG_ESP_RMAKER_TASK_STACK && CONFIG_IDF_TARGET_ESP32
32

43
static esp_err_t err;
54

@@ -29,5 +28,3 @@ esp_err_t Param::updateAndReport(param_val_t val)
2928
}
3029
return err;
3130
}
32-
33-
#endif

libraries/RainMaker/src/RMakerParam.h

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,18 @@
1+
// Copyright 2015-2020 Espressif Systems (Shanghai) PTE LTD
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
#pragma once
115
#include "esp_system.h"
2-
#if ESP_IDF_VERSION_MAJOR >= 4 && CONFIG_ESP_RMAKER_TASK_STACK && CONFIG_IDF_TARGET_ESP32
3-
416
#include "RMakerType.h"
517

618
class Param
@@ -34,5 +46,3 @@ class Param
3446
esp_err_t addBounds(param_val_t min, param_val_t max, param_val_t step);
3547
esp_err_t updateAndReport(param_val_t val);
3648
};
37-
38-
#endif

libraries/RainMaker/src/RMakerQR.h

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,18 @@
1+
// Copyright 2015-2020 Espressif Systems (Shanghai) PTE LTD
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
#pragma once
115
#include "esp_system.h"
2-
#if ESP_IDF_VERSION_MAJOR >= 4 && CONFIG_ESP_RMAKER_TASK_STACK && CONFIG_IDF_TARGET_ESP32
3-
416
#include <qrcode.h>
517

618
#define PROV_QR_VERSION "v1"
@@ -20,5 +32,3 @@ static void printQR(const char *name, const char *pop, const char *transport)
2032
qrcode_display(payload);
2133
Serial.printf("If QR code is not visible, copy paste the below URL in a browser.\n%s?data=%s\n", QRCODE_BASE_URL, payload);
2234
}
23-
24-
#endif

libraries/RainMaker/src/RMakerType.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#include "RMakerType.h"
2-
#if ESP_IDF_VERSION_MAJOR >= 4 && CONFIG_ESP_RMAKER_TASK_STACK && CONFIG_IDF_TARGET_ESP32
32

43
param_val_t value(int ival)
54
{
@@ -20,5 +19,3 @@ param_val_t value(float fval)
2019
{
2120
return esp_rmaker_float(fval);
2221
}
23-
24-
#endif

libraries/RainMaker/src/RMakerType.h

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,18 @@
1+
// Copyright 2015-2020 Espressif Systems (Shanghai) PTE LTD
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
#pragma once
115
#include "esp_system.h"
2-
#if ESP_IDF_VERSION_MAJOR >= 4 && CONFIG_ESP_RMAKER_TASK_STACK && CONFIG_IDF_TARGET_ESP32
3-
416
#include <esp_rmaker_core.h>
517
#include <esp_rmaker_ota.h>
618
#include <esp_err.h>
@@ -19,5 +31,3 @@ param_val_t value(int);
1931
param_val_t value(bool);
2032
param_val_t value(char *);
2133
param_val_t value(float);
22-
23-
#endif

libraries/RainMaker/src/RMakerUtils.h

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,26 @@
1+
// Copyright 2015-2020 Espressif Systems (Shanghai) PTE LTD
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
#pragma once
115
#include "esp_system.h"
2-
#if ESP_IDF_VERSION_MAJOR >= 4 && CONFIG_ESP_RMAKER_TASK_STACK && CONFIG_IDF_TARGET_ESP32
3-
416
#include <esp_rmaker_utils.h>
517

618
static void RMakerFactoryReset(int seconds)
719
{
8-
esp_rmaker_factory_reset(seconds);
20+
esp_rmaker_factory_reset(0, seconds);
921
}
1022

1123
static void RMakerWiFiReset(int seconds)
1224
{
13-
esp_rmaker_wifi_reset(seconds);
25+
esp_rmaker_wifi_reset(0, seconds);
1426
}
15-
16-
#endif

0 commit comments

Comments
 (0)