Class: Ocpp::Rails::ResetJob
- Inherits:
-
ApplicationJob
- Object
- ActiveJob::Base
- ApplicationJob
- Ocpp::Rails::ResetJob
- Defined in:
- app/jobs/ocpp/rails/reset_job.rb
Instance Method Summary collapse
-
#perform(charge_point_id, type) ⇒ Object
type is the OCPP Reset.req ResetType: "Hard" or "Soft".
Instance Method Details
#perform(charge_point_id, type) ⇒ Object
type is the OCPP Reset.req ResetType: "Hard" or "Soft".
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'app/jobs/ocpp/rails/reset_job.rb', line 7 def perform(charge_point_id, type) charge_point = ChargePoint.find(charge_point_id) = SecureRandom.uuid payload = { type: type } = Protocol.build_call(, "Reset", payload) Message.create!( charge_point: charge_point, message_id: , direction: "outbound", action: "Reset", message_type: "CALL", payload: payload, status: "pending" ) send_to_charge_point(charge_point, ) end |