Class: Ocpp::Rails::GetConfigurationJob
- Inherits:
-
ApplicationJob
- Object
- ActiveJob::Base
- ApplicationJob
- Ocpp::Rails::GetConfigurationJob
- Defined in:
- app/jobs/ocpp/rails/get_configuration_job.rb
Instance Method Summary collapse
-
#perform(charge_point_id, keys = []) ⇒ Object
keys is the OCPP GetConfiguration.req optional key array; when blank the station returns every configuration key.
Instance Method Details
#perform(charge_point_id, keys = []) ⇒ Object
keys is the OCPP GetConfiguration.req optional key array; when blank the station returns every configuration key.
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'app/jobs/ocpp/rails/get_configuration_job.rb', line 8 def perform(charge_point_id, keys = []) charge_point = ChargePoint.find(charge_point_id) = SecureRandom.uuid payload = keys.blank? ? {} : { key: Array(keys) } = Protocol.build_call(, "GetConfiguration", payload) Message.create!( charge_point: charge_point, message_id: , direction: "outbound", action: "GetConfiguration", message_type: "CALL", payload: payload, status: "pending" ) send_to_charge_point(charge_point, ) end |