Skip to content

Commit

Permalink
common: apply big-edian case for ascii to uint16_t (COVESA#529)
Browse files Browse the repository at this point in the history
Swap bit of apid, ctid counters
Turn ON MSBF in HTYP to use dlt in big-edian architecture

Co-authored-by: LUU QUANG MINH <[email protected]>
Co-authored-by: Gianfranco Costamagna <[email protected]>
  • Loading branch information
3 people authored Oct 18, 2023
1 parent ac3a843 commit f74e548
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions tests/gtest_dlt_daemon_gateway.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -456,8 +456,8 @@ TEST(t_dlt_gateway_parse_get_log_info, normal)
char ecuid[] = "ECU2";
uint32_t sid = DLT_SERVICE_ID_GET_LOG_INFO;
uint8_t status = 7;
uint16_t count_app_ids = 1;
uint16_t count_context_ids = 1;
uint16_t count_app_ids = DLT_HTOLE_16(1);
uint16_t count_context_ids =DLT_HTOLE_16(1);
const char *apid = "LOG";
const char *ctid = "TEST";
const char *com = "remo";
Expand Down Expand Up @@ -531,6 +531,9 @@ TEST(t_dlt_gateway_parse_get_log_info, normal)

msg.standardheader = (DltStandardHeader *)(msg.headerbuffer + sizeof(DltStorageHeader));
msg.standardheader->htyp = DLT_HTYP_WEID | DLT_HTYP_WTMS | DLT_HTYP_UEH | DLT_HTYP_PROTOCOL_VERSION1;
#if (BYTE_ORDER == BIG_ENDIAN)
msg.standardheader->htyp = (msg.standardheader->htyp | DLT_HTYP_MSBF);
#endif
msg.standardheader->mcnt = 0;

dlt_set_id(msg.headerextra.ecu, ecuid);
Expand Down

0 comments on commit f74e548

Please sign in to comment.