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