Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Speed / baudrate of the BLE connection? #283

Open
pvonmoradi opened this issue Jan 20, 2021 · 0 comments
Open

Speed / baudrate of the BLE connection? #283

pvonmoradi opened this issue Jan 20, 2021 · 0 comments

Comments

@pvonmoradi
Copy link

I'm using the UART over BLE example. It seems there is a "delay" somewhere between sending packets. Is it possible to make the transmission faster?
Currently it looks like the Tx packets are saved in a buffer and are send periodically. Here is the code:

#include <Arduino.h>
#include "BLESerial.h"
#include "variant.h"
BLESerial bleSerial;

int32_t count = 5;
#define LED_DELAY 10

void setupBLE() {
    bleSerial.setLocalName("UART over BLE!");
    bleSerial.begin();
}
void printBLE() {
    if (bleSerial) {
        bleSerial.println(count);
    }
}

void setup() {
    Serial.setPins(PIN_SERIAL_RX, PIN_SERIAL_TX);

    Serial.begin(115200);
    Serial.println("Hi Pooya from nRF52832!");

    pinMode(BLUE_LED, OUTPUT);
    pinMode(GREEN_LED, OUTPUT);

    setupBLE();

}
void loop() {
    if (count > 0) {
        digitalWrite(BLUE_LED, HIGH);
        delay(LED_DELAY);
        digitalWrite(BLUE_LED, LOW);
        delay(LED_DELAY);
        digitalWrite(GREEN_LED, HIGH);
        delay(LED_DELAY);
        digitalWrite(GREEN_LED, LOW);
        delay(LED_DELAY);
    }
    count++;
    printBLE();
}

Note that the transmission delay doesn't seem to be around 4*LED_DELAY but much longer ~800ms.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant