32 lines
799 B
PHP
32 lines
799 B
PHP
<?php
|
|
|
|
class OCPP201Adapter
|
|
{
|
|
public function normalizeInbound(OCPPMessage $message): array
|
|
{
|
|
return [
|
|
'version' => '2.0.1',
|
|
'action' => $message->action,
|
|
'uniqueId' => $message->uniqueId,
|
|
'payload' => $message->payload
|
|
];
|
|
}
|
|
|
|
public function buildSetChargingProfile(array $profile): OCPPMessage
|
|
{
|
|
return OCPPMessage::call('SetChargingProfile', $profile, '2.0.1');
|
|
}
|
|
|
|
public function buildClearChargingProfile(int $evseId): OCPPMessage
|
|
{
|
|
return OCPPMessage::call('ClearChargingProfile', ['evseId' => $evseId], '2.0.1');
|
|
}
|
|
|
|
public function buildReset(string $type = 'Immediate'): OCPPMessage
|
|
{
|
|
return OCPPMessage::call('Reset', ['type' => $type], '2.0.1');
|
|
}
|
|
}
|
|
|
|
?>
|