feat: half baked fw upload
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user