Woman, Life, Freedom


Adaptive AUTOSAR
ARA public interface header documentation
obd_to_doip_converter.h
1#ifndef OBD_TO_DOIP_CONVERTER_H
2#define OBD_TO_DOIP_CONVERTER_H
3
4#include <obdemulator/obd_service.h>
5#include "./doip_client.h"
6
7namespace application
8{
9 namespace doip
10 {
13 class ObdToDoipConverter : public ObdEmulator::ObdService
14 {
15 private:
16 // Show current data mode
17 static const uint8_t cService{0x01};
18 static const uint8_t cSid{0x22};
19 static const uint8_t cProtocolVersion{2};
20
21 DoipClient mClient;
22
23 static bool tryParseUdsData(
24 std::vector<uint8_t> &&udsResponse,
25 uint8_t &pid,
26 std::vector<uint8_t> &obdData);
27
28 void onUdsDataReceived(
29 std::vector<uint8_t> &&receivedUdsData) const;
30
31 bool trySendAsDoip(uint8_t pid);
32
33 public:
40 AsyncBsdSocketLib::Poller *poller,
41 std::string ipAddress,
42 uint16_t port);
43
44 bool TryGetResponse(
45 const std::vector<uint8_t> &pid,
46 std::vector<uint8_t> &response) const override;
47
48 bool TryGetResponseAsync(const std::vector<uint8_t> &pid) override;
49 };
50 }
51}
52
53#endif
A class to send DoIP requests to a DoIP server.
Definition: doip_client.h:17
A OBD service class to handle OBD queries asynchronously.
Definition: obd_to_doip_converter.h:14
ObdToDoipConverter(AsyncBsdSocketLib::Poller *poller, std::string ipAddress, uint16_t port)
Constructor.
Definition: obd_to_doip_converter.cpp:12
AUTOSAR application namespace.
Definition: diag_message_handler.cpp:5