6
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/remote_start_transaction_job.rb', line 6
def perform(charge_point_id, connector_id, id_tag)
charge_point = ChargePoint.find(charge_point_id)
message_id = SecureRandom.uuid
payload = {
connectorId: connector_id.to_i,
idTag: id_tag
}
message = Protocol.build_call(message_id, "RemoteStartTransaction", payload)
Message.create!(
charge_point: charge_point,
message_id: message_id,
direction: "outbound",
action: "RemoteStartTransaction",
message_type: "CALL",
payload: payload,
status: "pending"
)
send_to_charge_point(charge_point, message)
end
|