diff --git a/api/api.hpp b/api/api.hpp index 337c876..e45eef8 100644 --- a/api/api.hpp +++ b/api/api.hpp @@ -1,6 +1,7 @@ #pragma once +#include "apibasic/basic.hpp" // -#include "errorcode.hpp" + // #include "zi_module.hpp" // @@ -8,24 +9,8 @@ // #include "zi_xymotor.hpp" // -#include "packet_interface.hpp" -// -#include "i_zcanreceiver.hpp" - - -// -#include "protocol_constant.hpp" -// -#include "reg_index.hpp" -// -#include "zi_code_scaner.hpp" -// #include "zi_event_bus.hpp" // #include "zi_a8000_optical_module.hpp" // -#include "zi_board_module.hpp" - -// -#include "zi_pipette_ctrl_module.hpp" -#include "reg_index_table.hpp" \ No newline at end of file +#include "zi_pipette_ctrl_module.hpp" \ No newline at end of file diff --git a/api/apibasic/basic.hpp b/api/apibasic/basic.hpp new file mode 100644 index 0000000..395c1d5 --- /dev/null +++ b/api/apibasic/basic.hpp @@ -0,0 +1,14 @@ +#pragma once + +#include "cmdid.hpp" +// +#include "errorcode.hpp" +// +#include "packet_interface.hpp" +// +#include "module_type_index.hpp" +// +#include "protocol_constant.hpp" +// +#include "reg_index.hpp" +// diff --git a/cmdid.hpp b/api/apibasic/cmdid.hpp similarity index 99% rename from cmdid.hpp rename to api/apibasic/cmdid.hpp index d58a4d5..6018ee6 100644 --- a/cmdid.hpp +++ b/api/apibasic/cmdid.hpp @@ -1,5 +1,6 @@ #pragma once -#include "api/api.hpp" + +#define CMDID(cmdid, cmdSubId) ((cmdid << 8) + cmdSubId) namespace iflytop { namespace zcr { diff --git a/api/errorcode.cpp b/api/apibasic/errorcode.cpp similarity index 100% rename from api/errorcode.cpp rename to api/apibasic/errorcode.cpp diff --git a/api/errorcode.hpp b/api/apibasic/errorcode.hpp similarity index 100% rename from api/errorcode.hpp rename to api/apibasic/errorcode.hpp diff --git a/api/module_type_index.hpp b/api/apibasic/module_type_index.hpp similarity index 100% rename from api/module_type_index.hpp rename to api/apibasic/module_type_index.hpp diff --git a/api/packet_interface.hpp b/api/apibasic/packet_interface.hpp similarity index 92% rename from api/packet_interface.hpp rename to api/apibasic/packet_interface.hpp index 438a550..a0802e8 100644 --- a/api/packet_interface.hpp +++ b/api/apibasic/packet_interface.hpp @@ -24,7 +24,6 @@ typedef enum { } // namespace zcr } // namespace iflytop -#define CMDID(cmdid, cmdSubId) ((cmdid << 8) + cmdSubId) #define CMD_SUB_ID(cmdid) (cmdid & 0xff) #define MODULE_CMDID(cmdid) (cmdid >> 8) diff --git a/api/protocol_constant.hpp b/api/apibasic/protocol_constant.hpp similarity index 100% rename from api/protocol_constant.hpp rename to api/apibasic/protocol_constant.hpp diff --git a/api/reg_index.hpp b/api/apibasic/reg_index.hpp similarity index 98% rename from api/reg_index.hpp rename to api/apibasic/reg_index.hpp index aea8fc8..69b6be4 100644 --- a/api/reg_index.hpp +++ b/api/apibasic/reg_index.hpp @@ -155,7 +155,7 @@ typedef enum { kreg_laster_scaner_laster_intensity = REG_INDEX(43, 0, 14), /*********************************************************************************************************************** - * NEW_API * + * XYROBOT * ***********************************************************************************************************************/ kreg_xyrobot_default_velocity = REG_INDEX(100, 0, 0), diff --git a/api/zi_a8000_optical_module.hpp b/api/zi_a8000_optical_module.hpp index cea5b63..f57d77c 100644 --- a/api/zi_a8000_optical_module.hpp +++ b/api/zi_a8000_optical_module.hpp @@ -3,7 +3,8 @@ #include -#include "errorcode.hpp" +#include "apibasic/basic.hpp" + namespace iflytop { using namespace std; diff --git a/api/zi_adc_capture.hpp b/api/zi_adc_capture.hpp deleted file mode 100644 index d91d186..0000000 --- a/api/zi_adc_capture.hpp +++ /dev/null @@ -1,15 +0,0 @@ -#pragma once -#include - -#include - -#include "errorcode.hpp" - -namespace iflytop { -using namespace std; -class ZICodeScaner { - public: - - -}; -} // namespace iflytop \ No newline at end of file diff --git a/api/zi_board_module.hpp b/api/zi_board_module.hpp deleted file mode 100644 index dc807f8..0000000 --- a/api/zi_board_module.hpp +++ /dev/null @@ -1,22 +0,0 @@ -#pragma once -#include - -#include - -#include "errorcode.hpp" - -namespace iflytop { -using namespace std; -class ZIBoardModule { - public: - typedef enum { - kf_optical = 0, - kt_optical = 1, - } optical_type_t; - - public: - virtual ~ZIBoardModule(){}; - - virtual int32_t board_reset() = 0; -}; -} // namespace iflytop diff --git a/api/zi_code_scaner.hpp b/api/zi_code_scaner.hpp deleted file mode 100644 index 18a0c8c..0000000 --- a/api/zi_code_scaner.hpp +++ /dev/null @@ -1,18 +0,0 @@ -#pragma once -#include - -#include - -#include "errorcode.hpp" - -namespace iflytop { -using namespace std; -#if 0 -class ZICodeScaner { - public: - virtual int32_t code_scaner_start_scan() { return err::koperation_not_support; } - virtual int32_t code_scaner_stop_scan() { return err::koperation_not_support; } - virtual int32_t code_scaner_read_scaner_result(int32_t startadd, uint8_t *data, int32_t *len) { return err::koperation_not_support; } -}; -#endif -} // namespace iflytop \ No newline at end of file diff --git a/api/zi_event_bus.hpp b/api/zi_event_bus.hpp index 549bca3..5af71eb 100644 --- a/api/zi_event_bus.hpp +++ b/api/zi_event_bus.hpp @@ -2,8 +2,11 @@ #include #include +#include "apibasic/basic.hpp" + + + -#include "errorcode.hpp" namespace iflytop { using namespace std; diff --git a/api/zi_module.hpp b/api/zi_module.hpp index c8a7519..ef76156 100644 --- a/api/zi_module.hpp +++ b/api/zi_module.hpp @@ -3,8 +3,8 @@ #include -#include "errorcode.hpp" -#include "module_type_index.hpp" +#include "apibasic/basic.hpp" + namespace iflytop { using namespace std; diff --git a/api/zi_motor.hpp b/api/zi_motor.hpp index d5fe9f4..5a9ff4d 100644 --- a/api/zi_motor.hpp +++ b/api/zi_motor.hpp @@ -3,7 +3,9 @@ #include -#include "errorcode.hpp" +#include "apibasic/basic.hpp" + + namespace iflytop { using namespace std; diff --git a/api/zi_pipette_ctrl_module.hpp b/api/zi_pipette_ctrl_module.hpp index 57230a9..3a39ca7 100644 --- a/api/zi_pipette_ctrl_module.hpp +++ b/api/zi_pipette_ctrl_module.hpp @@ -2,8 +2,9 @@ #include #include +#include "apibasic/basic.hpp" + -#include "errorcode.hpp" namespace iflytop { using namespace std; diff --git a/api/zi_xymotor.hpp b/api/zi_xymotor.hpp index d83a315..c0341ef 100644 --- a/api/zi_xymotor.hpp +++ b/api/zi_xymotor.hpp @@ -2,8 +2,9 @@ #include #include +#include "apibasic/basic.hpp" + -#include "errorcode.hpp" namespace iflytop { using namespace std; diff --git a/api/i_zcanreceiver.hpp b/i_zcanreceiver.hpp similarity index 90% rename from api/i_zcanreceiver.hpp rename to i_zcanreceiver.hpp index 210a86e..ebdd3ee 100644 --- a/api/i_zcanreceiver.hpp +++ b/i_zcanreceiver.hpp @@ -3,8 +3,7 @@ // #pragma once -#include "errorcode.hpp" -#include "packet_interface.hpp" +#include "api/api.hpp" namespace iflytop { using namespace zcr; diff --git a/protocol.hpp b/protocol.hpp new file mode 100644 index 0000000..412f90d --- /dev/null +++ b/protocol.hpp @@ -0,0 +1,8 @@ +#pragma once +#include "api/api.hpp" +// +#include "i_zcanreceiver.hpp" +// +#include "reg_index_table.hpp" +// +#include "protocol_event_bus_sender.hpp" \ No newline at end of file diff --git a/protocol_event_bus_sender.cpp b/protocol_event_bus_sender.cpp index c2189a8..353a387 100644 --- a/protocol_event_bus_sender.cpp +++ b/protocol_event_bus_sender.cpp @@ -1,7 +1,7 @@ #include "protocol_event_bus_sender.hpp" #include "api/api.hpp" -#include "cmdid.hpp" +#include "i_zcanreceiver.hpp" namespace iflytop { using namespace std; diff --git a/protocol_event_bus_sender.hpp b/protocol_event_bus_sender.hpp index 10af115..f740e07 100644 --- a/protocol_event_bus_sender.hpp +++ b/protocol_event_bus_sender.hpp @@ -1,5 +1,6 @@ #pragma once #include "api/api.hpp" +#include "i_zcanreceiver.hpp" namespace iflytop { using namespace std; @@ -11,4 +12,4 @@ class ProtocolEventBusSender : public ZIEventBusSender { virtual void push_reg_state_change_event(int32_t moduleid, int32_t regindex, int32_t oldval, int32_t toval) override; }; -} // namespace iflytop \ No newline at end of file +} // namespace iflytop diff --git a/api/reg_index_table.cpp b/reg_index_table.cpp similarity index 91% rename from api/reg_index_table.cpp rename to reg_index_table.cpp index 587c154..650e017 100644 --- a/api/reg_index_table.cpp +++ b/reg_index_table.cpp @@ -3,7 +3,7 @@ #include #include -#include "reg_index.hpp" +#include "api/api.hpp" using namespace iflytop; static reg_index_table_iterm_t iterms[] = {}; diff --git a/api/reg_index_table.hpp b/reg_index_table.hpp similarity index 100% rename from api/reg_index_table.hpp rename to reg_index_table.hpp