You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
889 B

1 year ago
  1. #include <stddef.h>
  2. #include <stdio.h>
  3. #include "sdk/sdk.hpp"
  4. #include "protocol/protocol.hpp"
  5. //
  6. #include "components/zcancmder/zcanreceiver.hpp"
  7. #include "components/zcancmder/zcan_protocol_parser.hpp"
  8. #include "components/zcancmder/protocol_event_bus_sender.hpp"
  9. namespace iflytop {
  10. class GService {
  11. ZCanReceiver zcanreceiver;
  12. ZCanProtocolParser zcan_protocol_parser;
  13. ProtocolEventBusSender evenSender;
  14. public:
  15. void initialize();
  16. static GService* inst();
  17. ZCanReceiver* getZCanReceiver() { return &zcanreceiver; }
  18. ZCanProtocolParser* getZCanProtocolParser() { return &zcan_protocol_parser; }
  19. void registerModule(ZIModule* module) { zcan_protocol_parser.registerModule(module); }
  20. template <typename T>
  21. T* getModule(uint32_t moduleId) {
  22. return dynamic_cast<T*>(zcan_protocol_parser.getModule(moduleId));
  23. }
  24. };
  25. } // namespace iflytop