Skip to content

Commit

Permalink
Merge pull request #47 from BeldrothTheGold/move_secrets
Browse files Browse the repository at this point in the history
Move secrets to a new file secrets.h add add to gitignore
  • Loading branch information
davepl committed Oct 20, 2021
2 parents 99ce588 + 30843c2 commit 788c4cd
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
NightDriverStrip.code-workspace
src/uzlib/src/*.o
.history

include/secrets.h
5 changes: 1 addition & 4 deletions include/network.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include "remotecontrol.h"
#include "socketserver.h"
#include "ntptimeclient.h"
#include "secrets.h"

extern byte g_Brightness;
extern bool g_bUpdateStarted;
Expand All @@ -42,9 +43,5 @@ void processRemoteDebugCmd();
extern RemoteControl g_RemoteControl;
#endif

#define cszSSID "Your SSID"
#define cszPassword "Your PASS"
#define cszHostname "NightDriverStrip"

bool ConnectToWiFi(uint cRetries);
void SetupOTA(const char *pszHostname);
11 changes: 7 additions & 4 deletions include/ntptimeclient.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@
#include <WiFiUdp.h>
#include <mutex>

// define the NTP server to connect too (replace . [dots] in IP addresses with , [commas])
#define cszNTPServer 94, 199, 173, 123 // 0.pool.ntp.org
//#define cszNTPServer 216, 239, 35, 12 // google time
//#define cszNTPServer 17, 253, 16, 253 // apple time


// NTPTimeClient
//
// Basically, I took some really ancient NTP code that I had on hand that I knew
Expand Down Expand Up @@ -92,10 +98,7 @@ class NTPTimeClient
chNtpPacket[0] = 0b00011011;

// Send the ntp packet.

IPAddress ipNtpServer(192, 168, 1, 2); // My Synology NAS
//IPAddress ipNtpServer(216, 239, 35, 12); // 216.239.35.12 Google Time
//IPAddress ipNtpServer(17, 253, 16, 253); // Apple time
IPAddress ipNtpServer(cszNTPServer);

pUDP->beginPacket(ipNtpServer, 123);
pUDP->write((const uint8_t *)chNtpPacket, NTP_PACKET_LENGTH);
Expand Down
32 changes: 32 additions & 0 deletions include/secrets.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
//+--------------------------------------------------------------------------
//
// File: secrets.h
//
// NightDriverStrip - (c) 2018 Plummer's Software LLC. All Rights Reserved.
//
// This file is part of the NightDriver software project.
//
// NightDriver is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// NightDriver is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Nightdriver. It is normally found in copying.txt
// If not, see <https://www.gnu.org/licenses/>.
//
// Description:
//
// secret definitions, at the moment this is just network secrets,
// but could be expanded in the future
//
//---------------------------------------------------------------------------

#define cszSSID "Your SSID"
#define cszPassword "Your PASS"
#define cszHostname "NightDriverStrip"

0 comments on commit 788c4cd

Please sign in to comment.