Skip to content

Commit

Permalink
fix explicit string casting LyndLabs#4
Browse files Browse the repository at this point in the history
warning: ISO C++ forbids converting a string constant to 'char*'
  • Loading branch information
lukeswitz committed Aug 17, 2023
1 parent 74c5c00 commit 512b15c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions src/Demo/Scan.h
Original file line number Diff line number Diff line change
Expand Up @@ -313,19 +313,19 @@ void makeDNSRequest() {
// /* ----------------- Make DNS Request to URL ------------------ */
// /* --------------------------------------------------------------*/

char *getEncryption(uint8_t network) {
const char* getEncryption(uint8_t network) {
byte encryption = WiFi.encryptionType(network);
switch (encryption) {
case 5:
return "WEP"; // WEP
return "WEP";
case 2:
return "WPA"; // WPA
return "WPA";
case 4:
return "WPA2"; // WPA2
return "WPA2";
case 7:
return "NONE"; // NONE
return "NONE";
case 8:
return "AUTO"; // AUTO
return "AUTO";
}
return "AUTO"; // AUTO / fail case
}
Expand Down
2 changes: 1 addition & 1 deletion src/Demo/Screen.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ static uint8_t initScreen(uint8_t SCL, uint8_t SDA, uint8_t addr) {
return 0;
}

void drawMockup(char* gpscoords, char* time, uint8_t sats, uint8_t nets, uint8_t reqs, uint8_t open, char* message) {
void drawMockup(const char* gpscoords, const char* time, uint8_t sats, uint8_t nets, uint8_t reqs, uint8_t open, const char* message) {
display.clear();
display.drawLine(0,12,127,12);
display.drawLine(0,49,127,49);
Expand Down

0 comments on commit 512b15c

Please sign in to comment.