Made device names unique
This commit is contained in:
@@ -11,7 +11,7 @@ class BluetoothBeginAction : public virtual ActionInterface
|
||||
public:
|
||||
void triggered() override
|
||||
{
|
||||
if (!bluetoothSerial.begin("bobbyquad"))
|
||||
if (!bluetoothSerial.begin(deviceName))
|
||||
{
|
||||
Serial.println("Could not begin bluetooth");
|
||||
// TODO: better error handling
|
||||
|
@@ -11,7 +11,7 @@ class BluetoothBeginMasterAction : public virtual ActionInterface
|
||||
public:
|
||||
void triggered() override
|
||||
{
|
||||
if (!bluetoothSerial.begin("bobbyquad", true))
|
||||
if (!bluetoothSerial.begin(deviceName, true))
|
||||
{
|
||||
Serial.println("Could not begin bluetooth master");
|
||||
// TODO: better error handling
|
||||
|
@@ -24,6 +24,8 @@ float gametrakX, gametrakY, gametrakDist;
|
||||
#endif
|
||||
float avgSpeed, avgSpeedKmh, sumCurrent, sumAbsoluteCurrent;
|
||||
|
||||
char deviceName[16];
|
||||
|
||||
Settings settings;
|
||||
SettingsSaver settingsSaver;
|
||||
|
||||
|
11
src/main.cpp
11
src/main.cpp
@@ -1,3 +1,5 @@
|
||||
#include <cstdio>
|
||||
|
||||
#include <Arduino.h>
|
||||
#include <HardwareSerial.h>
|
||||
#include <WiFi.h>
|
||||
@@ -61,10 +63,15 @@ void setup()
|
||||
|
||||
updateSwapFrontBack();
|
||||
|
||||
{
|
||||
uint8_t macAddress[6];
|
||||
WiFi.macAddress(&macAddress[0]);
|
||||
std::sprintf(deviceName, "bobbyquad_%02hhx%02hhx%02hhx", macAddress[3], macAddress[4], macAddress[5]);
|
||||
}
|
||||
|
||||
WiFi.mode(WIFI_AP_STA);
|
||||
WiFi.softAP("bobbyquad", "Passwort_123");
|
||||
WiFi.softAP(deviceName, "Passwort_123");
|
||||
WiFi.begin("realraum", "r3alraum");
|
||||
//WiFi.begin("McDonalds Free WiFi 2.4GHz", "Passwort_123");
|
||||
|
||||
BluetoothBeginMasterAction{}.triggered();
|
||||
#ifdef FEATURE_BMS
|
||||
|
Reference in New Issue
Block a user