module_other_alarm.cpp 966 B

1234567891011121314151617181920212223242526272829303132
  1. #include "module_other_alarm.h"
  2. #include "event.h"
  3. #include "common_tool.h"
  4. #include "log.h"
  5. /*
  6. * @brief 低电量报警
  7. * @param std::shared_ptr<card_location_base> card_ptr 卡对象
  8. * @return 无
  9. * @note
  10. * @warning
  11. * @bug
  12. * */
  13. void module_other_alarm::power_lower_serious(std::shared_ptr<card_location_base> card_ptr)
  14. {
  15. uint64_t id = tool_other::type_id_to_u64(card_ptr->m_type, card_ptr->m_id);
  16. event_tool::instance()->handle_event(OT_CARD, ET_CARD_LOW_POWER_SERIOUS, id, 0, 0, true);
  17. }
  18. /*
  19. * @brief 电量正常时,取消电量低报警
  20. * @param std::shared_ptr<card_location_base> card_ptr
  21. * @return 无
  22. * @note
  23. * @warning
  24. * @bug
  25. * */
  26. void module_other_alarm::power_normal(std::shared_ptr<card_location_base> card_ptr)
  27. {
  28. uint64_t id = tool_other::type_id_to_u64(card_ptr->m_type, card_ptr->m_id);
  29. event_tool::instance()->handle_event(OT_CARD, ET_CARD_LOW_POWER_SERIOUS, id, 0, 0, false);
  30. }