File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -849,19 +849,12 @@ static void handleGetText(TsChannelBase* tsChannel) {
849849 tsState.textCommandCounter ++;
850850
851851 printOverallStatus ();
852-
853- #if 0
854- size_t outputSize = loggingGetOutputData(tsChannel->scratchBuffer + TS_PACKET_HEADER_SIZE, sizeof(tsChannel->scratchBuffer) - TS_PACKET_HEADER_SIZE - TS_PACKET_TAIL_SIZE);
855852#if EFI_SIMULATOR
856- logMsg("get test sending [%d]\r\n", outputSize);
857- #endif
858-
859- tsChannel->crcAndWriteBuffer(TS_RESPONSE_OK, outputSize);
860- #else
861- /* size_t outputSize = */ loggingSendOutputData (tsChannel);
862- #endif
853+ size_t outputSize =
854+ #endif // EFI_SIMULATOR
855+ loggingSendOutputData (tsChannel);
863856#if EFI_SIMULATOR
864- // logMsg("sent [%d]\r\n", outputSize);
857+ logMsg (" sent [%d]\r\n " , outputSize);
865858#endif // EFI_SIMULATOR
866859}
867860#endif // EFI_TEXT_LOGGING
Original file line number Diff line number Diff line change @@ -46,38 +46,16 @@ void LogLineBuffer::free() {
4646 freeBuffers.post (this , TIME_INFINITE );
4747}
4848
49- /* *
50- * Fill buffer with as much data as possible
51- *
52- * @return actual size to transfer
53- */
54- size_t loggingGetOutputData (char *buffer, size_t size) {
55- LogBufferBase* line;
56- size_t offset = 0 ;
57- // TODO: better?
58- while (offset + 128 <= size) {
59- // Fetch a queued message
60- msg_t msg = filledBuffers.fetch (&line, TIME_IMMEDIATE );
61-
62- if (msg != MSG_OK ) {
63- return offset;
64- }
65-
66- const char * content = line->getBuffer ();
67- size_t len = std::strlen (content);
68- memcpy (buffer + offset, content, len);
69- offset += len;
70-
71- // Return this logging buffer to the owner
72- line->free ();
73- }
74-
75- return offset;
76- }
7749
7850// actually we can send much more in one packed. this is just a threshold that triggers current packet finalization
7951constexpr size_t maxSend = scratchBuffer_SIZE;
8052
53+ /* *
54+ * Write as much data as possible
55+ *
56+ * @return actual size transfered
57+ */
58+
8159size_t loggingSendOutputData (TsChannelBase* tsChannel) {
8260 // consolidate up to 16 line buffers in one TS packet
8361 LogBufferBase* bufs[16 ];
Original file line number Diff line number Diff line change @@ -15,7 +15,6 @@ class Logging;
1515
1616void startLoggingProcessor ();
1717
18- size_t loggingGetOutputData (char *buffer, size_t size);
1918size_t loggingSendOutputData (TsChannelBase* tsChannel);
2019
2120namespace priv
You can’t perform that action at this time.
0 commit comments