Move common helpers related to "diag clients" into a "Diagnostics
Monitor" implementation. This becomes necessary in order to support
non-HDLC encoding between the DM and device transparently to the
rest of the implementation.
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
In order to support any sort of fragmentation in a stream based
transport, such as TCP/IP, the data is read into a circular buffer and
the HDLC decoder is turned into a reentrant consumer of said circular
buffer.
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Increased buffer size to accommodate for masks in command packets.
Signed-off-by: Eyal Ilsar <eilsar@codeaurora.org>
[bjorn: Extracted from another patch]
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Let the socket register itself as a client upon successfully connecting
to the remote, in order to isolate the interfacing with the socket from
the common code and group socket related handling in one place.
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Continued to consolidate the transport layer by moving the incoming
packet read to the separate file and delegating the command handling
back to the main code for now.
Signed-off-by: Eyal Ilsar <eilsar@codeaurora.org>
[bjorn: omit new debug mask flags]
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
First move in separating the transport layer from the main code so to
enable support for other connections besides socket based.
Signed-off-by: Eyal Ilsar <eilsar@codeaurora.org>
[bjorn: Retained original implementation,
dropped now unnecessary includes from diag.c,
moved implementation to socket.c]
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>