mirror of
https://github.com/Martin-P/OpenV2G.git
synced 2024-11-18 12:53:58 +00:00
Merge SourceForge SVN repository, OpenV2G 0.9.5
This commit is contained in:
commit
671f422a73
2 changed files with 390 additions and 248 deletions
|
@ -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 0.9.4, released January 30, 2018
|
||||
Version 0.9.5, released March 11, 2022
|
||||
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-2018 Siemens AG
|
||||
Copyright (C) 2007-2022 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
|
||||
|
@ -21,6 +21,10 @@ GNU Lesser General Public License for more details.
|
|||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
-------------------------------------------------------------------------
|
||||
CHANGES from version 0.9.4:
|
||||
-------------------------------------------------------------------------
|
||||
* fix possible memory corruption bug
|
||||
|
||||
-------------------------------------------------------------------------
|
||||
CHANGES from version 0.9.3:
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2007-2018 Siemens AG
|
||||
* Copyright (C) 2007-2022 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-03-02
|
||||
* @version 2022-03-08
|
||||
* @contact Richard.Kuntschke@siemens.com
|
||||
*
|
||||
* <p>Code generated by EXIdizer</p>
|
||||
|
@ -314,121 +314,259 @@ int decodeUnsignedIntegerBig(bitstream_t* stream, size_t size, uint8_t* data, si
|
|||
uint64_4 += ((uint64_t) (b & 127)) << mShift4;
|
||||
mShift4 += 7;
|
||||
} else {
|
||||
return -1; // too large
|
||||
return -1; /* too large */
|
||||
}
|
||||
} while (errn == 0 && (b >> 7) == 1);
|
||||
|
||||
// shift actual data into array
|
||||
/* shift actual data into array */
|
||||
if(uint64_4 != 0) {
|
||||
// 7 octets for uint64_1
|
||||
data[(*len)++] = (uint8_t)(uint64_1 & 0xFF); // 1
|
||||
/* 7 octets for uint64_1 */
|
||||
if(*len >= size) {
|
||||
return EXI_ERROR_OUT_OF_BOUNDS;
|
||||
}
|
||||
data[(*len)++] = (uint8_t)(uint64_1 & 0xFF); /* 1 */
|
||||
uint64_1 >>= 8;
|
||||
data[(*len)++] = (uint8_t)(uint64_1 & 0xFF); // 2
|
||||
if(*len >= size) {
|
||||
return EXI_ERROR_OUT_OF_BOUNDS;
|
||||
}
|
||||
data[(*len)++] = (uint8_t)(uint64_1 & 0xFF); /* 2 */
|
||||
uint64_1 >>= 8;
|
||||
data[(*len)++] = (uint8_t)(uint64_1 & 0xFF); // 3
|
||||
if(*len >= size) {
|
||||
return EXI_ERROR_OUT_OF_BOUNDS;
|
||||
}
|
||||
data[(*len)++] = (uint8_t)(uint64_1 & 0xFF); /* 3 */
|
||||
uint64_1 >>= 8;
|
||||
data[(*len)++] = (uint8_t)(uint64_1 & 0xFF); // 4
|
||||
if(*len >= size) {
|
||||
return EXI_ERROR_OUT_OF_BOUNDS;
|
||||
}
|
||||
data[(*len)++] = (uint8_t)(uint64_1 & 0xFF); /* 4 */
|
||||
uint64_1 >>= 8;
|
||||
data[(*len)++] = (uint8_t)(uint64_1 & 0xFF); // 5
|
||||
if(*len >= size) {
|
||||
return EXI_ERROR_OUT_OF_BOUNDS;
|
||||
}
|
||||
data[(*len)++] = (uint8_t)(uint64_1 & 0xFF); /* 5 */
|
||||
uint64_1 >>= 8;
|
||||
data[(*len)++] = (uint8_t)(uint64_1 & 0xFF); // 6
|
||||
if(*len >= size) {
|
||||
return EXI_ERROR_OUT_OF_BOUNDS;
|
||||
}
|
||||
data[(*len)++] = (uint8_t)(uint64_1 & 0xFF); /* 6 */
|
||||
uint64_1 >>= 8;
|
||||
data[(*len)++] = (uint8_t)(uint64_1 & 0xFF); // 7
|
||||
if(*len >= size) {
|
||||
return EXI_ERROR_OUT_OF_BOUNDS;
|
||||
}
|
||||
data[(*len)++] = (uint8_t)(uint64_1 & 0xFF); /* 7 */
|
||||
|
||||
// 7 octets for uint64_2
|
||||
data[(*len)++] = (uint8_t)(uint64_2 & 0xFF); // 1
|
||||
/* 7 octets for uint64_2 */
|
||||
if(*len >= size) {
|
||||
return EXI_ERROR_OUT_OF_BOUNDS;
|
||||
}
|
||||
data[(*len)++] = (uint8_t)(uint64_2 & 0xFF); /* 1 */
|
||||
uint64_2 >>= 8;
|
||||
data[(*len)++] = (uint8_t)(uint64_2 & 0xFF); // 2
|
||||
if(*len >= size) {
|
||||
return EXI_ERROR_OUT_OF_BOUNDS;
|
||||
}
|
||||
data[(*len)++] = (uint8_t)(uint64_2 & 0xFF); /* 2 */
|
||||
uint64_2 >>= 8;
|
||||
data[(*len)++] = (uint8_t)(uint64_2 & 0xFF); // 3
|
||||
if(*len >= size) {
|
||||
return EXI_ERROR_OUT_OF_BOUNDS;
|
||||
}
|
||||
data[(*len)++] = (uint8_t)(uint64_2 & 0xFF); /* 3 */
|
||||
uint64_2 >>= 8;
|
||||
data[(*len)++] = (uint8_t)(uint64_2 & 0xFF); // 4
|
||||
if(*len >= size) {
|
||||
return EXI_ERROR_OUT_OF_BOUNDS;
|
||||
}
|
||||
data[(*len)++] = (uint8_t)(uint64_2 & 0xFF); /* 4 */
|
||||
uint64_2 >>= 8;
|
||||
data[(*len)++] = (uint8_t)(uint64_2 & 0xFF); // 5
|
||||
if(*len >= size) {
|
||||
return EXI_ERROR_OUT_OF_BOUNDS;
|
||||
}
|
||||
data[(*len)++] = (uint8_t)(uint64_2 & 0xFF); /* 5 */
|
||||
uint64_2 >>= 8;
|
||||
data[(*len)++] = (uint8_t)(uint64_2 & 0xFF); // 6
|
||||
if(*len >= size) {
|
||||
return EXI_ERROR_OUT_OF_BOUNDS;
|
||||
}
|
||||
data[(*len)++] = (uint8_t)(uint64_2 & 0xFF); /* 6 */
|
||||
uint64_2 >>= 8;
|
||||
data[(*len)++] = (uint8_t)(uint64_2 & 0xFF); // 7
|
||||
if(*len >= size) {
|
||||
return EXI_ERROR_OUT_OF_BOUNDS;
|
||||
}
|
||||
data[(*len)++] = (uint8_t)(uint64_2 & 0xFF); /* 7 */
|
||||
|
||||
// 7 octets for uint64_3
|
||||
data[(*len)++] = (uint8_t)(uint64_3 & 0xFF); // 1
|
||||
/* 7 octets for uint64_3 */
|
||||
if(*len >= size) {
|
||||
return EXI_ERROR_OUT_OF_BOUNDS;
|
||||
}
|
||||
data[(*len)++] = (uint8_t)(uint64_3 & 0xFF); /* 1 */
|
||||
uint64_3 >>= 8;
|
||||
data[(*len)++] = (uint8_t)(uint64_3 & 0xFF); // 2
|
||||
if(*len >= size) {
|
||||
return EXI_ERROR_OUT_OF_BOUNDS;
|
||||
}
|
||||
data[(*len)++] = (uint8_t)(uint64_3 & 0xFF); /* 2 */
|
||||
uint64_3 >>= 8;
|
||||
data[(*len)++] = (uint8_t)(uint64_3 & 0xFF); // 3
|
||||
if(*len >= size) {
|
||||
return EXI_ERROR_OUT_OF_BOUNDS;
|
||||
}
|
||||
data[(*len)++] = (uint8_t)(uint64_3 & 0xFF); /* 3 */
|
||||
uint64_3 >>= 8;
|
||||
data[(*len)++] = (uint8_t)(uint64_3 & 0xFF); // 4
|
||||
if(*len >= size) {
|
||||
return EXI_ERROR_OUT_OF_BOUNDS;
|
||||
}
|
||||
data[(*len)++] = (uint8_t)(uint64_3 & 0xFF); /* 4 */
|
||||
uint64_3 >>= 8;
|
||||
data[(*len)++] = (uint8_t)(uint64_3 & 0xFF); // 5
|
||||
if(*len >= size) {
|
||||
return EXI_ERROR_OUT_OF_BOUNDS;
|
||||
}
|
||||
data[(*len)++] = (uint8_t)(uint64_3 & 0xFF); /* 5 */
|
||||
uint64_3 >>= 8;
|
||||
data[(*len)++] = (uint8_t)(uint64_3 & 0xFF); // 6
|
||||
if(*len >= size) {
|
||||
return EXI_ERROR_OUT_OF_BOUNDS;
|
||||
}
|
||||
data[(*len)++] = (uint8_t)(uint64_3 & 0xFF); /* 6 */
|
||||
uint64_3 >>= 8;
|
||||
data[(*len)++] = (uint8_t)(uint64_3 & 0xFF); // 7
|
||||
if(*len >= size) {
|
||||
return EXI_ERROR_OUT_OF_BOUNDS;
|
||||
}
|
||||
data[(*len)++] = (uint8_t)(uint64_3 & 0xFF); /* 7 */
|
||||
|
||||
// remaining octets of uint64_4
|
||||
/* remaining octets of uint64_4 */
|
||||
while (uint64_4 != 0 && errn == 0) {
|
||||
if(*len >= size) {
|
||||
return EXI_ERROR_OUT_OF_BOUNDS;
|
||||
}
|
||||
data[(*len)++] = uint64_4 & 0xFF;
|
||||
uint64_4 >>= 8;
|
||||
}
|
||||
} else if(uint64_3 != 0) {
|
||||
// 7 octets for uint64_1
|
||||
data[(*len)++] = (uint8_t)(uint64_1 & 0xFF); // 1
|
||||
/* 7 octets for uint64_1 */
|
||||
if(*len >= size) {
|
||||
return EXI_ERROR_OUT_OF_BOUNDS;
|
||||
}
|
||||
data[(*len)++] = (uint8_t)(uint64_1 & 0xFF); /* 1 */
|
||||
uint64_1 >>= 8;
|
||||
data[(*len)++] = (uint8_t)(uint64_1 & 0xFF); // 2
|
||||
if(*len >= size) {
|
||||
return EXI_ERROR_OUT_OF_BOUNDS;
|
||||
}
|
||||
data[(*len)++] = (uint8_t)(uint64_1 & 0xFF); /* 2 */
|
||||
uint64_1 >>= 8;
|
||||
data[(*len)++] = (uint8_t)(uint64_1 & 0xFF); // 3
|
||||
if(*len >= size) {
|
||||
return EXI_ERROR_OUT_OF_BOUNDS;
|
||||
}
|
||||
data[(*len)++] = (uint8_t)(uint64_1 & 0xFF); /* 3 */
|
||||
uint64_1 >>= 8;
|
||||
data[(*len)++] = (uint8_t)(uint64_1 & 0xFF); // 4
|
||||
if(*len >= size) {
|
||||
return EXI_ERROR_OUT_OF_BOUNDS;
|
||||
}
|
||||
data[(*len)++] = (uint8_t)(uint64_1 & 0xFF); /* 4 */
|
||||
uint64_1 >>= 8;
|
||||
data[(*len)++] = (uint8_t)(uint64_1 & 0xFF); // 5
|
||||
if(*len >= size) {
|
||||
return EXI_ERROR_OUT_OF_BOUNDS;
|
||||
}
|
||||
data[(*len)++] = (uint8_t)(uint64_1 & 0xFF); /* 5 */
|
||||
uint64_1 >>= 8;
|
||||
data[(*len)++] = (uint8_t)(uint64_1 & 0xFF); // 6
|
||||
if(*len >= size) {
|
||||
return EXI_ERROR_OUT_OF_BOUNDS;
|
||||
}
|
||||
data[(*len)++] = (uint8_t)(uint64_1 & 0xFF); /* 6 */
|
||||
uint64_1 >>= 8;
|
||||
data[(*len)++] = (uint8_t)(uint64_1 & 0xFF); // 7
|
||||
if(*len >= size) {
|
||||
return EXI_ERROR_OUT_OF_BOUNDS;
|
||||
}
|
||||
data[(*len)++] = (uint8_t)(uint64_1 & 0xFF); /* 7 */
|
||||
|
||||
// 7 octets for uint64_2
|
||||
data[(*len)++] = (uint8_t)(uint64_2 & 0xFF); // 1
|
||||
/* 7 octets for uint64_2 */
|
||||
if(*len >= size) {
|
||||
return EXI_ERROR_OUT_OF_BOUNDS;
|
||||
}
|
||||
data[(*len)++] = (uint8_t)(uint64_2 & 0xFF); /* 1 */
|
||||
uint64_2 >>= 8;
|
||||
data[(*len)++] = (uint8_t)(uint64_2 & 0xFF); // 2
|
||||
if(*len >= size) {
|
||||
return EXI_ERROR_OUT_OF_BOUNDS;
|
||||
}
|
||||
data[(*len)++] = (uint8_t)(uint64_2 & 0xFF); /* 2 */
|
||||
uint64_2 >>= 8;
|
||||
data[(*len)++] = (uint8_t)(uint64_2 & 0xFF); // 3
|
||||
if(*len >= size) {
|
||||
return EXI_ERROR_OUT_OF_BOUNDS;
|
||||
}
|
||||
data[(*len)++] = (uint8_t)(uint64_2 & 0xFF); /* 3 */
|
||||
uint64_2 >>= 8;
|
||||
data[(*len)++] = (uint8_t)(uint64_2 & 0xFF); // 4
|
||||
if(*len >= size) {
|
||||
return EXI_ERROR_OUT_OF_BOUNDS;
|
||||
}
|
||||
data[(*len)++] = (uint8_t)(uint64_2 & 0xFF); /* 4 */
|
||||
uint64_2 >>= 8;
|
||||
data[(*len)++] = (uint8_t)(uint64_2 & 0xFF); // 5
|
||||
if(*len >= size) {
|
||||
return EXI_ERROR_OUT_OF_BOUNDS;
|
||||
}
|
||||
data[(*len)++] = (uint8_t)(uint64_2 & 0xFF); /* 5 */
|
||||
uint64_2 >>= 8;
|
||||
data[(*len)++] = (uint8_t)(uint64_2 & 0xFF); // 6
|
||||
if(*len >= size) {
|
||||
return EXI_ERROR_OUT_OF_BOUNDS;
|
||||
}
|
||||
data[(*len)++] = (uint8_t)(uint64_2 & 0xFF); /* 6 */
|
||||
uint64_2 >>= 8;
|
||||
data[(*len)++] = (uint8_t)(uint64_2 & 0xFF); // 7
|
||||
if(*len >= size) {
|
||||
return EXI_ERROR_OUT_OF_BOUNDS;
|
||||
}
|
||||
data[(*len)++] = (uint8_t)(uint64_2 & 0xFF); /* 7 */
|
||||
|
||||
// remaining octets of uint64_3
|
||||
/* remaining octets of uint64_3 */
|
||||
while (uint64_3 != 0 && errn == 0) {
|
||||
if(*len >= size) {
|
||||
return EXI_ERROR_OUT_OF_BOUNDS;
|
||||
}
|
||||
data[(*len)++] = uint64_3 & 0xFF;
|
||||
uint64_3 >>= 8;
|
||||
}
|
||||
|
||||
} else if(uint64_2 != 0) {
|
||||
// 7 octets for uint64_1
|
||||
data[(*len)++] = (uint8_t)(uint64_1 & 0xFF); // 1
|
||||
/* 7 octets for uint64_1 */
|
||||
if(*len >= size) {
|
||||
return EXI_ERROR_OUT_OF_BOUNDS;
|
||||
}
|
||||
data[(*len)++] = (uint8_t)(uint64_1 & 0xFF); /* 1 */
|
||||
uint64_1 >>= 8;
|
||||
data[(*len)++] = (uint8_t)(uint64_1 & 0xFF); // 2
|
||||
if(*len >= size) {
|
||||
return EXI_ERROR_OUT_OF_BOUNDS;
|
||||
}
|
||||
data[(*len)++] = (uint8_t)(uint64_1 & 0xFF); /* 2 */
|
||||
uint64_1 >>= 8;
|
||||
data[(*len)++] = (uint8_t)(uint64_1 & 0xFF); // 3
|
||||
if(*len >= size) {
|
||||
return EXI_ERROR_OUT_OF_BOUNDS;
|
||||
}
|
||||
data[(*len)++] = (uint8_t)(uint64_1 & 0xFF); /* 3 */
|
||||
uint64_1 >>= 8;
|
||||
data[(*len)++] = (uint8_t)(uint64_1 & 0xFF); // 4
|
||||
if(*len >= size) {
|
||||
return EXI_ERROR_OUT_OF_BOUNDS;
|
||||
}
|
||||
data[(*len)++] = (uint8_t)(uint64_1 & 0xFF); /* 4 */
|
||||
uint64_1 >>= 8;
|
||||
data[(*len)++] = (uint8_t)(uint64_1 & 0xFF); // 5
|
||||
if(*len >= size) {
|
||||
return EXI_ERROR_OUT_OF_BOUNDS;
|
||||
}
|
||||
data[(*len)++] = (uint8_t)(uint64_1 & 0xFF); /* 5 */
|
||||
uint64_1 >>= 8;
|
||||
data[(*len)++] = (uint8_t)(uint64_1 & 0xFF); // 6
|
||||
if(*len >= size) {
|
||||
return EXI_ERROR_OUT_OF_BOUNDS;
|
||||
}
|
||||
data[(*len)++] = (uint8_t)(uint64_1 & 0xFF); /* 6 */
|
||||
uint64_1 >>= 8;
|
||||
data[(*len)++] = (uint8_t)(uint64_1 & 0xFF); // 7
|
||||
// remaining octets of uint64_2
|
||||
if(*len >= size) {
|
||||
return EXI_ERROR_OUT_OF_BOUNDS;
|
||||
}
|
||||
data[(*len)++] = (uint8_t)(uint64_1 & 0xFF); /* 7 */
|
||||
/* remaining octets of uint64_2 */
|
||||
while (uint64_2 != 0 && errn == 0) {
|
||||
if(*len >= size) {
|
||||
return EXI_ERROR_OUT_OF_BOUNDS;
|
||||
}
|
||||
data[(*len)++] = uint64_2 & 0xFF;
|
||||
uint64_2 >>= 8;
|
||||
}
|
||||
} else if(uint64_1 != 0) {
|
||||
while (uint64_1 != 0 && errn == 0) {
|
||||
if(*len >= size) {
|
||||
return EXI_ERROR_OUT_OF_BOUNDS;
|
||||
}
|
||||
data[(*len)++] = uint64_1 & 0xFF;
|
||||
uint64_1 >>= 8;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue