I am using the function SvcReadDataByPeriodicIdentifier_2013.
The protocol works fine and I see on the can bus the full set of identifiers thet I've defined before (SvcDynamicallyDefineDataIdentifierDBMA_2013).
Code: Select all
7) 201381.5 Rx 07E4 8 10 19 2C 02 F2 00 13 01 request: SvcDynamicallyDefineDataIdentifierDBMA_2013
8) 201413.1 Rx 07EC 3 30 1F 00
9) 201413.4 Rx 07E4 8 21 00 00 02 01 00 04 04
10) 201413.5 Rx 07E4 8 22 01 00 08 04 01 00 0C
11) 201413.5 Rx 07E4 8 23 04 01 00 10 04 55 55
12) 201453.2 Rx 07EC 5 04 6C 02 F2 00 positive ack to SvcDynamicallyDefineDataIdentifierDBMA_2013
13) 209303.4 Rx 07E4 8 03 2A 02 00 55 55 55 55 request: SvcReadDataByPeriodicIdentifier_2013
14) 209353.6 Rx 07EC 8 10 14 6A 00 34 12 CD AB positive ack to SvcReadDataByPeriodicIdentifier_2013
15) 209353.9 Rx 07E4 8 30 1F 00 55 55 55 55 55
16) 209393.7 Rx 07EC 8 21 78 56 AA 55 00 00 01
17) 209394.3 Rx 07EC 8 22 00 00 00 02 00 00 00
18) 209552.8 Rx 07EC 8 10 14 6A 00 34 12 CD AB ECU keep sending data at regular intervals
19) 209553.1 Rx 07E4 8 30 1F 00 55 55 55 55 55
20) 209553.4 Rx 07EC 8 21 78 56 AA 55 00 00 01
21) 209553.9 Rx 07EC 8 22 00 00 00 02 00 00 00
22) 209753.0 Rx 07EC 8 10 14 6A 00 34 12 CD AB ECU keep sending data at regular intervals
23) 209753.2 Rx 07E4 8 30 1F 00 55 55 55 55 55
24) 209753.5 Rx 07EC 8 21 78 56 AA 55 00 00 01
25) 209754.0 Rx 07EC 8 22 00 00 00 02 00 00 00
26) 209953.0 Rx 07EC 8 10 14 6A 00 34 12 CD AB ECU keep sending data at regular intervals
27) 209953.4 Rx 07E4 8 30 1F 00 55 55 55 55 55
28) 209953.6 Rx 07EC 8 21 78 56 AA 55 00 00 01
29) 209954.2 Rx 07EC 8 22 00 00 00 02 00 00 00
... continue ...
I have two problems.
First problem: after calling SvcReadDataByPeriodicIdentifier_2013, I call WaitForService_2013 and get the response.
I expected the response to carry all data, however, I only see the first 5 bytes (those in the first can bus message 00 34 12 CD AB); then following bytes are zeros.
This is the C# code:
Code: Select all
Byte[] periodic_data_identifier = { 0 };
result = UDSApi.SvcReadDataByPeriodicIdentifier_2013(
canport, config, out uds_msg request,
uds_svc_param_rdbpi.PUDS_SVC_PARAM_RDBPI_SAMR,
periodic_data_identifier, (uint)periodic_data_identifier.Length);
if (UDSApi.StatusIsOk_2013(result)) {
uds_msg response = new uds_msg();
result = UDSApi.WaitForService_2013(canport,
ref request, out response, out request_confirmation);
for (int i = 0; i < 0x14; i++) {
UDSApi.GetDataParameter_2013(ref response, i, out byte x);
Console.Out.WriteLine($"x = {x:X2}");
}
Second problem: the ECU keeps sending data at regular intervals.
How to use the UDS API to get this data?
For sure I cannot call SvcReadDataByPeriodicIdentifier_2013 again.
Thanks and regards
Fabio