Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions examples/utility/Provisioning_2.0/ClaimingHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include <ArduinoBLE.h>
#include "utility/HCI.h"
#include <Arduino_HEX.h>
#include "ANetworkConfigurator_Config.h"

#define SLOT_BOARD_PRIVATE_KEY 1

Expand Down Expand Up @@ -148,8 +149,14 @@ void ClaimingHandlerClass::resetStoredCredReqHandler() {
}

void ClaimingHandlerClass::getBLEMacAddressReqHandler() {
uint8_t mac[6] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };

/* Set the default MAC address as ff:ff:ff:ff:ff:ff for compatibility
* with the Arduino IoT Cloud WebUI
*/
uint8_t mac[6] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };

#ifdef ARDUINO_OPTA
if(_getPid_() == OPTA_WIFI_PID) {
#endif
bool activated = false;
ConfiguratorAgent * connectedAgent = _agentManager.getConnectedAgent();
if(!_agentManager.isAgentEnabled(ConfiguratorAgent::AgentTypes::BLE) || (connectedAgent != nullptr &&
Expand All @@ -168,7 +175,9 @@ void ClaimingHandlerClass::getBLEMacAddressReqHandler() {
if (activated) {
BLE.end();
}

#ifdef ARDUINO_OPTA
}
#endif
ProvisioningOutputMessage outputMsg;
outputMsg.type = MessageOutputType::BLE_MAC_ADDRESS;
outputMsg.m.BLEMacAddress = mac;
Expand Down