@@ -104,7 +104,7 @@ OTACloudProcessInterface::State OTADefaultCloudProcessInterface::fetch() {
104104 continue ;
105105 }
106106
107- http_res = http_client->read (context->buffer , context->buf_len );
107+ http_res = http_client->read (context->buffer , context->bufLen );
108108
109109 if (http_res < 0 ) {
110110 DEBUG_VERBOSE (" OTA ERROR: Download read error %d" , http_res);
@@ -153,13 +153,13 @@ OTACloudProcessInterface::State OTADefaultCloudProcessInterface::fetch() {
153153 return res;
154154}
155155
156- void OTADefaultCloudProcessInterface::parseOta (uint8_t * buffer, size_t buf_len ) {
156+ void OTADefaultCloudProcessInterface::parseOta (uint8_t * buffer, size_t bufLen ) {
157157 assert (context != nullptr ); // This should never fail
158158
159- for (uint8_t * cursor=(uint8_t *)buffer; cursor<buffer+buf_len ; ) {
159+ for (uint8_t * cursor=(uint8_t *)buffer; cursor<buffer+bufLen ; ) {
160160 switch (context->downloadState ) {
161161 case OtaDownloadHeader: {
162- const uint32_t headerLeft = context->headerCopiedBytes + buf_len <= sizeof (context->header .buf ) ? buf_len : sizeof (context->header .buf ) - context->headerCopiedBytes ;
162+ const uint32_t headerLeft = context->headerCopiedBytes + bufLen <= sizeof (context->header .buf ) ? bufLen : sizeof (context->header .buf ) - context->headerCopiedBytes ;
163163 memcpy (context->header .buf +context->headerCopiedBytes , buffer, headerLeft);
164164 cursor += headerLeft;
165165 context->headerCopiedBytes += headerLeft;
@@ -185,7 +185,7 @@ void OTADefaultCloudProcessInterface::parseOta(uint8_t* buffer, size_t buf_len)
185185 }
186186 case OtaDownloadFile: {
187187 const uint32_t contentLength = http_client->contentLength ();
188- const uint32_t dataLeft = buf_len - (cursor-buffer);
188+ const uint32_t dataLeft = bufLen - (cursor-buffer);
189189 context->decoder .decompress (cursor, dataLeft); // TODO verify return value
190190
191191 context->calculatedCrc32 = crc_update (
0 commit comments