新增log 4k写入文件控制功能
Change-Id: Iaeee7c4c593376bb70fea6061bd9186eac9d3753
diff --git a/mbtk/mbtk_logd/alog_read.c b/mbtk/mbtk_logd/alog_read.c
index 5e86138..20a6d0e 100755
--- a/mbtk/mbtk_logd/alog_read.c
+++ b/mbtk/mbtk_logd/alog_read.c
@@ -63,6 +63,7 @@
//extern char radiolog_buff[MAX_BUFFER_SIZE];
extern char *radio_globalPtr;
extern int radio_len;
+extern int emmc_pro;
void hex_print(char* buf, int len)
@@ -274,24 +275,35 @@
defaultBuffer[index] ^= 1;
}
}
-
- if(buffer_index + totalLen >= RADIOLOG_BUFF_SIZE && buffer_index < RADIOLOG_BUFF_SIZE)
+ if(emmc_pro)
{
- memcpy(buffer + buffer_index, defaultBuffer, totalLen);
- buffer_index += totalLen;
- if (write(fd_radio, buffer, buffer_index) < 0)
+ if(buffer_index + totalLen >= RADIOLOG_BUFF_SIZE && buffer_index < RADIOLOG_BUFF_SIZE)
+ {
+ memcpy(buffer + buffer_index, defaultBuffer, totalLen);
+ buffer_index += totalLen;
+ if (write(fd_radio, buffer, buffer_index) < 0)
+ {
+ perror("write error");
+ close(fd_radio);
+ return -1;
+ }
+ buffer_index = 0; // Reset buffer index after flushing
+ }
+ else
+ {
+ memcpy(buffer + buffer_index, defaultBuffer, totalLen);
+ buffer_index += totalLen;
+ //memcpy(radiolog_buff,buffer,buffer_index);
+ }
+ }
+ else
+ {
+ if (write(fd_radio, defaultBuffer, totalLen) < 0)
{
perror("write error");
close(fd_radio);
return -1;
}
- buffer_index = 0; // Reset buffer index after flushing
- }
- else
- {
- memcpy(buffer + buffer_index, defaultBuffer, totalLen);
- buffer_index += totalLen;
- //memcpy(radiolog_buff,buffer,buffer_index);
}