From 247f4647cf3081bef4cf7c77d16e860aae577208 Mon Sep 17 00:00:00 2001 From: daniel_peintner Date: Tue, 30 Jan 2018 13:19:51 +0000 Subject: [PATCH] get read for release 0.9.4 git-svn-id: https://svn.code.sf.net/p/openv2g/code/trunk@110 d9f2db14-54d0-4bde-b00c-16405c910529 --- README.txt | 7 +- src/appHandshake/appHandEXIDatatypes.c | 6 +- src/appHandshake/appHandEXIDatatypes.h | 6 +- src/appHandshake/appHandEXIDatatypesDecoder.c | 6 +- src/appHandshake/appHandEXIDatatypesDecoder.h | 6 +- src/appHandshake/appHandEXIDatatypesEncoder.c | 6 +- src/appHandshake/appHandEXIDatatypesEncoder.h | 6 +- src/codec/BitInputStream.c | 4 +- src/codec/BitInputStream.h | 4 +- src/codec/BitOutputStream.c | 4 +- src/codec/BitOutputStream.h | 4 +- src/codec/ByteStream.c | 4 +- src/codec/ByteStream.h | 4 +- src/codec/DecoderChannel.c | 4 +- src/codec/DecoderChannel.h | 4 +- src/codec/EXIConfig.h | 4 +- src/codec/EXIHeaderDecoder.c | 4 +- src/codec/EXIHeaderDecoder.h | 4 +- src/codec/EXIHeaderEncoder.c | 4 +- src/codec/EXIHeaderEncoder.h | 4 +- src/codec/EXIOptions.h | 4 +- src/codec/EXITypes.h | 4 +- src/codec/EncoderChannel.c | 4 +- src/codec/EncoderChannel.h | 4 +- src/codec/ErrorCodes.h | 4 +- src/codec/MethodsBag.c | 4 +- src/codec/MethodsBag.h | 4 +- src/din/dinEXIDatatypes.c | 4 +- src/din/dinEXIDatatypes.h | 4 +- src/din/dinEXIDatatypesDecoder.c | 4 +- src/din/dinEXIDatatypesDecoder.h | 4 +- src/din/dinEXIDatatypesEncoder.c | 4 +- src/din/dinEXIDatatypesEncoder.h | 4 +- src/iso1/iso1EXIDatatypes.c | 4 +- src/iso1/iso1EXIDatatypes.h | 8 +- src/iso1/iso1EXIDatatypesDecoder.c | 4 +- src/iso1/iso1EXIDatatypesDecoder.h | 4 +- src/iso1/iso1EXIDatatypesEncoder.c | 4 +- src/iso1/iso1EXIDatatypesEncoder.h | 4 +- src/iso2/iso2EXIDatatypes.c | 4 +- src/iso2/iso2EXIDatatypes.h | 8 +- src/iso2/iso2EXIDatatypesDecoder.c | 4 +- src/iso2/iso2EXIDatatypesDecoder.h | 4 +- src/iso2/iso2EXIDatatypesEncoder.c | 4 +- src/iso2/iso2EXIDatatypesEncoder.h | 4 +- src/test/main.c | 4 +- src/test/main.h | 4 +- src/test/main_databinder.c | 43 +- src/test/main_example.c | 969 ++++++++++++++++-- src/transport/v2gtp.c | 4 +- src/transport/v2gtp.h | 4 +- src/xmldsig/xmldsigEXIDatatypes.c | 4 +- src/xmldsig/xmldsigEXIDatatypes.h | 4 +- src/xmldsig/xmldsigEXIDatatypesDecoder.c | 4 +- src/xmldsig/xmldsigEXIDatatypesDecoder.h | 4 +- src/xmldsig/xmldsigEXIDatatypesEncoder.c | 4 +- src/xmldsig/xmldsigEXIDatatypesEncoder.h | 4 +- 57 files changed, 1036 insertions(+), 219 deletions(-) diff --git a/README.txt b/README.txt index b851bda..33379da 100644 --- a/README.txt +++ b/README.txt @@ -1,12 +1,12 @@ ------------------------------------------------------------------------- OpenV2G - an open source project implementing the basic functionality of the ISO IEC 15118 vehicle to grid (V2G) communication interface -Version 1.0.0alpha, released March/April ??, 2017 +Version 0.9.4, released January 30, 2018 http://openv2g.sourceforge.net/ Please report bugs via the SourceForge bug tracking system at http://sourceforge.net/tracker/?group_id=350113. Thank you. -Copyright (C) 2007-2017 Siemens AG +Copyright (C) 2007-2018 Siemens AG This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published @@ -25,7 +25,8 @@ along with this program. If not, see . ------------------------------------------------------------------------- CHANGES from version 0.9.3: ------------------------------------------------------------------------- -* Support for 15118-2-2016 (ISO2) besides 15118-2-2013 (ISO1) and DIN added +* Support for 15118-2-2016 (ISO2) started besides 15118-2-2013 (ISO1) and DIN +* fix eMAID fragment encoding/decoding support * internal coding updates * bug-fixes diff --git a/src/appHandshake/appHandEXIDatatypes.c b/src/appHandshake/appHandEXIDatatypes.c index ba88d80..a94bd8d 100644 --- a/src/appHandshake/appHandEXIDatatypes.c +++ b/src/appHandshake/appHandEXIDatatypes.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2015 Siemens AG + * Copyright (C) 2007-2018 Siemens AG * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published @@ -18,8 +18,8 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 0.9.3 - * @contact Joerg.Heuer@siemens.com + * @version 0.9.4 + * @contact Richard.Kuntschke@siemens.com * *

Code generated by EXIdizer

*

Schema: V2G_CI_AppProtocol.xsd

diff --git a/src/appHandshake/appHandEXIDatatypes.h b/src/appHandshake/appHandEXIDatatypes.h index 9eebcf4..6dad852 100644 --- a/src/appHandshake/appHandEXIDatatypes.h +++ b/src/appHandshake/appHandEXIDatatypes.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2015 Siemens AG + * Copyright (C) 2007-2018 Siemens AG * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published @@ -18,8 +18,8 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 0.9.3 - * @contact Joerg.Heuer@siemens.com + * @version 0.9.4 + * @contact Richard.Kuntschke@siemens.com * *

Code generated by EXIdizer

*

Schema: V2G_CI_AppProtocol.xsd

diff --git a/src/appHandshake/appHandEXIDatatypesDecoder.c b/src/appHandshake/appHandEXIDatatypesDecoder.c index 38d37b6..466af7e 100644 --- a/src/appHandshake/appHandEXIDatatypesDecoder.c +++ b/src/appHandshake/appHandEXIDatatypesDecoder.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2015 Siemens AG + * Copyright (C) 2007-2018 Siemens AG * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published @@ -18,8 +18,8 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 0.9.3 - * @contact Joerg.Heuer@siemens.com + * @version 0.9.4 + * @contact Richard.Kuntschke@siemens.com * *

Code generated by EXIdizer

*

Schema: V2G_CI_AppProtocol.xsd

diff --git a/src/appHandshake/appHandEXIDatatypesDecoder.h b/src/appHandshake/appHandEXIDatatypesDecoder.h index bd43109..5173beb 100644 --- a/src/appHandshake/appHandEXIDatatypesDecoder.h +++ b/src/appHandshake/appHandEXIDatatypesDecoder.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2015 Siemens AG + * Copyright (C) 2007-2018 Siemens AG * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published @@ -18,8 +18,8 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 0.9.3 - * @contact Joerg.Heuer@siemens.com + * @version 0.9.4 + * @contact Richard.Kuntschke@siemens.com * *

Code generated by EXIdizer

*

Schema: V2G_CI_AppProtocol.xsd

diff --git a/src/appHandshake/appHandEXIDatatypesEncoder.c b/src/appHandshake/appHandEXIDatatypesEncoder.c index 633dc4a..dc62713 100644 --- a/src/appHandshake/appHandEXIDatatypesEncoder.c +++ b/src/appHandshake/appHandEXIDatatypesEncoder.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2015 Siemens AG + * Copyright (C) 2007-2018 Siemens AG * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published @@ -18,8 +18,8 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 0.9.3 - * @contact Joerg.Heuer@siemens.com + * @version 0.9.4 + * @contact Richard.Kuntschke@siemens.com * *

Code generated by EXIdizer

*

Schema: V2G_CI_AppProtocol.xsd

diff --git a/src/appHandshake/appHandEXIDatatypesEncoder.h b/src/appHandshake/appHandEXIDatatypesEncoder.h index ce428e2..6701210 100644 --- a/src/appHandshake/appHandEXIDatatypesEncoder.h +++ b/src/appHandshake/appHandEXIDatatypesEncoder.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2015 Siemens AG + * Copyright (C) 2007-2018 Siemens AG * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published @@ -18,8 +18,8 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 0.9.3 - * @contact Joerg.Heuer@siemens.com + * @version 0.9.4 + * @contact Richard.Kuntschke@siemens.com * *

Code generated by EXIdizer

*

Schema: V2G_CI_AppProtocol.xsd

diff --git a/src/codec/BitInputStream.c b/src/codec/BitInputStream.c index b07848e..c554df7 100644 --- a/src/codec/BitInputStream.c +++ b/src/codec/BitInputStream.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2017 Siemens AG + * Copyright (C) 2007-2018 Siemens AG * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published @@ -19,7 +19,7 @@ * * @author Daniel.Peintner.EXT@siemens.com * @version 2017-03-02 - * @contact Joerg.Heuer@siemens.com + * @contact Richard.Kuntschke@siemens.com * *

Code generated by EXIdizer

*

Schema: V2G_CI_MsgDef.xsd

diff --git a/src/codec/BitInputStream.h b/src/codec/BitInputStream.h index 7ef68e2..5ccf72c 100644 --- a/src/codec/BitInputStream.h +++ b/src/codec/BitInputStream.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2017 Siemens AG + * Copyright (C) 2007-2018 Siemens AG * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published @@ -19,7 +19,7 @@ * * @author Daniel.Peintner.EXT@siemens.com * @version 2017-03-02 - * @contact Joerg.Heuer@siemens.com + * @contact Richard.Kuntschke@siemens.com * *

Code generated by EXIdizer

*

Schema: V2G_CI_MsgDef.xsd

diff --git a/src/codec/BitOutputStream.c b/src/codec/BitOutputStream.c index 80a79fa..0813992 100644 --- a/src/codec/BitOutputStream.c +++ b/src/codec/BitOutputStream.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2017 Siemens AG + * Copyright (C) 2007-2018 Siemens AG * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published @@ -19,7 +19,7 @@ * * @author Daniel.Peintner.EXT@siemens.com * @version 2017-03-02 - * @contact Joerg.Heuer@siemens.com + * @contact Richard.Kuntschke@siemens.com * *

Code generated by EXIdizer

*

Schema: V2G_CI_MsgDef.xsd

diff --git a/src/codec/BitOutputStream.h b/src/codec/BitOutputStream.h index a1d2198..c40ea4b 100644 --- a/src/codec/BitOutputStream.h +++ b/src/codec/BitOutputStream.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2017 Siemens AG + * Copyright (C) 2007-2018 Siemens AG * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published @@ -19,7 +19,7 @@ * * @author Daniel.Peintner.EXT@siemens.com * @version 2017-03-02 - * @contact Joerg.Heuer@siemens.com + * @contact Richard.Kuntschke@siemens.com * *

Code generated by EXIdizer

*

Schema: V2G_CI_MsgDef.xsd

diff --git a/src/codec/ByteStream.c b/src/codec/ByteStream.c index e6791ff..fba7547 100644 --- a/src/codec/ByteStream.c +++ b/src/codec/ByteStream.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2017 Siemens AG + * Copyright (C) 2007-2018 Siemens AG * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published @@ -19,7 +19,7 @@ * * @author Daniel.Peintner.EXT@siemens.com * @version 2017-03-02 - * @contact Joerg.Heuer@siemens.com + * @contact Richard.Kuntschke@siemens.com * *

Code generated by EXIdizer

*

Schema: V2G_CI_MsgDef.xsd

diff --git a/src/codec/ByteStream.h b/src/codec/ByteStream.h index 536177b..2b6ab76 100644 --- a/src/codec/ByteStream.h +++ b/src/codec/ByteStream.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2017 Siemens AG + * Copyright (C) 2007-2018 Siemens AG * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published @@ -19,7 +19,7 @@ * * @author Daniel.Peintner.EXT@siemens.com * @version 2017-03-02 - * @contact Joerg.Heuer@siemens.com + * @contact Richard.Kuntschke@siemens.com * *

Code generated by EXIdizer

*

Schema: V2G_CI_MsgDef.xsd

diff --git a/src/codec/DecoderChannel.c b/src/codec/DecoderChannel.c index 9b4388d..69732da 100644 --- a/src/codec/DecoderChannel.c +++ b/src/codec/DecoderChannel.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2017 Siemens AG + * Copyright (C) 2007-2018 Siemens AG * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published @@ -19,7 +19,7 @@ * * @author Daniel.Peintner.EXT@siemens.com * @version 2017-03-02 - * @contact Joerg.Heuer@siemens.com + * @contact Richard.Kuntschke@siemens.com * *

Code generated by EXIdizer

*

Schema: V2G_CI_MsgDef.xsd

diff --git a/src/codec/DecoderChannel.h b/src/codec/DecoderChannel.h index 10dfe75..d0bdfb6 100644 --- a/src/codec/DecoderChannel.h +++ b/src/codec/DecoderChannel.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2017 Siemens AG + * Copyright (C) 2007-2018 Siemens AG * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published @@ -19,7 +19,7 @@ * * @author Daniel.Peintner.EXT@siemens.com * @version 2017-03-02 - * @contact Joerg.Heuer@siemens.com + * @contact Richard.Kuntschke@siemens.com * *

Code generated by EXIdizer

*

Schema: V2G_CI_MsgDef.xsd

diff --git a/src/codec/EXIConfig.h b/src/codec/EXIConfig.h index a2d0810..edbb2dc 100644 --- a/src/codec/EXIConfig.h +++ b/src/codec/EXIConfig.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2017 Siemens AG + * Copyright (C) 2007-2018 Siemens AG * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published @@ -19,7 +19,7 @@ * * @author Daniel.Peintner.EXT@siemens.com * @version 2017-03-23 - * @contact Joerg.Heuer@siemens.com + * @contact Richard.Kuntschke@siemens.com * *

Code generated by EXIdizer

*

Schema: V2G_CI_MsgDef.xsd

diff --git a/src/codec/EXIHeaderDecoder.c b/src/codec/EXIHeaderDecoder.c index f2dded5..a5dde69 100644 --- a/src/codec/EXIHeaderDecoder.c +++ b/src/codec/EXIHeaderDecoder.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2017 Siemens AG + * Copyright (C) 2007-2018 Siemens AG * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published @@ -19,7 +19,7 @@ * * @author Daniel.Peintner.EXT@siemens.com * @version 2017-03-02 - * @contact Joerg.Heuer@siemens.com + * @contact Richard.Kuntschke@siemens.com * *

Code generated by EXIdizer

*

Schema: V2G_CI_MsgDef.xsd

diff --git a/src/codec/EXIHeaderDecoder.h b/src/codec/EXIHeaderDecoder.h index ceef546..6363d6b 100644 --- a/src/codec/EXIHeaderDecoder.h +++ b/src/codec/EXIHeaderDecoder.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2017 Siemens AG + * Copyright (C) 2007-2018 Siemens AG * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published @@ -19,7 +19,7 @@ * * @author Daniel.Peintner.EXT@siemens.com * @version 2017-03-02 - * @contact Joerg.Heuer@siemens.com + * @contact Richard.Kuntschke@siemens.com * *

Code generated by EXIdizer

*

Schema: V2G_CI_MsgDef.xsd

diff --git a/src/codec/EXIHeaderEncoder.c b/src/codec/EXIHeaderEncoder.c index 0d52a87..924355c 100644 --- a/src/codec/EXIHeaderEncoder.c +++ b/src/codec/EXIHeaderEncoder.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2017 Siemens AG + * Copyright (C) 2007-2018 Siemens AG * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published @@ -19,7 +19,7 @@ * * @author Daniel.Peintner.EXT@siemens.com * @version 2017-03-02 - * @contact Joerg.Heuer@siemens.com + * @contact Richard.Kuntschke@siemens.com * *

Code generated by EXIdizer

*

Schema: V2G_CI_MsgDef.xsd

diff --git a/src/codec/EXIHeaderEncoder.h b/src/codec/EXIHeaderEncoder.h index ea39f54..42663bc 100644 --- a/src/codec/EXIHeaderEncoder.h +++ b/src/codec/EXIHeaderEncoder.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2017 Siemens AG + * Copyright (C) 2007-2018 Siemens AG * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published @@ -19,7 +19,7 @@ * * @author Daniel.Peintner.EXT@siemens.com * @version 2017-03-02 - * @contact Joerg.Heuer@siemens.com + * @contact Richard.Kuntschke@siemens.com * *

Code generated by EXIdizer

*

Schema: V2G_CI_MsgDef.xsd

diff --git a/src/codec/EXIOptions.h b/src/codec/EXIOptions.h index f2c7140..9156746 100644 --- a/src/codec/EXIOptions.h +++ b/src/codec/EXIOptions.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2017 Siemens AG + * Copyright (C) 2007-2018 Siemens AG * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published @@ -19,7 +19,7 @@ * * @author Daniel.Peintner.EXT@siemens.com * @version 2017-03-02 - * @contact Joerg.Heuer@siemens.com + * @contact Richard.Kuntschke@siemens.com * *

Code generated by EXIdizer

*

Schema: V2G_CI_MsgDef.xsd

diff --git a/src/codec/EXITypes.h b/src/codec/EXITypes.h index 0c53d52..b8a2b45 100644 --- a/src/codec/EXITypes.h +++ b/src/codec/EXITypes.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2017 Siemens AG + * Copyright (C) 2007-2018 Siemens AG * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published @@ -19,7 +19,7 @@ * * @author Daniel.Peintner.EXT@siemens.com * @version 2017-03-02 - * @contact Joerg.Heuer@siemens.com + * @contact Richard.Kuntschke@siemens.com * *

Code generated by EXIdizer

*

Schema: V2G_CI_MsgDef.xsd

diff --git a/src/codec/EncoderChannel.c b/src/codec/EncoderChannel.c index 8789350..d15d52a 100644 --- a/src/codec/EncoderChannel.c +++ b/src/codec/EncoderChannel.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2017 Siemens AG + * Copyright (C) 2007-2018 Siemens AG * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published @@ -19,7 +19,7 @@ * * @author Daniel.Peintner.EXT@siemens.com * @version 2017-03-02 - * @contact Joerg.Heuer@siemens.com + * @contact Richard.Kuntschke@siemens.com * *

Code generated by EXIdizer

*

Schema: V2G_CI_MsgDef.xsd

diff --git a/src/codec/EncoderChannel.h b/src/codec/EncoderChannel.h index 4eba629..9523d5d 100644 --- a/src/codec/EncoderChannel.h +++ b/src/codec/EncoderChannel.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2017 Siemens AG + * Copyright (C) 2007-2018 Siemens AG * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published @@ -19,7 +19,7 @@ * * @author Daniel.Peintner.EXT@siemens.com * @version 2017-03-02 - * @contact Joerg.Heuer@siemens.com + * @contact Richard.Kuntschke@siemens.com * *

Code generated by EXIdizer

*

Schema: V2G_CI_MsgDef.xsd

diff --git a/src/codec/ErrorCodes.h b/src/codec/ErrorCodes.h index 3adf726..4237205 100644 --- a/src/codec/ErrorCodes.h +++ b/src/codec/ErrorCodes.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2017 Siemens AG + * Copyright (C) 2007-2018 Siemens AG * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published @@ -19,7 +19,7 @@ * * @author Daniel.Peintner.EXT@siemens.com * @version 2017-03-02 - * @contact Joerg.Heuer@siemens.com + * @contact Richard.Kuntschke@siemens.com * *

Code generated by EXIdizer

*

Schema: V2G_CI_MsgDef.xsd

diff --git a/src/codec/MethodsBag.c b/src/codec/MethodsBag.c index 399ea22..23e70ba 100644 --- a/src/codec/MethodsBag.c +++ b/src/codec/MethodsBag.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2017 Siemens AG + * Copyright (C) 2007-2018 Siemens AG * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published @@ -19,7 +19,7 @@ * * @author Daniel.Peintner.EXT@siemens.com * @version 2017-03-02 - * @contact Joerg.Heuer@siemens.com + * @contact Richard.Kuntschke@siemens.com * *

Code generated by EXIdizer

*

Schema: V2G_CI_MsgDef.xsd

diff --git a/src/codec/MethodsBag.h b/src/codec/MethodsBag.h index a5d0cc1..e418560 100644 --- a/src/codec/MethodsBag.h +++ b/src/codec/MethodsBag.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2017 Siemens AG + * Copyright (C) 2007-2018 Siemens AG * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published @@ -19,7 +19,7 @@ * * @author Daniel.Peintner.EXT@siemens.com * @version 2017-03-02 - * @contact Joerg.Heuer@siemens.com + * @contact Richard.Kuntschke@siemens.com * *

Code generated by EXIdizer

*

Schema: V2G_CI_MsgDef.xsd

diff --git a/src/din/dinEXIDatatypes.c b/src/din/dinEXIDatatypes.c index 668f4af..af5875d 100644 --- a/src/din/dinEXIDatatypes.c +++ b/src/din/dinEXIDatatypes.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2017 Siemens AG + * Copyright (C) 2007-2018 Siemens AG * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published @@ -18,7 +18,7 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 2017-11-16 + * @version 0.9.4 * @contact Richard.Kuntschke@siemens.com * *

Code generated by EXIdizer

diff --git a/src/din/dinEXIDatatypes.h b/src/din/dinEXIDatatypes.h index 50d4156..ad09324 100644 --- a/src/din/dinEXIDatatypes.h +++ b/src/din/dinEXIDatatypes.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2017 Siemens AG + * Copyright (C) 2007-2018 Siemens AG * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published @@ -18,7 +18,7 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 2017-11-16 + * @version 0.9.4 * @contact Richard.Kuntschke@siemens.com * *

Code generated by EXIdizer

diff --git a/src/din/dinEXIDatatypesDecoder.c b/src/din/dinEXIDatatypesDecoder.c index c05452e..c242e8d 100644 --- a/src/din/dinEXIDatatypesDecoder.c +++ b/src/din/dinEXIDatatypesDecoder.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2017 Siemens AG + * Copyright (C) 2007-2018 Siemens AG * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published @@ -18,7 +18,7 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 2017-11-16 + * @version 0.9.4 * @contact Richard.Kuntschke@siemens.com * *

Code generated by EXIdizer

diff --git a/src/din/dinEXIDatatypesDecoder.h b/src/din/dinEXIDatatypesDecoder.h index 26988c6..a99cb48 100644 --- a/src/din/dinEXIDatatypesDecoder.h +++ b/src/din/dinEXIDatatypesDecoder.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2017 Siemens AG + * Copyright (C) 2007-2018 Siemens AG * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published @@ -18,7 +18,7 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 2017-11-16 + * @version 0.9.4 * @contact Richard.Kuntschke@siemens.com * *

Code generated by EXIdizer

diff --git a/src/din/dinEXIDatatypesEncoder.c b/src/din/dinEXIDatatypesEncoder.c index 3904f3d..08a2cca 100644 --- a/src/din/dinEXIDatatypesEncoder.c +++ b/src/din/dinEXIDatatypesEncoder.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2017 Siemens AG + * Copyright (C) 2007-2018 Siemens AG * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published @@ -18,7 +18,7 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 2017-11-16 + * @version 0.9.4 * @contact Richard.Kuntschke@siemens.com * *

Code generated by EXIdizer

diff --git a/src/din/dinEXIDatatypesEncoder.h b/src/din/dinEXIDatatypesEncoder.h index f10a058..d0ee4d5 100644 --- a/src/din/dinEXIDatatypesEncoder.h +++ b/src/din/dinEXIDatatypesEncoder.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2017 Siemens AG + * Copyright (C) 2007-2018 Siemens AG * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published @@ -18,7 +18,7 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 2017-11-16 + * @version 0.9.4 * @contact Richard.Kuntschke@siemens.com * *

Code generated by EXIdizer

diff --git a/src/iso1/iso1EXIDatatypes.c b/src/iso1/iso1EXIDatatypes.c index 0b10164..5640486 100644 --- a/src/iso1/iso1EXIDatatypes.c +++ b/src/iso1/iso1EXIDatatypes.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2017 Siemens AG + * Copyright (C) 2007-2018 Siemens AG * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published @@ -18,7 +18,7 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 2017-12-12 + * @version 0.9.4 * @contact Richard.Kuntschke@siemens.com * *

Code generated by EXIdizer

diff --git a/src/iso1/iso1EXIDatatypes.h b/src/iso1/iso1EXIDatatypes.h index c394583..cc22a45 100644 --- a/src/iso1/iso1EXIDatatypes.h +++ b/src/iso1/iso1EXIDatatypes.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2017 Siemens AG + * Copyright (C) 2007-2018 Siemens AG * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published @@ -18,7 +18,7 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 2017-12-12 + * @version 0.9.4 * @contact Richard.Kuntschke@siemens.com * *

Code generated by EXIdizer

@@ -44,8 +44,8 @@ extern "C" { #define SUPPORT_YES 1 #define SUPPORT_NO 2 -#define DEPLOY_ISO1_CODEC SUPPORT_NO -#define DEPLOY_ISO1_CODEC_FRAGMENT SUPPORT_NO +#define DEPLOY_ISO1_CODEC SUPPORT_YES +#define DEPLOY_ISO1_CODEC_FRAGMENT SUPPORT_YES #if DEPLOY_ISO1_CODEC == SUPPORT_YES diff --git a/src/iso1/iso1EXIDatatypesDecoder.c b/src/iso1/iso1EXIDatatypesDecoder.c index 6c360a5..9a76ca2 100644 --- a/src/iso1/iso1EXIDatatypesDecoder.c +++ b/src/iso1/iso1EXIDatatypesDecoder.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2017 Siemens AG + * Copyright (C) 2007-2018 Siemens AG * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published @@ -18,7 +18,7 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 2017-12-12 + * @version 0.9.4 * @contact Richard.Kuntschke@siemens.com * *

Code generated by EXIdizer

diff --git a/src/iso1/iso1EXIDatatypesDecoder.h b/src/iso1/iso1EXIDatatypesDecoder.h index 2c9d791..6b11657 100644 --- a/src/iso1/iso1EXIDatatypesDecoder.h +++ b/src/iso1/iso1EXIDatatypesDecoder.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2017 Siemens AG + * Copyright (C) 2007-2018 Siemens AG * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published @@ -18,7 +18,7 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 2017-12-12 + * @version 0.9.4 * @contact Richard.Kuntschke@siemens.com * *

Code generated by EXIdizer

diff --git a/src/iso1/iso1EXIDatatypesEncoder.c b/src/iso1/iso1EXIDatatypesEncoder.c index 8ef3406..a54ab28 100644 --- a/src/iso1/iso1EXIDatatypesEncoder.c +++ b/src/iso1/iso1EXIDatatypesEncoder.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2017 Siemens AG + * Copyright (C) 2007-2018 Siemens AG * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published @@ -18,7 +18,7 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 2017-12-12 + * @version 0.9.4 * @contact Richard.Kuntschke@siemens.com * *

Code generated by EXIdizer

diff --git a/src/iso1/iso1EXIDatatypesEncoder.h b/src/iso1/iso1EXIDatatypesEncoder.h index c2abd37..50ee1d7 100644 --- a/src/iso1/iso1EXIDatatypesEncoder.h +++ b/src/iso1/iso1EXIDatatypesEncoder.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2017 Siemens AG + * Copyright (C) 2007-2018 Siemens AG * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published @@ -18,7 +18,7 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 2017-12-12 + * @version 0.9.4 * @contact Richard.Kuntschke@siemens.com * *

Code generated by EXIdizer

diff --git a/src/iso2/iso2EXIDatatypes.c b/src/iso2/iso2EXIDatatypes.c index 221fadd..5dec4a3 100644 --- a/src/iso2/iso2EXIDatatypes.c +++ b/src/iso2/iso2EXIDatatypes.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2017 Siemens AG + * Copyright (C) 2007-2018 Siemens AG * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published @@ -18,7 +18,7 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 2017-11-16 + * @version 0.9.4 * @contact Richard.Kuntschke@siemens.com * *

Code generated by EXIdizer

diff --git a/src/iso2/iso2EXIDatatypes.h b/src/iso2/iso2EXIDatatypes.h index bc11233..724685a 100644 --- a/src/iso2/iso2EXIDatatypes.h +++ b/src/iso2/iso2EXIDatatypes.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2017 Siemens AG + * Copyright (C) 2007-2018 Siemens AG * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published @@ -18,7 +18,7 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 2017-11-16 + * @version 0.9.4 * @contact Richard.Kuntschke@siemens.com * *

Code generated by EXIdizer

@@ -44,8 +44,8 @@ extern "C" { #define SUPPORT_YES 1 #define SUPPORT_NO 2 -#define DEPLOY_ISO2_CODEC SUPPORT_YES -#define DEPLOY_ISO2_CODEC_FRAGMENT SUPPORT_YES +#define DEPLOY_ISO2_CODEC SUPPORT_NO +#define DEPLOY_ISO2_CODEC_FRAGMENT SUPPORT_NO #if DEPLOY_ISO2_CODEC == SUPPORT_YES diff --git a/src/iso2/iso2EXIDatatypesDecoder.c b/src/iso2/iso2EXIDatatypesDecoder.c index 18b3d32..067a17c 100644 --- a/src/iso2/iso2EXIDatatypesDecoder.c +++ b/src/iso2/iso2EXIDatatypesDecoder.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2017 Siemens AG + * Copyright (C) 2007-2018 Siemens AG * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published @@ -18,7 +18,7 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 2017-11-16 + * @version 0.9.4 * @contact Richard.Kuntschke@siemens.com * *

Code generated by EXIdizer

diff --git a/src/iso2/iso2EXIDatatypesDecoder.h b/src/iso2/iso2EXIDatatypesDecoder.h index f0beda1..cc2d949 100644 --- a/src/iso2/iso2EXIDatatypesDecoder.h +++ b/src/iso2/iso2EXIDatatypesDecoder.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2017 Siemens AG + * Copyright (C) 2007-2018 Siemens AG * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published @@ -18,7 +18,7 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 2017-11-16 + * @version 0.9.4 * @contact Richard.Kuntschke@siemens.com * *

Code generated by EXIdizer

diff --git a/src/iso2/iso2EXIDatatypesEncoder.c b/src/iso2/iso2EXIDatatypesEncoder.c index 670755e..d34b268 100644 --- a/src/iso2/iso2EXIDatatypesEncoder.c +++ b/src/iso2/iso2EXIDatatypesEncoder.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2017 Siemens AG + * Copyright (C) 2007-2018 Siemens AG * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published @@ -18,7 +18,7 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 2017-11-16 + * @version 0.9.4 * @contact Richard.Kuntschke@siemens.com * *

Code generated by EXIdizer

diff --git a/src/iso2/iso2EXIDatatypesEncoder.h b/src/iso2/iso2EXIDatatypesEncoder.h index b6aae65..1c1b497 100644 --- a/src/iso2/iso2EXIDatatypesEncoder.h +++ b/src/iso2/iso2EXIDatatypesEncoder.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2017 Siemens AG + * Copyright (C) 2007-2018 Siemens AG * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published @@ -18,7 +18,7 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 2017-11-16 + * @version 0.9.4 * @contact Richard.Kuntschke@siemens.com * *

Code generated by EXIdizer

diff --git a/src/test/main.c b/src/test/main.c index 59c3f3e..c1ce2f0 100644 --- a/src/test/main.c +++ b/src/test/main.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2017 Siemens AG + * Copyright (C) 2007-2018 Siemens AG * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published @@ -19,7 +19,7 @@ * * @author Daniel.Peintner.EXT@siemens.com * @author Sebastian.Kaebisch@siemens.com - * @version 1.0.0alpha + * @version 0.9.4 * @contact Richard.Kuntschke@siemens.com * *

Switch for sample programs: EXI codec only or for entire V2G example

diff --git a/src/test/main.h b/src/test/main.h index 42a4c00..ae3e0c2 100644 --- a/src/test/main.h +++ b/src/test/main.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2017 Siemens AG + * Copyright (C) 2007-2018 Siemens AG * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published @@ -19,7 +19,7 @@ * * @author Daniel.Peintner.EXT@siemens.com * @author Sebastian.Kaebisch@siemens.com - * @version 1.0.0alpha + * @version 0.9.4 * @contact Richard.Kuntschke@siemens.com * * diff --git a/src/test/main_databinder.c b/src/test/main_databinder.c index e16e2f3..60d31f3 100644 --- a/src/test/main_databinder.c +++ b/src/test/main_databinder.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2017 Siemens AG + * Copyright (C) 2007-2018 Siemens AG * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published @@ -18,7 +18,7 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 1.0.0alpha + * @version 0.9.4 * @contact Richard.Kuntschke@siemens.com * *

Code generated by EXIdizer

@@ -41,11 +41,17 @@ #include #include -/* schema-dependent */ -#include "iso2EXIDatatypes.h" +/* schema-dependent */ +#include "iso1EXIDatatypes.h" +#if DEPLOY_ISO1_CODEC == SUPPORT_YES +#include "iso1EXIDatatypesEncoder.h" +#include "iso1EXIDatatypesDecoder.h" +#endif /* DEPLOY_ISO1_CODEC == SUPPORT_YES */ +#include "iso2EXIDatatypes.h" +#if DEPLOY_ISO2_CODEC == SUPPORT_YES #include "iso2EXIDatatypesEncoder.h" #include "iso2EXIDatatypesDecoder.h" - +#endif /* DEPLOY_ISO2_CODEC == SUPPORT_YES */ #include "ByteStream.h" @@ -65,8 +71,13 @@ uint8_t bufferOut[BUFFER_SIZE]; int main_databinder(int argc, char *argv[]) { - - struct iso2EXIDocument exiDoc; + +#if DEPLOY_ISO1_CODEC == SUPPORT_YES + struct iso1EXIDocument exi1Doc; +#endif /* DEPLOY_ISO1_CODEC == SUPPORT_YES */ +#if DEPLOY_ISO2_CODEC == SUPPORT_YES + struct iso2EXIDocument exi2Doc; +#endif /* DEPLOY_ISO2_CODEC == SUPPORT_YES */ int errn = 0; bitstream_t iStream, oStream; @@ -111,8 +122,13 @@ int main_databinder(int argc, char *argv[]) { iStream.capacity = 0; - printf("Start decoding EXI stream to databinding layer \n"); - errn = decode_iso2ExiDocument(&iStream, &exiDoc); + printf("Start decoding EXI stream to databinding layer \n"); +#if DEPLOY_ISO1_CODEC == SUPPORT_YES + errn = decode_iso1ExiDocument(&iStream, &exi1Doc); +#endif /* DEPLOY_ISO1_CODEC == SUPPORT_YES */ +#if DEPLOY_ISO2_CODEC == SUPPORT_YES + errn = decode_iso2ExiDocument(&iStream, &exi2Doc); +#endif /* DEPLOY_ISO2_CODEC == SUPPORT_YES */ if (errn != 0) { printf("Problems while decoding EXI stream, err==%d\n", errn); return errn; @@ -129,8 +145,13 @@ int main_databinder(int argc, char *argv[]) { oStream.buffer = 0; oStream.capacity = 8; - printf("Start encoding databinding layer to EXI \n"); - errn = encode_iso2ExiDocument(&oStream, &exiDoc); + printf("Start encoding databinding layer to EXI \n"); +#if DEPLOY_ISO1_CODEC == SUPPORT_YES + errn = encode_iso1ExiDocument(&oStream, &exi1Doc); +#endif /* DEPLOY_ISO1_CODEC == SUPPORT_YES */ +#if DEPLOY_ISO2_CODEC == SUPPORT_YES + errn = encode_iso2ExiDocument(&oStream, &exi2Doc); +#endif /* DEPLOY_ISO2_CODEC == SUPPORT_YES */ if (errn != 0) { printf("Problems while encoding databinding layer, err==%d\n", errn); return errn; diff --git a/src/test/main_example.c b/src/test/main_example.c index 2985755..e54d7be 100644 --- a/src/test/main_example.c +++ b/src/test/main_example.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2017 Siemens AG + * Copyright (C) 2007-2018 Siemens AG * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published @@ -19,7 +19,7 @@ * * @author Daniel.Peintner.EXT@siemens.com * @author Sebastian.Kaebisch@siemens.com - * @version 1.0.0alpha + * @version 0.9.4 * @contact Richard.Kuntschke@siemens.com * * @@ -53,6 +53,13 @@ #include "xmldsigEXIDatatypesDecoder.h" #endif /* DEPLOY_XMLDSIG_CODEC == SUPPORT_YES */ +/* Activate support for ISO1 */ +#include "iso1EXIDatatypes.h" +#if DEPLOY_ISO1_CODEC == SUPPORT_YES +#include "iso1EXIDatatypesEncoder.h" +#include "iso1EXIDatatypesDecoder.h" +#endif /* DEPLOY_ISO1_CODEC == SUPPORT_YES */ + /* Activate support for ISO2 */ #include "iso2EXIDatatypes.h" #if DEPLOY_ISO2_CODEC == SUPPORT_YES @@ -103,12 +110,6 @@ static void printASCIIString(exi_string_character_t* string, uint16_t len) { printf("\n"); } -static void printEVSEStatus(struct iso2EVSEStatusType* status) -{ - printf("\tEVSEStatus:\n"); - printf("\t\tEVSENotification=%d\n", status->EVSENotification); - printf("\t\tNotificationMaxDelay=%d\n", status->NotificationMaxDelay); -} static void printBinaryArray(uint8_t* byte, uint16_t len) { unsigned int i; @@ -126,31 +127,6 @@ static void copyBytes(uint8_t* from, uint16_t len, uint8_t* to) { } -/* serializes EXI stream and adds V2G TP header */ -static int serializeEXI2Stream(struct iso2EXIDocument* exiIn, bitstream_t* stream) { - int errn; - *stream->pos = V2GTP_HEADER_LENGTH; /* v2gtp header */ - if( (errn = encode_iso2ExiDocument(stream, exiIn)) == 0) { - errn = write_v2gtpHeader(stream->data, (*stream->pos)-V2GTP_HEADER_LENGTH, V2GTP_EXI_TYPE); - } - return errn; -} - - -/* deserializes V2G TP header and decodes right away EXI stream */ -static int deserializeStream2EXI(bitstream_t* streamIn, struct iso2EXIDocument* exi) { - int errn; - uint32_t payloadLength; - - *streamIn->pos = 0; - if ( (errn = read_v2gtpHeader(streamIn->data, &payloadLength)) == 0) { - *streamIn->pos += V2GTP_HEADER_LENGTH; - - errn = decode_iso2ExiDocument(streamIn, exi); - } - return errn; -} - /** Example implementation of the app handshake protocol for the EVSE side */ static int appHandshakeHandler(bitstream_t* iStream, bitstream_t* oStream) { struct appHandEXIDocument appHandResp; @@ -287,7 +263,44 @@ static int appHandshake() } -static int sessionSetup(struct iso2EXIDocument* exiIn, struct iso2EXIDocument* exiOut) { + + + +#if DEPLOY_ISO2_CODEC == SUPPORT_YES + +static void printEVSEStatus2(struct iso2EVSEStatusType* status) +{ + printf("\tEVSEStatus:\n"); + printf("\t\tEVSENotification=%d\n", status->EVSENotification); + printf("\t\tNotificationMaxDelay=%d\n", status->NotificationMaxDelay); +} + +/* serializes EXI stream and adds V2G TP header */ +static int serialize2EXI2Stream(struct iso2EXIDocument* exiIn, bitstream_t* stream) { + int errn; + *stream->pos = V2GTP_HEADER_LENGTH; /* v2gtp header */ + if( (errn = encode_iso2ExiDocument(stream, exiIn)) == 0) { + errn = write_v2gtpHeader(stream->data, (*stream->pos)-V2GTP_HEADER_LENGTH, V2GTP_EXI_TYPE); + } + return errn; +} + + +/* deserializes V2G TP header and decodes right away EXI stream */ +static int deserialize2Stream2EXI(bitstream_t* streamIn, struct iso2EXIDocument* exi) { + int errn; + uint32_t payloadLength; + + *streamIn->pos = 0; + if ( (errn = read_v2gtpHeader(streamIn->data, &payloadLength)) == 0) { + *streamIn->pos += V2GTP_HEADER_LENGTH; + + errn = decode_iso2ExiDocument(streamIn, exi); + } + return errn; +} + +static int sessionSetup2(struct iso2EXIDocument* exiIn, struct iso2EXIDocument* exiOut) { printf("EVSE side: sessionSetup called\n" ); printf("\tReceived data:\n"); printf("\tHeader SessionID="); @@ -324,7 +337,7 @@ static int sessionSetup(struct iso2EXIDocument* exiIn, struct iso2EXIDocument* e return 0; } -static int serviceDiscovery(struct iso2EXIDocument* exiIn, struct iso2EXIDocument* exiOut) { +static int serviceDiscovery2(struct iso2EXIDocument* exiIn, struct iso2EXIDocument* exiOut) { int i; printf("EVSE side: serviceDiscovery called\n" ); @@ -362,7 +375,7 @@ static int serviceDiscovery(struct iso2EXIDocument* exiIn, struct iso2EXIDocumen } -static int serviceDetail(struct iso2EXIDocument* exiIn, struct iso2EXIDocument* exiOut) { +static int serviceDetail2(struct iso2EXIDocument* exiIn, struct iso2EXIDocument* exiOut) { printf("EVSE side: serviceDetail called\n" ); printf("\tReceived data:\n"); @@ -433,7 +446,7 @@ static int serviceDetail(struct iso2EXIDocument* exiIn, struct iso2EXIDocument* } -static int paymentServiceSelection(struct iso2EXIDocument* exiIn, struct iso2EXIDocument* exiOut) { +static int paymentServiceSelection2(struct iso2EXIDocument* exiIn, struct iso2EXIDocument* exiOut) { int i; printf("EVSE side: paymentServiceSelection called\n" ); @@ -466,7 +479,7 @@ static int paymentServiceSelection(struct iso2EXIDocument* exiIn, struct iso2EXI } -static int paymentDetails(struct iso2EXIDocument* exiIn, struct iso2EXIDocument* exiOut) { +static int paymentDetails2(struct iso2EXIDocument* exiIn, struct iso2EXIDocument* exiOut) { printf("EVSE side: paymentDetails called\n" ); printf("\tReceived data:\n"); @@ -493,7 +506,7 @@ static int paymentDetails(struct iso2EXIDocument* exiIn, struct iso2EXIDocument* } -static int authorization(struct iso2EXIDocument* exiIn, struct iso2EXIDocument* exiOut) { +static int authorization2(struct iso2EXIDocument* exiIn, struct iso2EXIDocument* exiOut) { printf("EVSE: Authorization called\n" ); printf("\tReceived data:\n"); @@ -520,7 +533,7 @@ static int authorization(struct iso2EXIDocument* exiIn, struct iso2EXIDocument* } -static int chargeParameterDiscovery(struct iso2EXIDocument* exiIn, struct iso2EXIDocument* exiOut) { +static int chargeParameterDiscovery2(struct iso2EXIDocument* exiIn, struct iso2EXIDocument* exiOut) { printf("EVSE side: chargeParameterDiscovery called\n" ); printf("\tReceived data:\n"); @@ -545,7 +558,7 @@ static int chargeParameterDiscovery(struct iso2EXIDocument* exiIn, struct iso2EX } -static int powerDelivery(struct iso2EXIDocument* exiIn, struct iso2EXIDocument* exiOut) { +static int powerDelivery2(struct iso2EXIDocument* exiIn, struct iso2EXIDocument* exiOut) { printf("EVSE side: powerDelivery called\n" ); printf("\tReceived data:\n"); @@ -571,7 +584,7 @@ static int powerDelivery(struct iso2EXIDocument* exiIn, struct iso2EXIDocument* } -static int chargingStatus(struct iso2EXIDocument* exiIn, struct iso2EXIDocument* exiOut) { +static int chargingStatus2(struct iso2EXIDocument* exiIn, struct iso2EXIDocument* exiOut) { printf("EVSE side: chargingStatus called\n" ); @@ -596,7 +609,7 @@ static int chargingStatus(struct iso2EXIDocument* exiIn, struct iso2EXIDocument* } -static int meteringReceipt(struct iso2EXIDocument* exiIn, struct iso2EXIDocument* exiOut) { +static int meteringReceipt2(struct iso2EXIDocument* exiIn, struct iso2EXIDocument* exiOut) { printf("EVSE side: meteringReceipt called\n" ); printf("\tReceived data:\n"); @@ -619,7 +632,7 @@ static int meteringReceipt(struct iso2EXIDocument* exiIn, struct iso2EXIDocument return 0; } -static int sessionStop(struct iso2EXIDocument* exiIn, struct iso2EXIDocument* exiOut) { +static int sessionStop2(struct iso2EXIDocument* exiIn, struct iso2EXIDocument* exiOut) { printf("EVSE side: sessionStop called\n" ); printf("\tReceived data:\n"); @@ -639,7 +652,7 @@ static int sessionStop(struct iso2EXIDocument* exiIn, struct iso2EXIDocument* ex return 0; } -static int cableCheck(struct iso2EXIDocument* exiIn, struct iso2EXIDocument* exiOut) { +static int cableCheck2(struct iso2EXIDocument* exiIn, struct iso2EXIDocument* exiOut) { printf("EVSE side: cableCheck called\n" ); @@ -660,7 +673,7 @@ static int cableCheck(struct iso2EXIDocument* exiIn, struct iso2EXIDocument* exi return 0; } -static int preCharge(struct iso2EXIDocument* exiIn, struct iso2EXIDocument* exiOut) { +static int preCharge2(struct iso2EXIDocument* exiIn, struct iso2EXIDocument* exiOut) { printf("EVSE side: preCharge called\n" ); printf("\tReceived data:\n"); @@ -688,38 +701,38 @@ static int preCharge(struct iso2EXIDocument* exiIn, struct iso2EXIDocument* exiO -static int create_response_message(struct iso2EXIDocument* exiIn, struct iso2EXIDocument* exiOut) { +static int create_response_message2(struct iso2EXIDocument* exiIn, struct iso2EXIDocument* exiOut) { int errn = ERROR_UNEXPECTED_REQUEST_MESSAGE; /* create response message as EXI document */ if(exiIn->V2G_Message_isUsed) { init_iso2EXIDocument(exiOut); if (exiIn->V2G_Message.Body.SessionSetupReq_isUsed) { - errn = sessionSetup(exiIn, exiOut); + errn = sessionSetup2(exiIn, exiOut); } else if (exiIn->V2G_Message.Body.ServiceDiscoveryReq_isUsed) { - errn = serviceDiscovery(exiIn, exiOut); + errn = serviceDiscovery2(exiIn, exiOut); } else if (exiIn->V2G_Message.Body.ServiceDetailReq_isUsed) { - errn = serviceDetail(exiIn, exiOut); + errn = serviceDetail2(exiIn, exiOut); } else if (exiIn->V2G_Message.Body.PaymentServiceSelectionReq_isUsed) { - errn = paymentServiceSelection(exiIn, exiOut); + errn = paymentServiceSelection2(exiIn, exiOut); } else if (exiIn->V2G_Message.Body.PaymentDetailsReq_isUsed) { - errn = paymentDetails(exiIn, exiOut); + errn = paymentDetails2(exiIn, exiOut); } else if (exiIn->V2G_Message.Body.AuthorizationReq_isUsed) { - errn = authorization(exiIn, exiOut); + errn = authorization2(exiIn, exiOut); } else if (exiIn->V2G_Message.Body.ChargeParameterDiscoveryReq_isUsed) { - errn = chargeParameterDiscovery(exiIn, exiOut); + errn = chargeParameterDiscovery2(exiIn, exiOut); } else if (exiIn->V2G_Message.Body.PowerDeliveryReq_isUsed) { - errn = powerDelivery(exiIn, exiOut); + errn = powerDelivery2(exiIn, exiOut); } else if (exiIn->V2G_Message.Body.ChargingStatusReq_isUsed) { - errn = chargingStatus(exiIn, exiOut); + errn = chargingStatus2(exiIn, exiOut); } else if (exiIn->V2G_Message.Body.MeteringReceiptReq_isUsed) { - errn = meteringReceipt(exiIn, exiOut); + errn = meteringReceipt2(exiIn, exiOut); } else if (exiIn->V2G_Message.Body.SessionStopReq_isUsed) { - errn = sessionStop(exiIn, exiOut); + errn = sessionStop2(exiIn, exiOut); } else if (exiIn->V2G_Message.Body.CableCheckReq_isUsed) { - errn = cableCheck(exiIn, exiOut); + errn = cableCheck2(exiIn, exiOut); } else if (exiIn->V2G_Message.Body.PreChargeReq_isUsed) { - errn = preCharge(exiIn, exiOut); + errn = preCharge2(exiIn, exiOut); } } @@ -728,7 +741,7 @@ static int create_response_message(struct iso2EXIDocument* exiIn, struct iso2EXI /* Adapt this to your system setup! */ /* In this situation EV and EVSE is the same party */ -static int request_response(struct iso2EXIDocument* exiIn, struct iso2EXIDocument* exiOut) { +static int request_response2(struct iso2EXIDocument* exiIn, struct iso2EXIDocument* exiOut) { int errn; bitstream_t stream1; @@ -746,20 +759,20 @@ static int request_response(struct iso2EXIDocument* exiIn, struct iso2EXIDocumen stream2.pos = &pos2; /* EV side */ - errn = serializeEXI2Stream(exiIn, &stream1); + errn = serialize2EXI2Stream(exiIn, &stream1); /* --> Start of EVSE side */ /* deserialize request message */ if (errn == 0) { - errn = deserializeStream2EXI(&stream1, exiOut); + errn = deserialize2Stream2EXI(&stream1, exiOut); } /* create response message */ if (errn == 0) { - errn = create_response_message(exiOut, exiIn); + errn = create_response_message2(exiOut, exiIn); } /* serialize response message */ if (errn == 0) { - errn = serializeEXI2Stream(exiIn, &stream2); + errn = serialize2EXI2Stream(exiIn, &stream2); } /* <-- End of EVSE side */ @@ -767,15 +780,14 @@ static int request_response(struct iso2EXIDocument* exiIn, struct iso2EXIDocumen /* EV side */ /* deserialize response message */ if (errn == 0) { - errn = deserializeStream2EXI(&stream2, exiOut); + errn = deserialize2Stream2EXI(&stream2, exiOut); } return errn; } - -static int charging() +static int charging2() { int errn = 0; int i, j; @@ -816,7 +828,7 @@ static int charging() printf("EV side: call EVSE sessionSetup"); - errn = request_response(&exiIn, &exiOut); + errn = request_response2(&exiIn, &exiOut); if(errn == 0) { /* check, if this is the right response message */ @@ -851,7 +863,7 @@ static int charging() printf("EV side: call EVSE serviceDiscovery"); - errn = request_response(&exiIn, &exiOut); + errn = request_response2(&exiIn, &exiOut); if(errn == 0) { /* check, if this is the right response message */ @@ -914,7 +926,7 @@ static int charging() printf("EV side: call EVSE ServiceDetail \n"); - errn = request_response(&exiIn, &exiOut); + errn = request_response2(&exiIn, &exiOut); if(errn == 0) { /* check, if this is the right response message */ @@ -975,7 +987,7 @@ static int charging() printf("EV side: call EVSE ServicePaymentSelection \n"); - errn = request_response(&exiIn, &exiOut); + errn = request_response2(&exiIn, &exiOut); if(errn == 0) { /* check, if this is the right response message */ @@ -1030,7 +1042,7 @@ static int charging() printf("EV side: call EVSE ServiceDetail \n"); - errn = request_response(&exiIn, &exiOut); + errn = request_response2(&exiIn, &exiOut); if(errn == 0) { /* check, if this is the right response message */ @@ -1077,7 +1089,7 @@ static int charging() printf("EV side: call EVSE Authorization \n"); - errn = request_response(&exiIn, &exiOut); + errn = request_response2(&exiIn, &exiOut); if(errn == 0) { /* check, if this is the right response message */ @@ -1141,7 +1153,7 @@ static int charging() printf("EV side: call EVSE chargeParameterDiscovery"); - errn = request_response(&exiIn, &exiOut); + errn = request_response2(&exiIn, &exiOut); if(errn == 0) { /* check, if this is the right response message */ @@ -1179,7 +1191,7 @@ static int charging() printf("EV side: call EVSE cableCheck \n"); - errn = request_response(&exiIn, &exiOut); + errn = request_response2(&exiIn, &exiOut); if(errn == 0) { /* check, if this is the right response message */ @@ -1195,7 +1207,7 @@ static int charging() printf("\tEVSEProcessing=Finished\n"); } - printEVSEStatus(&(exiOut.V2G_Message.Body.CableCheckRes.EVSEStatus)); + printEVSEStatus2(&(exiOut.V2G_Message.Body.CableCheckRes.EVSEStatus)); } else { errn = ERROR_UNEXPECTED_CABLE_CHECK_RESP_MESSAGE; return errn; @@ -1222,7 +1234,7 @@ static int charging() printf("EV side: call EVSE preCharge \n"); - errn = request_response(&exiIn, &exiOut); + errn = request_response2(&exiIn, &exiOut); if(errn == 0) { /* check, if this is the right response message */ @@ -1234,7 +1246,7 @@ static int charging() printBinaryArray(exiOut.V2G_Message.Header.SessionID.bytes, exiOut.V2G_Message.Header.SessionID.bytesLen); printf("\t ResponseCode=%d\n", exiOut.V2G_Message.Body.PreChargeRes.ResponseCode); - printEVSEStatus(&exiOut.V2G_Message.Body.PreChargeRes.EVSEStatus); + printEVSEStatus2(&exiOut.V2G_Message.Body.PreChargeRes.EVSEStatus); printf("\tEVSEPresentVoltage=%d (%d %d)\n", exiOut.V2G_Message.Body.PreChargeRes.EVSEPresentVoltage.Value, exiOut.V2G_Message.Body.PreChargeRes.EVSEPresentVoltage.Value, exiOut.V2G_Message.Body.PreChargeRes.EVSEPresentVoltage.Exponent); } else { @@ -1262,7 +1274,7 @@ static int charging() printf("EV side: call EVSE powerDelivery \n"); - errn = request_response(&exiIn, &exiOut); + errn = request_response2(&exiIn, &exiOut); if(errn == 0) { /* check, if this is the right response message */ @@ -1298,7 +1310,7 @@ static int charging() printf("EV side: call EVSE chargingStatus \n"); - errn = request_response(&exiIn, &exiOut); + errn = request_response2(&exiIn, &exiOut); if(errn == 0) { /* check, if this is the right response message */ @@ -1359,7 +1371,7 @@ static int charging() printf("EV side: call EVSE meteringReceipt \n"); - errn = request_response(&exiIn, &exiOut); + errn = request_response2(&exiIn, &exiOut); if(errn == 0) { /* check, if this is the right response message */ @@ -1394,7 +1406,7 @@ static int charging() printf("EV side: call EVSE stopSession \n"); - errn = request_response(&exiIn, &exiOut); + errn = request_response2(&exiIn, &exiOut); if(errn == 0) { /* check, if this is the right response message */ @@ -1419,6 +1431,777 @@ static int charging() return errn; } +#endif /* DEPLOY_ISO2_CODEC == SUPPORT_YES */ + + + + + + +#if DEPLOY_ISO1_CODEC == SUPPORT_YES + +static void printEVSEStatus1(struct iso1DC_EVSEStatusType* status) +{ + printf("\tEVSEStatus:\n"); + printf("\t\tEVSENotification=%d\n", status->EVSENotification); + printf("\t\tNotificationMaxDelay=%d\n", status->NotificationMaxDelay); +} + + +/* serializes EXI stream and adds V2G TP header */ +static int serialize1EXI2Stream(struct iso1EXIDocument* exiIn, bitstream_t* stream) { + int errn; + *stream->pos = V2GTP_HEADER_LENGTH; /* v2gtp header */ + if( (errn = encode_iso1ExiDocument(stream, exiIn)) == 0) { + errn = write_v2gtpHeader(stream->data, (*stream->pos)-V2GTP_HEADER_LENGTH, V2GTP_EXI_TYPE); + } + return errn; +} + + + +/* deserializes V2G TP header and decodes right away EXI stream */ +static int deserialize1Stream2EXI(bitstream_t* streamIn, struct iso1EXIDocument* exi) { + int errn; + uint32_t payloadLength; + + *streamIn->pos = 0; + if ( (errn = read_v2gtpHeader(streamIn->data, &payloadLength)) == 0) { + *streamIn->pos += V2GTP_HEADER_LENGTH; + + errn = decode_iso1ExiDocument(streamIn, exi); + } + return errn; +} + + + +static int sessionSetup1(struct iso1EXIDocument* exiIn, struct iso1EXIDocument* exiOut) { + printf("EVSE side: sessionSetup called\n" ); + printf("\tReceived data:\n"); + printf("\tHeader SessionID="); + printBinaryArray(exiIn->V2G_Message.Header.SessionID.bytes, exiIn->V2G_Message.Header.SessionID.bytesLen); + printf("\t\t EVCCID=%d\n", exiIn->V2G_Message.Body.SessionSetupReq.EVCCID.bytes[0]); + + exiOut->V2G_Message_isUsed = 1u; + + /* generate an unique sessionID */ + init_iso1MessageHeaderType(&exiOut->V2G_Message.Header); + exiOut->V2G_Message.Header.SessionID.bytes[0] = 1; + exiOut->V2G_Message.Header.SessionID.bytes[1] = 2; + exiOut->V2G_Message.Header.SessionID.bytes[2] = 3; + exiOut->V2G_Message.Header.SessionID.bytes[3] = 4; + exiOut->V2G_Message.Header.SessionID.bytes[4] = 5; + exiOut->V2G_Message.Header.SessionID.bytes[5] = 6; + exiOut->V2G_Message.Header.SessionID.bytes[6] = 7; + exiOut->V2G_Message.Header.SessionID.bytes[7] = 8; + exiOut->V2G_Message.Header.SessionID.bytesLen = 8; + + /* Prepare data for EV */ + init_iso1BodyType(&exiOut->V2G_Message.Body); + + exiOut->V2G_Message.Body.SessionSetupRes_isUsed = 1u; + init_iso1SessionSetupResType(&exiOut->V2G_Message.Body.SessionSetupRes); + + exiOut->V2G_Message.Body.SessionSetupRes.ResponseCode = iso1responseCodeType_OK; + exiOut->V2G_Message.Body.SessionSetupRes.EVSEID.characters[0] = 0; + exiOut->V2G_Message.Body.SessionSetupRes.EVSEID.characters[1] = 20; + exiOut->V2G_Message.Body.SessionSetupRes.EVSEID.charactersLen = 2; + exiOut->V2G_Message.Body.SessionSetupRes.EVSETimeStamp_isUsed = 1u; + exiOut->V2G_Message.Body.SessionSetupRes.EVSETimeStamp = 123456789; + + return 0; +} + + + +static int serviceDetail1(struct iso1EXIDocument* exiIn, struct iso1EXIDocument* exiOut) { + + printf("EVSE side: serviceDetail called\n" ); + printf("\tReceived data:\n"); + printf("\tHeader SessionID="); + printBinaryArray(exiIn->V2G_Message.Header.SessionID.bytes, exiIn->V2G_Message.Header.SessionID.bytesLen); + printf("\t\t ServiceDetailID=%d\n",exiIn->V2G_Message.Body.ServiceDetailReq.ServiceID); + + + /* Prepare data for EV */ + exiOut->V2G_Message_isUsed = 1u; + init_iso1BodyType(&exiOut->V2G_Message.Body); + + exiOut->V2G_Message.Body.ServiceDetailRes_isUsed= 1u; + init_iso1ServiceDetailResType(&exiOut->V2G_Message.Body.ServiceDetailRes); + + exiOut->V2G_Message.Body.ServiceDetailRes.ServiceID = 1234; + + exiOut->V2G_Message.Body.ServiceDetailRes.ServiceParameterList_isUsed = 1u; + exiOut->V2G_Message.Body.ServiceDetailRes.ServiceParameterList.ParameterSet.arrayLen = 2; + + /* Parameter Set 1*/ + exiOut->V2G_Message.Body.ServiceDetailRes.ServiceParameterList.ParameterSet.array[0].ParameterSetID = 1; + exiOut->V2G_Message.Body.ServiceDetailRes.ServiceParameterList.ParameterSet.array[0].Parameter.arrayLen = 2; + exiOut->V2G_Message.Body.ServiceDetailRes.ServiceParameterList.ParameterSet.array[0].Parameter.array[0].Name.charactersLen = 8; + exiOut->V2G_Message.Body.ServiceDetailRes.ServiceParameterList.ParameterSet.array[0].Parameter.array[0].Name.characters[0] = 'P'; + exiOut->V2G_Message.Body.ServiceDetailRes.ServiceParameterList.ParameterSet.array[0].Parameter.array[0].Name.characters[1] = 'r'; + exiOut->V2G_Message.Body.ServiceDetailRes.ServiceParameterList.ParameterSet.array[0].Parameter.array[0].Name.characters[2] = 'o'; + exiOut->V2G_Message.Body.ServiceDetailRes.ServiceParameterList.ParameterSet.array[0].Parameter.array[0].Name.characters[3] = 't'; + exiOut->V2G_Message.Body.ServiceDetailRes.ServiceParameterList.ParameterSet.array[0].Parameter.array[0].Name.characters[4]= 'o'; + exiOut->V2G_Message.Body.ServiceDetailRes.ServiceParameterList.ParameterSet.array[0].Parameter.array[0].Name.characters[5] = 'c'; + exiOut->V2G_Message.Body.ServiceDetailRes.ServiceParameterList.ParameterSet.array[0].Parameter.array[0].Name.characters[6] = 'o'; + exiOut->V2G_Message.Body.ServiceDetailRes.ServiceParameterList.ParameterSet.array[0].Parameter.array[0].Name.characters[7] = 'l'; + exiOut->V2G_Message.Body.ServiceDetailRes.ServiceParameterList.ParameterSet.array[0].Parameter.array[0].intValue = 15119; + exiOut->V2G_Message.Body.ServiceDetailRes.ServiceParameterList.ParameterSet.array[0].Parameter.array[0].intValue_isUsed = 1u; + + exiOut->V2G_Message.Body.ServiceDetailRes.ServiceParameterList.ParameterSet.array[0].Parameter.array[1].Name.charactersLen = 4; + exiOut->V2G_Message.Body.ServiceDetailRes.ServiceParameterList.ParameterSet.array[0].Parameter.array[1].Name.characters[0] = 'N'; + exiOut->V2G_Message.Body.ServiceDetailRes.ServiceParameterList.ParameterSet.array[0].Parameter.array[1].Name.characters[1] = 'a'; + exiOut->V2G_Message.Body.ServiceDetailRes.ServiceParameterList.ParameterSet.array[0].Parameter.array[1].Name.characters[2] = 'm'; + exiOut->V2G_Message.Body.ServiceDetailRes.ServiceParameterList.ParameterSet.array[0].Parameter.array[1].Name.characters[3] = 'e'; + + exiOut->V2G_Message.Body.ServiceDetailRes.ServiceParameterList.ParameterSet.array[0].Parameter.array[1].stringValue_isUsed = 1u; + exiOut->V2G_Message.Body.ServiceDetailRes.ServiceParameterList.ParameterSet.array[0].Parameter.array[1].stringValue.charactersLen = 3; + exiOut->V2G_Message.Body.ServiceDetailRes.ServiceParameterList.ParameterSet.array[0].Parameter.array[1].stringValue.characters[0] = 'V'; + exiOut->V2G_Message.Body.ServiceDetailRes.ServiceParameterList.ParameterSet.array[0].Parameter.array[1].stringValue.characters[1] = '2'; + exiOut->V2G_Message.Body.ServiceDetailRes.ServiceParameterList.ParameterSet.array[0].Parameter.array[1].stringValue.characters[2] = 'G'; + + /* Parameter Set 2 */ + exiOut->V2G_Message.Body.ServiceDetailRes.ServiceParameterList.ParameterSet.array[1].ParameterSetID = 2; + exiOut->V2G_Message.Body.ServiceDetailRes.ServiceParameterList.ParameterSet.array[1].Parameter.arrayLen = 1; + exiOut->V2G_Message.Body.ServiceDetailRes.ServiceParameterList.ParameterSet.array[1].Parameter.array[0].Name.charactersLen = 7; + exiOut->V2G_Message.Body.ServiceDetailRes.ServiceParameterList.ParameterSet.array[1].Parameter.array[0].Name.characters[0] = 'C'; + exiOut->V2G_Message.Body.ServiceDetailRes.ServiceParameterList.ParameterSet.array[1].Parameter.array[0].Name.characters[1] = 'h'; + exiOut->V2G_Message.Body.ServiceDetailRes.ServiceParameterList.ParameterSet.array[1].Parameter.array[0].Name.characters[2] = 'a'; + exiOut->V2G_Message.Body.ServiceDetailRes.ServiceParameterList.ParameterSet.array[1].Parameter.array[0].Name.characters[3] = 'n'; + exiOut->V2G_Message.Body.ServiceDetailRes.ServiceParameterList.ParameterSet.array[1].Parameter.array[0].Name.characters[4] = 'n'; + exiOut->V2G_Message.Body.ServiceDetailRes.ServiceParameterList.ParameterSet.array[1].Parameter.array[0].Name.characters[5] = 'e'; + exiOut->V2G_Message.Body.ServiceDetailRes.ServiceParameterList.ParameterSet.array[1].Parameter.array[0].Name.characters[6] = 'l'; + exiOut->V2G_Message.Body.ServiceDetailRes.ServiceParameterList.ParameterSet.array[1].Parameter.array[0].physicalValue_isUsed = 1u; + exiOut->V2G_Message.Body.ServiceDetailRes.ServiceParameterList.ParameterSet.array[1].Parameter.array[0].physicalValue.Value = 1234; + + exiOut->V2G_Message.Body.ServiceDetailRes.ServiceParameterList.ParameterSet.array[1].Parameter.array[0].physicalValue.Multiplier = 1; + exiOut->V2G_Message.Body.ServiceDetailRes.ServiceParameterList.ParameterSet.array[1].Parameter.array[0].physicalValue.Value = 2; + + exiOut->V2G_Message.Body.ServiceDetailRes.ResponseCode = iso1responseCodeType_OK; + + return 0; +} + + + +static int authorization1(struct iso1EXIDocument* exiIn, struct iso1EXIDocument* exiOut) { + + printf("EVSE: Authorization called\n" ); + printf("\tReceived data:\n"); + + if(exiIn->V2G_Message.Body.AuthorizationReq.GenChallenge_isUsed) { + printf("\t\t\t GenChallenge=%d\n", exiIn->V2G_Message.Body.AuthorizationReq.GenChallenge.bytes[0]); + } + if(exiIn->V2G_Message.Body.AuthorizationReq.Id_isUsed ) { + printf("\t\t\t ID=%c%c%c\n", exiIn->V2G_Message.Body.AuthorizationReq.Id.characters[0], exiIn->V2G_Message.Body.AuthorizationReq.Id.characters[1], exiIn->V2G_Message.Body.AuthorizationReq.Id.characters[2]); + } + + + /* Prepare data for EV */ + exiOut->V2G_Message_isUsed = 1u; + init_iso1BodyType(&exiOut->V2G_Message.Body); + + exiOut->V2G_Message.Body.AuthorizationRes_isUsed = 1u; + init_iso1AuthorizationResType(&exiOut->V2G_Message.Body.AuthorizationRes); + + exiOut->V2G_Message.Body.AuthorizationRes.ResponseCode = iso1responseCodeType_OK; + exiOut->V2G_Message.Body.AuthorizationRes.EVSEProcessing = iso1EVSEProcessingType_Finished; + + return 0; +} + + +static int powerDelivery1(struct iso1EXIDocument* exiIn, struct iso1EXIDocument* exiOut) { + printf("EVSE side: powerDelivery called\n" ); + printf("\tReceived data:\n"); + + printf("\t\t ChargeProgress=%d\n", exiIn->V2G_Message.Body.PowerDeliveryReq.ChargeProgress); + printf("\t\t SAScheduleTupleID=%d\n", exiIn->V2G_Message.Body.PowerDeliveryReq.SAScheduleTupleID); + + /* Prepare data for EV */ + exiOut->V2G_Message_isUsed = 1u; + init_iso1BodyType(&exiOut->V2G_Message.Body); + + exiOut->V2G_Message.Body.PowerDeliveryRes_isUsed = 1u; + init_iso1PowerDeliveryResType(&exiOut->V2G_Message.Body.PowerDeliveryRes); + + exiOut->V2G_Message.Body.PowerDeliveryRes.ResponseCode = iso1responseCodeType_OK; + + exiOut->V2G_Message.Body.PowerDeliveryRes.EVSEStatus_isUsed = 1; + exiOut->V2G_Message.Body.PowerDeliveryRes.EVSEStatus.EVSENotification = iso1EVSENotificationType_StopCharging; + exiOut->V2G_Message.Body.PowerDeliveryRes.EVSEStatus.NotificationMaxDelay=12; + + return 0; +} + + +static int chargingStatus1(struct iso1EXIDocument* exiIn, struct iso1EXIDocument* exiOut) { + + printf("EVSE side: chargingStatus called\n" ); + + /* Prepare data for EV */ + exiOut->V2G_Message_isUsed = 1u; + init_iso1BodyType(&exiOut->V2G_Message.Body); + + exiOut->V2G_Message.Body.ChargingStatusRes_isUsed = 1u; + init_iso1ChargingStatusResType(&exiOut->V2G_Message.Body.ChargingStatusRes); + + + exiOut->V2G_Message.Body.ChargingStatusRes.ResponseCode = iso1responseCodeType_OK; + exiOut->V2G_Message.Body.ChargingStatusRes.EVSEID.characters[0]= 'A'; + exiOut->V2G_Message.Body.ChargingStatusRes.EVSEID.charactersLen =1; + + exiOut->V2G_Message.Body.ChargingStatusRes.ReceiptRequired = 1; + exiOut->V2G_Message.Body.ChargingStatusRes.ReceiptRequired_isUsed = 1; + + return 0; +} + + +static int meteringReceipt1(struct iso1EXIDocument* exiIn, struct iso1EXIDocument* exiOut) { + + printf("EVSE side: meteringReceipt called\n" ); + printf("\tReceived data:\n"); + + printf("\t\t ID=%c%c%c\n", exiIn->V2G_Message.Body.MeteringReceiptReq.Id.characters[0], exiIn->V2G_Message.Body.MeteringReceiptReq.Id.characters[1], exiIn->V2G_Message.Body.MeteringReceiptReq.Id.characters[2]); + printf("\t\t SAScheduleTupleID=%d\n", exiIn->V2G_Message.Body.MeteringReceiptReq.SAScheduleTupleID); + printf("\t\t SessionID=%d\n", exiIn->V2G_Message.Body.MeteringReceiptReq.SessionID.bytes[1]); + printf("\t\t MeterInfo.MeterStatus=%d\n", exiIn->V2G_Message.Body.MeteringReceiptReq.MeterInfo.MeterStatus); + printf("\t\t MeterInfo.MeterID=%d\n", exiIn->V2G_Message.Body.MeteringReceiptReq.MeterInfo.MeterID.characters[0]); + + /* Prepare data for EV */ + exiOut->V2G_Message_isUsed = 1u; + init_iso1BodyType(&exiOut->V2G_Message.Body); + + exiOut->V2G_Message.Body.MeteringReceiptRes_isUsed = 1u; + init_iso1MeteringReceiptResType(&exiOut->V2G_Message.Body.MeteringReceiptRes); + + exiOut->V2G_Message.Body.MeteringReceiptRes.ResponseCode = iso1responseCodeType_FAILED; + + return 0; +} + +static int sessionStop1(struct iso1EXIDocument* exiIn, struct iso1EXIDocument* exiOut) { + + printf("EVSE side: sessionStop called\n" ); + printf("\tReceived data:\n"); + printf("\tHeader SessionID="); + printBinaryArray(exiIn->V2G_Message.Header.SessionID.bytes, exiIn->V2G_Message.Header.SessionID.bytesLen); + printf("\t\t ChargingSession=%d\n", exiIn->V2G_Message.Body.SessionStopReq.ChargingSession); + + /* Prepare data for EV */ + exiOut->V2G_Message_isUsed = 1u; + init_iso1BodyType(&exiOut->V2G_Message.Body); + + exiOut->V2G_Message.Body.SessionStopRes_isUsed = 1u; + init_iso1SessionStopResType(&exiOut->V2G_Message.Body.SessionStopRes); + + exiOut->V2G_Message.Body.SessionStopRes.ResponseCode = iso1responseCodeType_OK; + + return 0; +} + +static int cableCheck1(struct iso1EXIDocument* exiIn, struct iso1EXIDocument* exiOut) { + + printf("EVSE side: cableCheck called\n" ); + + /* Prepare data for EV */ + exiOut->V2G_Message_isUsed = 1u; + init_iso1BodyType(&exiOut->V2G_Message.Body); + + exiOut->V2G_Message.Body.CableCheckRes_isUsed = 1u; + init_iso1CableCheckResType(&exiOut->V2G_Message.Body.CableCheckRes); + + exiOut->V2G_Message.Body.CableCheckRes.ResponseCode = iso1responseCodeType_OK; + + exiOut->V2G_Message.Body.CableCheckRes.DC_EVSEStatus.NotificationMaxDelay = 1234; + exiOut->V2G_Message.Body.CableCheckRes.DC_EVSEStatus.EVSENotification= iso1EVSENotificationType_ReNegotiation; + + exiOut->V2G_Message.Body.CableCheckRes.EVSEProcessing = iso1EVSEProcessingType_Finished; + + return 0; +} + +static int preCharge1(struct iso1EXIDocument* exiIn, struct iso1EXIDocument* exiOut) { + + printf("EVSE side: preCharge called\n" ); + printf("\tReceived data:\n"); + + printf("\t\t EVTargetCurrent=%d (%d)\n", exiIn->V2G_Message.Body.PreChargeReq.EVTargetCurrent.Value, exiIn->V2G_Message.Body.PreChargeReq.EVTargetCurrent.Multiplier); + printf("\t\t EVTargetVoltage=%d (%d)\n", exiIn->V2G_Message.Body.PreChargeReq.EVTargetVoltage.Value, exiIn->V2G_Message.Body.PreChargeReq.EVTargetVoltage.Multiplier); + + /* Prepare data for EV */ + exiOut->V2G_Message_isUsed = 1u; + init_iso1BodyType(&exiOut->V2G_Message.Body); + + exiOut->V2G_Message.Body.PreChargeRes_isUsed = 1u; + init_iso1PreChargeResType(&exiOut->V2G_Message.Body.PreChargeRes); + + exiOut->V2G_Message.Body.PreChargeRes.ResponseCode = iso1responseCodeType_OK; + + exiOut->V2G_Message.Body.PreChargeRes.DC_EVSEStatus.EVSENotification = iso1EVSENotificationType_StopCharging; + exiOut->V2G_Message.Body.PreChargeRes.DC_EVSEStatus.NotificationMaxDelay= 1234; + + exiOut->V2G_Message.Body.PreChargeRes.EVSEPresentVoltage.Multiplier = 3; + exiOut->V2G_Message.Body.PreChargeRes.EVSEPresentVoltage.Value= 456; + + return 0; +} + + + + + +static int create_response_message1(struct iso1EXIDocument* exiIn, struct iso1EXIDocument* exiOut) { + int errn = ERROR_UNEXPECTED_REQUEST_MESSAGE; + + /* create response message as EXI document */ + if(exiIn->V2G_Message_isUsed) { + init_iso1EXIDocument(exiOut); + if (exiIn->V2G_Message.Body.SessionSetupReq_isUsed) { + errn = sessionSetup1(exiIn, exiOut); + } else if (exiIn->V2G_Message.Body.ServiceDetailReq_isUsed) { + errn = serviceDetail1(exiIn, exiOut); + /*} else if (exiIn->V2G_Message.Body.PaymentDetailsReq_isUsed) { + errn = paymentDetails1(exiIn, exiOut);*/ + } else if (exiIn->V2G_Message.Body.AuthorizationReq_isUsed) { + errn = authorization1(exiIn, exiOut); + } else if (exiIn->V2G_Message.Body.PowerDeliveryReq_isUsed) { + errn = powerDelivery1(exiIn, exiOut); + } else if (exiIn->V2G_Message.Body.ChargingStatusReq_isUsed) { + errn = chargingStatus1(exiIn, exiOut); + } else if (exiIn->V2G_Message.Body.MeteringReceiptReq_isUsed) { + errn = meteringReceipt1(exiIn, exiOut); + } else if (exiIn->V2G_Message.Body.SessionStopReq_isUsed) { + errn = sessionStop1(exiIn, exiOut); + } else if (exiIn->V2G_Message.Body.CableCheckReq_isUsed) { + errn = cableCheck1(exiIn, exiOut); + } else if (exiIn->V2G_Message.Body.PreChargeReq_isUsed) { + errn = preCharge1(exiIn, exiOut); + } + } + + return errn; +} + + +/* Adapt this to your system setup! */ +/* In this situation EV and EVSE is the same party */ +static int request_response1(struct iso1EXIDocument* exiIn, struct iso1EXIDocument* exiOut) { + int errn; + + bitstream_t stream1; + bitstream_t stream2; + + size_t pos1; + size_t pos2; + + stream1.size = BUFFER_SIZE; + stream1.data = buffer1; + stream1.pos = &pos1; + + stream2.size = BUFFER_SIZE; + stream2.data = buffer2; + stream2.pos = &pos2; + + /* EV side */ + errn = serialize1EXI2Stream(exiIn, &stream1); + + /* --> Start of EVSE side */ + /* deserialize request message */ + if (errn == 0) { + errn = deserialize1Stream2EXI(&stream1, exiOut); + } + /* create response message */ + if (errn == 0) { + errn = create_response_message1(exiOut, exiIn); + } + /* serialize response message */ + if (errn == 0) { + errn = serialize1EXI2Stream(exiIn, &stream2); + } + /* <-- End of EVSE side */ + + + /* EV side */ + /* deserialize response message */ + if (errn == 0) { + errn = deserialize1Stream2EXI(&stream2, exiOut); + } + + return errn; +} + +static int charging1() +{ + int errn = 0; + int i, j; + + struct iso1EXIDocument exiIn; + struct iso1EXIDocument exiOut; + + struct iso1ServiceDetailResType serviceDetailRes; + struct iso1PaymentDetailsResType paymentDetailsRes; + + /* setup header information */ + init_iso1EXIDocument(&exiIn); + exiIn.V2G_Message_isUsed = 1u; + init_iso1MessageHeaderType(&exiIn.V2G_Message.Header); + exiIn.V2G_Message.Header.SessionID.bytes[0] = 0; /* sessionID is always '0' at the beginning (the response contains the valid sessionID)*/ + exiIn.V2G_Message.Header.SessionID.bytes[1] = 0; + exiIn.V2G_Message.Header.SessionID.bytes[2] = 0; + exiIn.V2G_Message.Header.SessionID.bytes[3] = 0; + exiIn.V2G_Message.Header.SessionID.bytes[4] = 0; + exiIn.V2G_Message.Header.SessionID.bytes[5] = 0; + exiIn.V2G_Message.Header.SessionID.bytes[6] = 0; + exiIn.V2G_Message.Header.SessionID.bytes[7] = 0; + exiIn.V2G_Message.Header.SessionID.bytesLen = 8; + exiIn.V2G_Message.Header.Signature_isUsed = 0u; + + + /************************ + * sessionSetup * + ************************/ + init_iso1BodyType(&exiIn.V2G_Message.Body); + exiIn.V2G_Message.Body.SessionSetupReq_isUsed = 1u; + + init_iso1SessionSetupReqType(&exiIn.V2G_Message.Body.SessionSetupReq); + + exiIn.V2G_Message.Body.SessionSetupReq.EVCCID.bytesLen = 1; + exiIn.V2G_Message.Body.SessionSetupReq.EVCCID.bytes[0] = 10; + + printf("EV side: call EVSE sessionSetup"); + + errn = request_response1(&exiIn, &exiOut); + + if(errn == 0) { + /* check, if this is the right response message */ + if(exiOut.V2G_Message.Body.SessionSetupRes_isUsed) { + /* show results of EVSEs answer message */ + printf("EV side: received response message from EVSE\n"); + printf("\tHeader SessionID="); + printBinaryArray(exiOut.V2G_Message.Header.SessionID.bytes, exiOut.V2G_Message.Header.SessionID.bytesLen); + printf("\tResponseCode=%d\n", exiOut.V2G_Message.Body.SessionSetupRes.ResponseCode); + printf("\tEVSEID=%d\n", exiOut.V2G_Message.Body.SessionSetupRes.EVSEID.characters[1]); + printf("\tEVSETimeStamp=%li\n", (long int)exiOut.V2G_Message.Body.SessionSetupRes.EVSETimeStamp); + } else { + errn = ERROR_UNEXPECTED_SESSION_SETUP_RESP_MESSAGE; + return errn; + } + } else { + return errn; + } + + + + /********************************* + * ServiceDetails * + *********************************/ + init_iso1BodyType(&exiIn.V2G_Message.Body); + exiIn.V2G_Message.Body.ServiceDetailReq_isUsed = 1u; + + init_iso1ServiceDetailReqType(&exiIn.V2G_Message.Body.ServiceDetailReq); + + exiIn.V2G_Message.Body.ServiceDetailReq.ServiceID = 22; /* Value Added Server ID */ + + printf("EV side: call EVSE ServiceDetail \n"); + + errn = request_response1(&exiIn, &exiOut); + + if(errn == 0) { + /* check, if this is the right response message */ + if(exiOut.V2G_Message.Body.ServiceDetailRes_isUsed) { + serviceDetailRes = exiOut.V2G_Message.Body.ServiceDetailRes; + /* show results of EVSEs answer message */ + printf("EV side: received response message from EVSE\n"); + printf("\tHeader SessionID="); + printBinaryArray(exiOut.V2G_Message.Header.SessionID.bytes, exiOut.V2G_Message.Header.SessionID.bytesLen); + printf("\t ResponseCode=%d\n", exiOut.V2G_Message.Body.ServiceDiscoveryRes.ResponseCode); + printf("\t ServiceID=%d\n", exiOut.V2G_Message.Body.ServiceDetailRes.ServiceID); + + if(serviceDetailRes.ServiceParameterList_isUsed) { + printf("\t\tLength=%d\n", serviceDetailRes.ServiceParameterList.ParameterSet.arrayLen );/*TEST*/ + + for(i=0; iCode generated by EXIdizer

diff --git a/src/xmldsig/xmldsigEXIDatatypes.h b/src/xmldsig/xmldsigEXIDatatypes.h index ff902fe..8b06393 100644 --- a/src/xmldsig/xmldsigEXIDatatypes.h +++ b/src/xmldsig/xmldsigEXIDatatypes.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2017 Siemens AG + * Copyright (C) 2007-2018 Siemens AG * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published @@ -18,7 +18,7 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 2017-09-04 + * @version 0.9.4 * @contact Richard.Kuntschke@siemens.com * *

Code generated by EXIdizer

diff --git a/src/xmldsig/xmldsigEXIDatatypesDecoder.c b/src/xmldsig/xmldsigEXIDatatypesDecoder.c index fd61f25..4e4636d 100644 --- a/src/xmldsig/xmldsigEXIDatatypesDecoder.c +++ b/src/xmldsig/xmldsigEXIDatatypesDecoder.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2017 Siemens AG + * Copyright (C) 2007-2018 Siemens AG * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published @@ -18,7 +18,7 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 2017-09-04 + * @version 0.9.4 * @contact Richard.Kuntschke@siemens.com * *

Code generated by EXIdizer

diff --git a/src/xmldsig/xmldsigEXIDatatypesDecoder.h b/src/xmldsig/xmldsigEXIDatatypesDecoder.h index b717062..fc2b046 100644 --- a/src/xmldsig/xmldsigEXIDatatypesDecoder.h +++ b/src/xmldsig/xmldsigEXIDatatypesDecoder.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2017 Siemens AG + * Copyright (C) 2007-2018 Siemens AG * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published @@ -18,7 +18,7 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 2017-09-04 + * @version 0.9.4 * @contact Richard.Kuntschke@siemens.com * *

Code generated by EXIdizer

diff --git a/src/xmldsig/xmldsigEXIDatatypesEncoder.c b/src/xmldsig/xmldsigEXIDatatypesEncoder.c index 2e4f236..1fc92d2 100644 --- a/src/xmldsig/xmldsigEXIDatatypesEncoder.c +++ b/src/xmldsig/xmldsigEXIDatatypesEncoder.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2017 Siemens AG + * Copyright (C) 2007-2018 Siemens AG * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published @@ -18,7 +18,7 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 2017-09-04 + * @version 0.9.4 * @contact Richard.Kuntschke@siemens.com * *

Code generated by EXIdizer

diff --git a/src/xmldsig/xmldsigEXIDatatypesEncoder.h b/src/xmldsig/xmldsigEXIDatatypesEncoder.h index d9e303d..4d8edb7 100644 --- a/src/xmldsig/xmldsigEXIDatatypesEncoder.h +++ b/src/xmldsig/xmldsigEXIDatatypesEncoder.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2017 Siemens AG + * Copyright (C) 2007-2018 Siemens AG * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published @@ -18,7 +18,7 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 2017-09-04 + * @version 0.9.4 * @contact Richard.Kuntschke@siemens.com * *

Code generated by EXIdizer