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
1007 B
34 lines
1007 B
#include <stddef.h>
|
|
#include <stdio.h>
|
|
|
|
#include "sdk/chip/chip.hpp"
|
|
#include "sdk/components/zcancmder/zcan_protocol_parser.hpp"
|
|
#include "sdk/components/zcancmder/zcanreceiver.hpp"
|
|
#include "sdk/os/zos.hpp"
|
|
#include "sdk\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); }
|
|
// dynamic_cast<StepMotorCtrlModule*>(GService::inst()->getZCanProtocolParser()->getModule(getmoduleId(1)))
|
|
|
|
template <typename T>
|
|
T* getModule(uint32_t moduleId) {
|
|
return dynamic_cast<T*>(zcan_protocol_parser.getModule(moduleId));
|
|
}
|
|
};
|
|
|
|
} // namespace iflytop
|