iBetter conenction handling.

master
Holger Wirtz 4 years ago
parent 989ed20434
commit 6beba5c112
  1. 56
      OSC2MIDI.ino

@ -48,6 +48,8 @@ void OSCToMidiCC(OSCMessage &msg, int offset);
void OSCMixerMuteToMidiCC(OSCMessage &msg, int offset);
void OSCMixerSoloToMidiCC(OSCMessage &msg, int offset);
void MidiCCToOSC(uint8_t channel, uint8_t number, uint8_t value);
void ConfigAPWeb(void);
/*void change_midi_state(uint8_t midichannel, uint8_t cc, uint8_t value);
void show_midi_state(void);
void set_midi_state(void);
@ -148,14 +150,17 @@ void setup()
{
DEBUG_MSG("Mode Client\n");
lcd.setCursor(0, 1);
lcd.print(F("Connecting... "));
WiFiManager wm;
lcd.clear();
lcd.setCursor(0, 0);
lcd.print(F("Mode Config-AP"));
lcd.setCursor(0, 1);
lcd.print(F("192.168.4.1"));
/*
//called after AP mode and config portal has started
void setAPCallback( std::function<void(WiFiManager*)> func );
//called after webserver has started */
wm.setWebServerCallback(ConfigAPWeb);
wm.setConnectTimeout(WIFI_CONNECT_TIMEOUT);
wm.setConfigPortalTimeout(CFG_PORTAL_TIMEOUT);
wm.setBreakAfterConfig(true);
@ -1028,35 +1033,46 @@ void ping(OSCMessage & msg, int offset)
broadcast_midistate();
}
}
void ConfigAPWeb(void)
{
lcd.clear();
lcd.setCursor(0, 0);
lcd.print(F("Mode Config-AP"));
lcd.setCursor(0, 1);
lcd.print(F("192.168.4.1"));
}
void listDir(fs::FS & fs, const char * dirname, uint8_t levels)
{
Serial.printf("Listing directory : %s\r\n", dirname);
DEBUG_MSG("Listing directory : %s\n", dirname);
File root = fs.open(dirname);
if (!root) {
Serial.println(" - failed to open directory");
if (!root)
{
DEBUG_MSG("* Failed to open directory\n");
return;
}
if (!root.isDirectory()) {
Serial.println(" - not a directory");
if (!root.isDirectory())
{
DEBUG_MSG("* Not a directory\n");
return;
}
File file = root.openNextFile();
while (file) {
if (file.isDirectory()) {
Serial.print(" DIR : ");
Serial.println(file.name());
if (levels) {
while (file)
{
if (file.isDirectory())
{
DEBUG_MSG(" DIR: ");
DEBUG_MSG("%s\n", file.name());
if (levels)
{
listDir(fs, file.name(), levels - 1);
}
} else {
Serial.print(" FILE : ");
Serial.print(file.name());
Serial.print("\tSIZE : ");
Serial.println(file.size());
}
else
DEBUG_MSG(" FILE: %s\t\tSIZE: %d\n", file.name(), file.size());
file = root.openNextFile();
}
}

Loading…
Cancel
Save