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
34 lines
889 B
#include <stddef.h>
|
|
#include <stdio.h>
|
|
|
|
#include "sdk/sdk.hpp"
|
|
#include "protocol/protocol.hpp"
|
|
//
|
|
#include "components/zcancmder/zcanreceiver.hpp"
|
|
#include "components/zcancmder/zcan_protocol_parser.hpp"
|
|
#include "components/zcancmder/protocol_event_bus_sender.hpp"
|
|
|
|
namespace iflytop {
|
|
|
|
class GService {
|
|
ZCanReceiver zcanreceiver;
|
|
ZCanProtocolParser zcan_protocol_parser;
|
|
ProtocolEventBusSender evenSender;
|
|
|
|
public:
|
|
void initialize();
|
|
|
|
static GService* inst();
|
|
|
|
ZCanReceiver* getZCanReceiver() { return &zcanreceiver; }
|
|
ZCanProtocolParser* getZCanProtocolParser() { return &zcan_protocol_parser; }
|
|
|
|
void registerModule(ZIModule* module) { zcan_protocol_parser.registerModule(module); }
|
|
|
|
template <typename T>
|
|
T* getModule(uint32_t moduleId) {
|
|
return dynamic_cast<T*>(zcan_protocol_parser.getModule(moduleId));
|
|
}
|
|
};
|
|
|
|
} // namespace iflytop
|