Change command FileUpload binary index

This commit is contained in:
Theo Arends 2023-05-06 18:09:11 +02:00
parent b9464a21a8
commit e9d1e8c725
7 changed files with 7 additions and 4 deletions

View File

@ -14,6 +14,7 @@ All notable changes to this project will be documented in this file.
- Support for GM861 1D and 2D bar code reader (#18399) - Support for GM861 1D and 2D bar code reader (#18399)
### Breaking Changed ### Breaking Changed
- Change command ``FileUpload`` index binary data detection from >199 to >299
### Changed ### Changed

View File

@ -124,6 +124,7 @@ The latter links can be used for OTA upgrades too like ``OtaUrl https://ota.tasm
- Berry `tcpclientasync` class for non-blocking TCP client - Berry `tcpclientasync` class for non-blocking TCP client
### Breaking Changed ### Breaking Changed
- Change command ``FileUpload`` index binary data detection from >199 to >299
### Changed ### Changed
- ESP32 Framework (Core) from v2.0.7 to v2.0.8 - ESP32 Framework (Core) from v2.0.7 to v2.0.8

View File

@ -408,7 +408,7 @@ void CommandHandler(char* topicBuf, char* dataBuf, uint32_t data_len) {
} }
type[i] = '\0'; type[i] = '\0';
bool binary_data = (index > 199); // Suppose binary data on topic index > 199 bool binary_data = (index > 299); // Suppose binary data on topic index > 299
if (!binary_data) { if (!binary_data) {
bool keep_spaces = ((strstr_P(type, PSTR("SERIALSEND")) != nullptr) && (index > 9)); // Do not skip leading spaces on (s)serialsend10 and up bool keep_spaces = ((strstr_P(type, PSTR("SERIALSEND")) != nullptr) && (index > 9)); // Do not skip leading spaces on (s)serialsend10 and up
if (!keep_spaces) { if (!keep_spaces) {

View File

@ -210,7 +210,7 @@ void CmndFileUpload(void) {
const char* base64_data = nullptr; const char* base64_data = nullptr;
uint32_t rcv_id = 0; uint32_t rcv_id = 0;
bool binary_data = (XdrvMailbox.index > 199); // Check for raw data bool binary_data = (XdrvMailbox.index > 299); // Check for raw data
if (!binary_data) { if (!binary_data) {
if (strlen(XdrvMailbox.data) > 8) { // Workaround exception if empty JSON like {} - Needs checks if (strlen(XdrvMailbox.data) > 8) { // Workaround exception if empty JSON like {} - Needs checks

View File

@ -28,6 +28,7 @@
* GM861Zone<byte> <value> - Set zone byte to value * GM861Zone<byte> <value> - Set zone byte to value
* GM861Zone5 20 - Set read interval to 2 seconds (default 10 = 0x0A) * GM861Zone5 20 - Set read interval to 2 seconds (default 10 = 0x0A)
* GM861Zone44 0x02 - Enable all barcodes using full area (default 5 = 0x05) * GM861Zone44 0x02 - Enable all barcodes using full area (default 5 = 0x05)
* GM861Zone208 0x80 - Enable AIM ID (default 0 = 0x00)
* GM861Save - Save changes in zone bytes to flash * GM861Save - Save changes in zone bytes to flash
* GM861Reset 1 - Reset to factory settings and re-init the scanner * GM861Reset 1 - Reset to factory settings and re-init the scanner
* GM861Dump - Dump zone bytes 0 to 97 if logging level 4 * GM861Dump - Dump zone bytes 0 to 97 if logging level 4

View File

@ -158,7 +158,7 @@ while Run_flag:
# Message length used by Tasmota (FileTransferHeaderSize) # Message length used by Tasmota (FileTransferHeaderSize)
client.publish(mypublish, "{\"Id\":"+str("%3d"%file_id)+",\"Data\":\""+base64_data+"\"}") client.publish(mypublish, "{\"Id\":"+str("%3d"%file_id)+",\"Data\":\""+base64_data+"\"}")
else: else:
client.publish(mypublish+"201", chunk) client.publish(mypublish+"301", chunk)
file_pos = file_pos + file_chunk_size file_pos = file_pos + file_chunk_size
if file_pos % 102400 < file_chunk_size: if file_pos % 102400 < file_chunk_size:
progress = round((file_pos / 10240)) * 10 progress = round((file_pos / 10240)) * 10

View File

@ -156,7 +156,7 @@ while Run_flag:
# Message length used by Tasmota (FileTransferHeaderSize) # Message length used by Tasmota (FileTransferHeaderSize)
client.publish(mypublish, "{\"Id\":"+str("%3d"%file_id)+",\"Data\":\""+base64_data+"\"}") client.publish(mypublish, "{\"Id\":"+str("%3d"%file_id)+",\"Data\":\""+base64_data+"\"}")
else: else:
client.publish(mypublish+"201", chunk) client.publish(mypublish+"301", chunk)
Ack_flag = True Ack_flag = True
else: else: