Skip to content

Commit 5d7f7a7

Browse files
committed
Dynamically change Bluetooth advertising based on platform
1 parent cf55b87 commit 5d7f7a7

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

Firmware/RTK_Surveyor/Begin.ino

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ void beginBoard()
99
{
1010
productVariant = RTK_EXPRESS;
1111
}
12-
else if(analogRead(35) > 400 && analogRead(35) < 600)
12+
else if (analogRead(35) > 400 && analogRead(35) < 600)
1313
{
1414
productVariant = RTK_FACET;
1515
}
@@ -31,6 +31,7 @@ void beginBoard()
3131
pin_batteryLevel_alert = 36;
3232

3333
strcpy(platformFilePrefix, "SFE_Surveyor");
34+
strcpy(platformBluetoothPrefix, "Surveyor");
3435
}
3536
else if (productVariant == RTK_EXPRESS)
3637
{
@@ -56,6 +57,7 @@ void beginBoard()
5657
setMuxport(settings.dataPortChannel); //Set mux to user's choice: NMEA, I2C, PPS, or DAC
5758

5859
strcpy(platformFilePrefix, "SFE_Express");
60+
strcpy(platformBluetoothPrefix, "Express");
5961
}
6062
else if (productVariant == RTK_FACET)
6163
{
@@ -82,6 +84,7 @@ void beginBoard()
8284
setMuxport(settings.dataPortChannel); //Set mux to user's choice: NMEA, I2C, PPS, or DAC
8385

8486
strcpy(platformFilePrefix, "SFE_Facet");
87+
strcpy(platformBluetoothPrefix, "Facet");
8588
}
8689

8790
Serial.printf("RTK Variant: %s\n\r", platformFilePrefix);

Firmware/RTK_Surveyor/Display.ino

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1300,7 +1300,6 @@ void displayTest()
13001300
oled.setCursor(xOffset, yOffset + (3 * charHeight) ); //x, y
13011301
oled.print(F("GNSS:"));
13021302
int satsInView = i2cGNSS.getSIV();
1303-
13041303
if (online.gnss == true && satsInView > 8)
13051304
oled.print(F("OK"));
13061305
else

Firmware/RTK_Surveyor/System.ino

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,13 @@ bool startBluetooth()
77
esp_read_mac(unitMACAddress, ESP_MAC_WIFI_STA);
88
unitMACAddress[5] += 2; //Convert MAC address to Bluetooth MAC (add 2): https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/system/system.html#mac-address
99

10+
char stateName[10];
1011
if (buttonPreviousState == BUTTON_ROVER)
11-
sprintf(deviceName, "Surveyor Rover-%02X%02X", unitMACAddress[4], unitMACAddress[5]); //Rover mode
12+
strcpy(stateName, "Rover");
1213
else
13-
sprintf(deviceName, "Surveyor Base-%02X%02X", unitMACAddress[4], unitMACAddress[5]); //Base mode
14+
strcpy(stateName, "Base");
15+
16+
sprintf(deviceName, "%s %s-%02X%02X", platformBluetoothPrefix, stateName, unitMACAddress[4], unitMACAddress[5]); //Base mode
1417

1518
if (SerialBT.begin(deviceName) == false)
1619
{
@@ -186,7 +189,7 @@ bool configureUbloxModule()
186189
#define INPUT_SETTING 12
187190

188191
//UART1 will primarily be used to pass NMEA and UBX from ZED to ESP32 (eventually to cell phone)
189-
//but the phone can also provide RTCM data and a user may want to configure the ZED over Bluetooth.
192+
//but the phone can also provide RTCM data and a user may want to configure the ZED over Bluetooth.
190193
//So let's be sure to enable UBX+NMEA+RTCM on the input
191194
getPortSettings(COM_PORT_UART1); //Load the settingPayload with this port's settings
192195
if (settingPayload[OUTPUT_SETTING] != (COM_TYPE_NMEA | COM_TYPE_UBX) || settingPayload[INPUT_SETTING] != (COM_TYPE_NMEA | COM_TYPE_UBX | COM_TYPE_RTCM3))

0 commit comments

Comments
 (0)