Skip to content

Commit

Permalink
Visual Studio project updated
Browse files Browse the repository at this point in the history
  • Loading branch information
RainerZ committed Nov 12, 2024
1 parent 56c1eca commit 7f1e9ca
Show file tree
Hide file tree
Showing 10 changed files with 76 additions and 26 deletions.
7 changes: 5 additions & 2 deletions CPP_Demo/CPP_Demo.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,8 @@
<ClCompile Include="..\src\xcpEthServer.c" />
<ClCompile Include="..\src\xcpEthTl.c" />
<ClCompile Include="..\src\xcpLite.c" />
<ClCompile Include="..\src\xcpTl.c" />
<ClCompile Include="..\src\xcpTlQueue.c" />
<ClCompile Include="main.cpp" />
</ItemGroup>
<ItemGroup>
Expand All @@ -181,10 +183,11 @@
<ClInclude Include="..\src\xcpEthTl.h" />
<ClInclude Include="..\src\xcpLite.h" />
<ClInclude Include="..\src\xcpTl.h" />
<ClInclude Include="..\src\xcpTlQueue.h" />
<ClInclude Include="..\src\xcptl_cfg.h" />
<ClInclude Include="..\src\xcp_cfg.h" />
<ClInclude Include="main.h" />
<ClInclude Include="main_cfg.h" />
<ClInclude Include="xcptl_cfg.h" />
<ClInclude Include="xcp_cfg.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
Expand Down
17 changes: 15 additions & 2 deletions CPP_Demo/CPP_Demo.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,15 @@
<ClCompile Include="..\src\options.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\src\xcpTl.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\src\xcpTlQueue.c">
<Filter>src</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="main_cfg.h" />
<ClInclude Include="xcptl_cfg.h" />
<ClInclude Include="xcp_cfg.h" />
<ClInclude Include="..\src\platform.h">
<Filter>src</Filter>
</ClInclude>
Expand Down Expand Up @@ -73,6 +77,15 @@
<ClInclude Include="main.h">
<Filter>src</Filter>
</ClInclude>
<ClInclude Include="..\src\xcpTlQueue.h">
<Filter>src</Filter>
</ClInclude>
<ClInclude Include="..\src\xcp_cfg.h">
<Filter>src</Filter>
</ClInclude>
<ClInclude Include="..\src\xcptl_cfg.h">
<Filter>src</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<Filter Include="src">
Expand Down
7 changes: 5 additions & 2 deletions C_Demo/C_Demo.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,8 @@
<ClCompile Include="..\src\xcpEthServer.c" />
<ClCompile Include="..\src\xcpEthTl.c" />
<ClCompile Include="..\src\xcpLite.c" />
<ClCompile Include="..\src\xcpTl.c" />
<ClCompile Include="..\src\xcpTlQueue.c" />
<ClCompile Include="ecu.c" />
<ClCompile Include="main.c" />
</ItemGroup>
Expand All @@ -176,11 +178,12 @@
<ClInclude Include="..\src\xcpEthTl.h" />
<ClInclude Include="..\src\xcpLite.h" />
<ClInclude Include="..\src\xcpTl.h" />
<ClInclude Include="..\src\xcpTlQueue.h" />
<ClInclude Include="..\src\xcptl_cfg.h" />
<ClInclude Include="..\src\xcp_cfg.h" />
<ClInclude Include="ecu.h" />
<ClInclude Include="main.h" />
<ClInclude Include="main_cfg.h" />
<ClInclude Include="xcptl_cfg.h" />
<ClInclude Include="xcp_cfg.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
Expand Down
17 changes: 15 additions & 2 deletions C_Demo/C_Demo.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,16 @@
<ClCompile Include="..\src\xcpAppl.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\src\xcpTl.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\src\xcpTlQueue.c">
<Filter>src</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="ecu.h" />
<ClInclude Include="main_cfg.h" />
<ClInclude Include="xcptl_cfg.h" />
<ClInclude Include="..\src\A2L.h">
<Filter>src</Filter>
</ClInclude>
Expand All @@ -47,7 +52,6 @@
<ClInclude Include="..\src\xcpTl.h">
<Filter>src</Filter>
</ClInclude>
<ClInclude Include="xcp_cfg.h" />
<ClInclude Include="..\src\xcpEthServer.h">
<Filter>src</Filter>
</ClInclude>
Expand All @@ -63,6 +67,15 @@
<ClInclude Include="main.h">
<Filter>src</Filter>
</ClInclude>
<ClInclude Include="..\src\xcp_cfg.h">
<Filter>src</Filter>
</ClInclude>
<ClInclude Include="..\src\xcptl_cfg.h">
<Filter>src</Filter>
</ClInclude>
<ClInclude Include="..\src\xcpTlQueue.h">
<Filter>src</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<Filter Include="src">
Expand Down
7 changes: 5 additions & 2 deletions XCPlite/XCPlite.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,8 @@
<ClCompile Include="..\src\xcpEthServer.c" />
<ClCompile Include="..\src\xcpEthTl.c" />
<ClCompile Include="..\src\xcpLite.c" />
<ClCompile Include="..\src\xcpTl.c" />
<ClCompile Include="..\src\xcpTlQueue.c" />
<ClCompile Include="main.c" />
</ItemGroup>
<ItemGroup>
Expand All @@ -174,9 +176,10 @@
<ClInclude Include="..\src\xcpEthTl.h" />
<ClInclude Include="..\src\xcpLite.h" />
<ClInclude Include="..\src\xcpTl.h" />
<ClInclude Include="..\src\xcpTlQueue.h" />
<ClInclude Include="..\src\xcptl_cfg.h" />
<ClInclude Include="..\src\xcp_cfg.h" />
<ClInclude Include="main_cfg.h" />
<ClInclude Include="xcpTl_cfg.h" />
<ClInclude Include="xcp_cfg.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
Expand Down
17 changes: 15 additions & 2 deletions XCPlite/XCPlite.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,14 @@
<ClCompile Include="..\src\xcpAppl.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\src\xcpTl.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\src\xcpTlQueue.c">
<Filter>src</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="xcp_cfg.h" />
<ClInclude Include="..\src\A2L.h">
<Filter>src</Filter>
</ClInclude>
Expand All @@ -36,7 +41,6 @@
<Filter>src</Filter>
</ClInclude>
<ClInclude Include="main_cfg.h" />
<ClInclude Include="xcpTl_cfg.h" />
<ClInclude Include="..\src\xcpEthTl.h">
<Filter>src</Filter>
</ClInclude>
Expand All @@ -52,6 +56,15 @@
<ClInclude Include="..\src\main.h">
<Filter>src</Filter>
</ClInclude>
<ClInclude Include="..\src\xcpTlQueue.h">
<Filter>src</Filter>
</ClInclude>
<ClInclude Include="..\src\xcp_cfg.h">
<Filter>src</Filter>
</ClInclude>
<ClInclude Include="..\src\xcptl_cfg.h">
<Filter>src</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<Filter Include="src">
Expand Down
10 changes: 5 additions & 5 deletions src/xcpEthTl.c
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ void XcpEthTlSendMulticastCrm(const uint8_t* packet, uint16_t packet_size, const

//------------------------------------------------------------------------------

static int handleXcpCommand(tXcpCtoMessage *p, uint8_t *srcAddr, uint16_t srcPort) {
static BOOL handleXcpCommand(tXcpCtoMessage *p, uint8_t *srcAddr, uint16_t srcPort) {

int connected;

Expand All @@ -175,19 +175,19 @@ static int handleXcpCommand(tXcpCtoMessage *p, uint8_t *srcAddr, uint16_t srcPor
DBG_PRINTF_WARNING("WARNING: message from unknown new master %u.%u.%u.%u, disconnecting!\n", srcAddr[0], srcAddr[1], srcAddr[2], srcAddr[3]);
XcpDisconnect();
gXcpTl.MasterAddrValid = FALSE;
return 1; // Disconnect
return TRUE; // Disconnect
}

// Check unicast master udp port, not allowed to change
if (gXcpTl.MasterPort != srcPort) {
DBG_PRINTF_WARNING("WARNING: master port changed from %u to %u, disconnecting!\n", gXcpTl.MasterPort, srcPort);
XcpDisconnect();
gXcpTl.MasterAddrValid = FALSE;
return 1; // Disconnect
return TRUE; // Disconnect
}
}
#endif // UDP
if (p->dlc>XCPTL_MAX_CTO_SIZE) return 0;
if (p->dlc>XCPTL_MAX_CTO_SIZE) return FALSE;
XcpCommand((const uint32_t*)&p->packet[0], (uint8_t)p->dlc); // Handle command
}

Expand Down Expand Up @@ -222,7 +222,7 @@ static int handleXcpCommand(tXcpCtoMessage *p, uint8_t *srcAddr, uint16_t srcPor
} // not connected before
#endif // UDP

return 1; // Ok
return TRUE; // Ok
}


Expand Down
16 changes: 9 additions & 7 deletions src/xcpLite.c
Original file line number Diff line number Diff line change
Expand Up @@ -1047,7 +1047,7 @@ static void XcpSendResponse(const tXcpCto* crm, uint8_t crmLen) {
}

// Transmit multicast command response
#ifdef PLATFORM_ENABLE_GET_LOCAL_ADDR
#ifdef XCPTL_ENABLE_MULTICAST
static void XcpSendMulticastResponse( const tXcpCto* crm, uint8_t crmLen, uint8_t *addr, uint16_t port) {

XcpEthTlSendMulticastCrm((const uint8_t*)crm, crmLen, addr, port);
Expand Down Expand Up @@ -2246,9 +2246,9 @@ static void XcpPrintCmd(const tXcpCto* cmdBuf) {

#endif // >= 0x0104

#ifdef XCP_ENABLE_DAQ_CLOCK_MULTICAST
case CC_TRANSPORT_LAYER_CMD:
switch (CRO_TL_SUBCOMMAND) {
#ifdef XCP_ENABLE_DAQ_CLOCK_MULTICAST
case CC_TL_GET_DAQ_CLOCK_MULTICAST:
{
printf("GET_DAQ_CLOCK_MULTICAST counter=%u, cluster=%u\n", CRO_GET_DAQ_CLOCK_MCAST_COUNTER, CRO_GET_DAQ_CLOCK_MCAST_CLUSTER_IDENTIFIER);
Expand All @@ -2258,9 +2258,9 @@ static void XcpPrintCmd(const tXcpCto* cmdBuf) {
case CC_TL_GET_SERVER_ID:
printf("GET_SERVER_ID %u:%u:%u:%u:%u\n", CRO_TL_GET_SERVER_ID_ADDR(0), CRO_TL_GET_SERVER_ID_ADDR(1), CRO_TL_GET_SERVER_ID_ADDR(2), CRO_TL_GET_SERVER_ID_ADDR(3), CRO_TL_GET_SERVER_ID_PORT );
break;
#endif // XCP_ENABLE_DAQ_CLOCK_MULTICAST
default: printf("UNKNOWN TRANSPORT LAYER COMMAND %02X\n", CRO_TL_SUBCOMMAND); break;
} // switch (CRO_TL_SUBCOMMAND)
#endif // XCP_ENABLE_DAQ_CLOCK_MULTICAST

} // switch (CRO_CMD)
}
Expand Down Expand Up @@ -2397,9 +2397,10 @@ static void XcpPrintRes(const tXcpCto* crm) {
break;
#endif

#if defined(XCP_ENABLE_DAQ_CLOCK_MULTICAST) || defined(XCPTL_ENABLE_MULTICAST)
case CC_TRANSPORT_LAYER_CMD:
switch (gXcp.CmdLast1) {
#ifdef XCP_ENABLE_DAQ_CLOCK_MULTICAST
#ifdef XCP_ENABLE_DAQ_CLOCK_MULTICAST
case CC_TL_GET_DAQ_CLOCK_MULTICAST:
{
if (isLegacyMode()) {
Expand All @@ -2421,16 +2422,17 @@ static void XcpPrintRes(const tXcpCto* crm) {
}

break;
#endif // XCP_ENABLE_DAQ_CLOCK_MULTICAST
#endif // XCP_ENABLE_DAQ_CLOCK_MULTICAST

#ifdef XCPTL_ENABLE_MULTICAST
#ifdef XCPTL_ENABLE_MULTICAST
case CC_TL_GET_SERVER_ID:
printf("<- %u.%u.%u.%u:%u %s\n",
CRM_TL_GET_SERVER_ID_ADDR(0), CRM_TL_GET_SERVER_ID_ADDR(1), CRM_TL_GET_SERVER_ID_ADDR(2), CRM_TL_GET_SERVER_ID_ADDR(3), CRM_TL_GET_SERVER_ID_PORT, &CRM_TL_GET_SERVER_ID_ID);
break;
#endif
#endif
}
break;
#endif

default:
if (DBG_LEVEL >= 5) {
Expand Down
2 changes: 1 addition & 1 deletion src/xcpTl.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ uint8_t XcpTlCommand( uint16_t msgLen, const uint8_t* msgBuf) {
/* Connected */
if (connected) {
if (p->dlc>XCPTL_MAX_CTO_SIZE) return CRC_CMD_SYNTAX;
return XcpCommand((const uint32_t*)&p->packet[0], p->dlc); // Handle command
return XcpCommand((const uint32_t*)&p->packet[0], (uint8_t)p->dlc); // Handle command
}

/* Not connected yet */
Expand Down
2 changes: 1 addition & 1 deletion src/xcpTl.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
typedef struct {
uint16_t dlc; // XCP TL header lenght
uint16_t ctr; // XCP TL Header message counter
uint8_t data[];
uint8_t data[1];
} tXcpDtoMessage;
#pragma pack(pop)

Expand Down

0 comments on commit 7f1e9ca

Please sign in to comment.