Ble.scan returning -270

A have just received a Boron in the post. It’s running 3.1.0 (upgraded via the web IDE).
Every call to BLE.scan() is returning -270. Can anyone explain what’s going on?

The code loaded is this cut-down sample:

#include "Particle.h"
const size_t SCAN_RESULT_MAX = 30;
BleScanResult scanResults[SCAN_RESULT_MAX];

void setup() {
    BLE.on();
}

void loop() {
    BLE.setScanTimeout(500);
    int count = BLE.scan(scanResults, SCAN_RESULT_MAX);
    Serial.println(count);
    delay(1000);
}

This appears to be a bug in 3.1.0 (final) only. You can either downgrade, or add the following line of code to your app until a fixed version is released.

BLE.setScanPhy(BlePhy::BLE_PHYS_AUTO);
2 Likes

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.