add ping to startuup - not working yet
This commit is contained in:
BIN
FW/leo_muziekdoos_esp32/data/ping.mp3
Normal file
BIN
FW/leo_muziekdoos_esp32/data/ping.mp3
Normal file
Binary file not shown.
@@ -28,5 +28,6 @@
|
|||||||
"GameTimeout": 20000,
|
"GameTimeout": 20000,
|
||||||
"PowerTimeout": 30,
|
"PowerTimeout": 30,
|
||||||
"PowerOTADelay": 4000,
|
"PowerOTADelay": 4000,
|
||||||
"Brightness": 2
|
"Brightness": 2,
|
||||||
|
"ping": "/ping.mp3"
|
||||||
}
|
}
|
||||||
@@ -77,7 +77,23 @@ float getFloatParam(String param, int def)
|
|||||||
}
|
}
|
||||||
if(!settingsDoc.containsKey(param))
|
if(!settingsDoc.containsKey(param))
|
||||||
{
|
{
|
||||||
log_e("param(%s)",param);
|
log_e("param(%s) not availavle",param);
|
||||||
|
return def;
|
||||||
|
}
|
||||||
|
return settingsDoc[param];
|
||||||
|
}
|
||||||
|
|
||||||
|
String getStringParam(String param, String def)
|
||||||
|
{
|
||||||
|
log_i("Get String param %s",param );
|
||||||
|
if( param == "")
|
||||||
|
{
|
||||||
|
log_e("No param(%s) given",param);
|
||||||
|
return def;
|
||||||
|
}
|
||||||
|
if(!settingsDoc.containsKey(param))
|
||||||
|
{
|
||||||
|
log_e("param(%s) not availavle",param);
|
||||||
return def;
|
return def;
|
||||||
}
|
}
|
||||||
return settingsDoc[param];
|
return settingsDoc[param];
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ bool getUIDvalid(String uid);
|
|||||||
String GetWifiPassword(String ssid);
|
String GetWifiPassword(String ssid);
|
||||||
int GetIntparam(String param, int def = -1);
|
int GetIntparam(String param, int def = -1);
|
||||||
float getFloatParam( String param, int def = -1);
|
float getFloatParam( String param, int def = -1);
|
||||||
|
String getStringParam(String param, String def = "error");
|
||||||
|
|
||||||
void initConfig(void);
|
void initConfig(void);
|
||||||
void handleConfig(void);
|
void handleConfig(void);
|
||||||
@@ -47,6 +47,10 @@ void loop()
|
|||||||
handleHallSensor();
|
handleHallSensor();
|
||||||
handleGame();
|
handleGame();
|
||||||
}
|
}
|
||||||
|
else if(getPowerState() == POWERSTATES::poweringOn2)
|
||||||
|
{
|
||||||
|
handleAudio();
|
||||||
|
}
|
||||||
else if (getPowerState() == POWERSTATES::overTheAir2)
|
else if (getPowerState() == POWERSTATES::overTheAir2)
|
||||||
{
|
{
|
||||||
handleOta();
|
handleOta();
|
||||||
|
|||||||
@@ -109,6 +109,7 @@ void handlePowerState(void)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
log_i("Release for poweron, hold for %d to OTA", (POWERBUTTONOTADELAY - buttonPower.getPressedFor()));
|
log_i("Release for poweron, hold for %d to OTA", (POWERBUTTONOTADELAY - buttonPower.getPressedFor()));
|
||||||
|
playSong(getStringParam("ping"));
|
||||||
}
|
}
|
||||||
if (buttonPower.pressedFor(POWERBUTTONOTADELAY))
|
if (buttonPower.pressedFor(POWERBUTTONOTADELAY))
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user