summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDinh Cong Toan <toan.dinhcong@vn.bosch.com>2021-05-25 16:28:21 +0700
committerSaya Sugiura <39760799+ssugiura@users.noreply.github.com>2021-06-30 10:54:59 +0900
commit1e7d374593ae34c5f1b343a213123d5385852fe7 (patch)
tree8df78ee5c1112874dc0d4d7c682ff559cbc2d04f /include
parent3bb7eb24092ff771ccfd1119f8c1088f3f78f981 (diff)
downloadDLT-daemon-1e7d374593ae34c5f1b343a213123d5385852fe7.tar.gz
dlt message header broken
This commit is to revert the following commits: - de4a4234 - fb9ff078 - db9917b3 - e4467f0e - a567e01d Those commits are from improvement but they seem to break the dlt message header in some cases. Signed-off-by: Bui Nguyen Quoc Thanh <thanh.buinguyenquoc@vn.bosch.com>
Diffstat (limited to 'include')
-rw-r--r--include/dlt/dlt_common.h24
-rw-r--r--include/dlt/dlt_user.h.in2
2 files changed, 13 insertions, 13 deletions
diff --git a/include/dlt/dlt_common.h b/include/dlt/dlt_common.h
index 049b6ee..7973ab1 100644
--- a/include/dlt/dlt_common.h
+++ b/include/dlt/dlt_common.h
@@ -300,10 +300,10 @@ enum {
# define DLT_MSG_READ_VALUE(dst, src, length, type) \
{ \
- if ((length < 0) || ((length) < ((int32_t) sizeof(type)))) \
+ if ((length < 0) || ((length) < ((int32_t)sizeof(type)))) \
{ length = -1; } \
else \
- { dst = *((type *)src); src += sizeof(type); length -= (int32_t) sizeof(type); } \
+ { dst = *((type *)src); src += sizeof(type); length -= sizeof(type); } \
}
# define DLT_MSG_READ_ID(dst, src, length) \
@@ -322,7 +322,7 @@ enum {
} \
else \
{ \
- memcpy(dst, src, (size_t) length); \
+ memcpy(dst, src, length); \
dlt_clean_string(dst, length); \
dst[length] = 0; \
src += length; \
@@ -500,14 +500,14 @@ typedef struct sDltMessage
int32_t resync_offset;
/* size parameters */
- uint32_t headersize; /**< size of complete header including storage header */
- uint32_t datasize; /**< size of complete payload */
+ int32_t headersize; /**< size of complete header including storage header */
+ int32_t datasize; /**< size of complete payload */
/* buffer for current loaded message */
uint8_t headerbuffer[sizeof(DltStorageHeader) +
sizeof(DltStandardHeader) + sizeof(DltStandardHeaderExtra) + sizeof(DltExtendedHeader)]; /**< buffer for loading complete header */
uint8_t *databuffer; /**< buffer for loading payload */
- uint32_t databuffersize;
+ int32_t databuffersize;
/* header values of current loaded message */
DltStorageHeader *storageheader; /**< pointer to storage header of current loaded header */
@@ -778,12 +778,12 @@ typedef struct
int32_t lastBytesRcvd; /**< bytes received in last receive call */
int32_t bytesRcvd; /**< received bytes */
int32_t totalBytesRcvd; /**< total number of received bytes */
- char *buffer; /**< pointer to receiver buffer */
- char *buf; /**< pointer to position within receiver buffer */
- char *backup_buf; /** pointer to the buffer with partial messages if any **/
- int fd; /**< connection handle */
+ char *buffer; /**< pointer to receiver buffer */
+ char *buf; /**< pointer to position within receiver buffer */
+ char *backup_buf; /** pointer to the buffer with partial messages if any **/
+ int fd; /**< connection handle */
DltReceiverType type; /**< type of connection handle */
- uint32_t buffersize; /**< size of receiver buffer */
+ int32_t buffersize; /**< size of receiver buffer */
struct sockaddr_in addr; /**< socket address information */
} DltReceiver;
@@ -1301,7 +1301,7 @@ DltReturnValue dlt_check_storageheader(DltStorageHeader *storageheader);
* @param required size
* @return negative value if required size is not sufficient
* */
-DltReturnValue dlt_check_rcv_data_size(uint32_t received, uint32_t required);
+DltReturnValue dlt_check_rcv_data_size(int received, int required);
/**
* Initialise static ringbuffer with a size of size.
diff --git a/include/dlt/dlt_user.h.in b/include/dlt/dlt_user.h.in
index 960b9f0..b4d508d 100644
--- a/include/dlt/dlt_user.h.in
+++ b/include/dlt/dlt_user.h.in
@@ -129,7 +129,7 @@ typedef struct
{
DltContext *handle; /**< pointer to DltContext */
unsigned char *buffer; /**< buffer for building log message*/
- size_t size; /**< payload size */
+ int32_t size; /**< payload size */
int32_t log_level; /**< log level */
int32_t trace_status; /**< trace status */
int32_t args_num; /**< number of arguments for extended header*/