v2g_serviceMethods.c 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. /*
  2. * Copyright (C) 2007-2010 Siemens AG
  3. *
  4. * This program is free software: you can redistribute it and/or modify
  5. * it under the terms of the GNU Lesser General Public License as published
  6. * by the Free Software Foundation, either version 3 of the License, or
  7. * (at your option) any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU Lesser General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU Lesser General Public License
  15. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  16. */
  17. /*******************************************************************
  18. *
  19. * @author Sebastian.Kaebisch.EXT@siemens.com
  20. * @version 0.3.1
  21. * @contact Joerg.Heuer@siemens.com
  22. *
  23. ********************************************************************/
  24. #include "v2g_serviceMethods.h"
  25. #include "v2g_serviceDataTypes.h"
  26. #include <stdio.h>
  27. /* This service methods has to be implemented by the EVSE server */
  28. int sessionSetup(struct SessionSetupReqType* param, struct SessionSetupResType* result)
  29. {
  30. printf("EVSE: sessionSetup called\n" );
  31. printf("\tReceived data:\n");
  32. printf("\t\t PEVStatus ChargerStandby=%d\n",param->PEVStatus.ChargerStandby);
  33. printf("\t\t PEVStatus ConnectorLocked=%d\n", param->PEVStatus.ConnectorLocked);
  34. /* Prepare data for PEV */
  35. result->ResponseCode = OK_SessionSetup_responseCode_SessionSetupType;
  36. result->EVSEID.data[0]='E';
  37. result->EVSEID.arraylen.data=1;
  38. result->EVSEStatus.ConnectorLocked=0;
  39. result->EVSEStatus.EVSEStandby=1;
  40. result->EVSEStatus.FatalError=0;
  41. result->EVSEStatus.PowerSwitchClosed=1;
  42. result->EVSEStatus.RCD=1;
  43. result->EVSEStatus.ShutDownTime=12345678L;
  44. result->TCurrent=12345678L;
  45. return 0;
  46. }
  47. int serviceDiscovery(struct ServiceDiscoveryReqType* param, struct ServiceDiscoveryResType* result)
  48. {
  49. return 0;
  50. }
  51. int selectedServicePayment(struct ServicePaymentSelectionReqType* param, struct ServicePaymentSelectionResType* result)
  52. {
  53. return 0;
  54. }
  55. int paymentDetails(struct PaymentDetailsReqType* param, struct PaymentDetailsResType* result)
  56. {
  57. return 0;
  58. }
  59. int powerDiscovery(struct PowerDiscoveryReqType* param, struct PowerDiscoveryResType* result)
  60. {
  61. return 0;
  62. }
  63. int lineLock(struct LineLockReqType* param, struct LineLockResType* result)
  64. {
  65. return 0;
  66. }
  67. int powerDelivery(struct PowerDeliveryReqType* param, struct PowerDeliveryResType* result)
  68. {
  69. return 0;
  70. }
  71. int meteringStatus(struct MeteringStatusReqType* param, struct MeteringStatusResType* result)
  72. {
  73. return 0;
  74. }
  75. int meteringReceipt(struct MeteringReceiptReqType* param, struct MeteringReceiptResType* result)
  76. {
  77. return 0;
  78. }