feat: half baked fw upload

This commit is contained in:
2025-08-25 09:41:56 +02:00
parent 2938b5f5fe
commit 9514bf7ac5
4 changed files with 251 additions and 0 deletions

View File

@@ -192,6 +192,22 @@ class SporeApiClient {
async factoryReset() {
return this.request('POST', '/api/device/factory-reset');
}
/**
* Update firmware on the device
* @param {Buffer|Uint8Array} firmwareData - Firmware binary data
* @returns {Promise<Object>} Update response
*/
async updateFirmware(firmwareData, filename) {
// Send the raw firmware data directly to the SPORE device
// The SPORE device expects the file data, not re-encoded multipart
return this.request('POST', '/api/node/update', {
body: firmwareData,
headers: {
'Content-Type': 'application/octet-stream'
}
});
}
}
// Export the client class