Skip to content

Commit

Permalink
add chart
Browse files Browse the repository at this point in the history
  • Loading branch information
Joatin committed Dec 25, 2024
1 parent ab9c456 commit 95f67ee
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 7 deletions.
3 changes: 3 additions & 0 deletions ocpp/src/charger/charger.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ use tracing::{error, instrument, warn};
#[derive(Clone)]
pub struct Charger {
pub id: String,

#[allow(dead_code)]
pub config: Config,
pub data_store: Arc<dyn DataStore>,
pub authenticated: bool,
Expand Down Expand Up @@ -176,6 +178,7 @@ impl Charger {
Ocpp1_6Interface::new(self)
}

#[allow(dead_code)]
pub fn ocpp2_0_1(&mut self) -> Ocpp2_0_1Interface {
Ocpp2_0_1Interface::new(self)
}
Expand Down
10 changes: 4 additions & 6 deletions ocpp/src/charger/charger_model.rs
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@

#[allow(dead_code)]
#[derive(Debug, Clone)]
pub enum ChargerModel {
Unknown
Unknown,
}

impl ChargerModel {
#[allow(dead_code)]
pub fn from_vendor_and_model(vendor: &str, _model: &str) -> Self {
match vendor {
_ => {
Self::Unknown
}
_ => Self::Unknown,
}
}
}

29 changes: 28 additions & 1 deletion ocpp/src/charger/ocpp_2_0_interface.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,191 +66,218 @@ use rust_ocpp::v2_0_1::messages::status_notification::{
use rust_ocpp::v2_0_1::messages::transaction_event::{
TransactionEventRequest, TransactionEventResponse,
};

#[allow(dead_code)]
pub struct Ocpp2_0_1Interface<'a> {
pub charger: &'a mut Charger,
}

impl<'a> Ocpp2_0_1Interface<'a> {
#[allow(dead_code)]
pub fn new(charger: &'a mut Charger) -> Self {
Self { charger }
}

#[allow(dead_code)]
pub async fn handle_authorize(
&mut self,
_request: AuthorizeRequest,
) -> Result<AuthorizeResponse, OCPP2_0_1Error> {
todo!()
}

#[allow(dead_code)]
pub async fn handle_boot_notification(
&mut self,
_request: BootNotificationRequest,
) -> Result<BootNotificationResponse, OCPP2_0_1Error> {
todo!()
}

#[allow(dead_code)]
pub async fn handle_cleared_charging_limit(
&mut self,
_request: ClearedChargingLimitRequest,
) -> Result<ClearedChargingLimitResponse, OCPP2_0_1Error> {
todo!()
}

#[allow(dead_code)]
pub async fn handle_data_transfer(
&mut self,
_request: DataTransferRequest,
) -> Result<DataTransferResponse, OCPP2_0_1Error> {
todo!()
}

#[allow(dead_code)]
pub async fn handle_firmware_status_notification(
&mut self,
_request: FirmwareStatusNotificationRequest,
) -> Result<FirmwareStatusNotificationResponse, OCPP2_0_1Error> {
todo!()
}

#[allow(dead_code)]
pub async fn handle_get_15118_ev_certificate(
&mut self,
_request: Get15118EVCertificateRequest,
) -> Result<Get15118EVCertificateResponse, OCPP2_0_1Error> {
todo!()
}

#[allow(dead_code)]
pub async fn handle_get_certificate_status(
&mut self,
_request: GetCertificateStatusRequest,
) -> Result<GetCertificateStatusResponse, OCPP2_0_1Error> {
todo!()
}

#[allow(dead_code)]
pub async fn handle_heartbeat(
&mut self,
_request: HeartbeatRequest,
) -> Result<HeartbeatResponse, OCPP2_0_1Error> {
todo!()
}

#[allow(dead_code)]
pub async fn handle_log_status_notification(
&mut self,
_request: LogStatusNotificationRequest,
) -> Result<LogStatusNotificationResponse, OCPP2_0_1Error> {
todo!()
}

#[allow(dead_code)]
pub async fn handle_meter_values(
&mut self,
_request: MeterValuesRequest,
) -> Result<MeterValuesResponse, OCPP2_0_1Error> {
todo!()
}

#[allow(dead_code)]
pub async fn handle_notify_customer_information(
&mut self,
_request: NotifyCustomerInformationRequest,
) -> Result<NotifyCustomerInformationResponse, OCPP2_0_1Error> {
todo!()
}

#[allow(dead_code)]
pub async fn handle_notify_display_messages(
&mut self,
_request: NotifyDisplayMessagesRequest,
) -> Result<NotifyDisplayMessagesResponse, OCPP2_0_1Error> {
todo!()
}

#[allow(dead_code)]
pub async fn handle_notify_ev_charging_needs(
&mut self,
_request: NotifyEVChargingNeedsRequest,
) -> Result<NotifyEVChargingNeedsResponse, OCPP2_0_1Error> {
todo!()
}

#[allow(dead_code)]
pub async fn handle_notify_ev_charging_schedule(
&mut self,
_request: NotifyEVChargingScheduleRequest,
) -> Result<NotifyEVChargingScheduleResponse, OCPP2_0_1Error> {
todo!()
}

#[allow(dead_code)]
pub async fn handle_notify_event(
&mut self,
_request: NotifyEventRequest,
) -> Result<NotifyEventResponse, OCPP2_0_1Error> {
todo!()
}

#[allow(dead_code)]
pub async fn handle_notify_monitoring_report(
&mut self,
_request: NotifyMonitoringReportRequest,
) -> Result<NotifyMonitoringReportResponse, OCPP2_0_1Error> {
todo!()
}

#[allow(dead_code)]
pub async fn handle_notify_report(
&mut self,
_request: NotifyReportRequest,
) -> Result<NotifyReportResponse, OCPP2_0_1Error> {
todo!()
}

#[allow(dead_code)]
pub async fn handle_publish_firmware_status_notification(
&mut self,
_request: PublishFirmwareStatusNotificationRequest,
) -> Result<PublishFirmwareStatusNotificationResponse, OCPP2_0_1Error> {
todo!()
}

#[allow(dead_code)]
pub async fn handle_report_charging_profiles(
&mut self,
_request: ReportChargingProfilesRequest,
) -> Result<ReportChargingProfilesResponse, OCPP2_0_1Error> {
todo!()
}

#[allow(dead_code)]
pub async fn handle_request_start_transaction(
&mut self,
_request: RequestStartTransactionRequest,
) -> Result<RequestStartTransactionResponse, OCPP2_0_1Error> {
todo!()
}

#[allow(dead_code)]
pub async fn handle_request_stop_transaction(
&mut self,
_request: RequestStopTransactionRequest,
) -> Result<RequestStopTransactionResponse, OCPP2_0_1Error> {
todo!()
}

#[allow(dead_code)]
pub async fn handle_reservation_status_update(
&mut self,
_request: ReservationStatusUpdateRequest,
) -> Result<ReservationStatusUpdateResponse, OCPP2_0_1Error> {
todo!()
}

#[allow(dead_code)]
pub async fn handle_security_event_notification(
&mut self,
_request: SecurityEventNotificationRequest,
) -> Result<SecurityEventNotificationResponse, OCPP2_0_1Error> {
todo!()
}

#[allow(dead_code)]
pub async fn handle_sign_certificate(
&mut self,
_request: SignCertificateRequest,
) -> Result<SignCertificateResponse, OCPP2_0_1Error> {
todo!()
}

#[allow(dead_code)]
pub async fn handle_status_notification(
&mut self,
_request: StatusNotificationRequest,
) -> Result<StatusNotificationResponse, OCPP2_0_1Error> {
todo!()
}

#[allow(dead_code)]
pub async fn handle_transaction_event(
&mut self,
_request: TransactionEventRequest,
Expand Down

0 comments on commit 95f67ee

Please sign in to comment.