Skip to content

Commit 5567b6b

Browse files
authored
Merge pull request #569 from fabik111/provisioning-opta-lite
fix provisioning sketch for opta lite
2 parents 39ead2e + 214a581 commit 5567b6b

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

examples/utility/Provisioning_2.0/ClaimingHandler.cpp

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#include <ArduinoBLE.h>
1313
#include "utility/HCI.h"
1414
#include <Arduino_HEX.h>
15+
#include "ANetworkConfigurator_Config.h"
1516

1617
#define SLOT_BOARD_PRIVATE_KEY 1
1718

@@ -148,8 +149,14 @@ void ClaimingHandlerClass::resetStoredCredReqHandler() {
148149
}
149150

150151
void ClaimingHandlerClass::getBLEMacAddressReqHandler() {
151-
uint8_t mac[6] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
152-
152+
/* Set the default MAC address as ff:ff:ff:ff:ff:ff for compatibility
153+
* with the Arduino IoT Cloud WebUI
154+
*/
155+
uint8_t mac[6] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
156+
157+
#ifdef ARDUINO_OPTA
158+
if(_getPid_() == OPTA_WIFI_PID) {
159+
#endif
153160
bool activated = false;
154161
ConfiguratorAgent * connectedAgent = _agentManager.getConnectedAgent();
155162
if(!_agentManager.isAgentEnabled(ConfiguratorAgent::AgentTypes::BLE) || (connectedAgent != nullptr &&
@@ -168,7 +175,9 @@ void ClaimingHandlerClass::getBLEMacAddressReqHandler() {
168175
if (activated) {
169176
BLE.end();
170177
}
171-
178+
#ifdef ARDUINO_OPTA
179+
}
180+
#endif
172181
ProvisioningOutputMessage outputMsg;
173182
outputMsg.type = MessageOutputType::BLE_MAC_ADDRESS;
174183
outputMsg.m.BLEMacAddress = mac;

examples/utility/Provisioning_2.0/Provisioning_2.0.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#include <utility/SElementArduinoCloudCertificate.h>
1616
#include "utility/LEDFeedback.h"
1717

18-
const char *SKETCH_VERSION = "0.3.0";
18+
const char *SKETCH_VERSION = "0.3.3";
1919

2020
enum class DeviceState {
2121
HARDWARE_CHECK,

0 commit comments

Comments
 (0)