main.cpp 613 B

1234567891011121314151617181920
  1. #include "acq_vendor.h"
  2. int main(int argc, char *argv[])
  3. {
  4. HTELINK_LOG_ENABLE(true);
  5. HTELINK_LOG_INFO("check env set");
  6. if (getenv(VENDOR_RUN_PATH_ENV) == nullptr) {
  7. HTELINK_LOG_INFO("execute env not set");
  8. std::string exe_dir = utils::get_executable_directory();
  9. setenv(VENDOR_RUN_PATH_ENV, exe_dir.c_str(), 1);
  10. }
  11. HTELINK_LOG_INFO("execute directory is %s", getenv(VENDOR_RUN_PATH_ENV));
  12. vendor::VendorBase *vdor = new iot_acq::AcqVendor();
  13. if (vendor::VendorBase::ParseOptionArgs(vdor, argc, argv) != 0) {
  14. exit(-1);
  15. }
  16. return vdor->Exec();
  17. }