|
@@ -419,7 +419,7 @@ int sendTTIAInfo(uint8_t gun_index)
|
|
|
|
|
|
uint8_t tx_buf[80] = {0};
|
|
|
uint8_t logBuf[256]= {0};
|
|
|
- uint8_t tempIndex, socStart, socEnd;
|
|
|
+ uint8_t tx_len, tempIndex, socStart, socEnd;
|
|
|
uint16_t PresentChargedEnergy;
|
|
|
struct tm tmStart, tmEnd;
|
|
|
|
|
@@ -626,12 +626,13 @@ int sendTTIAInfo(uint8_t gun_index)
|
|
|
bcopy((char *)server->h_addr, (char *)&dest_addr.sin_addr.s_addr, server->h_length);
|
|
|
dest_addr.sin_port = htons(ShmSysConfigAndInfo->SysConfig.TTIA_Info.server_port);
|
|
|
|
|
|
- if(sendto(udp_socket_fd, tx_buf, strlen((char*)tx_buf), 0, &dest_addr, sizeof(dest_addr)) >= 0)
|
|
|
+ if((tx_len = sendto(udp_socket_fd, tx_buf, ARRAY_SIZE(tx_buf), 0, &dest_addr, sizeof(dest_addr))) >= 0)
|
|
|
{
|
|
|
for(uint8_t idx=0;idx<ARRAY_SIZE(tx_buf);idx++)
|
|
|
{
|
|
|
sprintf((char*)logBuf, "%s %02X", logBuf, tx_buf[idx]);
|
|
|
}
|
|
|
+ DEBUG_TTIA_INFO("TX raw data length: %d\n", tx_len);
|
|
|
DEBUG_TTIA_INFO("Message raw: %s\n", logBuf);
|
|
|
DEBUG_TTIA_INFO("OCPP Transaction ID: %d\n", ShmOCPP16Data->StopTransaction[gun_index].TransactionId);
|
|
|
DEBUG_TTIA_INFO("TTIA server address: %s\n", ShmSysConfigAndInfo->SysConfig.TTIA_Info.server_addr);
|