From 046f770a525c3e2a848aa1924c7f08c9bd050dfb Mon Sep 17 00:00:00 2001 From: Manuel Weiser Date: Fri, 29 Aug 2025 13:29:07 +0200 Subject: [PATCH] fix: update createdVendorId reset value to 65535 for improved API handling --- src/api.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/api.cpp b/src/api.cpp index 40f97c6..e9ec60f 100644 --- a/src/api.cpp +++ b/src/api.cpp @@ -618,7 +618,7 @@ uint16_t createVendor(String vendor) { // Create new vendor in Spoolman database using task system // Note: Due to async nature, the ID will be stored in createdVendorId global variable // Note: This function assumes that the caller has already ensured API is IDLE - createdVendorId = 0; // Reset previous value + createdVendorId = 65535; // Reset previous value String spoolsUrl = spoolmanUrl + apiUrl + "/vendor"; Serial.print("Create vendor with URL: "); @@ -668,8 +668,8 @@ uint16_t createVendor(String vendor) { // Wait for task completion and return the created vendor ID // Note: createdVendorId will be set by sendToApi when response is received - while(spoolmanApiState != API_IDLE) { - vTaskDelay(100 / portTICK_PERIOD_MS); + while(createdVendorId == 65535) { + vTaskDelay(50 / portTICK_PERIOD_MS); } return createdVendorId;