fixed Bug in Battery-Type-Setting and disabled WiFiClient
This commit is contained in:
		| @@ -190,8 +190,8 @@ | |||||||
|               <div class="col-8"> |               <div class="col-8"> | ||||||
|                 <select id="batterytype" class="set-wsevent data-batterytype select form-control">  |                 <select id="batterytype" class="set-wsevent data-batterytype select form-control">  | ||||||
|                   <option value="Undefined">Undefined</option> |                   <option value="Undefined">Undefined</option> | ||||||
|                   <option value="LiPo3S">LiPo 3S</option> |                   <option value="LiPo 3S">LiPo 3S</option> | ||||||
|                   <option value="LiPo2S">LiPo 2S</option>             |                   <option value="LiPo 2S">LiPo 2S</option>             | ||||||
|                 </select> |                 </select> | ||||||
|               </div> |               </div> | ||||||
|             </div> |             </div> | ||||||
| @@ -215,28 +215,34 @@ | |||||||
|             <div class="form-group row"> |             <div class="form-group row"> | ||||||
|               <label for="name_faction1" class="control-label col-4">Faktion 1</label> |               <label for="name_faction1" class="control-label col-4">Faktion 1</label> | ||||||
|               <div class="col-8"> |               <div class="col-8"> | ||||||
|                 <input id="name_faction1" type="text" class="set-wsevent data-name_faction1 form-control" required="required"> |                 <div class="input-group"> | ||||||
|  |                   <input id="name_faction1" type="text" class="set-wsevent data-name_faction1 form-control" required="required"> | ||||||
|                   <div class="input-group-append"> |                   <div class="input-group-append"> | ||||||
|                     <span class="input-group-text">max. 32 Zeichen</span> |                     <span class="input-group-text">max. 32 Zeichen</span> | ||||||
|                   </div> |                   </div> | ||||||
|  |                 </div> | ||||||
|               </div> |               </div> | ||||||
|             </div> |             </div> | ||||||
|             <div class="form-group row"> |             <div class="form-group row"> | ||||||
|               <label for="name_faction2" class="control-label col-4">Faktion 2</label> |               <label for="name_faction2" class="control-label col-4">Faktion 2</label> | ||||||
|               <div class="col-8"> |               <div class="col-8"> | ||||||
|                 <input id="name_faction2" type="text" class="set-wsevent data-name_faction2 form-control" required="required"> |                 <div class="input-group"> | ||||||
|  |                   <input id="name_faction2" type="text" class="set-wsevent data-name_faction2 form-control" required="required"> | ||||||
|                   <div class="input-group-append"> |                   <div class="input-group-append"> | ||||||
|                     <span class="input-group-text">max. 32 Zeichen</span> |                     <span class="input-group-text">max. 32 Zeichen</span> | ||||||
|                   </div> |                   </div> | ||||||
|  |                 </div> | ||||||
|               </div> |               </div> | ||||||
|             </div> |             </div> | ||||||
|             <div class="form-group row"> |             <div class="form-group row"> | ||||||
|               <label for="name_faction3" class="control-label col-4">Faktion 3</label> |               <label for="name_faction3" class="control-label col-4">Faktion 3</label> | ||||||
|               <div class="col-8"> |               <div class="col-8"> | ||||||
|                 <input id="name_faction3" type="text" class="set-wsevent data-name_faction3 form-control" required="required"> |                 <div class="input-group"> | ||||||
|  |                   <input id="name_faction3" type="text" class="set-wsevent data-name_faction3 form-control" required="required"> | ||||||
|                   <div class="input-group-append"> |                   <div class="input-group-append"> | ||||||
|                     <span class="input-group-text">max. 32 Zeichen</span> |                     <span class="input-group-text">max. 32 Zeichen</span> | ||||||
|                   </div> |                   </div> | ||||||
|  |                 </div> | ||||||
|               </div> |               </div> | ||||||
|             </div> |             </div> | ||||||
|           <!-- Div Group Timer Settings --> |           <!-- Div Group Timer Settings --> | ||||||
| @@ -267,15 +273,15 @@ | |||||||
|           </tr> |           </tr> | ||||||
|           <tr> |           <tr> | ||||||
|             <td>Firmware Version</td> |             <td>Firmware Version</td> | ||||||
|             <td>%SW_VERSION%</td> |             <td><span class="data-fw-version"></span></td> | ||||||
|           </tr> |           </tr> | ||||||
|           <tr> |           <tr> | ||||||
|             <td>Flash Version</td> |             <td>Flash Version</td> | ||||||
|             <td>%FS_VERSION%</td> |             <td><span class="data-flash-version"></span></td> | ||||||
|           </tr> |           </tr> | ||||||
|           <tr> |           <tr> | ||||||
|             <td>Git Revision</td> |             <td>Git Revision</td> | ||||||
|             <td>%GIT_REV%</td> |             <td><span class="data-git-revision"></span></td> | ||||||
|           </tr> |           </tr> | ||||||
|       </table> |       </table> | ||||||
|       </p> |       </p> | ||||||
|   | |||||||
| @@ -29,7 +29,7 @@ upload_speed = 921600 | |||||||
|  |  | ||||||
| build_flags= | build_flags= | ||||||
|   -DATOMIC_FS_UPDATE |   -DATOMIC_FS_UPDATE | ||||||
|   -DFEATURE_ENABLE_WIFI_CLIENT |   ;-DFEATURE_ENABLE_WIFI_CLIENT | ||||||
|   ;-DFEATURE_ENABLE_LORA |   ;-DFEATURE_ENABLE_LORA | ||||||
|   -DFEATURE_ENABLE_UARTLORA |   -DFEATURE_ENABLE_UARTLORA | ||||||
|   -DWIFI_AP_IP_GW=10,0,0,1 |   -DWIFI_AP_IP_GW=10,0,0,1 | ||||||
|   | |||||||
| @@ -3,6 +3,7 @@ | |||||||
| const char *BatteryString[] = { | const char *BatteryString[] = { | ||||||
|     "Undefined", |     "Undefined", | ||||||
|     "LiPo 2S", |     "LiPo 2S", | ||||||
|     "LiPo 3S"}; |     "LiPo 3S" | ||||||
|  |     }; | ||||||
|  |  | ||||||
| const size_t BatteryString_Elements = sizeof(BatteryString) / sizeof(BatteryString[0]); | const size_t BatteryString_Elements = sizeof(BatteryString) / sizeof(BatteryString[0]); | ||||||
| @@ -497,7 +497,6 @@ void Websocket_HandleSettings(uint8_t *data) | |||||||
|   { |   { | ||||||
|     ConfigData.active_faction_on_reboot = value[0] == '1' ? true : false; |     ConfigData.active_faction_on_reboot = value[0] == '1' ? true : false; | ||||||
|   } |   } | ||||||
|  |  | ||||||
|   else if (strcmp(identifier, "name_faction1") == 0) |   else if (strcmp(identifier, "name_faction1") == 0) | ||||||
|   { |   { | ||||||
|     strncpy(ConfigData.Faction_1_Name, value, sizeof(ConfigData.Faction_1_Name)); |     strncpy(ConfigData.Faction_1_Name, value, sizeof(ConfigData.Faction_1_Name)); | ||||||
| @@ -511,10 +510,6 @@ void Websocket_HandleSettings(uint8_t *data) | |||||||
|     strncpy(ConfigData.Faction_3_Name, value, sizeof(ConfigData.Faction_3_Name)); |     strncpy(ConfigData.Faction_3_Name, value, sizeof(ConfigData.Faction_3_Name)); | ||||||
|   } |   } | ||||||
|   else if (strcmp(identifier, "batterytype") == 0) |   else if (strcmp(identifier, "batterytype") == 0) | ||||||
|   { |  | ||||||
|     strncpy(ConfigData.wifi_client_ssid, value, sizeof(ConfigData.wifi_client_ssid)); |  | ||||||
|   } |  | ||||||
|   else if (strcmp(identifier, "batterytype") == 0) |  | ||||||
|   { |   { | ||||||
|     int index = findIndexByString(value, BatteryString, BatteryString_Elements); |     int index = findIndexByString(value, BatteryString, BatteryString_Elements); | ||||||
|     batterytypePreselect = (batteryType_t)index; |     batterytypePreselect = (batteryType_t)index; | ||||||
| @@ -660,7 +655,10 @@ void Websocket_RefreshClientData_Static(uint32_t client_id, bool send_mapping) | |||||||
|                            "name_faction2;" |                            "name_faction2;" | ||||||
|                            "name_faction3;" |                            "name_faction3;" | ||||||
|                            "wifi-ssid;" |                            "wifi-ssid;" | ||||||
|                            "wifi-pass;"; |                            "wifi-pass;" | ||||||
|  |                            "fw-version;" | ||||||
|  |                            "flash-version;" | ||||||
|  |                            "git-revison;"; | ||||||
|  |  | ||||||
|     if (client_id > 0) |     if (client_id > 0) | ||||||
|       webSocket.text(client_id, mapping); |       webSocket.text(client_id, mapping); | ||||||
| @@ -668,24 +666,31 @@ void Websocket_RefreshClientData_Static(uint32_t client_id, bool send_mapping) | |||||||
|       webSocket.textAll(mapping); |       webSocket.textAll(mapping); | ||||||
|   } |   } | ||||||
|  |  | ||||||
|   String temp = "STATIC:"; |   char dataString[200]; // Maximal 200 Zeichen für den Data-String | ||||||
|  |   char flash_version[6]; | ||||||
|  |   GetFlashVersion(flash_version, sizeof(flash_version)); | ||||||
|  |  | ||||||
|   temp.concat(String(globals.DeviceName) + ";"); |   sprintf(dataString, "STATIC:%s;%d;%d;%s;%s;%s;%s;%s;%d.%02d;%s;%s;", | ||||||
|   temp.concat(String(ConfigData.active_faction_on_reboot) + ";"); |           globals.DeviceName, | ||||||
|   temp.concat(String(ConfigData.batteryType) + ";"); |           ConfigData.active_faction_on_reboot, | ||||||
|   temp.concat(String(ConfigData.Faction_1_Name) + ";"); |           ConfigData.batteryType, | ||||||
|   temp.concat(String(ConfigData.Faction_2_Name) + ";"); |           ConfigData.Faction_1_Name, | ||||||
|   temp.concat(String(ConfigData.Faction_3_Name) + ";"); |           ConfigData.Faction_2_Name, | ||||||
|   temp.concat(String(ConfigData.wifi_client_ssid) + ";"); |           ConfigData.Faction_3_Name, | ||||||
|   temp.concat(String(ConfigData.wifi_client_password) + ";"); |           ConfigData.wifi_client_ssid, | ||||||
|  |           ConfigData.wifi_client_password, | ||||||
|  |           constants.FW_Version_major, | ||||||
|  |           constants.FW_Version_minor, | ||||||
|  |           flash_version, | ||||||
|  |           constants.GitHash); | ||||||
|  |  | ||||||
|   if (client_id > 0) |   if (client_id > 0) | ||||||
|   { |   { | ||||||
|     webSocket.text(client_id, temp); |     webSocket.text(client_id, dataString); | ||||||
|   } |   } | ||||||
|   else |   else | ||||||
|   { |   { | ||||||
|     webSocket.textAll(temp); |     webSocket.textAll(dataString); | ||||||
|   } |   } | ||||||
| } | } | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user