diff options
author | 2020-11-20 23:36:23 +0900 | |
---|---|---|
committer | 2020-11-22 09:02:55 +0900 | |
commit | 17cf21bcf8a2e29d2cbcf0a313474d2a4ee44f5d (patch) | |
tree | 582a9768558d9eaf261ca5df6136e9de54c95816 /vehicleservice/positioning/server/src | |
parent | 9e86046cdb356913ae026f616e5bf17f6f238aa5 (diff) |
Re-organized sub-directory by category
Since all the sub-directories were placed in the
first level, created sub-directories, "hal", "module",
and "service" for classification and relocated each component.
Signed-off-by: Tadao Tanikawa <tanikawa.tadao@jp.panasonic.com>
Change-Id: Ifdf743ac0d1893bd8e445455cf0d2c199a011d5c
Diffstat (limited to 'vehicleservice/positioning/server/src')
135 files changed, 0 insertions, 29092 deletions
diff --git a/vehicleservice/positioning/server/src/Sensor/ClockUtility.cpp b/vehicleservice/positioning/server/src/Sensor/ClockUtility.cpp deleted file mode 100755 index 2e9639a..0000000 --- a/vehicleservice/positioning/server/src/Sensor/ClockUtility.cpp +++ /dev/null @@ -1,414 +0,0 @@ -/* - * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/************************************************************************* -@file ClockUtility.cpp -@detail Common processing function concerning clock -*****************************************************************************/ - -#include <vehicle_service/positioning_base_library.h> -#include "ClockUtility.h" -#include "ClockUtility_private.h" - -/* - Global Constant Definitions -* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -static const u_int16 kUsMonth[3][12] = { /* Mnumonic For Remembering The Months With Fewer Than 31 Days Table(Leap year version) Task_31499 */ - {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}, /* Number of days per month(If it is not a leap year) */ - {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}, /* Number of days per month(For leap years) */ - {0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334} /* Cumulative number of days per month(If it is not a leap year) */ -}; - -static const ClockDayCntTbl kUlDayCntTbl = { - /* 1970 Year */ {{0x000007B2U, 0x00000000U, {0x00000000U, 0x0028DE80U, 0x004DC880U, 0x0076A700U, 0x009E3400U, 0x00C71280U, 0x00EE9F80U, 0x01177E00U, 0x01405C80U, 0x0167E980U, 0x0190C800U, 0x01B85500U}}, // NOLINT(whitespace/line_length) - /* 1971 Year */ {0x000007B3U, 0x01E13380U, {0x01E13380U, 0x020A1200U, 0x022EFC00U, 0x0257DA80U, 0x027F6780U, 0x02A84600U, 0x02CFD300U, 0x02F8B180U, 0x03219000U, 0x03491D00U, 0x0371FB80U, 0x03998880U}}, // NOLINT(whitespace/line_length) - /* 1972 Year */ {0x000007B4U, 0x03C26700U, {0x03C26700U, 0x03EB4580U, 0x04118100U, 0x043A5F80U, 0x0461EC80U, 0x048ACB00U, 0x04B25800U, 0x04DB3680U, 0x05041500U, 0x052BA200U, 0x05548080U, 0x057C0D80U}}, // NOLINT(whitespace/line_length) - /* 1973 Year */ {0x000007B5U, 0x05A4EC00U, {0x05A4EC00U, 0x05CDCA80U, 0x05F2B480U, 0x061B9300U, 0x06432000U, 0x066BFE80U, 0x06938B80U, 0x06BC6A00U, 0x06E54880U, 0x070CD580U, 0x0735B400U, 0x075D4100U}}, // NOLINT(whitespace/line_length) - /* 1974 Year */ {0x000007B6U, 0x07861F80U, {0x07861F80U, 0x07AEFE00U, 0x07D3E800U, 0x07FCC680U, 0x08245380U, 0x084D3200U, 0x0874BF00U, 0x089D9D80U, 0x08C67C00U, 0x08EE0900U, 0x0916E780U, 0x093E7480U}}, // NOLINT(whitespace/line_length) - /* 1975 Year */ {0x000007B7U, 0x09675300U, {0x09675300U, 0x09903180U, 0x09B51B80U, 0x09DDFA00U, 0x0A058700U, 0x0A2E6580U, 0x0A55F280U, 0x0A7ED100U, 0x0AA7AF80U, 0x0ACF3C80U, 0x0AF81B00U, 0x0B1FA800U}}, // NOLINT(whitespace/line_length) - /* 1976 Year */ {0x000007B8U, 0x0B488680U, {0x0B488680U, 0x0B716500U, 0x0B97A080U, 0x0BC07F00U, 0x0BE80C00U, 0x0C10EA80U, 0x0C387780U, 0x0C615600U, 0x0C8A3480U, 0x0CB1C180U, 0x0CDAA000U, 0x0D022D00U}}, // NOLINT(whitespace/line_length) - /* 1977 Year */ {0x000007B9U, 0x0D2B0B80U, {0x0D2B0B80U, 0x0D53EA00U, 0x0D78D400U, 0x0DA1B280U, 0x0DC93F80U, 0x0DF21E00U, 0x0E19AB00U, 0x0E428980U, 0x0E6B6800U, 0x0E92F500U, 0x0EBBD380U, 0x0EE36080U}}, // NOLINT(whitespace/line_length) - /* 1978 Year */ {0x000007BAU, 0x0F0C3F00U, {0x0F0C3F00U, 0x0F351D80U, 0x0F5A0780U, 0x0F82E600U, 0x0FAA7300U, 0x0FD35180U, 0x0FFADE80U, 0x1023BD00U, 0x104C9B80U, 0x10742880U, 0x109D0700U, 0x10C49400U}}, // NOLINT(whitespace/line_length) - /* 1979 Year */ {0x000007BBU, 0x10ED7280U, {0x10ED7280U, 0x11165100U, 0x113B3B00U, 0x11641980U, 0x118BA680U, 0x11B48500U, 0x11DC1200U, 0x1204F080U, 0x122DCF00U, 0x12555C00U, 0x127E3A80U, 0x12A5C780U}}, // NOLINT(whitespace/line_length) - /* 1980 Year */ {0x000007BCU, 0x12CEA600U, {0x12CEA600U, 0x12F78480U, 0x131DC000U, 0x13469E80U, 0x136E2B80U, 0x13970A00U, 0x13BE9700U, 0x13E77580U, 0x14105400U, 0x1437E100U, 0x1460BF80U, 0x14884C80U}}, // NOLINT(whitespace/line_length) - /* 1981 Year */ {0x000007BDU, 0x14B12B00U, {0x14B12B00U, 0x14DA0980U, 0x14FEF380U, 0x1527D200U, 0x154F5F00U, 0x15783D80U, 0x159FCA80U, 0x15C8A900U, 0x15F18780U, 0x16191480U, 0x1641F300U, 0x16698000U}}, // NOLINT(whitespace/line_length) - /* 1982 Year */ {0x000007BEU, 0x16925E80U, {0x16925E80U, 0x16BB3D00U, 0x16E02700U, 0x17090580U, 0x17309280U, 0x17597100U, 0x1780FE00U, 0x17A9DC80U, 0x17D2BB00U, 0x17FA4800U, 0x18232680U, 0x184AB380U}}, // NOLINT(whitespace/line_length) - /* 1983 Year */ {0x000007BFU, 0x18739200U, {0x18739200U, 0x189C7080U, 0x18C15A80U, 0x18EA3900U, 0x1911C600U, 0x193AA480U, 0x19623180U, 0x198B1000U, 0x19B3EE80U, 0x19DB7B80U, 0x1A045A00U, 0x1A2BE700U}}, // NOLINT(whitespace/line_length) - /* 1984 Year */ {0x000007C0U, 0x1A54C580U, {0x1A54C580U, 0x1A7DA400U, 0x1AA3DF80U, 0x1ACCBE00U, 0x1AF44B00U, 0x1B1D2980U, 0x1B44B680U, 0x1B6D9500U, 0x1B967380U, 0x1BBE0080U, 0x1BE6DF00U, 0x1C0E6C00U}}, // NOLINT(whitespace/line_length) - /* 1985 Year */ {0x000007C1U, 0x1C374A80U, {0x1C374A80U, 0x1C602900U, 0x1C851300U, 0x1CADF180U, 0x1CD57E80U, 0x1CFE5D00U, 0x1D25EA00U, 0x1D4EC880U, 0x1D77A700U, 0x1D9F3400U, 0x1DC81280U, 0x1DEF9F80U}}, // NOLINT(whitespace/line_length) - /* 1986 Year */ {0x000007C2U, 0x1E187E00U, {0x1E187E00U, 0x1E415C80U, 0x1E664680U, 0x1E8F2500U, 0x1EB6B200U, 0x1EDF9080U, 0x1F071D80U, 0x1F2FFC00U, 0x1F58DA80U, 0x1F806780U, 0x1FA94600U, 0x1FD0D300U}}, // NOLINT(whitespace/line_length) - /* 1987 Year */ {0x000007C3U, 0x1FF9B180U, {0x1FF9B180U, 0x20229000U, 0x20477A00U, 0x20705880U, 0x2097E580U, 0x20C0C400U, 0x20E85100U, 0x21112F80U, 0x213A0E00U, 0x21619B00U, 0x218A7980U, 0x21B20680U}}, // NOLINT(whitespace/line_length) - /* 1988 Year */ {0x000007C4U, 0x21DAE500U, {0x21DAE500U, 0x2203C380U, 0x2229FF00U, 0x2252DD80U, 0x227A6A80U, 0x22A34900U, 0x22CAD600U, 0x22F3B480U, 0x231C9300U, 0x23442000U, 0x236CFE80U, 0x23948B80U}}, // NOLINT(whitespace/line_length) - /* 1989 Year */ {0x000007C5U, 0x23BD6A00U, {0x23BD6A00U, 0x23E64880U, 0x240B3280U, 0x24341100U, 0x245B9E00U, 0x24847C80U, 0x24AC0980U, 0x24D4E800U, 0x24FDC680U, 0x25255380U, 0x254E3200U, 0x2575BF00U}}, // NOLINT(whitespace/line_length) - /* 1990 Year */ {0x000007C6U, 0x259E9D80U, {0x259E9D80U, 0x25C77C00U, 0x25EC6600U, 0x26154480U, 0x263CD180U, 0x2665B000U, 0x268D3D00U, 0x26B61B80U, 0x26DEFA00U, 0x27068700U, 0x272F6580U, 0x2756F280U}}, // NOLINT(whitespace/line_length) - /* 1991 Year */ {0x000007C7U, 0x277FD100U, {0x277FD100U, 0x27A8AF80U, 0x27CD9980U, 0x27F67800U, 0x281E0500U, 0x2846E380U, 0x286E7080U, 0x28974F00U, 0x28C02D80U, 0x28E7BA80U, 0x29109900U, 0x29382600U}}, // NOLINT(whitespace/line_length) - /* 1992 Year */ {0x000007C8U, 0x29610480U, {0x29610480U, 0x2989E300U, 0x29B01E80U, 0x29D8FD00U, 0x2A008A00U, 0x2A296880U, 0x2A50F580U, 0x2A79D400U, 0x2AA2B280U, 0x2ACA3F80U, 0x2AF31E00U, 0x2B1AAB00U}}, // NOLINT(whitespace/line_length) - /* 1993 Year */ {0x000007C9U, 0x2B438980U, {0x2B438980U, 0x2B6C6800U, 0x2B915200U, 0x2BBA3080U, 0x2BE1BD80U, 0x2C0A9C00U, 0x2C322900U, 0x2C5B0780U, 0x2C83E600U, 0x2CAB7300U, 0x2CD45180U, 0x2CFBDE80U}}, // NOLINT(whitespace/line_length) - /* 1994 Year */ {0x000007CAU, 0x2D24BD00U, {0x2D24BD00U, 0x2D4D9B80U, 0x2D728580U, 0x2D9B6400U, 0x2DC2F100U, 0x2DEBCF80U, 0x2E135C80U, 0x2E3C3B00U, 0x2E651980U, 0x2E8CA680U, 0x2EB58500U, 0x2EDD1200U}}, // NOLINT(whitespace/line_length) - /* 1995 Year */ {0x000007CBU, 0x2F05F080U, {0x2F05F080U, 0x2F2ECF00U, 0x2F53B900U, 0x2F7C9780U, 0x2FA42480U, 0x2FCD0300U, 0x2FF49000U, 0x301D6E80U, 0x30464D00U, 0x306DDA00U, 0x3096B880U, 0x30BE4580U}}, // NOLINT(whitespace/line_length) - /* 1996 Year */ {0x000007CCU, 0x30E72400U, {0x30E72400U, 0x31100280U, 0x31363E00U, 0x315F1C80U, 0x3186A980U, 0x31AF8800U, 0x31D71500U, 0x31FFF380U, 0x3228D200U, 0x32505F00U, 0x32793D80U, 0x32A0CA80U}}, // NOLINT(whitespace/line_length) - /* 1997 Year */ {0x000007CDU, 0x32C9A900U, {0x32C9A900U, 0x32F28780U, 0x33177180U, 0x33405000U, 0x3367DD00U, 0x3390BB80U, 0x33B84880U, 0x33E12700U, 0x340A0580U, 0x34319280U, 0x345A7100U, 0x3481FE00U}}, // NOLINT(whitespace/line_length) - /* 1998 Year */ {0x000007CEU, 0x34AADC80U, {0x34AADC80U, 0x34D3BB00U, 0x34F8A500U, 0x35218380U, 0x35491080U, 0x3571EF00U, 0x35997C00U, 0x35C25A80U, 0x35EB3900U, 0x3612C600U, 0x363BA480U, 0x36633180U}}, // NOLINT(whitespace/line_length) - /* 1999 Year */ {0x000007CFU, 0x368C1000U, {0x368C1000U, 0x36B4EE80U, 0x36D9D880U, 0x3702B700U, 0x372A4400U, 0x37532280U, 0x377AAF80U, 0x37A38E00U, 0x37CC6C80U, 0x37F3F980U, 0x381CD800U, 0x38446500U}}, // NOLINT(whitespace/line_length) - /* 2000 Year */ {0x000007D0U, 0x386D4380U, {0x386D4380U, 0x38962200U, 0x38BC5D80U, 0x38E53C00U, 0x390CC900U, 0x3935A780U, 0x395D3480U, 0x39861300U, 0x39AEF180U, 0x39D67E80U, 0x39FF5D00U, 0x3A26EA00U}}, // NOLINT(whitespace/line_length) - /* 2001 Year */ {0x000007D1U, 0x3A4FC880U, {0x3A4FC880U, 0x3A78A700U, 0x3A9D9100U, 0x3AC66F80U, 0x3AEDFC80U, 0x3B16DB00U, 0x3B3E6800U, 0x3B674680U, 0x3B902500U, 0x3BB7B200U, 0x3BE09080U, 0x3C081D80U}}, // NOLINT(whitespace/line_length) - /* 2002 Year */ {0x000007D2U, 0x3C30FC00U, {0x3C30FC00U, 0x3C59DA80U, 0x3C7EC480U, 0x3CA7A300U, 0x3CCF3000U, 0x3CF80E80U, 0x3D1F9B80U, 0x3D487A00U, 0x3D715880U, 0x3D98E580U, 0x3DC1C400U, 0x3DE95100U}}, // NOLINT(whitespace/line_length) - /* 2003 Year */ {0x000007D3U, 0x3E122F80U, {0x3E122F80U, 0x3E3B0E00U, 0x3E5FF800U, 0x3E88D680U, 0x3EB06380U, 0x3ED94200U, 0x3F00CF00U, 0x3F29AD80U, 0x3F528C00U, 0x3F7A1900U, 0x3FA2F780U, 0x3FCA8480U}}, // NOLINT(whitespace/line_length) - /* 2004 Year */ {0x000007D4U, 0x3FF36300U, {0x3FF36300U, 0x401C4180U, 0x40427D00U, 0x406B5B80U, 0x4092E880U, 0x40BBC700U, 0x40E35400U, 0x410C3280U, 0x41351100U, 0x415C9E00U, 0x41857C80U, 0x41AD0980U}}, // NOLINT(whitespace/line_length) - /* 2005 Year */ {0x000007D5U, 0x41D5E800U, {0x41D5E800U, 0x41FEC680U, 0x4223B080U, 0x424C8F00U, 0x42741C00U, 0x429CFA80U, 0x42C48780U, 0x42ED6600U, 0x43164480U, 0x433DD180U, 0x4366B000U, 0x438E3D00U}}, // NOLINT(whitespace/line_length) - /* 2006 Year */ {0x000007D6U, 0x43B71B80U, {0x43B71B80U, 0x43DFFA00U, 0x4404E400U, 0x442DC280U, 0x44554F80U, 0x447E2E00U, 0x44A5BB00U, 0x44CE9980U, 0x44F77800U, 0x451F0500U, 0x4547E380U, 0x456F7080U}}, // NOLINT(whitespace/line_length) - /* 2007 Year */ {0x000007D7U, 0x45984F00U, {0x45984F00U, 0x45C12D80U, 0x45E61780U, 0x460EF600U, 0x46368300U, 0x465F6180U, 0x4686EE80U, 0x46AFCD00U, 0x46D8AB80U, 0x47003880U, 0x47291700U, 0x4750A400U}}, // NOLINT(whitespace/line_length) - /* 2008 Year */ {0x000007D8U, 0x47798280U, {0x47798280U, 0x47A26100U, 0x47C89C80U, 0x47F17B00U, 0x48190800U, 0x4841E680U, 0x48697380U, 0x48925200U, 0x48BB3080U, 0x48E2BD80U, 0x490B9C00U, 0x49332900U}}, // NOLINT(whitespace/line_length) - /* 2009 Year */ {0x000007D9U, 0x495C0780U, {0x495C0780U, 0x4984E600U, 0x49A9D000U, 0x49D2AE80U, 0x49FA3B80U, 0x4A231A00U, 0x4A4AA700U, 0x4A738580U, 0x4A9C6400U, 0x4AC3F100U, 0x4AECCF80U, 0x4B145C80U}}, // NOLINT(whitespace/line_length) - /* 2010 Year */ {0x000007DAU, 0x4B3D3B00U, {0x4B3D3B00U, 0x4B661980U, 0x4B8B0380U, 0x4BB3E200U, 0x4BDB6F00U, 0x4C044D80U, 0x4C2BDA80U, 0x4C54B900U, 0x4C7D9780U, 0x4CA52480U, 0x4CCE0300U, 0x4CF59000U}}, // NOLINT(whitespace/line_length) - /* 2011 Year */ {0x000007DBU, 0x4D1E6E80U, {0x4D1E6E80U, 0x4D474D00U, 0x4D6C3700U, 0x4D951580U, 0x4DBCA280U, 0x4DE58100U, 0x4E0D0E00U, 0x4E35EC80U, 0x4E5ECB00U, 0x4E865800U, 0x4EAF3680U, 0x4ED6C380U}}, // NOLINT(whitespace/line_length) - /* 2012 Year */ {0x000007DCU, 0x4EFFA200U, {0x4EFFA200U, 0x4F288080U, 0x4F4EBC00U, 0x4F779A80U, 0x4F9F2780U, 0x4FC80600U, 0x4FEF9300U, 0x50187180U, 0x50415000U, 0x5068DD00U, 0x5091BB80U, 0x50B94880U}}, // NOLINT(whitespace/line_length) - /* 2013 Year */ {0x000007DDU, 0x50E22700U, {0x50E22700U, 0x510B0580U, 0x512FEF80U, 0x5158CE00U, 0x51805B00U, 0x51A93980U, 0x51D0C680U, 0x51F9A500U, 0x52228380U, 0x524A1080U, 0x5272EF00U, 0x529A7C00U}}, // NOLINT(whitespace/line_length) - /* 2014 Year */ {0x000007DEU, 0x52C35A80U, {0x52C35A80U, 0x52EC3900U, 0x53112300U, 0x533A0180U, 0x53618E80U, 0x538A6D00U, 0x53B1FA00U, 0x53DAD880U, 0x5403B700U, 0x542B4400U, 0x54542280U, 0x547BAF80U}}, // NOLINT(whitespace/line_length) - /* 2015 Year */ {0x000007DFU, 0x54A48E00U, {0x54A48E00U, 0x54CD6C80U, 0x54F25680U, 0x551B3500U, 0x5542C200U, 0x556BA080U, 0x55932D80U, 0x55BC0C00U, 0x55E4EA80U, 0x560C7780U, 0x56355600U, 0x565CE300U}}, // NOLINT(whitespace/line_length) - /* 2016 Year */ {0x000007E0U, 0x5685C180U, {0x5685C180U, 0x56AEA000U, 0x56D4DB80U, 0x56FDBA00U, 0x57254700U, 0x574E2580U, 0x5775B280U, 0x579E9100U, 0x57C76F80U, 0x57EEFC80U, 0x5817DB00U, 0x583F6800U}}, // NOLINT(whitespace/line_length) - /* 2017 Year */ {0x000007E1U, 0x58684680U, {0x58684680U, 0x58912500U, 0x58B60F00U, 0x58DEED80U, 0x59067A80U, 0x592F5900U, 0x5956E600U, 0x597FC480U, 0x59A8A300U, 0x59D03000U, 0x59F90E80U, 0x5A209B80U}}, // NOLINT(whitespace/line_length) - /* 2018 Year */ {0x000007E2U, 0x5A497A00U, {0x5A497A00U, 0x5A725880U, 0x5A974280U, 0x5AC02100U, 0x5AE7AE00U, 0x5B108C80U, 0x5B381980U, 0x5B60F800U, 0x5B89D680U, 0x5BB16380U, 0x5BDA4200U, 0x5C01CF00U}}, // NOLINT(whitespace/line_length) - /* 2019 Year */ {0x000007E3U, 0x5C2AAD80U, {0x5C2AAD80U, 0x5C538C00U, 0x5C787600U, 0x5CA15480U, 0x5CC8E180U, 0x5CF1C000U, 0x5D194D00U, 0x5D422B80U, 0x5D6B0A00U, 0x5D929700U, 0x5DBB7580U, 0x5DE30280U}}, // NOLINT(whitespace/line_length) - /* 2020 Year */ {0x000007E4U, 0x5E0BE100U, {0x5E0BE100U, 0x5E34BF80U, 0x5E5AFB00U, 0x5E83D980U, 0x5EAB6680U, 0x5ED44500U, 0x5EFBD200U, 0x5F24B080U, 0x5F4D8F00U, 0x5F751C00U, 0x5F9DFA80U, 0x5FC58780U}}, // NOLINT(whitespace/line_length) - /* 2021 Year */ {0x000007E5U, 0x5FEE6600U, {0x5FEE6600U, 0x60174480U, 0x603C2E80U, 0x60650D00U, 0x608C9A00U, 0x60B57880U, 0x60DD0580U, 0x6105E400U, 0x612EC280U, 0x61564F80U, 0x617F2E00U, 0x61A6BB00U}}, // NOLINT(whitespace/line_length) - /* 2022 Year */ {0x000007E6U, 0x61CF9980U, {0x61CF9980U, 0x61F87800U, 0x621D6200U, 0x62464080U, 0x626DCD80U, 0x6296AC00U, 0x62BE3900U, 0x62E71780U, 0x630FF600U, 0x63378300U, 0x63606180U, 0x6387EE80U}}, // NOLINT(whitespace/line_length) - /* 2023 Year */ {0x000007E7U, 0x63B0CD00U, {0x63B0CD00U, 0x63D9AB80U, 0x63FE9580U, 0x64277400U, 0x644F0100U, 0x6477DF80U, 0x649F6C80U, 0x64C84B00U, 0x64F12980U, 0x6518B680U, 0x65419500U, 0x65692200U}}, // NOLINT(whitespace/line_length) - /* 2024 Year */ {0x000007E8U, 0x65920080U, {0x65920080U, 0x65BADF00U, 0x65E11A80U, 0x6609F900U, 0x66318600U, 0x665A6480U, 0x6681F180U, 0x66AAD000U, 0x66D3AE80U, 0x66FB3B80U, 0x67241A00U, 0x674BA700U}}, // NOLINT(whitespace/line_length) - /* 2025 Year */ {0x000007E9U, 0x67748580U, {0x67748580U, 0x679D6400U, 0x67C24E00U, 0x67EB2C80U, 0x6812B980U, 0x683B9800U, 0x68632500U, 0x688C0380U, 0x68B4E200U, 0x68DC6F00U, 0x69054D80U, 0x692CDA80U}}, // NOLINT(whitespace/line_length) - /* 2026 Year */ {0x000007EAU, 0x6955B900U, {0x6955B900U, 0x697E9780U, 0x69A38180U, 0x69CC6000U, 0x69F3ED00U, 0x6A1CCB80U, 0x6A445880U, 0x6A6D3700U, 0x6A961580U, 0x6ABDA280U, 0x6AE68100U, 0x6B0E0E00U}}, // NOLINT(whitespace/line_length) - /* 2027 Year */ {0x000007EBU, 0x6B36EC80U, {0x6B36EC80U, 0x6B5FCB00U, 0x6B84B500U, 0x6BAD9380U, 0x6BD52080U, 0x6BFDFF00U, 0x6C258C00U, 0x6C4E6A80U, 0x6C774900U, 0x6C9ED600U, 0x6CC7B480U, 0x6CEF4180U}}, // NOLINT(whitespace/line_length) - /* 2028 Year */ {0x000007ECU, 0x6D182000U, {0x6D182000U, 0x6D40FE80U, 0x6D673A00U, 0x6D901880U, 0x6DB7A580U, 0x6DE08400U, 0x6E081100U, 0x6E30EF80U, 0x6E59CE00U, 0x6E815B00U, 0x6EAA3980U, 0x6ED1C680U}}, // NOLINT(whitespace/line_length) - /* 2029 Year */ {0x000007EDU, 0x6EFAA500U, {0x6EFAA500U, 0x6F238380U, 0x6F486D80U, 0x6F714C00U, 0x6F98D900U, 0x6FC1B780U, 0x6FE94480U, 0x70122300U, 0x703B0180U, 0x70628E80U, 0x708B6D00U, 0x70B2FA00U}}, // NOLINT(whitespace/line_length) - /* 2030 Year */ {0x000007EEU, 0x70DBD880U, {0x70DBD880U, 0x7104B700U, 0x7129A100U, 0x71527F80U, 0x717A0C80U, 0x71A2EB00U, 0x71CA7800U, 0x71F35680U, 0x721C3500U, 0x7243C200U, 0x726CA080U, 0x72942D80U}}, // NOLINT(whitespace/line_length) - /* 2031 Year */ {0x000007EFU, 0x72BD0C00U, {0x72BD0C00U, 0x72E5EA80U, 0x730AD480U, 0x7333B300U, 0x735B4000U, 0x73841E80U, 0x73ABAB80U, 0x73D48A00U, 0x73FD6880U, 0x7424F580U, 0x744DD400U, 0x74756100U}}, // NOLINT(whitespace/line_length) - /* 2032 Year */ {0x000007F0U, 0x749E3F80U, {0x749E3F80U, 0x74C71E00U, 0x74ED5980U, 0x75163800U, 0x753DC500U, 0x7566A380U, 0x758E3080U, 0x75B70F00U, 0x75DFED80U, 0x76077A80U, 0x76305900U, 0x7657E600U}}, // NOLINT(whitespace/line_length) - /* 2033 Year */ {0x000007F1U, 0x7680C480U, {0x7680C480U, 0x76A9A300U, 0x76CE8D00U, 0x76F76B80U, 0x771EF880U, 0x7747D700U, 0x776F6400U, 0x77984280U, 0x77C12100U, 0x77E8AE00U, 0x78118C80U, 0x78391980U}}, // NOLINT(whitespace/line_length) - /* 2034 Year */ {0x000007F2U, 0x7861F800U, {0x7861F800U, 0x788AD680U, 0x78AFC080U, 0x78D89F00U, 0x79002C00U, 0x79290A80U, 0x79509780U, 0x79797600U, 0x79A25480U, 0x79C9E180U, 0x79F2C000U, 0x7A1A4D00U}}, // NOLINT(whitespace/line_length) - /* 2035 Year */ {0x000007F3U, 0x7A432B80U, {0x7A432B80U, 0x7A6C0A00U, 0x7A90F400U, 0x7AB9D280U, 0x7AE15F80U, 0x7B0A3E00U, 0x7B31CB00U, 0x7B5AA980U, 0x7B838800U, 0x7BAB1500U, 0x7BD3F380U, 0x7BFB8080U}}, // NOLINT(whitespace/line_length) - /* 2036 Year */ {0x000007F4U, 0x7C245F00U, {0x7C245F00U, 0x7C4D3D80U, 0x7C737900U, 0x7C9C5780U, 0x7CC3E480U, 0x7CECC300U, 0x7D145000U, 0x7D3D2E80U, 0x7D660D00U, 0x7D8D9A00U, 0x7DB67880U, 0x7DDE0580U}}, // NOLINT(whitespace/line_length) - /* 2037 Year */ {0x000007F5U, 0x7E06E400U, {0x7E06E400U, 0x7E2FC280U, 0x7E54AC80U, 0x7E7D8B00U, 0x7EA51800U, 0x7ECDF680U, 0x7EF58380U, 0x7F1E6200U, 0x7F474080U, 0x7F6ECD80U, 0x7F97AC00U, 0x7FBF3900U}}, // NOLINT(whitespace/line_length) - /* 2038 Year */ {0x000007F6U, 0x7FE81780U, {0x7FE81780U, 0x8010F600U, 0x8035E000U, 0x805EBE80U, 0x80864B80U, 0x80AF2A00U, 0x80D6B700U, 0x80FF9580U, 0x81287400U, 0x81500100U, 0x8178DF80U, 0x81A06C80U}}, // NOLINT(whitespace/line_length) - /* 2039 Year */ {0x000007F7U, 0x81C94B00U, {0x81C94B00U, 0x81F22980U, 0x82171380U, 0x823FF200U, 0x82677F00U, 0x82905D80U, 0x82B7EA80U, 0x82E0C900U, 0x8309A780U, 0x83313480U, 0x835A1300U, 0x8381A000U}}, // NOLINT(whitespace/line_length) - /* 2040 Year */ {0x000007F8U, 0x83AA7E80U, {0x83AA7E80U, 0x83D35D00U, 0x83F99880U, 0x84227700U, 0x844A0400U, 0x8472E280U, 0x849A6F80U, 0x84C34E00U, 0x84EC2C80U, 0x8513B980U, 0x853C9800U, 0x85642500U}}, // NOLINT(whitespace/line_length) - /* 2041 Year */ {0x000007F9U, 0x858D0380U, {0x858D0380U, 0x85B5E200U, 0x85DACC00U, 0x8603AA80U, 0x862B3780U, 0x86541600U, 0x867BA300U, 0x86A48180U, 0x86CD6000U, 0x86F4ED00U, 0x871DCB80U, 0x87455880U}}, // NOLINT(whitespace/line_length) - /* 2042 Year */ {0x000007FAU, 0x876E3700U, {0x876E3700U, 0x87971580U, 0x87BBFF80U, 0x87E4DE00U, 0x880C6B00U, 0x88354980U, 0x885CD680U, 0x8885B500U, 0x88AE9380U, 0x88D62080U, 0x88FEFF00U, 0x89268C00U}}, // NOLINT(whitespace/line_length) - /* 2043 Year */ {0x000007FBU, 0x894F6A80U, {0x894F6A80U, 0x89784900U, 0x899D3300U, 0x89C61180U, 0x89ED9E80U, 0x8A167D00U, 0x8A3E0A00U, 0x8A66E880U, 0x8A8FC700U, 0x8AB75400U, 0x8AE03280U, 0x8B07BF80U}}, // NOLINT(whitespace/line_length) - /* 2044 Year */ {0x000007FCU, 0x8B309E00U, {0x8B309E00U, 0x8B597C80U, 0x8B7FB800U, 0x8BA89680U, 0x8BD02380U, 0x8BF90200U, 0x8C208F00U, 0x8C496D80U, 0x8C724C00U, 0x8C99D900U, 0x8CC2B780U, 0x8CEA4480U}}, // NOLINT(whitespace/line_length) - /* 2045 Year */ {0x000007FDU, 0x8D132300U, {0x8D132300U, 0x8D3C0180U, 0x8D60EB80U, 0x8D89CA00U, 0x8DB15700U, 0x8DDA3580U, 0x8E01C280U, 0x8E2AA100U, 0x8E537F80U, 0x8E7B0C80U, 0x8EA3EB00U, 0x8ECB7800U}}, // NOLINT(whitespace/line_length) - /* 2046 Year */ {0x000007FEU, 0x8EF45680U, {0x8EF45680U, 0x8F1D3500U, 0x8F421F00U, 0x8F6AFD80U, 0x8F928A80U, 0x8FBB6900U, 0x8FE2F600U, 0x900BD480U, 0x9034B300U, 0x905C4000U, 0x90851E80U, 0x90ACAB80U}}, // NOLINT(whitespace/line_length) - /* 2047 Year */ {0x000007FFU, 0x90D58A00U, {0x90D58A00U, 0x90FE6880U, 0x91235280U, 0x914C3100U, 0x9173BE00U, 0x919C9C80U, 0x91C42980U, 0x91ED0800U, 0x9215E680U, 0x923D7380U, 0x92665200U, 0x928DDF00U}}, // NOLINT(whitespace/line_length) - /* 2048 Year */ {0x00000800U, 0x92B6BD80U, {0x92B6BD80U, 0x92DF9C00U, 0x9305D780U, 0x932EB600U, 0x93564300U, 0x937F2180U, 0x93A6AE80U, 0x93CF8D00U, 0x93F86B80U, 0x941FF880U, 0x9448D700U, 0x94706400U}}, // NOLINT(whitespace/line_length) - /* 2049 Year */ {0x00000801U, 0x94994280U, {0x94994280U, 0x94C22100U, 0x94E70B00U, 0x950FE980U, 0x95377680U, 0x95605500U, 0x9587E200U, 0x95B0C080U, 0x95D99F00U, 0x96012C00U, 0x962A0A80U, 0x96519780U}}, // NOLINT(whitespace/line_length) - /* 2050 Year */ {0x00000802U, 0x967A7600U, {0x967A7600U, 0x96A35480U, 0x96C83E80U, 0x96F11D00U, 0x9718AA00U, 0x97418880U, 0x97691580U, 0x9791F400U, 0x97BAD280U, 0x97E25F80U, 0x980B3E00U, 0x9832CB00U}}, // NOLINT(whitespace/line_length) - /* 2051 Year */ {0x00000803U, 0x985BA980U, {0x985BA980U, 0x98848800U, 0x98A97200U, 0x98D25080U, 0x98F9DD80U, 0x9922BC00U, 0x994A4900U, 0x99732780U, 0x999C0600U, 0x99C39300U, 0x99EC7180U, 0x9A13FE80U}}, // NOLINT(whitespace/line_length) - /* 2052 Year */ {0x00000804U, 0x9A3CDD00U, {0x9A3CDD00U, 0x9A65BB80U, 0x9A8BF700U, 0x9AB4D580U, 0x9ADC6280U, 0x9B054100U, 0x9B2CCE00U, 0x9B55AC80U, 0x9B7E8B00U, 0x9BA61800U, 0x9BCEF680U, 0x9BF68380U}}, // NOLINT(whitespace/line_length) - /* 2053 Year */ {0x00000805U, 0x9C1F6200U, {0x9C1F6200U, 0x9C484080U, 0x9C6D2A80U, 0x9C960900U, 0x9CBD9600U, 0x9CE67480U, 0x9D0E0180U, 0x9D36E000U, 0x9D5FBE80U, 0x9D874B80U, 0x9DB02A00U, 0x9DD7B700U}}, // NOLINT(whitespace/line_length) - /* 2054 Year */ {0x00000806U, 0x9E009580U, {0x9E009580U, 0x9E297400U, 0x9E4E5E00U, 0x9E773C80U, 0x9E9EC980U, 0x9EC7A800U, 0x9EEF3500U, 0x9F181380U, 0x9F40F200U, 0x9F687F00U, 0x9F915D80U, 0x9FB8EA80U}}, // NOLINT(whitespace/line_length) - /* 2055 Year */ {0x00000807U, 0x9FE1C900U, {0x9FE1C900U, 0xA00AA780U, 0xA02F9180U, 0xA0587000U, 0xA07FFD00U, 0xA0A8DB80U, 0xA0D06880U, 0xA0F94700U, 0xA1222580U, 0xA149B280U, 0xA1729100U, 0xA19A1E00U}}, // NOLINT(whitespace/line_length) - /* 2056 Year */ {0x00000808U, 0xA1C2FC80U, {0xA1C2FC80U, 0xA1EBDB00U, 0xA2121680U, 0xA23AF500U, 0xA2628200U, 0xA28B6080U, 0xA2B2ED80U, 0xA2DBCC00U, 0xA304AA80U, 0xA32C3780U, 0xA3551600U, 0xA37CA300U}}, // NOLINT(whitespace/line_length) - /* 2057 Year */ {0x00000809U, 0xA3A58180U, {0xA3A58180U, 0xA3CE6000U, 0xA3F34A00U, 0xA41C2880U, 0xA443B580U, 0xA46C9400U, 0xA4942100U, 0xA4BCFF80U, 0xA4E5DE00U, 0xA50D6B00U, 0xA5364980U, 0xA55DD680U}}, // NOLINT(whitespace/line_length) - /* 2058 Year */ {0x0000080AU, 0xA586B500U, {0xA586B500U, 0xA5AF9380U, 0xA5D47D80U, 0xA5FD5C00U, 0xA624E900U, 0xA64DC780U, 0xA6755480U, 0xA69E3300U, 0xA6C71180U, 0xA6EE9E80U, 0xA7177D00U, 0xA73F0A00U}}, // NOLINT(whitespace/line_length) - /* 2059 Year */ {0x0000080BU, 0xA767E880U, {0xA767E880U, 0xA790C700U, 0xA7B5B100U, 0xA7DE8F80U, 0xA8061C80U, 0xA82EFB00U, 0xA8568800U, 0xA87F6680U, 0xA8A84500U, 0xA8CFD200U, 0xA8F8B080U, 0xA9203D80U}}, // NOLINT(whitespace/line_length) - /* 2060 Year */ {0x0000080CU, 0xA9491C00U, {0xA9491C00U, 0xA971FA80U, 0xA9983600U, 0xA9C11480U, 0xA9E8A180U, 0xAA118000U, 0xAA390D00U, 0xAA61EB80U, 0xAA8ACA00U, 0xAAB25700U, 0xAADB3580U, 0xAB02C280U}}, // NOLINT(whitespace/line_length) - /* 2061 Year */ {0x0000080DU, 0xAB2BA100U, {0xAB2BA100U, 0xAB547F80U, 0xAB796980U, 0xABA24800U, 0xABC9D500U, 0xABF2B380U, 0xAC1A4080U, 0xAC431F00U, 0xAC6BFD80U, 0xAC938A80U, 0xACBC6900U, 0xACE3F600U}}, // NOLINT(whitespace/line_length) - /* 2062 Year */ {0x0000080EU, 0xAD0CD480U, {0xAD0CD480U, 0xAD35B300U, 0xAD5A9D00U, 0xAD837B80U, 0xADAB0880U, 0xADD3E700U, 0xADFB7400U, 0xAE245280U, 0xAE4D3100U, 0xAE74BE00U, 0xAE9D9C80U, 0xAEC52980U}}, // NOLINT(whitespace/line_length) - /* 2063 Year */ {0x0000080FU, 0xAEEE0800U, {0xAEEE0800U, 0xAF16E680U, 0xAF3BD080U, 0xAF64AF00U, 0xAF8C3C00U, 0xAFB51A80U, 0xAFDCA780U, 0xB0058600U, 0xB02E6480U, 0xB055F180U, 0xB07ED000U, 0xB0A65D00U}}, // NOLINT(whitespace/line_length) - /* 2064 Year */ {0x00000810U, 0xB0CF3B80U, {0xB0CF3B80U, 0xB0F81A00U, 0xB11E5580U, 0xB1473400U, 0xB16EC100U, 0xB1979F80U, 0xB1BF2C80U, 0xB1E80B00U, 0xB210E980U, 0xB2387680U, 0xB2615500U, 0xB288E200U}}, // NOLINT(whitespace/line_length) - /* 2065 Year */ {0x00000811U, 0xB2B1C080U, {0xB2B1C080U, 0xB2DA9F00U, 0xB2FF8900U, 0xB3286780U, 0xB34FF480U, 0xB378D300U, 0xB3A06000U, 0xB3C93E80U, 0xB3F21D00U, 0xB419AA00U, 0xB4428880U, 0xB46A1580U}}, // NOLINT(whitespace/line_length) - /* 2066 Year */ {0x00000812U, 0xB492F400U, {0xB492F400U, 0xB4BBD280U, 0xB4E0BC80U, 0xB5099B00U, 0xB5312800U, 0xB55A0680U, 0xB5819380U, 0xB5AA7200U, 0xB5D35080U, 0xB5FADD80U, 0xB623BC00U, 0xB64B4900U}}, // NOLINT(whitespace/line_length) - /* 2067 Year */ {0x00000813U, 0xB6742780U, {0xB6742780U, 0xB69D0600U, 0xB6C1F000U, 0xB6EACE80U, 0xB7125B80U, 0xB73B3A00U, 0xB762C700U, 0xB78BA580U, 0xB7B48400U, 0xB7DC1100U, 0xB804EF80U, 0xB82C7C80U}}, // NOLINT(whitespace/line_length) - /* 2068 Year */ {0x00000814U, 0xB8555B00U, {0xB8555B00U, 0xB87E3980U, 0xB8A47500U, 0xB8CD5380U, 0xB8F4E080U, 0xB91DBF00U, 0xB9454C00U, 0xB96E2A80U, 0xB9970900U, 0xB9BE9600U, 0xB9E77480U, 0xBA0F0180U}}, // NOLINT(whitespace/line_length) - /* 2069 Year */ {0x00000815U, 0xBA37E000U, {0xBA37E000U, 0xBA60BE80U, 0xBA85A880U, 0xBAAE8700U, 0xBAD61400U, 0xBAFEF280U, 0xBB267F80U, 0xBB4F5E00U, 0xBB783C80U, 0xBB9FC980U, 0xBBC8A800U, 0xBBF03500U}}, // NOLINT(whitespace/line_length) - /* 2070 Year */ {0x00000816U, 0xBC191380U, {0xBC191380U, 0xBC41F200U, 0xBC66DC00U, 0xBC8FBA80U, 0xBCB74780U, 0xBCE02600U, 0xBD07B300U, 0xBD309180U, 0xBD597000U, 0xBD80FD00U, 0xBDA9DB80U, 0xBDD16880U}}, // NOLINT(whitespace/line_length) - /* 2071 Year */ {0x00000817U, 0xBDFA4700U, {0xBDFA4700U, 0xBE232580U, 0xBE480F80U, 0xBE70EE00U, 0xBE987B00U, 0xBEC15980U, 0xBEE8E680U, 0xBF11C500U, 0xBF3AA380U, 0xBF623080U, 0xBF8B0F00U, 0xBFB29C00U}}, // NOLINT(whitespace/line_length) - /* 2072 Year */ {0x00000818U, 0xBFDB7A80U, {0xBFDB7A80U, 0xC0045900U, 0xC02A9480U, 0xC0537300U, 0xC07B0000U, 0xC0A3DE80U, 0xC0CB6B80U, 0xC0F44A00U, 0xC11D2880U, 0xC144B580U, 0xC16D9400U, 0xC1952100U}}, // NOLINT(whitespace/line_length) - /* 2073 Year */ {0x00000819U, 0xC1BDFF80U, {0xC1BDFF80U, 0xC1E6DE00U, 0xC20BC800U, 0xC234A680U, 0xC25C3380U, 0xC2851200U, 0xC2AC9F00U, 0xC2D57D80U, 0xC2FE5C00U, 0xC325E900U, 0xC34EC780U, 0xC3765480U}}, // NOLINT(whitespace/line_length) - /* 2074 Year */ {0x0000081AU, 0xC39F3300U, {0xC39F3300U, 0xC3C81180U, 0xC3ECFB80U, 0xC415DA00U, 0xC43D6700U, 0xC4664580U, 0xC48DD280U, 0xC4B6B100U, 0xC4DF8F80U, 0xC5071C80U, 0xC52FFB00U, 0xC5578800U}}, // NOLINT(whitespace/line_length) - /* 2075 Year */ {0x0000081BU, 0xC5806680U, {0xC5806680U, 0xC5A94500U, 0xC5CE2F00U, 0xC5F70D80U, 0xC61E9A80U, 0xC6477900U, 0xC66F0600U, 0xC697E480U, 0xC6C0C300U, 0xC6E85000U, 0xC7112E80U, 0xC738BB80U}}, // NOLINT(whitespace/line_length) - /* 2076 Year */ {0x0000081CU, 0xC7619A00U, {0xC7619A00U, 0xC78A7880U, 0xC7B0B400U, 0xC7D99280U, 0xC8011F80U, 0xC829FE00U, 0xC8518B00U, 0xC87A6980U, 0xC8A34800U, 0xC8CAD500U, 0xC8F3B380U, 0xC91B4080U}}, // NOLINT(whitespace/line_length) - /* 2077 Year */ {0x0000081DU, 0xC9441F00U, {0xC9441F00U, 0xC96CFD80U, 0xC991E780U, 0xC9BAC600U, 0xC9E25300U, 0xCA0B3180U, 0xCA32BE80U, 0xCA5B9D00U, 0xCA847B80U, 0xCAAC0880U, 0xCAD4E700U, 0xCAFC7400U}}, // NOLINT(whitespace/line_length) - /* 2078 Year */ {0x0000081EU, 0xCB255280U, {0xCB255280U, 0xCB4E3100U, 0xCB731B00U, 0xCB9BF980U, 0xCBC38680U, 0xCBEC6500U, 0xCC13F200U, 0xCC3CD080U, 0xCC65AF00U, 0xCC8D3C00U, 0xCCB61A80U, 0xCCDDA780U}}, // NOLINT(whitespace/line_length) - /* 2079 Year */ {0x0000081FU, 0xCD068600U, {0xCD068600U, 0xCD2F6480U, 0xCD544E80U, 0xCD7D2D00U, 0xCDA4BA00U, 0xCDCD9880U, 0xCDF52580U, 0xCE1E0400U, 0xCE46E280U, 0xCE6E6F80U, 0xCE974E00U, 0xCEBEDB00U}}, // NOLINT(whitespace/line_length) - /* 2080 Year */ {0x00000820U, 0xCEE7B980U, {0xCEE7B980U, 0xCF109800U, 0xCF36D380U, 0xCF5FB200U, 0xCF873F00U, 0xCFB01D80U, 0xCFD7AA80U, 0xD0008900U, 0xD0296780U, 0xD050F480U, 0xD079D300U, 0xD0A16000U}}, // NOLINT(whitespace/line_length) - /* 2081 Year */ {0x00000821U, 0xD0CA3E80U, {0xD0CA3E80U, 0xD0F31D00U, 0xD1180700U, 0xD140E580U, 0xD1687280U, 0xD1915100U, 0xD1B8DE00U, 0xD1E1BC80U, 0xD20A9B00U, 0xD2322800U, 0xD25B0680U, 0xD2829380U}}, // NOLINT(whitespace/line_length) - /* 2082 Year */ {0x00000822U, 0xD2AB7200U, {0xD2AB7200U, 0xD2D45080U, 0xD2F93A80U, 0xD3221900U, 0xD349A600U, 0xD3728480U, 0xD39A1180U, 0xD3C2F000U, 0xD3EBCE80U, 0xD4135B80U, 0xD43C3A00U, 0xD463C700U}}, // NOLINT(whitespace/line_length) - /* 2083 Year */ {0x00000823U, 0xD48CA580U, {0xD48CA580U, 0xD4B58400U, 0xD4DA6E00U, 0xD5034C80U, 0xD52AD980U, 0xD553B800U, 0xD57B4500U, 0xD5A42380U, 0xD5CD0200U, 0xD5F48F00U, 0xD61D6D80U, 0xD644FA80U}}, // NOLINT(whitespace/line_length) - /* 2084 Year */ {0x00000824U, 0xD66DD900U, {0xD66DD900U, 0xD696B780U, 0xD6BCF300U, 0xD6E5D180U, 0xD70D5E80U, 0xD7363D00U, 0xD75DCA00U, 0xD786A880U, 0xD7AF8700U, 0xD7D71400U, 0xD7FFF280U, 0xD8277F80U}}, // NOLINT(whitespace/line_length) - /* 2085 Year */ {0x00000825U, 0xD8505E00U, {0xD8505E00U, 0xD8793C80U, 0xD89E2680U, 0xD8C70500U, 0xD8EE9200U, 0xD9177080U, 0xD93EFD80U, 0xD967DC00U, 0xD990BA80U, 0xD9B84780U, 0xD9E12600U, 0xDA08B300U}}, // NOLINT(whitespace/line_length) - /* 2086 Year */ {0x00000826U, 0xDA319180U, {0xDA319180U, 0xDA5A7000U, 0xDA7F5A00U, 0xDAA83880U, 0xDACFC580U, 0xDAF8A400U, 0xDB203100U, 0xDB490F80U, 0xDB71EE00U, 0xDB997B00U, 0xDBC25980U, 0xDBE9E680U}}, // NOLINT(whitespace/line_length) - /* 2087 Year */ {0x00000827U, 0xDC12C500U, {0xDC12C500U, 0xDC3BA380U, 0xDC608D80U, 0xDC896C00U, 0xDCB0F900U, 0xDCD9D780U, 0xDD016480U, 0xDD2A4300U, 0xDD532180U, 0xDD7AAE80U, 0xDDA38D00U, 0xDDCB1A00U}}, // NOLINT(whitespace/line_length) - /* 2088 Year */ {0x00000828U, 0xDDF3F880U, {0xDDF3F880U, 0xDE1CD700U, 0xDE431280U, 0xDE6BF100U, 0xDE937E00U, 0xDEBC5C80U, 0xDEE3E980U, 0xDF0CC800U, 0xDF35A680U, 0xDF5D3380U, 0xDF861200U, 0xDFAD9F00U}}, // NOLINT(whitespace/line_length) - /* 2089 Year */ {0x00000829U, 0xDFD67D80U, {0xDFD67D80U, 0xDFFF5C00U, 0xE0244600U, 0xE04D2480U, 0xE074B180U, 0xE09D9000U, 0xE0C51D00U, 0xE0EDFB80U, 0xE116DA00U, 0xE13E6700U, 0xE1674580U, 0xE18ED280U}}, // NOLINT(whitespace/line_length) - /* 2090 Year */ {0x0000082AU, 0xE1B7B100U, {0xE1B7B100U, 0xE1E08F80U, 0xE2057980U, 0xE22E5800U, 0xE255E500U, 0xE27EC380U, 0xE2A65080U, 0xE2CF2F00U, 0xE2F80D80U, 0xE31F9A80U, 0xE3487900U, 0xE3700600U}}, // NOLINT(whitespace/line_length) - /* 2091 Year */ {0x0000082BU, 0xE398E480U, {0xE398E480U, 0xE3C1C300U, 0xE3E6AD00U, 0xE40F8B80U, 0xE4371880U, 0xE45FF700U, 0xE4878400U, 0xE4B06280U, 0xE4D94100U, 0xE500CE00U, 0xE529AC80U, 0xE5513980U}}, // NOLINT(whitespace/line_length) - /* 2092 Year */ {0x0000082CU, 0xE57A1800U, {0xE57A1800U, 0xE5A2F680U, 0xE5C93200U, 0xE5F21080U, 0xE6199D80U, 0xE6427C00U, 0xE66A0900U, 0xE692E780U, 0xE6BBC600U, 0xE6E35300U, 0xE70C3180U, 0xE733BE80U}}, // NOLINT(whitespace/line_length) - /* 2093 Year */ {0x0000082DU, 0xE75C9D00U, {0xE75C9D00U, 0xE7857B80U, 0xE7AA6580U, 0xE7D34400U, 0xE7FAD100U, 0xE823AF80U, 0xE84B3C80U, 0xE8741B00U, 0xE89CF980U, 0xE8C48680U, 0xE8ED6500U, 0xE914F200U}}, // NOLINT(whitespace/line_length) - /* 2094 Year */ {0x0000082EU, 0xE93DD080U, {0xE93DD080U, 0xE966AF00U, 0xE98B9900U, 0xE9B47780U, 0xE9DC0480U, 0xEA04E300U, 0xEA2C7000U, 0xEA554E80U, 0xEA7E2D00U, 0xEAA5BA00U, 0xEACE9880U, 0xEAF62580U}}, // NOLINT(whitespace/line_length) - /* 2095 Year */ {0x0000082FU, 0xEB1F0400U, {0xEB1F0400U, 0xEB47E280U, 0xEB6CCC80U, 0xEB95AB00U, 0xEBBD3800U, 0xEBE61680U, 0xEC0DA380U, 0xEC368200U, 0xEC5F6080U, 0xEC86ED80U, 0xECAFCC00U, 0xECD75900U}}, // NOLINT(whitespace/line_length) - /* 2096 Year */ {0x00000830U, 0xED003780U, {0xED003780U, 0xED291600U, 0xED4F5180U, 0xED783000U, 0xED9FBD00U, 0xEDC89B80U, 0xEDF02880U, 0xEE190700U, 0xEE41E580U, 0xEE697280U, 0xEE925100U, 0xEEB9DE00U}}, // NOLINT(whitespace/line_length) - /* 2097 Year */ {0x00000831U, 0xEEE2BC80U, {0xEEE2BC80U, 0xEF0B9B00U, 0xEF308500U, 0xEF596380U, 0xEF80F080U, 0xEFA9CF00U, 0xEFD15C00U, 0xEFFA3A80U, 0xF0231900U, 0xF04AA600U, 0xF0738480U, 0xF09B1180U}}, // NOLINT(whitespace/line_length) - /* 2098 Year */ {0x00000832U, 0xF0C3F000U, {0xF0C3F000U, 0xF0ECCE80U, 0xF111B880U, 0xF13A9700U, 0xF1622400U, 0xF18B0280U, 0xF1B28F80U, 0xF1DB6E00U, 0xF2044C80U, 0xF22BD980U, 0xF254B800U, 0xF27C4500U}}, // NOLINT(whitespace/line_length) - /* 2099 Year */ {0x00000833U, 0xF2A52380U, {0xF2A52380U, 0xF2CE0200U, 0xF2F2EC00U, 0xF31BCA80U, 0xF3435780U, 0xF36C3600U, 0xF393C300U, 0xF3BCA180U, 0xF3E58000U, 0xF40D0D00U, 0xF435EB80U, 0xF45D7880U}}, // NOLINT(whitespace/line_length) - /* 2100 Year */ {0x00000834U, 0xF4865700U, {0xF4865700U, 0xF4AF3580U, 0xF4D41F80U, 0xF4FCFE00U, 0xF5248B00U, 0xF54D6980U, 0xF574F680U, 0xF59DD500U, 0xF5C6B380U, 0xF5EE4080U, 0xF6171F00U, 0xF63EAC00U}}, // NOLINT(whitespace/line_length) - /* 2101 Year */ {0x00000835U, 0xF6678A80U, {0xF6678A80U, 0xF6906900U, 0xF6B55300U, 0xF6DE3180U, 0xF705BE80U, 0xF72E9D00U, 0xF7562A00U, 0xF77F0880U, 0xF7A7E700U, 0xF7CF7400U, 0xF7F85280U, 0xF81FDF80U}}, // NOLINT(whitespace/line_length) - /* 2102 Year */ {0x00000836U, 0xF848BE00U, {0xF848BE00U, 0xF8719C80U, 0xF8968680U, 0xF8BF6500U, 0xF8E6F200U, 0xF90FD080U, 0xF9375D80U, 0xF9603C00U, 0xF9891A80U, 0xF9B0A780U, 0xF9D98600U, 0xFA011300U}}, // NOLINT(whitespace/line_length) - /* 2103 Year */ {0x00000837U, 0xFA29F180U, {0xFA29F180U, 0xFA52D000U, 0xFA77BA00U, 0xFAA09880U, 0xFAC82580U, 0xFAF10400U, 0xFB189100U, 0xFB416F80U, 0xFB6A4E00U, 0xFB91DB00U, 0xFBBAB980U, 0xFBE24680U}}, // NOLINT(whitespace/line_length) - /* 2104 Year */ {0x00000838U, 0xFC0B2500U, {0xFC0B2500U, 0xFC340380U, 0xFC5A3F00U, 0xFC831D80U, 0xFCAAAA80U, 0xFCD38900U, 0xFCFB1600U, 0xFD23F480U, 0xFD4CD300U, 0xFD746000U, 0xFD9D3E80U, 0xFDC4CB80U}}, // NOLINT(whitespace/line_length) - /* 2105 Year */ {0x00000839U, 0xFDEDAA00U, {0xFDEDAA00U, 0xFE168880U, 0xFE3B7280U, 0xFE645100U, 0xFE8BDE00U, 0xFEB4BC80U, 0xFEDC4980U, 0xFF052800U, 0xFF2E0680U, 0xFF559380U, 0xFF7E7200U, 0xFFA5FF00U}}, // NOLINT(whitespace/line_length) - /* 2106 Year */ {0x0000083AU, 0xFFCEDD80U, {0xFFCEDD80U, 0xFFF7BC00U, 0x001CA600U, 0x00458480U, 0x006D1180U, 0x0095F000U, 0x00BD7D00U, 0x00E65B80U, 0x010F3A00U, 0x0136C700U, 0x015FA580U, 0x01873280U}} // NOLINT(whitespace/line_length) - } -}; - -/************************************************************************* -@brief The date is converted at the multiplication second. -@outline The specified time and date is converted at the multiplication second - from epoch time(0:0:0 January 1, 1970. ) -@type Completion return type<BR> -@param[in] const LPSYSTEMTIME lp_st : Converted time and date -@param[out] u_int32* uli_sec : Multiplication second from epoch time -@threshold lp_st != NULL, uli_sec != NULL <BR> - 1970 <= lp_st.wYear <= 2105 <BR> - 1 <= lp_st.wMonth <= 12 <BR> - 1 <= lp_st.wDay <= 31 <BR> - 0 <= lp_st.wHour <= 23 <BR> - 0 <= lp_st.wMinute <= 59 <BR> - 0 <= lp_st.wSecond <= 59 <BR> -@return RET_API -@retval RET_NORMAL : Normal end -@retval RET_ERROR : Abnormal end -*****************************************************************************/ -RET_API ClockUtilityConvertDateToSecond(const LPSYSTEMTIME lp_st, u_int32* uli_sec) { - u_int8 imflg; /* Leap year determination flag 0:Not a leap year 1:Leap year */ - u_int32 ui_day; - int32 century; - RET_API ret = RET_NORMAL; - - /* Checking the NULL of Pointer Arguments */ - if ((lp_st == NULL) || (uli_sec == NULL)) { - ret = RET_ERROR; - } else { - *uli_sec = 0; /* Reset accumulated seconds to 0 */ - - /* Parameter check */ - if (((lp_st->wYear < 1970) || (2105 < lp_st->wYear)) || /* Check Year to Convert */ - ((lp_st->wMonth < 1) || (12 < lp_st->wMonth))) { /* Check month to convert */ - ret = RET_ERROR; - } else { - /* Determine the leap year and select the "Mnumonic For Remembering The Months With Fewer Than 31 Days" table. */ - imflg = 0; /* Set the default to a non-leap year */ - if ((lp_st->wYear % 4) == 0) { /* If the year is divisible by 4, */ - imflg = 1; /* Be a leap year */ - } - if ((lp_st->wYear % 100) == 0) { /* However,If the year is divisible by 100 */ - imflg = 0; /* Not leap years */ - } - if ((lp_st->wYear % 400) == 0) { /* However,If the year is divisible by 400 */ - imflg = 1; /* Be a leap year */ - } - - /* Parameter check again */ - if (((lp_st->wDay < 1) || (kUsMonth[imflg][lp_st->wMonth - 1] < lp_st->wDay)) || /* Check date to convert */ - (23 < lp_st->wHour) || /* Check when converting */ - (59 < lp_st->wMinute) || /* Check the minutes to convert */ - (59 < lp_st->wSecond) ) { /* Check the seconds to convert */ - ret = RET_ERROR; - } else { - /* Converting Hours, Minutes, and Seconds to Seconds */ - *uli_sec = lp_st->wSecond; /* The specified seconds are stored as is. */ - *uli_sec += lp_st->wMinute * SEC_PER_MIN; /* Convert specified minutes to seconds and add */ - *uli_sec += lp_st->wHour * SEC_PER_HOUR; /* Convert specified hour to second and add */ - - /* Convert a date to the number of days since January 1, 1970 */ /* Task_31499 */ - ui_day = 0; - ui_day += (lp_st->wYear - 1970) * 365; - - /* Because years divisible by 100 are not counted as leap years,Calculate the number of times */ - century = lp_st->wYear / 100; - /* Add the number of days added for the leap year up to the previous year */ - /* Shift year to right by 2 bits until last year(Divide by 4) - - Exclude years divisible by 100(century) + Shift century right by 2 bits(Divide by 4 - -> If it is divisible by 4, it is counted as a leap year */ - ui_day += ((lp_st->wYear - 1) >> 2) - century + (century >> 2) - 477; /* 477 -> Number of leap years up to 1970 */ - /* Add the number of days up to the previous month of the current year */ - ui_day += kUsMonth[2][lp_st->wMonth - 1] + ((lp_st->wMonth > 2) ? imflg : 0); - - ui_day += (lp_st->wDay - 1); /* Add the number of elapsed days */ - - *uli_sec += (ui_day * SEC_PER_DAY); /* Convert the number of days to seconds and add */ - } - } - } - - return ret; -} - -/************************************************************************* -@brief The multiplication second is converted at the date. -@outline The specified multiplication second is converted as a multiplication second from epoch time(0:0:0 January 1, 1970.) at time and date. -@type Completion return type -@param[in] const u_int32*uli_sec : Converted multiplication second from epoch time -@param[out] LPSYSTEMTIME lp_st : Time after it converts it of date -@threshold lp_st != NULL, uli_sec != NULL <BR> - uli_sec < 0xFFCEDD80 -@return RET_API -@retval RET_NORMAL : Normal end -@retval RET_ERROR : Abnormal end -*****************************************************************************/ - -RET_API ClockUtilityConvertSecondToDate(const u_int32* uli_sec, LPSYSTEMTIME lp_st) { - u_int32 i; /* Loop control */ - u_int32 j; /* Loop control */ - u_int32 uli_sec_wk; /* Total value save */ - RET_API ret = RET_NORMAL; /* return value */ - u_int8 complete_cnv = FALSE; /* Conversion completion flag */ - u_int8 valid_date; /* Date Valid Value Flag */ - - /* Checking the NULL of Pointer Arguments */ - if ((uli_sec == NULL) || (lp_st == NULL)) { - ret = RET_ERROR; - } else { - /* Back up the accumulated seconds to the work. */ - uli_sec_wk = static_cast<u_int32>(*uli_sec); - - /* Parameter check processing */ - if (uli_sec_wk >= kUlDayCntTbl.st_tbl[CNV_YEAR_MAX].ulCount) { - ret = RET_ERROR; - } else { - /* Initialize */ - lp_st->wYear = (WORD)(kUlDayCntTbl.st_tbl[0].ulYear); - lp_st->wMonth = (WORD)(1); /* Month Settings */ - lp_st->wDay = (WORD)(1); /* Day Settings */ - lp_st->wDayOfWeek = (WORD)(4); /* Setting the day of the week(Note : Corrected in cases other than 1970) */ - lp_st->wHour = (WORD)(0); /* Time setting */ - lp_st->wMinute = (WORD)(0); /* Minute setting */ - lp_st->wSecond = (WORD)(0); /* Set Seconds */ - lp_st->wMilliseconds = (WORD)(0); /* Set msec. */ - - /* Search time accumulated seconds conversion table */ - for (i = 0; i < CNV_YEAR_MAX; i++) { - /* Set the year(Maximum value) */ - if ((kUlDayCntTbl.st_tbl[i + 1].ulCount > uli_sec_wk) || (i == (CNV_YEAR_MAX - 1))) { - lp_st->wYear = (WORD)kUlDayCntTbl.st_tbl[i].ulYear; - - /* Set the month(Maximum value) */ - j = 0; - while ((j < 12) && (complete_cnv == FALSE)) { - /* Prevent 12Month(j=11)ulMonth[12] access */ - valid_date = FALSE; - if (j == (MONTH_MAX - 1)) { - valid_date = TRUE; - } else { - if (kUlDayCntTbl.st_tbl[i].ulMonth[j + 1] > uli_sec_wk) { - valid_date = TRUE; - } - } - - if (valid_date == TRUE) { - lp_st->wMonth = (WORD)(j + 1); - - /* Day-of-week,Set Date Hour Minute Second */ - lp_st->wDayOfWeek = (WORD)((lp_st->wDayOfWeek + - (WORD)((uli_sec_wk / SEC_PER_DAY) % 7)) % 7); /* Setting the day of the week */ - uli_sec_wk = uli_sec_wk - (u_int32)(kUlDayCntTbl.st_tbl[i].ulMonth[j]); - lp_st->wDay = (WORD)((uli_sec_wk / SEC_PER_DAY) + 1); /* Day Settings */ - lp_st->wSecond = (WORD)(uli_sec_wk % SEC_PER_MIN); /* Set Seconds */ - lp_st->wMinute = (WORD)((uli_sec_wk % SEC_PER_HOUR) / SEC_PER_MIN); /* Minute setting */ - lp_st->wHour = (WORD)((uli_sec_wk % SEC_PER_DAY) / SEC_PER_HOUR); /* Time setting */ - - complete_cnv = TRUE; /* Completion */ - } - j++; - } - } - - if (complete_cnv != FALSE) { - break; - } - } - } - } - - return ret; -} - -/************************************************************************* -@brief Type conversion is done. -@outline It converts it from the TimeData type to the SYSTEMTIME type. -@type Completion return type -@param[in] const TimeData* base_time : Time of conversion origin -@param[out] const SYSTEMTIME* result_time : Time after it converts it -@threshold base_time != NULL<BR> -@threshold result_time != NULL -@return CLOCK_RETURN -@retval CLOCK_OK : Normal end -@retval CLOCK_ERROR : Abnormal end -@retval CLOCK_ERROR_ARGUMENTS : The argument is wrong -@trace -*****************************************************************************/ -CLOCK_RETURN ClockApiConvertTimeDataToSYSTEMTIME(const TimeData* base_time, SYSTEMTIME* result_time) { - CLOCK_RETURN ret = CLOCK_ERROR; - RET_API ret_cnv = RET_ERROR; - u_int32 total_sec = 0; - - if ((base_time != NULL) && (result_time != NULL)) { - /* Converting TimeData Types to SYSTEMTIME Types */ - result_time->wYear = static_cast<WORD>(base_time->year); - result_time->wMonth = static_cast<WORD>(base_time->month); - result_time->wDay = static_cast<WORD>(base_time->day); - result_time->wHour = static_cast<WORD>(base_time->hour); - result_time->wMinute = static_cast<WORD>(base_time->minute); - result_time->wSecond = static_cast<WORD>(base_time->second); - result_time->wMilliseconds = 0; /* 0 because there is no corresponding parameter */ - result_time->wDayOfWeek = CLKMNG_SUN; /* 0 because there is no corresponding parameter */ - - ret_cnv = ClockUtilityConvertDateToSecond(result_time, &total_sec); - if (ret_cnv == RET_NORMAL) { - /* Calculate the day of the week from the cumulative second. */ - ret_cnv = ClockUtilityConvertSecondToDate(&total_sec, result_time); - if (ret_cnv == RET_NORMAL) { - ret = CLOCK_OK; - } else { - ret = CLOCK_ERROR; - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, - "ClockUtility.lib:%s:LINE:%d\r\nClockApiConvertTimeDataToSYSTEMTIME"\ - "ClockUtilityConvertSecondToDate ERROR!![%d]\r\n", - LTEXT(__FILE__), - __LINE__, - ret); - } - } else { - ret = CLOCK_ERROR; - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, - "ClockUtility.lib:%s:LINE:%d\r\nClockApiConvertTimeDataToSYSTEMTIME"\ - "ClockUtilityConvertDateToSecond ERROR!![%d]\r\n", - LTEXT(__FILE__), - __LINE__, - ret); - } - - } else { - /* Invalid argument */ - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, - "ClockUtility.lib:%s:LINE:%d\r\nClockApiConvertTimeDataToSYSTEMTIME"\ - "Arguments ERROR!![%d]\r\n", - LTEXT(__FILE__), - __LINE__, - ret); - ret = CLOCK_ERROR_ARGUMENTS; - } - return ret; -} diff --git a/vehicleservice/positioning/server/src/Sensor/DeadReckoning_Common.cpp b/vehicleservice/positioning/server/src/Sensor/DeadReckoning_Common.cpp deleted file mode 100755 index 9503b34..0000000 --- a/vehicleservice/positioning/server/src/Sensor/DeadReckoning_Common.cpp +++ /dev/null @@ -1,127 +0,0 @@ -/* - * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/******************************************************************************* - * File name :DeadReckoning_Common.cpp - * System name :PastModel002 - * Subsystem name :DeadReckoning processes - * Program name :DeadReckoning shared process(DEADRECKONING_COMMON) - * Module configuration DeadReckoningMemcmp() Functions for Common Processing Memory Block Comparisons - * DeadReckoningCheckDid() Common Processing Data ID Check Function - * DeadReckoningGetDataMasterOffset() Get function for common processing data master offset value - ******************************************************************************/ -#include "DeadReckoning_Common.h" -#include <vehicle_service/positioning_base_library.h> - -/*************************************************/ -/* Global variable */ -/*************************************************/ -static const DEADRECKONING_DID_OFFSET_TBL kGstDidListS[] = { - /* Data ID Offset size Reserved */ - { VEHICLE_DID_DR_LONGITUDE, DEADRECKONING_OFFSET_NORMAL, {0, 0} }, - { VEHICLE_DID_DR_LATITUDE, DEADRECKONING_OFFSET_NORMAL, {0, 0} }, - { VEHICLE_DID_DR_ALTITUDE, DEADRECKONING_OFFSET_NORMAL, {0, 0} }, - { VEHICLE_DID_DR_SPEED, DEADRECKONING_OFFSET_NORMAL, {0, 0} }, - { VEHICLE_DID_DR_HEADING, DEADRECKONING_OFFSET_NORMAL, {0, 0} }, - { VEHICLE_DID_DR_GYRO_OFFSET, DEADRECKONING_OFFSET_NORMAL, {0, 0} }, - { VEHICLE_DID_DR_GYRO_SCALE_FACTOR, DEADRECKONING_OFFSET_NORMAL, {0, 0} }, - { VEHICLE_DID_DR_GYRO_SCALE_FACTOR_LEVEL, DEADRECKONING_OFFSET_NORMAL, {0, 0} }, - { VEHICLE_DID_DR_SPEED_PULSE_SCALE_FACTOR, DEADRECKONING_OFFSET_NORMAL, {0, 0} }, - { VEHICLE_DID_DR_SPEED_PULSE_SCALE_FACTOR_LEVEL, DEADRECKONING_OFFSET_NORMAL, {0, 0} }, - { 0, 0, {0, 0} } /* Termination code */ -}; - -/******************************************************************************* -* MODULE : DeadReckoningMemcmp -* ABSTRACT : Functions for Common Processing Memory Block Comparisons -* FUNCTION : Memory block comparison processing -* ARGUMENT : *vp_data1 : Comparison target address 1 -* : *vp_data2 : Comparison target address 2 -* : uc_size : Comparison Size -* NOTE : -* RETURN : DEADRECKONING_EQ : No data change -* : DEADRECKONING_NEQ : Data change -******************************************************************************/ -u_int8 DeadReckoningMemcmp(const void *vp_data1, const void *vp_data2, size_t uc_size) { // LCOV_EXCL_START 8: dead code. // NOLINT(whitespace/line_length) - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - u_int8 l_ret = DEADRECKONING_EQ; - const u_int8 *p_data1 = (const u_int8 *)vp_data1; - const u_int8 *p_data2 = (const u_int8 *)vp_data1; - - /* Loop by data size */ - while (uc_size > 0) { - if (*p_data1 != *p_data2) { - /* Data mismatch */ - l_ret = DEADRECKONING_NEQ; - break; - } - p_data1++; - p_data2++; - uc_size--; - } - return(l_ret); -} - -/******************************************************************************* -* MODULE : DeadReckoningCheckDid -* ABSTRACT : Common Processing Data ID Check Function -* FUNCTION : Check if the specified DID corresponds to the vehicle sensor information -* ARGUMENT : ul_did : Data ID -* NOTE : -* RETURN : DEADRECKONING_INVALID :Disabled -* : DEADRECKONING_EFFECTIVE :Enabled -******************************************************************************/ -int32 DeadReckoningCheckDid(DID ul_did) { - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - int32 i = 0; - int32 l_ret = DEADRECKONING_INVALID; - - while (0 != kGstDidListS[i].ul_did) { - if (kGstDidListS[i].ul_did == ul_did) { - /* DID enabled */ - l_ret = DEADRECKONING_EFFECTIVE; - break; - } - i++; - } - return(l_ret); -} - -/******************************************************************************* -* MODULE : DeadReckoningGetDataMasterOffset -* ABSTRACT : Get function for common processing data master offset value -* FUNCTION : Get the fixed offset value for a given DID -* ARGUMENT : ul_did : Data ID -* NOTE : -* RETURN : Offset value(Returns 0 if DID is invalid) -* : -******************************************************************************/ -u_int16 DeadReckoningGetDataMasterOffset(DID ul_did) { - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - int32 i = 0; /* Generic counters */ - u_int16 us_ret = 0; /* Return value of this function */ - - while (0 != kGstDidListS[i].ul_did) { - if (kGstDidListS[i].ul_did == ul_did) { - /* DID enabled */ - us_ret = kGstDidListS[i].us_offset; - break; - } - i++; - } - return(us_ret); -} -// LCOV_EXCL_STOP diff --git a/vehicleservice/positioning/server/src/Sensor/DeadReckoning_DataMasterMain.cpp b/vehicleservice/positioning/server/src/Sensor/DeadReckoning_DataMasterMain.cpp deleted file mode 100755 index 93adda0..0000000 --- a/vehicleservice/positioning/server/src/Sensor/DeadReckoning_DataMasterMain.cpp +++ /dev/null @@ -1,298 +0,0 @@ -/* - * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/******************************************************************************* - * File name :DeadReckoning_DataMasterMain.cpp - * System name :GPF - * Subsystem name :Vehicle sensor process - * Program name :Vehicle SW Data Master - * Module configuration :DeadReckoningInitDataMaster() Guess Navigation Data Master Initialization Function - * :DeadReckoningSetDataMaster() Estimated Navigational Data Master SW Data Set Processing - * :DeadReckoningGetDataMaster() Estimated Navigational Data Master Get Processing - ******************************************************************************/ - -#include <vehicle_service/positioning_base_library.h> -#include "DeadReckoning_DataMaster.h" - -/*************************************************/ -/* Global variable */ -/*************************************************/ - -#define DR_DEBUG 0 - -/******************************************************************************* -* MODULE : DeadReckoningInitDataMaster -* ABSTRACT : Initialization of Guess Navigation Data Master -* FUNCTION : Initialize the estimated navigation data master -* ARGUMENT : void -* NOTE : -* RETURN : void -******************************************************************************/ -void DeadReckoningInitDataMaster(void) { // LCOV_EXCL_START 8: dead code. - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - /* Vehicle sensor data master initialization */ - DeadReckoningInitLongitudeDr(); - DeadReckoningInitLatitudeDr(); - DeadReckoningInitAltitudeDr(); - DeadReckoningInitSpeedDr(); - DeadReckoningInitHeadingDr(); - DeadReckoningInitSnsCounterDr(); - DeadReckoningInitGyroOffsetDr(); - DeadReckoningInitGyroScaleFactorDr(); - DeadReckoningInitGyroScaleFactorLevelDr(); - DeadReckoningInitSpeedPulseScaleFactorDr(); - DeadReckoningInitSpeedPulseScaleFactorLevelDr(); -} - -/******************************************************************************* -* MODULE : DeadReckoning_SetDataMaster_Sub -* ABSTRACT : Estimated Navigational Data Master SW Data Set Processing -* FUNCTION : Set estimated navigation data -* ARGUMENT : *p_data : SW vehicle signal notification data -* : p_datamaster_set_n : Data Master Set Notification(Callback function) -* NOTE : -* RETURN : void -******************************************************************************/ -void DeadReckoningSetDataMaster(const DEADRECKONING_DATA_MASTER *p_data, - PFUNC_DR_DMASTER_SET_N p_datamaster_set_n) { - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - u_int8 chg_type; - - static u_int8 gyro_parameter_chg_type = 0; - static u_int8 speedpulse_parameter_chg_type = 0; - - /*------------------------------------------------------*/ - /* Call the data set processing associated with the DID */ - /* Call the data master set notification process */ - /*------------------------------------------------------*/ - switch (p_data->ul_did) { - case VEHICLE_DID_DR_LONGITUDE: - { -#if (DR_DEBUG == 1) /* PastModel002_DR_VEHICLE */ - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "DeadReckoningSetDataMaster DID=[0x%08X] DSIZE=[%d] \r\n", - p_data->ul_did, p_data->us_size); -#endif - chg_type = DeadReckoningSetLongitudeDr(p_data); - /* Implementation of delivery process at LATITUDE updating timings */ - /* Since the order of transmission (updating) at the main receiver is fixed, there is no problem. */ - break; - } - case VEHICLE_DID_DR_LATITUDE: - { -#if (DR_DEBUG == 1) /* PastModel002_DR_VEHICLE */ - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "DeadReckoningSetDataMaster DID=[0x%08X] DSIZE=[%d] \r\n", - p_data->ul_did, p_data->us_size); -#endif - chg_type = DeadReckoningSetLatitudeDr(p_data); - (*p_datamaster_set_n)(p_data->ul_did, chg_type, DEADRECKONING_GETMETHOD_DR); - break; - } - case VEHICLE_DID_DR_ALTITUDE: - { -#if (DR_DEBUG == 1) /* PastModel002_DR_VEHICLE */ - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "DeadReckoningSetDataMaster DID=[0x%08X] DSIZE=[%d] \r\n", - p_data->ul_did, p_data->us_size); -#endif - chg_type = DeadReckoningSetAltitudeDr(p_data); - (*p_datamaster_set_n)(p_data->ul_did, chg_type, DEADRECKONING_GETMETHOD_DR); - break; - } - case VEHICLE_DID_DR_SPEED: - { -#if (DR_DEBUG == 1) /* PastModel002_DR_VEHICLE */ - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "DeadReckoningSetDataMaster DID=[0x%08X] DSIZE=[%d] \r\n", - p_data->ul_did, p_data->us_size); -#endif - chg_type = DeadReckoningSetSpeedDr(p_data); - (*p_datamaster_set_n)(p_data->ul_did, chg_type, DEADRECKONING_GETMETHOD_DR); - break; - } - case VEHICLE_DID_DR_HEADING: - { -#if (DR_DEBUG == 1) /* PastModel002_DR_VEHICLE */ - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "DeadReckoningSetDataMaster DID=[0x%08X] DSIZE=[%d] \r\n", - p_data->ul_did, p_data->us_size); -#endif - chg_type = DeadReckoningSetHeadingDr(p_data); - (*p_datamaster_set_n)(p_data->ul_did, chg_type, DEADRECKONING_GETMETHOD_DR); - break; - } - case VEHICLE_DID_DR_SNS_COUNTER: - { -#if (DR_DEBUG == 1) /* PastModel002_DR_VEHICLE */ - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "DeadReckoningSetDataMaster DID=[0x%08X] DSIZE=[%d] \r\n", - p_data->ul_did, p_data->us_size); -#endif - chg_type = DeadReckoningSetSnsCounterDr(p_data); - (*p_datamaster_set_n)(p_data->ul_did, chg_type, DEADRECKONING_GETMETHOD_DR); - break; - } - case VEHICLE_DID_DR_GYRO_OFFSET: - { -#if (DR_DEBUG == 1) /* PastModel002_DR_VEHICLE */ - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "DeadReckoningSetDataMaster DID=[0x%08X] DSIZE=[%d] \r\n", - p_data->ul_did, p_data->us_size); -#endif - chg_type = DeadReckoningSetGyroOffsetDr(p_data); - /* Distribution processing not performed in this DID */ - /* Delivery processing is executed when VEHICLE_DID_DR_GYRO_SCALE_FACTOR_LEVEL is updated. */ - /* The GyroParameter order is defined by DeadReckoning_RcvMsg(). */ - if (chg_type == DEADRECKONING_NEQ) { - gyro_parameter_chg_type = DEADRECKONING_NEQ; - } - break; - } - case VEHICLE_DID_DR_GYRO_SCALE_FACTOR: - { -#if (DR_DEBUG == 1) /* PastModel002_DR_VEHICLE */ - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "DeadReckoningSetDataMaster DID=[0x%08X] DSIZE=[%d] \r\n", - p_data->ul_did, p_data->us_size); -#endif - chg_type = DeadReckoningSetGyroScaleFactorDr(p_data); - /* Distribution processing not performed in this DID */ - /* Delivery processing is executed when VEHICLE_DID_DR_GYRO_SCALE_FACTOR_LEVEL is updated. */ - /* The GyroParameter order is defined by DeadReckoning_RcvMsg(). */ - if (chg_type == DEADRECKONING_NEQ) { - gyro_parameter_chg_type = DEADRECKONING_NEQ; - } - break; - } - case VEHICLE_DID_DR_GYRO_SCALE_FACTOR_LEVEL: - { -#if (DR_DEBUG == 1) /* PastModel002_DR_VEHICLE */ - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "DeadReckoningSetDataMaster DID=[0x%08X] DSIZE=[%d] \r\n", - p_data->ul_did, p_data->us_size); -#endif - chg_type = DeadReckoningSetGyroScaleFactorLevelDr(p_data); - if (gyro_parameter_chg_type == DEADRECKONING_NEQ) { - chg_type = DEADRECKONING_NEQ; - gyro_parameter_chg_type = DEADRECKONING_EQ; - } - (*p_datamaster_set_n)(p_data->ul_did, chg_type, DEADRECKONING_GETMETHOD_DR); - break; - } - case VEHICLE_DID_DR_SPEED_PULSE_SCALE_FACTOR: - { -#if (DR_DEBUG == 1) /* PastModel002_DR_VEHICLE */ - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "DeadReckoningSetDataMaster DID=[0x%08X] DSIZE=[%d] \r\n", - p_data->ul_did, p_data->us_size); -#endif - chg_type = DeadReckoningSetSpeedPulseScaleFactorDr(p_data); - /* Distribution processing not performed in this DID */ - /* Delivery processing is executed when VEHICLE_DID_DR_SPEED_PULSE_SCALE_FACTOR_LEVEL is updated. */ - /* The SpeedPulseParameter order is defined by DeadReckoning_RcvMsg(). */ - if (chg_type == DEADRECKONING_NEQ) { - speedpulse_parameter_chg_type = DEADRECKONING_NEQ; - } - break; - } - case VEHICLE_DID_DR_SPEED_PULSE_SCALE_FACTOR_LEVEL: - { -#if (DR_DEBUG == 1) /* PastModel002_DR_VEHICLE */ - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "DeadReckoningSetDataMaster DID=[0x%08X] DSIZE=[%d] \r\n", - p_data->ul_did, p_data->us_size); -#endif - chg_type = DeadReckoningSetSpeedPulseScaleFactorLevelDr(p_data); - if (speedpulse_parameter_chg_type == DEADRECKONING_NEQ) { - chg_type = DEADRECKONING_NEQ; - speedpulse_parameter_chg_type = DEADRECKONING_EQ; - } - (*p_datamaster_set_n)(p_data->ul_did, chg_type, DEADRECKONING_GETMETHOD_DR); - break; - } - default: - break; - } -} - -/******************************************************************************* -* MODULE : DeadReckoningGetDataMaster -* ABSTRACT : Estimated Navigational Data Master Get Processing -* FUNCTION : Provide an estimated navigation data master -* ARGUMENT : ul_did : Data ID corresponding to the vehicle information -* : *p_data : Pointer to the data master provider -* NOTE : -* RETURN : void -******************************************************************************/ -void DeadReckoningGetDataMaster(DID ul_did, DEADRECKONING_DATA_MASTER *p_data) { - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - /*------------------------------------------------------*/ - /* Call the data Get processing associated with the DID */ - /*------------------------------------------------------*/ - switch (ul_did) { - /*------------------------------------------------------*/ - /* Vehicle sensor data group */ - /*------------------------------------------------------*/ - case VEHICLE_DID_DR_LONGITUDE: - { - DeadReckoningGetLongitudeDr(p_data); - break; - } - case VEHICLE_DID_DR_LATITUDE: - { - DeadReckoningGetLatitudeDr(p_data); - break; - } - case VEHICLE_DID_DR_ALTITUDE: - { - DeadReckoningGetAltitudeDr(p_data); - break; - } - case VEHICLE_DID_DR_SPEED: - { - DeadReckoningGetSpeedDr(p_data); - break; - } - case VEHICLE_DID_DR_HEADING: - { - DeadReckoningGetHeadingDr(p_data); - break; - } - case VEHICLE_DID_DR_SNS_COUNTER: - { - DeadReckoningGetSnsCounterDr(p_data); - break; - } - case VEHICLE_DID_DR_GYRO_OFFSET: - { - DeadReckoningGetGyroOffsetDr(p_data); - break; - } - case VEHICLE_DID_DR_GYRO_SCALE_FACTOR: - { - DeadReckoningGetGyroScaleFactorDr(p_data); - break; - } - case VEHICLE_DID_DR_GYRO_SCALE_FACTOR_LEVEL: - { - DeadReckoningGetGyroScaleFactorLevelDr(p_data); - break; - } - case VEHICLE_DID_DR_SPEED_PULSE_SCALE_FACTOR: - { - DeadReckoningGetSpeedPulseScaleFactorDr(p_data); - break; - } - case VEHICLE_DID_DR_SPEED_PULSE_SCALE_FACTOR_LEVEL: - { - DeadReckoningGetSpeedPulseScaleFactorLevelDr(p_data); - break; - } - default: - break; - } -} -// LCOV_EXCL_STOP diff --git a/vehicleservice/positioning/server/src/Sensor/DeadReckoning_DeliveryCtrl.cpp b/vehicleservice/positioning/server/src/Sensor/DeadReckoning_DeliveryCtrl.cpp deleted file mode 100755 index 0a08f5f..0000000 --- a/vehicleservice/positioning/server/src/Sensor/DeadReckoning_DeliveryCtrl.cpp +++ /dev/null @@ -1,835 +0,0 @@ -/* - * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/******************************************************************************* - * File name :DeadReckoning_DeliveryCtrl.cpp - * System name :GPF - * Subsystem name :Vehicle sensor process - * Program name :Vehicle Sensor Destination Management( - * Module configuration DeadReckoningInitDeliveryCtrlTbl() Vehicle sensor delivery destination management table initialization function - * DeadReckoningInitDeliveryCtrlTblMng() Vehicle sensor delivery destination management table management area initialization function - * DeadReckoningEntryDeliveryCtrl() Vehicle sensor delivery destination management registration function - * :DeadReckoningAddDeliveryCtrlTbl() Vehicle sensor delivery destination management table addition function - * :DeadReckoningUpdateDeliveryCtrlTbl() Vehicle sensor delivery destination management table update function - * :DeadReckoning_DeliveryEntry_Delete() Vehicle sensor delivery destination management table deletion function - * :DeadReckoningAddDeliveryCtrlTblMng() Vehicle sensor delivery destination management table management addition function - * :DeadReckoningUpdateDeliveryCtrlTblMng() Vehicle sensor delivery destination management table management update function - * :DeadReckoning_DeleteDeliveryCtrlTblMng_Touch() Vehicle sensor delivery destination management table management deletion (touch panel) function - * DeadReckoningMakeDeliveryPnoTbl() Vehicle Sensor Destination PNO Table Creation Function - * :DeadReckoningAddPnoTbl() Vehicle Sensor Destination PNO Table Addition Function - * :DeadReckoningDeliveryProc() Vehicle Sensor Data Delivery Process - ******************************************************************************/ - -#include <vehicle_service/positioning_base_library.h> -#include "DeadReckoning_DeliveryCtrl.h" -#include "Vehicle_API.h" -#include "Vehicle_API_Dummy.h" -#include "Dead_Reckoning_Local_Api.h" - -/*************************************************/ -/* Global variable */ -/*************************************************/ -static DEADRECKONING_DELIVERY_CTRL_TBL g_delivery_dr_ctrltbl; -static DEADRECKONING_DELIVERY_CTRL_TBL_MNG g_delivery_dr_ctrltbl_mng; -static DEADRECKONING_DELIVERY_PNO_TBL g_delivery_dr_pnotbl; - -/* Stored data count */ -int32 g_delivery_dr_ctrl_num = 0; - -/* PastModel002 support DR */ -/******************************************************************************* -* MODULE : DeadReckoningInitDeliveryCtrlTbl -* ABSTRACT : Vehicle sensor delivery destination management table initialization function -* FUNCTION : Delivery destination management table initialization processing -* ARGUMENT : void -* NOTE : -* RETURN : void -******************************************************************************/ -void DeadReckoningInitDeliveryCtrlTbl(void) { // LCOV_EXCL_START 8: dead code. - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - memset(&g_delivery_dr_ctrltbl, 0x00, sizeof(DEADRECKONING_DELIVERY_CTRL_TBL)); -} - -/******************************************************************************* -* MODULE : DeadReckoningInitDeliveryCtrlTblMng -* ABSTRACT : Vehicle sensor delivery destination management table management area initialization function -* FUNCTION : Delivery destination management table management area initialization processing -* ARGUMENT : void -* NOTE : -* RETURN : void -******************************************************************************/ -void DeadReckoningInitDeliveryCtrlTblMng(void) { - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - memset(&g_delivery_dr_ctrltbl_mng, 0x00, sizeof(DEADRECKONING_DELIVERY_CTRL_TBL_MNG)); -} - -/******************************************************************************* -* MODULE : DeadReckoningEntryDeliveryCtrl -* ABSTRACT : Vehicle sensor delivery destination management registration function -* FUNCTION : Shipping management table,Update the shipping management table management. -* ARGUMENT : p_st_delivery_entry : Pointer to the delivery registration information -* NOTE : -* RETURN : VEHICLE_RET_NORMAL :Successful registration -******************************************************************************/ -DEAD_RECKONING_RET_API DeadReckoningEntryDeliveryCtrl(const DEADRECKONING_MSG_DELIVERY_ENTRY *p_st_delivery_entry) { - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - int32 i; - u_int8 uc_action_type = DEADRECKONING_ACTION_TYPE_ADD; - int32 uc_did_flag; - DID ul_entry_did = p_st_delivery_entry->data.did; - DEADRECKONING_DELIVERY_CTRL_TBL_MNG_DATA *p_st_existing_mng_data = NULL; - /* _CWORD71_:QAC++4020:Multiple exit points found. MISRA-C++ Rule 6-6-5 */ - DEAD_RECKONING_RET_API ret = DEAD_RECKONING_RET_NORMAL; - - /* Check if the data ID exists. */ - uc_did_flag = DeadReckoningCheckDid(ul_entry_did); - if (uc_did_flag == 0) { - ret = DEADRECKONING_RET_ERROR_DID; /* _CWORD71_:QAC++4020:Multiple exit points found. MISRA-C++ Rule 6-6-5 */ - } - - /* Check the number of registered shipments. */ - if ((ret == DEAD_RECKONING_RET_NORMAL) &&/* _CWORD71_:QAC++4020:Multiple exit points found. MISRA-C++ Rule 6-6-5 */ - (g_delivery_dr_ctrltbl.us_num >= DEADRECKONING_DELIVERY_INFO_MAX)) { - /* Return the FULL of delivery registrations*/ - ret = DEADRECKONING_RET_ERROR_BUFFULL; /* _CWORD71_:QAC++4020:Multiple exit points found. MISRA-C++ Rule 6-6-5 */ - } - /* _CWORD71_:QAC++4020:Multiple exit points found. MISRA-C++ Rule 6-6-5 */ - if (ret == DEAD_RECKONING_RET_NORMAL) { - /* By searching for the delivery registration of the relevant DID,Hold the address. */ - for (i = 0; i < g_delivery_dr_ctrltbl_mng.us_num; i++) { - if (g_delivery_dr_ctrltbl_mng.st_ctrl_tbl_mng_data[i].ul_did == ul_entry_did) { - uc_action_type = DEADRECKONING_ACTION_TYPE_UPDATE; - p_st_existing_mng_data = &g_delivery_dr_ctrltbl_mng.st_ctrl_tbl_mng_data[i]; - } - } - - /* Add to the shipping management table.*/ - DeadReckoningAddDeliveryCtrlTbl(p_st_delivery_entry); - - /* Processing when updating existing data*/ - if (uc_action_type == DEADRECKONING_ACTION_TYPE_UPDATE) { - /* Update the shipping management table.*/ - DeadReckoningUpdateDeliveryCtrlTbl(p_st_existing_mng_data); - - /* Update the shipping destination management table management information.*/ - DeadReckoningUpdateDeliveryCtrlTblMng(p_st_existing_mng_data); - } else { /* Newly added processing*/ - /* Add to the shipping management table management information.*/ - DeadReckoningAddDeliveryCtrlTblMng(p_st_delivery_entry); - } - } - return ret; /* _CWORD71_:QAC++4020:Multiple exit points found. MISRA-C++ Rule 6-6-5 */ -} - -/******************************************************************************* -* MODULE : DeadReckoningAddDeliveryCtrlTbl -* ABSTRACT : Vehicle sensor delivery destination management table addition function -* FUNCTION : Add to the shipping management table. -* ARGUMENT : *p_st_delivery_entry : Pointer to the delivery registration information -* NOTE : -* RETURN : void -******************************************************************************/ -void DeadReckoningAddDeliveryCtrlTbl(const DEADRECKONING_MSG_DELIVERY_ENTRY *p_st_delivery_entry) { - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - DEADRECKONING_DELIVERY_CTRL_TBL_DATA *p_st_ctrl_data; - - p_st_ctrl_data = &g_delivery_dr_ctrltbl.st_ctrl_data[g_delivery_dr_ctrltbl.us_num]; - p_st_ctrl_data->ul_did = p_st_delivery_entry->data.did; - p_st_ctrl_data->us_pno = p_st_delivery_entry->data.pno; - p_st_ctrl_data->uc_chg_type = p_st_delivery_entry->data.delivery_timing; - p_st_ctrl_data->uc_ctrl_flg = p_st_delivery_entry->data.ctrl_flg; - p_st_ctrl_data->us_link_idx = DEADRECKONING_LINK_INDEX_END; - p_st_ctrl_data->uc_method = DEADRECKONING_DELIVERY_METHOD_NORMAL; - - g_delivery_dr_ctrltbl.us_num = static_cast<u_int16>(g_delivery_dr_ctrltbl.us_num + 1); -} - -/******************************************************************************* -* MODULE : DeadReckoningUpdateDeliveryCtrlTbl -* ABSTRACT : Vehicle sensor delivery destination management table update function -* FUNCTION : Update the shipping management table. -* ARGUMENT : *p_st_existing_mng_data : Pointer to the previous data information with the same data ID -* NOTE : -* RETURN : void -******************************************************************************/ -void DeadReckoningUpdateDeliveryCtrlTbl(DEADRECKONING_DELIVERY_CTRL_TBL_MNG_DATA *p_st_existing_mng_data) { - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - /* Update Link Index Only. - For the index of the value of us_end_idx that matches the data ID of the distribution target management table management information - Make us_link_idx a registered index */ - g_delivery_dr_ctrltbl.st_ctrl_data[p_st_existing_mng_data->us_end_idx].us_link_idx = - static_cast<u_int16>(g_delivery_dr_ctrltbl.us_num - 1); -} - -/******************************************************************************* -* MODULE : DeadReckoningAddDeliveryCtrlTblMng -* ABSTRACT : Vehicle sensor delivery destination management table management addition function -* FUNCTION : Add to the shipping management table management. -* ARGUMENT : *p_st_delivery_entry : Pointer to the delivery registration information -* NOTE : -* RETURN : void -******************************************************************************/ -void DeadReckoningAddDeliveryCtrlTblMng(const DEADRECKONING_MSG_DELIVERY_ENTRY *p_st_delivery_entry) { - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - DEADRECKONING_DELIVERY_CTRL_TBL_MNG_DATA *p_st_ctr_mng_data; - - p_st_ctr_mng_data = &g_delivery_dr_ctrltbl_mng.st_ctrl_tbl_mng_data[g_delivery_dr_ctrltbl_mng.us_num]; - p_st_ctr_mng_data->ul_did = p_st_delivery_entry->data.did; - p_st_ctr_mng_data->us_start_idx = static_cast<u_int16>(g_delivery_dr_ctrltbl.us_num - 1); - p_st_ctr_mng_data->us_end_idx = static_cast<u_int16>(g_delivery_dr_ctrltbl.us_num - 1); - p_st_ctr_mng_data->us_dlvry_entry_num++; - g_delivery_dr_ctrltbl_mng.us_num++; - g_delivery_dr_ctrl_num++; -} - -/******************************************************************************* -* MODULE : DeadReckoningUpdateDeliveryCtrlTblMng -* ABSTRACT : Vehicle sensor delivery destination management table management update function -* FUNCTION : Update the shipping management table management. -* ARGUMENT : *p_st_existing_mng_data : Pointer to the previous data information with the same data ID -* NOTE : -* RETURN : void -******************************************************************************/ -void DeadReckoningUpdateDeliveryCtrlTblMng(DEADRECKONING_DELIVERY_CTRL_TBL_MNG_DATA *p_st_existing_mng_data) { - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - /* Update only the end index and the number of registered shipping destinations. */ - p_st_existing_mng_data->us_end_idx = static_cast<u_int16>(g_delivery_dr_ctrltbl.us_num - 1); - p_st_existing_mng_data->us_dlvry_entry_num++; -} - -/******************************************************************************* -* MODULE : DeadReckoningMakeDeliveryPnoTbl -* ABSTRACT : Vehicle sensor delivery destination PNO table creation function -* FUNCTION : Create the shipping destination PNO table -* ARGUMENT : ul_did Data ID -* Change_type Delivery Trigger -* NOTE : -* RETURN : DEADRECKONING_DELIVERY_PNO_TBL* Pointer to the shipping PNO table -******************************************************************************/ -DEADRECKONING_DELIVERY_PNO_TBL* DeadReckoningMakeDeliveryPnoTbl(DID ul_did, u_int8 change_type) { - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - int32 i; - u_int16 us_index = 0; - u_int16 us_num = 0; - - /* Get the start index and count of the corresponding data ID. */ - for (i = 0; i < g_delivery_dr_ctrl_num; i++) { - /* Stores the information of the corresponding DID.. */ - if (g_delivery_dr_ctrltbl_mng.st_ctrl_tbl_mng_data[i].ul_did == ul_did) { - us_index = g_delivery_dr_ctrltbl_mng.st_ctrl_tbl_mng_data[i].us_start_idx; - us_num = g_delivery_dr_ctrltbl_mng.st_ctrl_tbl_mng_data[i].us_dlvry_entry_num; - break; - } - } - - /* Create a PNO list */ - g_delivery_dr_pnotbl.us_num = 0; - if (change_type == DEADRECKONING_CHGTYPE_CHG) { - /* Processing when delivery timing is changed*/ - for (i = 0; i < us_num; i++) { - /* Functionalization by Increasing Structure Members */ - DeadReckoningAddPnoTbl(us_index); - - us_index = g_delivery_dr_ctrltbl.st_ctrl_data[us_index].us_link_idx; - } - } else { - /* Processing when delivery timing is update */ - for (i = 0; i < us_num; i++) { - if (DEADRECKONING_DELIVERY_TIMING_UPDATE == g_delivery_dr_ctrltbl.st_ctrl_data[us_index].uc_chg_type) { - /* Functionalization by Increasing Structure Members */ - DeadReckoningAddPnoTbl(us_index); - } - us_index = g_delivery_dr_ctrltbl.st_ctrl_data[us_index].us_link_idx; - } - } - return (&g_delivery_dr_pnotbl); -} - -/******************************************************************************* -* MODULE : DeadReckoningAddPnoTbl -* ABSTRACT : Vehicle Sensor Destination PNO Table Addition Function -* FUNCTION : Add to the shipping PNO table. -* ARGUMENT : us_index : Index of the referenced destination management table -* NOTE : -* RETURN : void -******************************************************************************/ -void DeadReckoningAddPnoTbl(u_int16 us_index) { - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - u_int16 us_pno_tbl_idx; - - us_pno_tbl_idx = g_delivery_dr_pnotbl.us_num; - g_delivery_dr_pnotbl.st_pno_data[us_pno_tbl_idx].us_pno = g_delivery_dr_ctrltbl.st_ctrl_data[us_index].us_pno; - /* Save the relevant INDEX in the delivery control table */ - g_delivery_dr_pnotbl.st_pno_data[us_pno_tbl_idx].us_index = us_index; - g_delivery_dr_pnotbl.st_pno_data[us_pno_tbl_idx].uc_method = - g_delivery_dr_ctrltbl.st_ctrl_data[us_index].uc_method; - g_delivery_dr_pnotbl.us_num++; -} - -/******************************************************************************* -* MODULE : DeadReckoningDeliveryProc -* ABSTRACT : Vehicle Sensor Data Delivery Process -* FUNCTION : Deliver data to a destination. -* ARGUMENT : ul_did :Data ID -* uc_chg_type :Delivery timing -* uc_get_method :Acquisition method -* NOTE : -* RETURN : void -******************************************************************************/ -void DeadReckoningDeliveryProc(DID ul_did, u_int8 uc_chg_type, u_int8 uc_get_method) { - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - int32 i; /* Generic counters */ - DEADRECKONING_DATA_MASTER st_master; /* Data master of normal data */ - - - /* Defines the data master for each API. */ - SENSORLOCATION_MSG_LONLATINFO_DAT st_msg_lonlat_info; - SENSORLOCATION_MSG_ALTITUDEINFO_DAT st_msg_altitude_info; - SENSORMOTION_MSG_SPEEDINFO_DAT st_msg_speed_info; - SENSORMOTION_MSG_HEADINGINFO_DAT st_msg_heading_info; - - - const DEADRECKONING_DELIVERY_PNO_TBL *p_st_pno_tbl; /* Vehicle Sensor Destination PNO Table Pointer */ - - /* Initialization */ - st_msg_lonlat_info.reserve[0] = 0; - st_msg_lonlat_info.reserve[1] = 0; - st_msg_lonlat_info.reserve[2] = 0; - st_msg_altitude_info.reserve[0] = 0; - st_msg_altitude_info.reserve[1] = 0; - st_msg_altitude_info.reserve[2] = 0; - st_msg_speed_info.reserve = 0; - st_msg_heading_info.reserve = 0; - - /* Obtain the shipping destination PNO */ - p_st_pno_tbl = - reinterpret_cast<DEADRECKONING_DELIVERY_PNO_TBL*>(DeadReckoningMakeDeliveryPnoTbl(ul_did, uc_chg_type)); - - if ((p_st_pno_tbl->us_num) > 0) { - /* When there is a shipping destination PNO registration */ - /* Vehicle sensor information notification transmission process */ - for (i = 0; i < (p_st_pno_tbl->us_num); i++) { - /* Acquire the applicable data information from the data master..*/ - DeadReckoningGetDataMaster(ul_did, &st_master); - - /* Align data from the data master for API I/F */ - switch (ul_did) { - /* Describes the process for each DID. */ - case VEHICLE_DID_DR_LATITUDE: - { - /* Size storage(LONLAT) */ - st_msg_lonlat_info.size = (u_int16)sizeof(SENSORLOCATION_MSG_LONLATINFO_DAT); - - /* DR status setting */ - st_msg_lonlat_info.dr_status = st_master.dr_status; - - /* The DR enable flag is set to enabled. */ - st_msg_lonlat_info.is_exist_dr = SENSORLOCATION_EXISTDR_DR; - - /* Set the Latitude */ - (void)memcpy(reinterpret_cast<void *>(&(st_msg_lonlat_info.latitude)), - (const void *)(&(st_master.uc_data[0])), (size_t)(st_master.us_size)); - - /* Obtain the data master Longitude */ - DeadReckoningGetDataMaster(VEHICLE_DID_DR_LONGITUDE, &st_master); - - /* Set the Longitude */ - (void)memcpy(reinterpret_cast<void *>(&(st_msg_lonlat_info.longitude)), - (const void *)(&(st_master.uc_data[0])), (size_t)(st_master.us_size)); - - /* Acquire data master SensorCnt */ - DeadReckoningGetDataMaster(VEHICLE_DID_DR_SNS_COUNTER, &st_master); - - /* Set the SensorCnt */ - (void)memcpy(reinterpret_cast<void *>(&(st_msg_lonlat_info.sensor_cnt)), - (const void *)(&( st_master.uc_data[0])), (size_t)(st_master.us_size)); - - (void)DRManagerSndMsg(PNO_VEHICLE_SENSOR, - p_st_pno_tbl->st_pno_data[i].us_pno, - CID_VEHICLE_SENSORLOCATION_LONLAT, - sizeof(SENSORLOCATION_MSG_LONLATINFO_DAT), - (const void *)&st_msg_lonlat_info); - break; - } - case VEHICLE_DID_DR_ALTITUDE: - { - /* Size storage(ALTITUDE) */ - st_msg_altitude_info.size = (u_int16)sizeof(SENSORLOCATION_MSG_ALTITUDEINFO_DAT); - - /* The DR enable flag is set to enabled. */ - st_msg_altitude_info.is_exist_dr = SENSORLOCATION_EXISTDR_DR; - - /* DR status setting */ - st_msg_altitude_info.dr_status = st_master.dr_status; - - - /* Set the Altitude */ - (void)memcpy(reinterpret_cast<void *>(&(st_msg_altitude_info.altitude)), - (const void *)(&(st_master.uc_data[0])), (size_t)(st_master.us_size)); - - /* Acquire data master SensorCnt */ - DeadReckoningGetDataMaster(VEHICLE_DID_DR_SNS_COUNTER, &st_master); - - /* Set the SensorCnt */ - (void)memcpy(reinterpret_cast<void *>(&(st_msg_altitude_info.sensor_cnt)), - (const void *)(&(st_master.uc_data[0])), (size_t)(st_master.us_size)); - - (void)DRManagerSndMsg(PNO_VEHICLE_SENSOR, - p_st_pno_tbl->st_pno_data[i].us_pno, - CID_VEHICLE_SENSORLOCATION_ALTITUDE, - sizeof(SENSORLOCATION_MSG_ALTITUDEINFO_DAT), - (const void *)&st_msg_altitude_info); - - break; - } - case VEHICLE_DID_DR_SPEED: - { - /* Size storage(SPEED) */ - st_msg_speed_info.size = (u_int16)sizeof(SENSORMOTION_MSG_SPEEDINFO_DAT); - - /* The DR enable flag is set to enabled. */ - st_msg_speed_info.is_exist_dr = SENSORMOTION_EXISTDR_DR; - - /* DR status setting */ - st_msg_speed_info.dr_status = st_master.dr_status; - - - /* Set the Speed */ - (void)memcpy(reinterpret_cast<void *>(&(st_msg_speed_info.speed)), - (const void *)(&(st_master.uc_data[0])), (size_t)(st_master.us_size)); - - /* Acquire data master SensorCnt */ - DeadReckoningGetDataMaster(VEHICLE_DID_DR_SNS_COUNTER, &st_master); - /* Set the SensorCnt */ - (void)memcpy(reinterpret_cast<void *>(&(st_msg_speed_info.sensor_cnt)), - (const void *)(&(st_master.uc_data[0])), (size_t)(st_master.us_size)); - - (void)DRManagerSndMsg(PNO_VEHICLE_SENSOR, - p_st_pno_tbl->st_pno_data[i].us_pno, - CID_VEHICLE_SENSORMOTION_SPEED, - sizeof(SENSORMOTION_MSG_SPEEDINFO_DAT), - (const void *)&st_msg_speed_info); - break; - } - case VEHICLE_DID_DR_HEADING: - { - /* Size storage(HEADING) */ - st_msg_heading_info.size = (u_int16)sizeof(SENSORMOTION_MSG_HEADINGINFO_DAT); - - /* The DR enable flag is set to enabled. */ - st_msg_heading_info.is_exist_dr = SENSORMOTION_EXISTDR_DR; - - /* DR status setting */ - st_msg_heading_info.dr_status = st_master.dr_status; - - /* Set the Heading */ - (void)memcpy(reinterpret_cast<void *>(&(st_msg_heading_info.heading)), - (const void *)(&(st_master.uc_data[0])), (size_t)(st_master.us_size)); - - /* Acquire data master SensorCnt */ - DeadReckoningGetDataMaster(VEHICLE_DID_DR_SNS_COUNTER, &st_master); - /* Set the SensorCnt */ - (void)memcpy(reinterpret_cast<void *>(&(st_msg_heading_info.sensor_cnt)), - (const void *)(&(st_master.uc_data[0])), (size_t)(st_master.us_size)); - - (void)DRManagerSndMsg(PNO_VEHICLE_SENSOR, - p_st_pno_tbl->st_pno_data[i].us_pno, - CID_VEHICLE_SENSORMOTION_HEADING, - sizeof(SENSORMOTION_MSG_HEADINGINFO_DAT), - (const void *)&st_msg_heading_info); - break; - } - case VEHICLE_DID_DR_GYRO_SCALE_FACTOR_LEVEL: - { - SENSORMOTION_MSG_GYROPARAMETERINFO_DAT stMsgGyroParameterInfo; - /* Initialization */ - stMsgGyroParameterInfo.reserve[0] = 0; - stMsgGyroParameterInfo.reserve[1] = 0; - - /* GyroOffset/GyroScaleFactor/GyroScaleFactorLevel data master */ - /* setup must be completed before data delivery of this DID */ - /* The order of processing is defined by DeadReckoning_RcvMsg().,Be careful when changing */ - - /* Size storage(GYROPARAMETER) */ - stMsgGyroParameterInfo.size = (u_int16)sizeof(stMsgGyroParameterInfo); - - /* GyroOffset acuisition/setting */ - DeadReckoningGetDataMaster(VEHICLE_DID_DR_GYRO_OFFSET, &st_master); - - (void)memcpy(reinterpret_cast<void *>(&(stMsgGyroParameterInfo.gyro_offset)), - reinterpret_cast<void *>(&(st_master.uc_data[0])), - sizeof(stMsgGyroParameterInfo.gyro_offset)); - - /* GyroScaleFactor acuisition/setting */ - DeadReckoningGetDataMaster(VEHICLE_DID_DR_GYRO_SCALE_FACTOR, &st_master); - - (void)memcpy(reinterpret_cast<void *>(&(stMsgGyroParameterInfo.gyro_scale_factor)), - reinterpret_cast<void *>(&(st_master.uc_data[0])), - sizeof(stMsgGyroParameterInfo.gyro_scale_factor)); - - /* GyroScaleFactorLevel acuisition/setting */ - DeadReckoningGetDataMaster(VEHICLE_DID_DR_GYRO_SCALE_FACTOR_LEVEL, &st_master); - - (void)memcpy(reinterpret_cast<void *>(&(stMsgGyroParameterInfo.gyro_scale_factor_level)), - reinterpret_cast<void *>(&(st_master.uc_data[0])), - sizeof(stMsgGyroParameterInfo.gyro_scale_factor_level)); - - /* Data transmission */ - (void)DRManagerSndMsg(PNO_VEHICLE_SENSOR, - p_st_pno_tbl->st_pno_data[i].us_pno, - CID_VEHICLE_SENSORMOTION_GYROPARAMETER, - sizeof(stMsgGyroParameterInfo), - (const void *)&stMsgGyroParameterInfo); - } - break; - case VEHICLE_DID_DR_SPEED_PULSE_SCALE_FACTOR_LEVEL: - { - SENSORMOTION_MSG_SPEEDPULSEPARAMETERINFO_DAT stMsgSpeedPulseParameterInfo; - - /* Initialization */ - stMsgSpeedPulseParameterInfo.reserve[0] = 0; - stMsgSpeedPulseParameterInfo.reserve[1] = 0; - stMsgSpeedPulseParameterInfo.reserve[2] = 0; - - /* GyroOffset/GyroScaleFactor/GyroScaleFactorLevel data master */ - /* setup must be completed before data delivery of this DID */ - /* The order of processing is defined by DeadReckoning_RcvMsg().,Be careful when changing */ - - /* Size storage(SPEEDPULSEPARAMETER) */ - stMsgSpeedPulseParameterInfo.size = (u_int16)sizeof(stMsgSpeedPulseParameterInfo); - - /* SpeedPulseScaleFactor acuisition/setting */ - DeadReckoningGetDataMaster(VEHICLE_DID_DR_SPEED_PULSE_SCALE_FACTOR, &st_master); - - (void)memcpy(reinterpret_cast<void *>(&(stMsgSpeedPulseParameterInfo.speed_pulse_scale_factor)), - reinterpret_cast<void *>(&(st_master.uc_data[0])), - sizeof(stMsgSpeedPulseParameterInfo.speed_pulse_scale_factor)); - - /* SpeedPulseScaleFactorLevel acuisition/setting */ - DeadReckoningGetDataMaster(VEHICLE_DID_DR_SPEED_PULSE_SCALE_FACTOR_LEVEL, &st_master); - - (void)memcpy(reinterpret_cast<void *>(&(stMsgSpeedPulseParameterInfo.speed_pulse_scale_factor_level)), - reinterpret_cast<void *>(&(st_master.uc_data[0])), - sizeof(stMsgSpeedPulseParameterInfo.speed_pulse_scale_factor_level)); - - /* Data transmission */ - (void)DRManagerSndMsg(PNO_VEHICLE_SENSOR, - p_st_pno_tbl->st_pno_data[i].us_pno, - CID_VEHICLE_SENSORMOTION_SPEEDPULSEPARAMETER, - sizeof(stMsgSpeedPulseParameterInfo), - (const void *)&stMsgSpeedPulseParameterInfo); - } - break; - /* Other than the above */ - default: - /* Do not edit. */ - break; - } - } - } -} - -/******************************************************************************* - * MODULE : DRManagerSndMsg - * ABSTRACT : Message transmission processing - * FUNCTION : Send a message to the specified PNO - * ARGUMENT : us_pno_src : Source PNO - * : us_pno_dest : Destination PNO - * : us_cid : Command ID - * : us_msg_len : Message data body length - * : *p_msg_data : Pointer to message data - * NOTE : - * RETURN : RET_NORMAL : Normal completion - * : RET_ERRNOTRDY : Destination process is not wakeup - * : RET_ERRMSGFULL : Message queue overflows - * : RET_ERRPARAM : Buffer size error - ******************************************************************************/ -RET_API DRManagerSndMsg(PNO us_pno_src, PNO us_pno_dest, CID us_cid, u_int16 us_msg_len, const void *p_msg_data) { - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - DEADRECKONING_MSG_BUF st_msg_buf; /* message buffer */ - T_APIMSG_MSGBUF_HEADER *p_st_msg_hdr; /* Pointer to the message header */ - RET_API l_ret_api; /* Return value */ - - /* Message buffer initialization */ - memset(reinterpret_cast<void *>(&st_msg_buf), 0, sizeof(DEADRECKONING_MSG_BUF)); - - /* Get pointer to send buffer */ - p_st_msg_hdr = reinterpret_cast<T_APIMSG_MSGBUF_HEADER *>(reinterpret_cast<void *>(&st_msg_buf)); - - /*--------------------------------------------------------------* - * Create message headers * - *--------------------------------------------------------------*/ - p_st_msg_hdr->hdr.sndpno = us_pno_src; /* Source PNO */ - p_st_msg_hdr->hdr.cid = us_cid; /* Command ID */ - p_st_msg_hdr->hdr.msgbodysize = us_msg_len; /* Message data body length */ - - /*--------------------------------------------------------------* - * Create message data * - *--------------------------------------------------------------*/ - if ((0 != p_msg_data) && (0 != us_msg_len)) { - /* Set the message data */ - memcpy(reinterpret_cast<void *>(st_msg_buf.data), p_msg_data, (size_t)us_msg_len); - } - /*--------------------------------------------------------------* - * Send messages * - *--------------------------------------------------------------*/ - l_ret_api = _pb_SndMsg(us_pno_dest, - (u_int16)(sizeof(T_APIMSG_MSGBUF_HEADER) + us_msg_len), - reinterpret_cast<void *>(&st_msg_buf), - 0); - return (l_ret_api); -} - - -/******************************************************************************* -* MODULE : DeadReckoningFirstDelivery -* ABSTRACT : Vehicle Sensor Initial Data Delivery Process -* FUNCTION : Deliver the initial data to the destination. -* ARGUMENT : us_pno :Addresses for delivery NO -* ul_did :Data ID -* NOTE : -* RETURN : void -******************************************************************************/ -void DeadReckoningFirstDelivery(PNO us_pno, DID ul_did) { - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - DEADRECKONING_DATA_MASTER st_master; /* Data master of normal data */ - - /* Defines the data master for each API. */ - SENSORLOCATION_MSG_LONLATINFO_DAT st_msg_lonlat_info; - SENSORLOCATION_MSG_ALTITUDEINFO_DAT st_msg_altitude_info; - SENSORMOTION_MSG_SPEEDINFO_DAT st_msg_speed_info; - SENSORMOTION_MSG_HEADINGINFO_DAT st_msg_heading_info; - - /* Initialization */ - st_msg_lonlat_info.reserve[0] = 0; - st_msg_lonlat_info.reserve[1] = 0; - st_msg_lonlat_info.reserve[2] = 0; - st_msg_altitude_info.reserve[0] = 0; - st_msg_altitude_info.reserve[1] = 0; - st_msg_altitude_info.reserve[2] = 0; - st_msg_speed_info.reserve = 0; - st_msg_heading_info.reserve = 0; - - /* Align data from the data master for API I/F */ - switch (ul_did) { - /* Describes the process for each DID. */ - case VEHICLE_DID_DR_LATITUDE: - { - DeadReckoningGetDataMaster(ul_did, &st_master); - - /* Size storage(LONLAT) */ - st_msg_lonlat_info.size = (u_int16)sizeof(SENSORLOCATION_MSG_LONLATINFO_DAT); - - /* DR status setting */ - st_msg_lonlat_info.dr_status = st_master.dr_status; - - /* The DR enable flag is set to enabled. */ - st_msg_lonlat_info.is_exist_dr = SENSORLOCATION_EXISTDR_DR; - - /* Set the Latitude */ - memcpy(&(st_msg_lonlat_info.latitude), &(st_master.uc_data[0]), st_master.us_size); - - /* Obtain the data master Longitude */ - DeadReckoningGetDataMaster(VEHICLE_DID_DR_LONGITUDE, &st_master); - - /* Set the Longitude */ - memcpy(&(st_msg_lonlat_info.longitude), &(st_master.uc_data[0]), st_master.us_size); - - /* Acquire data master SensorCnt */ - DeadReckoningGetDataMaster(VEHICLE_DID_DR_SNS_COUNTER, &st_master); - - /* Set the SensorCnt */ - memcpy(&(st_msg_lonlat_info.sensor_cnt), &(st_master.uc_data[0]), st_master.us_size); - - (void)DRManagerSndMsg(PNO_VEHICLE_SENSOR, - us_pno, - CID_VEHICLE_SENSORLOCATION_LONLAT, - sizeof(SENSORLOCATION_MSG_LONLATINFO_DAT), - (const void *)&st_msg_lonlat_info); - break; - } - case VEHICLE_DID_DR_ALTITUDE: - { - DeadReckoningGetDataMaster(ul_did, &st_master); - - /* Size storage(ALTITUDE) */ - st_msg_altitude_info.size = (u_int16)sizeof(SENSORLOCATION_MSG_ALTITUDEINFO_DAT); - - /* The DR enable flag is set to enabled. */ - st_msg_altitude_info.is_exist_dr = SENSORLOCATION_EXISTDR_DR; - - /* DR status setting */ - st_msg_altitude_info.dr_status = st_master.dr_status; - - - /* Set the Altitude */ - memcpy(&(st_msg_altitude_info.altitude), &(st_master.uc_data[0]), st_master.us_size); - - /* Acquire data master SensorCnt */ - DeadReckoningGetDataMaster(VEHICLE_DID_DR_SNS_COUNTER, &st_master); - - /* Set the SensorCnt */ - memcpy(&(st_msg_altitude_info.sensor_cnt), &(st_master.uc_data[0]), st_master.us_size); - - (void)DRManagerSndMsg(PNO_VEHICLE_SENSOR, - us_pno, - CID_VEHICLE_SENSORLOCATION_ALTITUDE, - sizeof(SENSORLOCATION_MSG_ALTITUDEINFO_DAT), - (const void *)&st_msg_altitude_info); - - break; - } - case VEHICLE_DID_DR_SPEED: - { - DeadReckoningGetDataMaster(ul_did, &st_master); - - /* Size storage(SPEED) */ - st_msg_speed_info.size = (u_int16)sizeof(SENSORMOTION_MSG_SPEEDINFO_DAT); - - /* The DR enable flag is set to enabled. */ - st_msg_speed_info.is_exist_dr = SENSORMOTION_EXISTDR_DR; - - /* DR status setting */ - st_msg_speed_info.dr_status = st_master.dr_status; - - - /* Set the Speed */ - memcpy(&(st_msg_speed_info.speed), &(st_master.uc_data[0]), st_master.us_size); - - /* Acquire data master SensorCnt */ - DeadReckoningGetDataMaster(VEHICLE_DID_DR_SNS_COUNTER, &st_master); - /* Set the SensorCnt */ - memcpy(&(st_msg_speed_info.sensor_cnt), &(st_master.uc_data[0]), st_master.us_size); - - (void)DRManagerSndMsg(PNO_VEHICLE_SENSOR, - us_pno, - CID_VEHICLE_SENSORMOTION_SPEED, - sizeof(SENSORMOTION_MSG_SPEEDINFO_DAT), - (const void *)&st_msg_speed_info); - break; - } - case VEHICLE_DID_DR_HEADING: - { - DeadReckoningGetDataMaster(ul_did, &st_master); - - /* Size storage(HEADING) */ - st_msg_heading_info.size = (u_int16)sizeof(SENSORMOTION_MSG_HEADINGINFO_DAT); - - /* The DR enable flag is set to enabled. */ - st_msg_heading_info.is_exist_dr = SENSORMOTION_EXISTDR_DR; - - /* DR status setting */ - st_msg_heading_info.dr_status = st_master.dr_status; - - - /* Set the Heading */ - (void)memcpy(reinterpret_cast<void *>(&(st_msg_heading_info.heading)), - (const void *)(&(st_master.uc_data[0])), (size_t)(st_master.us_size)); - - /* Acquire data master SensorCnt */ - DeadReckoningGetDataMaster(VEHICLE_DID_DR_SNS_COUNTER, &st_master); - /* Set the SensorCnt */ - (void)memcpy(reinterpret_cast<void *>(&(st_msg_heading_info.sensor_cnt)), - (const void *)(&(st_master.uc_data[0])), (size_t)(st_master.us_size)); - - (void)DRManagerSndMsg(PNO_VEHICLE_SENSOR, - us_pno, - CID_VEHICLE_SENSORMOTION_HEADING, - sizeof(SENSORMOTION_MSG_HEADINGINFO_DAT), - (const void *)&st_msg_heading_info); - break; - } - case VEHICLE_DID_DR_GYRO_SCALE_FACTOR_LEVEL: - { - SENSORMOTION_MSG_GYROPARAMETERINFO_DAT stMsgGyroParameterInfo; - - /* Initialization */ - stMsgGyroParameterInfo.reserve[0] = 0; - stMsgGyroParameterInfo.reserve[1] = 0; - - /* Size storage(GYROPARAMETER) */ - stMsgGyroParameterInfo.size = (u_int16)sizeof(stMsgGyroParameterInfo); - - /* GyroOffset acuisition/setting */ - DeadReckoningGetDataMaster(VEHICLE_DID_DR_GYRO_OFFSET, &st_master); - - (void)memcpy(reinterpret_cast<void *>(&(stMsgGyroParameterInfo.gyro_offset)), - reinterpret_cast<void *>(&(st_master.uc_data[0])), - sizeof( stMsgGyroParameterInfo.gyro_offset)); - - /* GyroScaleFactor acuisition/setting */ - DeadReckoningGetDataMaster(VEHICLE_DID_DR_GYRO_SCALE_FACTOR, &st_master); - - (void)memcpy(reinterpret_cast<void *>(&(stMsgGyroParameterInfo.gyro_scale_factor)), - reinterpret_cast<void *>(&(st_master.uc_data[0])), - sizeof(stMsgGyroParameterInfo.gyro_scale_factor)); - - /* GyroScaleFactorLevel acuisition/setting */ - DeadReckoningGetDataMaster(VEHICLE_DID_DR_GYRO_SCALE_FACTOR_LEVEL, &st_master); - - (void)memcpy(reinterpret_cast<void *>(&(stMsgGyroParameterInfo.gyro_scale_factor_level)), - reinterpret_cast<void *>(&(st_master.uc_data[0])), - sizeof(stMsgGyroParameterInfo.gyro_scale_factor_level)); - - /* Data transmission */ - (void)DRManagerSndMsg(PNO_VEHICLE_SENSOR, - us_pno, - CID_VEHICLE_SENSORMOTION_GYROPARAMETER, - sizeof(stMsgGyroParameterInfo), - (const void *)&stMsgGyroParameterInfo); - } - break; - case VEHICLE_DID_DR_SPEED_PULSE_SCALE_FACTOR_LEVEL: - { - SENSORMOTION_MSG_SPEEDPULSEPARAMETERINFO_DAT stMsgSpeedPulseParameterInfo; - - /* Initialization */ - stMsgSpeedPulseParameterInfo.reserve[0] = 0; - stMsgSpeedPulseParameterInfo.reserve[1] = 0; - stMsgSpeedPulseParameterInfo.reserve[2] = 0; - - /* Size storage(SPEEDPULSEPARAMETER) */ - stMsgSpeedPulseParameterInfo.size = (u_int16)sizeof(stMsgSpeedPulseParameterInfo); - - /* SpeedPulseScaleFactor acuisition/setting */ - DeadReckoningGetDataMaster(VEHICLE_DID_DR_SPEED_PULSE_SCALE_FACTOR, &st_master); - - (void)memcpy(reinterpret_cast<void *>(&(stMsgSpeedPulseParameterInfo.speed_pulse_scale_factor)), - reinterpret_cast<void *>(&(st_master.uc_data[0])), - sizeof(stMsgSpeedPulseParameterInfo.speed_pulse_scale_factor)); - - /* SpeedPulseScaleFactorLevel acuisition/setting */ - DeadReckoningGetDataMaster(VEHICLE_DID_DR_SPEED_PULSE_SCALE_FACTOR_LEVEL, &st_master); - - (void)memcpy(reinterpret_cast<void *>(&(stMsgSpeedPulseParameterInfo.speed_pulse_scale_factor_level)), - reinterpret_cast<void *>(&(st_master.uc_data[0])), - sizeof(stMsgSpeedPulseParameterInfo.speed_pulse_scale_factor_level)); - - /* Data transmission */ - (void)DRManagerSndMsg(PNO_VEHICLE_SENSOR, - us_pno, - CID_VEHICLE_SENSORMOTION_SPEEDPULSEPARAMETER, - sizeof(stMsgSpeedPulseParameterInfo), - (const void *)&stMsgSpeedPulseParameterInfo); - } - break; - /* Other than the above */ - default: - /* Do not edit. */ - break; - } -} -// LCOV_EXCL_STOP diff --git a/vehicleservice/positioning/server/src/Sensor/DeadReckoning_Did_Altitude_dr.cpp b/vehicleservice/positioning/server/src/Sensor/DeadReckoning_Did_Altitude_dr.cpp deleted file mode 100755 index acd5f6d..0000000 --- a/vehicleservice/positioning/server/src/Sensor/DeadReckoning_Did_Altitude_dr.cpp +++ /dev/null @@ -1,106 +0,0 @@ -/* - * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/************************************************************************* -@file DeadReckoning_Did_Altitude.cpp -@detail DeadReckoning data Master(VEHICLE_DID_DR_ALTITUDE)<BR> - DeadReckoning data master(VEHICLE_DID_DR_ALTITUDE) -*****************************************************************************/ - -#include <vehicle_service/positioning_base_library.h> -#include "DeadReckoning_DataMaster.h" - -/*************************************************/ -/* Global variable */ -/*************************************************/ -static DEADRECKONING_DATA_MASTER gst_altitude; // NOLINT(readability/nolint) - -/************************************************************************ -@brief Altitude Dead Reckoning initialization function -@outline Altitude initialization process data master -@type Completion return type -@param[in] none -@threshold none -@return void -@retval none -@trace -**************************************************************************** */ -void DeadReckoningInitAltitudeDr(void) { // LCOV_EXCL_START 8: dead code. - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - memset(&(gst_altitude), 0x00, sizeof(DEADRECKONING_DATA_MASTER)); - gst_altitude.ul_did = VEHICLE_DID_DR_ALTITUDE; - gst_altitude.us_size = VEHICLE_DSIZE_ALTITUDE; - gst_altitude.uc_rcv_flag = DEADRECKONING_RCVFLAG_OFF; - gst_altitude.dr_status = SENSORLOCATION_DRSTATUS_INVALID; - gst_altitude.uc_data[0] = VEHICLE_DINIT_ALTITUDE; -} - -/*********************************************************************** -@brief Altitude Dead Reckoning SET function -@outline To update the master data Altitude. -@type Completion return type -@param[in] DEADRECKONING_DATA_MASTER *p_st_data : The pointer to GPS incoming message data -@threshold none -@return u_int8 -@retval DEADRECKONING_EQ : No data changes -@retval DEADRECKONING_NEQ : With data changes -@trace -*****************************************************************************/ -u_int8 DeadReckoningSetAltitudeDr(const DEADRECKONING_DATA_MASTER *p_st_data) { - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - u_int8 uc_ret; - DEADRECKONING_DATA_MASTER *p_st_master; - - p_st_master = &gst_altitude; - - /** Compare data master and received data */ - uc_ret = DeadReckoningMemcmp(p_st_master->uc_data, p_st_data->uc_data, p_st_data->us_size); - - /** Received data is set in the data master. */ - p_st_master->ul_did = p_st_data->ul_did; - p_st_master->us_size = p_st_data->us_size; - p_st_master->uc_rcv_flag = DEADRECKONING_RCVFLAG_ON; - p_st_master->dr_status = p_st_data->dr_status; - - memcpy(p_st_master->uc_data, p_st_data->uc_data, p_st_data->us_size); - - return (uc_ret); -} - -/************************************************************************ -@brief Altitude Dead Reckoning GET function -@outline Master Data provides the Altitude -@type Completion return type -@param[in] DEADRECKONING_DATA_MASTER *p_st_data : Where to get a pointer to the data master -@threshold none -@return void -@retval none -@trace -*****************************************************************************/ -void DeadReckoningGetAltitudeDr(DEADRECKONING_DATA_MASTER *p_st_data) { - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - const DEADRECKONING_DATA_MASTER *p_st_master; - - p_st_master = &gst_altitude; - - /** Store the data master in the specified destination. */ - p_st_data->ul_did = p_st_master->ul_did; - p_st_data->us_size = p_st_master->us_size; - p_st_data->uc_rcv_flag = p_st_master->uc_rcv_flag; - p_st_data->dr_status = p_st_master->dr_status; - memcpy(p_st_data->uc_data, p_st_master->uc_data, p_st_master->us_size); -} -// LCOV_EXCL_STOP diff --git a/vehicleservice/positioning/server/src/Sensor/DeadReckoning_Did_GyroOffset_dr.cpp b/vehicleservice/positioning/server/src/Sensor/DeadReckoning_Did_GyroOffset_dr.cpp deleted file mode 100755 index f295f8d..0000000 --- a/vehicleservice/positioning/server/src/Sensor/DeadReckoning_Did_GyroOffset_dr.cpp +++ /dev/null @@ -1,115 +0,0 @@ -/* - * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/************************************************************************* -@file DeadReckoning_Did_GyroScaleFactor_dr.cpp -@detail DeadReckoning data Master(VEHICLE_DID_DR_GYRO_OFFSET) -*****************************************************************************/ - -#include <vehicle_service/positioning_base_library.h> -#include "DeadReckoning_DataMaster.h" - -/*************************************************/ -/* Global variable */ -/*************************************************/ -static DEADRECKONING_DATA_MASTER gst_gyrooffset; // NOLINT(readability/nolint) - -/************************************************************************ -@brief GyroOffset initialization function -@outline GyroOffset initialization process data master -@type Completion return type -@param[in] none -@threshold none -@return void -@retval none -@trace -**************************************************************************** */ -void DeadReckoningInitGyroOffsetDr(void) { // LCOV_EXCL_START 8: dead code. - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - (void)memset(reinterpret_cast<void *>(&gst_gyrooffset), 0x00, sizeof(gst_gyrooffset)); - gst_gyrooffset.ul_did = VEHICLE_DID_DR_GYRO_OFFSET; - gst_gyrooffset.us_size = VEHICLE_DSIZE_GYRO_OFFSET; - gst_gyrooffset.uc_rcv_flag = DEADRECKONING_RCVFLAG_OFF; - gst_gyrooffset.dr_status = 0U; /* Not used */ -} - -/************************************************************************ -@brief GyroOffset SET function -@outline To update the master data GyroOffset -@type Completion return type -@param[in] DEADRECKONING_DATA_MASTER *p_st_data : The pointer to incoming message data -@threshold none -@return u_int8 -@retval DEADRECKONING_EQ : No data changes -@retval DEADRECKONING_NEQ : With data changes -@trace -*****************************************************************************/ -u_int8 DeadReckoningSetGyroOffsetDr(const DEADRECKONING_DATA_MASTER *p_st_data) { - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - u_int8 uc_ret = DEADRECKONING_EQ; - DEADRECKONING_DATA_MASTER *p_st_master; - - if (p_st_data == NULL) { - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "p_st_data == NULL\r\n"); - } else { - p_st_master = &gst_gyrooffset; - - /** Compare data master and received data */ - uc_ret = DeadReckoningMemcmp(reinterpret_cast<void *>(&(p_st_master->uc_data)), - (const void *)(&(p_st_data->uc_data)), (size_t)(p_st_data->us_size)); - - /** Received data is set in the data master. */ - p_st_master->ul_did = p_st_data->ul_did; - p_st_master->us_size = p_st_data->us_size; - p_st_master->uc_rcv_flag = DEADRECKONING_RCVFLAG_ON; - p_st_master->dr_status = 0U; /* Not used */ - - (void)memcpy(reinterpret_cast<void *>(&(p_st_master->uc_data)), - (const void *)(&(p_st_data->uc_data) ), sizeof(p_st_master->uc_data)); - } - - return (uc_ret); -} - -/************************************************************************ -@brief GyroOffset GET function -@outline Master Data provides the GyroOffset -@type Completion return type -@param[in] DEADRECKONING_DATA_MASTER *p_st_data : Where to get a pointer to the data master -@threshold none -@return void -@retval none -@trace -*****************************************************************************/ -void DeadReckoningGetGyroOffsetDr(DEADRECKONING_DATA_MASTER *p_st_data) { - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - const DEADRECKONING_DATA_MASTER *p_st_master; - - if (p_st_data == NULL) { - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "p_st_data == NULL\r\n"); - } else { - p_st_master = &gst_gyrooffset; - - /** Store the data master in the specified destination. */ - p_st_data->ul_did = p_st_master->ul_did; - p_st_data->us_size = p_st_master->us_size; - p_st_data->uc_rcv_flag = p_st_master->uc_rcv_flag; - p_st_data->dr_status = p_st_master->dr_status; /* Not used(Set DataMaster defaults) */ - (void)memcpy(reinterpret_cast<void *>(&(p_st_data->uc_data)), - (const void *)(&(p_st_master->uc_data)), (size_t)p_st_master->us_size); - } -} -// LCOV_EXCL_STOP diff --git a/vehicleservice/positioning/server/src/Sensor/DeadReckoning_Did_GyroScaleFactorLevel_dr.cpp b/vehicleservice/positioning/server/src/Sensor/DeadReckoning_Did_GyroScaleFactorLevel_dr.cpp deleted file mode 100755 index dff0913..0000000 --- a/vehicleservice/positioning/server/src/Sensor/DeadReckoning_Did_GyroScaleFactorLevel_dr.cpp +++ /dev/null @@ -1,115 +0,0 @@ -/* - * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/************************************************************************* -@file DeadReckoning_Did_GyroScaleFactorLevel_dr.cpp -@detail DeadReckoning data Master(VEHICLE_DID_DR_GYRO_SCALE_FACTOR_LEVEL) -*****************************************************************************/ - -#include <vehicle_service/positioning_base_library.h> -#include "DeadReckoning_DataMaster.h" - -/*************************************************/ -/* Global variable */ -/*************************************************/ -static DEADRECKONING_DATA_MASTER gst_gyroscalefactor_level; // NOLINT(readability/nolint) - -/************************************************************************ -@brief GyroScaleFactorLevel initialization function -@outline GyroScaleFactorLevel initialization process data master -@type Completion return type -@param[in] none -@threshold none -@return void -@retval none -@trace -**************************************************************************** */ -void DeadReckoningInitGyroScaleFactorLevelDr(void) { // LCOV_EXCL_START 8: dead code. - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - (void)memset(reinterpret_cast<void *>(&gst_gyroscalefactor_level), 0x00, sizeof(gst_gyroscalefactor_level)); - gst_gyroscalefactor_level.ul_did = VEHICLE_DID_DR_GYRO_SCALE_FACTOR_LEVEL; - gst_gyroscalefactor_level.us_size = VEHICLE_DSIZE_GYRO_SCALE_FACTOR_LEVEL; - gst_gyroscalefactor_level.uc_rcv_flag = DEADRECKONING_RCVFLAG_OFF; - gst_gyroscalefactor_level.dr_status = 0U; /* Not used */ -} - -/************************************************************************* -@brief GyroScaleFactorLevel SET function -@outline To update the master data GyroScaleFactorLevel -@type Completion return type -@param[in] DEADRECKONING_DATA_MASTER *p_st_data : The pointer to incoming message data -@threshold none -@return u_int8 -@retval DEADRECKONING_EQ : No data changes<BR> -@retval DEADRECKONING_NEQ : With data changes<BR> -@trace -*****************************************************************************/ -u_int8 DeadReckoningSetGyroScaleFactorLevelDr(const DEADRECKONING_DATA_MASTER *p_st_data) { - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - u_int8 uc_ret = DEADRECKONING_EQ; - DEADRECKONING_DATA_MASTER *p_st_master; - - if (p_st_data == NULL) { - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "p_st_data == NULL\r\n"); - } else { - p_st_master = &gst_gyroscalefactor_level; - - /** Compare data master and received data */ - uc_ret = DeadReckoningMemcmp(reinterpret_cast<void *>(&(p_st_master->uc_data)), - (const void *)( &(p_st_data->uc_data)), (size_t)(p_st_data->us_size)); - - /** Received data is set in the data master. */ - p_st_master->ul_did = p_st_data->ul_did; - p_st_master->us_size = p_st_data->us_size; - p_st_master->uc_rcv_flag = DEADRECKONING_RCVFLAG_ON; - p_st_master->dr_status = 0U; /* Not used */ - - (void)memcpy(reinterpret_cast<void *>(&(p_st_master->uc_data)), - (const void *)(&(p_st_data->uc_data)), sizeof(p_st_master->uc_data)); - } - - return (uc_ret); -} - -/************************************************************************* -@brief GyroScaleFactorLevel GET function -@outline Master Data provides the GyroScaleFactorLevel -@type Completion return type -@param[in] DEADRECKONING_DATA_MASTER *p_st_data : Where to get a pointer to the data master -@threshold none -@return void -@retval none -@trace -*****************************************************************************/ -void DeadReckoningGetGyroScaleFactorLevelDr(DEADRECKONING_DATA_MASTER *p_st_data) { - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - const DEADRECKONING_DATA_MASTER *p_st_master; - - if (p_st_data == NULL) { - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "p_st_data == NULL\r\n"); - } else { - p_st_master = &gst_gyroscalefactor_level; - - /** Store the data master in the specified destination. */ - p_st_data->ul_did = p_st_master->ul_did; - p_st_data->us_size = p_st_master->us_size; - p_st_data->uc_rcv_flag = p_st_master->uc_rcv_flag; - p_st_data->dr_status = p_st_master->dr_status; /* Not used(Set DataMaster defaults) */ - (void)memcpy(reinterpret_cast<void *>(&(p_st_data->uc_data)), - (const void *)(&(p_st_master->uc_data)), (size_t)p_st_master->us_size); - } -} -// LCOV_EXCL_STOP diff --git a/vehicleservice/positioning/server/src/Sensor/DeadReckoning_Did_GyroScaleFactor_dr.cpp b/vehicleservice/positioning/server/src/Sensor/DeadReckoning_Did_GyroScaleFactor_dr.cpp deleted file mode 100755 index d05ef5c..0000000 --- a/vehicleservice/positioning/server/src/Sensor/DeadReckoning_Did_GyroScaleFactor_dr.cpp +++ /dev/null @@ -1,115 +0,0 @@ -/* - * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/************************************************************************ -@file DeadReckoning_Did_GyroScaleFactor_dr.cpp -@detail DeadReckoning data Master(VEHICLE_DID_DR_GYRO_SCALE_FACTOR) -*****************************************************************************/ - -#include <vehicle_service/positioning_base_library.h> -#include "DeadReckoning_DataMaster.h" - -/*************************************************/ -/* Global variable */ -/*************************************************/ -static DEADRECKONING_DATA_MASTER gst_gyroscalefactor; // NOLINT(readability/nolint) - -/************************************************************************ -@brief GyroScaleFactor initialization function -@outline GyroScaleFactor initialization process data master -@type Completion return type -@param[in] none -@threshold none -@return void -@retval none -@trace -**************************************************************************** */ -void DeadReckoningInitGyroScaleFactorDr(void) { // LCOV_EXCL_START 8: dead code. - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - (void)memset(reinterpret_cast<void *>(&gst_gyroscalefactor), 0x00, sizeof(gst_gyroscalefactor)); - gst_gyroscalefactor.ul_did = VEHICLE_DID_DR_GYRO_SCALE_FACTOR; - gst_gyroscalefactor.us_size = VEHICLE_DSIZE_GYRO_SCALE_FACTOR; - gst_gyroscalefactor.uc_rcv_flag = DEADRECKONING_RCVFLAG_OFF; - gst_gyroscalefactor.dr_status = 0U; /* Not used */ -} - -/************************************************************************ -@brief GyroScaleFactor SET function -@outline To update the master data GyroScaleFactor -@type Completion return type -@param[in] DEADRECKONING_DATA_MASTER *p_st_data : The pointer to incoming message data -@threshold none -@return u_int8 -@retval DEADRECKONING_EQ : No data changes -@retval DEADRECKONING_NEQ : With data changes -@trace -*****************************************************************************/ -u_int8 DeadReckoningSetGyroScaleFactorDr(const DEADRECKONING_DATA_MASTER *p_st_data) { - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - u_int8 uc_ret = DEADRECKONING_EQ; - DEADRECKONING_DATA_MASTER *p_st_master; - - if (p_st_data == NULL) { - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "p_st_data == NULL\r\n"); - } else { - p_st_master = &gst_gyroscalefactor; - - /** Compare data master and received data */ - uc_ret = DeadReckoningMemcmp(reinterpret_cast<void *>(&(p_st_master->uc_data)), - (const void *)(&(p_st_data->uc_data)), (size_t)(p_st_data->us_size)); - - /** Received data is set in the data master. */ - p_st_master->ul_did = p_st_data->ul_did; - p_st_master->us_size = p_st_data->us_size; - p_st_master->uc_rcv_flag = DEADRECKONING_RCVFLAG_ON; - p_st_master->dr_status = 0U; /* Not used */ - - (void)memcpy(reinterpret_cast<void *>(&(p_st_master->uc_data)), - (const void *)(&(p_st_data->uc_data) ), sizeof(p_st_master->uc_data)); - } - - return (uc_ret); -} - -/************************************************************************ -@brief GyroScaleFactor GET function -@outline Master Data provides the GyroScaleFactor -@type Completion return type -@param[in] DEADRECKONING_DATA_MASTER *p_st_data : Where to get a pointer to the data master -@threshold none -@return void -@retval none -@trace -*****************************************************************************/ -void DeadReckoningGetGyroScaleFactorDr(DEADRECKONING_DATA_MASTER *p_st_data) { - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - const DEADRECKONING_DATA_MASTER *p_st_master; - - if (p_st_data == NULL) { - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "p_st_data == NULL\r\n"); - } else { - p_st_master = &gst_gyroscalefactor; - - /** Store the data master in the specified destination. */ - p_st_data->ul_did = p_st_master->ul_did; - p_st_data->us_size = p_st_master->us_size; - p_st_data->uc_rcv_flag = p_st_master->uc_rcv_flag; - p_st_data->dr_status = p_st_master->dr_status; /* Not used(Set DataMaster defaults) */ - (void)memcpy(reinterpret_cast<void *>(&(p_st_data->uc_data)), - (const void *)(&(p_st_master->uc_data)), (size_t)p_st_master->us_size); - } -} -// LCOV_EXCL_STOP diff --git a/vehicleservice/positioning/server/src/Sensor/DeadReckoning_Did_Heading_dr.cpp b/vehicleservice/positioning/server/src/Sensor/DeadReckoning_Did_Heading_dr.cpp deleted file mode 100755 index 451b133..0000000 --- a/vehicleservice/positioning/server/src/Sensor/DeadReckoning_Did_Heading_dr.cpp +++ /dev/null @@ -1,106 +0,0 @@ -/* - * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/************************************************************************ -@file DeadReckoning_Did_Heading.cpp -@detail DeadReckoning data Master(VEHICLE_DID_DR_HEADING)<BR> - DeadReckoning data master(VEHICLE_DID_DR_HEADING) -*****************************************************************************/ - -#include <vehicle_service/positioning_base_library.h> -#include "DeadReckoning_DataMaster.h" - -/*************************************************/ -/* Global variable */ -/*************************************************/ -static DEADRECKONING_DATA_MASTER gst_heading; // NOLINT(readability/nolint) - -/************************************************************************ -@brief Heading Dead Reckoning initialization function -@outline Heading initialization process data master -@type Completion return type -@param[in] none -@threshold none -@return void -@retval none -@trace -**************************************************************************** */ -void DeadReckoningInitHeadingDr(void) { // LCOV_EXCL_START 8: dead code. - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - memset(&(gst_heading), 0x00, sizeof(DEADRECKONING_DATA_MASTER)); - gst_heading.ul_did = VEHICLE_DID_DR_HEADING; - gst_heading.us_size = VEHICLE_DSIZE_HEADING; - gst_heading.uc_rcv_flag = DEADRECKONING_RCVFLAG_OFF; - gst_heading.dr_status = SENSORMOTION_DRSTATUS_INVALID; - gst_heading.uc_data[0] = VEHICLE_DINIT_HEADING; -} - -/************************************************************************* -@brief Heading Dead Reckoning SET function -@outline To update the master data Heading. -@type Completion return type -@param[in] DEADRECKONING_DATA_MASTER *p_st_data : The pointer to GPS incoming message data -@threshold none -@return u_int8 -@retval DEADRECKONING_EQ : No data changes -@retval DEADRECKONING_NEQ : With data changes -@trace -*****************************************************************************/ -u_int8 DeadReckoningSetHeadingDr(const DEADRECKONING_DATA_MASTER *p_st_data) { - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - u_int8 uc_ret; - DEADRECKONING_DATA_MASTER *p_st_master; - - p_st_master = &gst_heading; - - /** Compare data master and received data */ - uc_ret = DeadReckoningMemcmp(p_st_master->uc_data, p_st_data->uc_data, p_st_data->us_size); - - /** Received data is set in the data master. */ - p_st_master->ul_did = p_st_data->ul_did; - p_st_master->us_size = p_st_data->us_size; - p_st_master->uc_rcv_flag = DEADRECKONING_RCVFLAG_ON; - p_st_master->dr_status = p_st_data->dr_status; - - memcpy(p_st_master->uc_data, p_st_data->uc_data, p_st_data->us_size); - - return (uc_ret); -} - -/************************************************************************ -@brief Heading Dead Reckoning GET function -@outline Master Data provides the Heading -@type Completion return type -@param[in] DEADRECKONING_DATA_MASTER *p_st_data : Where to get a pointer to the data master -@threshold none -@return void -@retval none -@trace -*****************************************************************************/ -void DeadReckoningGetHeadingDr(DEADRECKONING_DATA_MASTER *p_st_data) { - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - const DEADRECKONING_DATA_MASTER *p_st_master; - - p_st_master = &gst_heading; - - /** Store the data master in the specified destination. */ - p_st_data->ul_did = p_st_master->ul_did; - p_st_data->us_size = p_st_master->us_size; - p_st_data->uc_rcv_flag = p_st_master->uc_rcv_flag; - p_st_data->dr_status = p_st_master->dr_status; - memcpy(p_st_data->uc_data, p_st_master->uc_data, p_st_master->us_size); -} -// LCOV_EXCL_STOP diff --git a/vehicleservice/positioning/server/src/Sensor/DeadReckoning_Did_Latitude_dr.cpp b/vehicleservice/positioning/server/src/Sensor/DeadReckoning_Did_Latitude_dr.cpp deleted file mode 100755 index 9d06e7a..0000000 --- a/vehicleservice/positioning/server/src/Sensor/DeadReckoning_Did_Latitude_dr.cpp +++ /dev/null @@ -1,105 +0,0 @@ -/* - * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/************************************************************************ -@file DeadReckoning_Did_Latitude.cpp -@detail DeadReckoning data Master(VEHICLE_DID_DR_LATITUDE) -*****************************************************************************/ - -#include <vehicle_service/positioning_base_library.h> -#include "DeadReckoning_DataMaster.h" - -/*************************************************/ -/* Global variable */ -/*************************************************/ -static DEADRECKONING_DATA_MASTER gst_latitude; // NOLINT(readability/nolint) - -/*********************************************************************** -@brief Latitude Dead Reckoning initialization function -@outline Latitude initialization process data master -@type Completion return type -@param[in] none -@threshold none -@return void -@retval none -@trace -**************************************************************************** */ -void DeadReckoningInitLatitudeDr(void) { // LCOV_EXCL_START 8: dead code. - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - memset(&(gst_latitude), 0x00, sizeof(DEADRECKONING_DATA_MASTER)); - gst_latitude.ul_did = VEHICLE_DID_DR_LATITUDE; - gst_latitude.us_size = VEHICLE_DSIZE_LATITUDE; - gst_latitude.uc_rcv_flag = DEADRECKONING_RCVFLAG_OFF; - gst_latitude.dr_status = SENSORLOCATION_DRSTATUS_INVALID; - gst_latitude.uc_data[0] = VEHICLE_DINIT_LATITUDE; -} - -/************************************************************************ -@brief Latitude Dead Reckoning SET function -@outline To update the master data Latitude. -@type Completion return type -@param[in] DEADRECKONING_DATA_MASTER *p_st_data : The pointer to GPS incoming message data -@threshold none -@return u_int8 -@retval DEADRECKONING_EQ : No data changes -@retval DEADRECKONING_NEQ : With data changes -@trace -*****************************************************************************/ -u_int8 DeadReckoningSetLatitudeDr(const DEADRECKONING_DATA_MASTER *p_st_data) { - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - u_int8 uc_ret; - DEADRECKONING_DATA_MASTER *p_st_master; - - p_st_master = &gst_latitude; - - /** Compare data master and received data */ - uc_ret = DeadReckoningMemcmp(p_st_master->uc_data, p_st_data->uc_data, p_st_data->us_size); - - /** Received data is set in the data master. */ - p_st_master->ul_did = p_st_data->ul_did; - p_st_master->us_size = p_st_data->us_size; - p_st_master->uc_rcv_flag = DEADRECKONING_RCVFLAG_ON; - p_st_master->dr_status = p_st_data->dr_status; - - memcpy(p_st_master->uc_data, p_st_data->uc_data, p_st_data->us_size); - - return (uc_ret); -} - -/************************************************************************ -@brief Latitude Dead Reckoning GET function -@outline Master Data provides the Latitude -@type Completion return type -@param[in] DEADRECKONING_DATA_MASTER *p_st_data : Where to get a pointer to the data master -@threshold none -@return void -@retval none -@trace -*****************************************************************************/ -void DeadReckoningGetLatitudeDr(DEADRECKONING_DATA_MASTER *p_st_data) { - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - const DEADRECKONING_DATA_MASTER *p_st_master; - - p_st_master = &gst_latitude; - - /** Store the data master in the specified destination. */ - p_st_data->ul_did = p_st_master->ul_did; - p_st_data->us_size = p_st_master->us_size; - p_st_data->uc_rcv_flag = p_st_master->uc_rcv_flag; - p_st_data->dr_status = p_st_master->dr_status; - memcpy(p_st_data->uc_data, p_st_master->uc_data, p_st_master->us_size); -} -// LCOV_EXCL_STOP diff --git a/vehicleservice/positioning/server/src/Sensor/DeadReckoning_Did_Longitude_dr.cpp b/vehicleservice/positioning/server/src/Sensor/DeadReckoning_Did_Longitude_dr.cpp deleted file mode 100755 index 38a6351..0000000 --- a/vehicleservice/positioning/server/src/Sensor/DeadReckoning_Did_Longitude_dr.cpp +++ /dev/null @@ -1,105 +0,0 @@ -/* - * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/************************************************************************ -@file DeadReckoning_Did_Longitude.cpp -@detail DeadReckoning data Master(VEHICLE_DID_DR_LONGITUDE) -*****************************************************************************/ - -#include <vehicle_service/positioning_base_library.h> -#include "DeadReckoning_DataMaster.h" - -/*************************************************/ -/* Global variable */ -/*************************************************/ -static DEADRECKONING_DATA_MASTER gst_longitude; // NOLINT(readability/nolint) - -/*********************************************************************** -@brief Longitude Dead Reckoning initialization function -@outline Longitude initialization process data master -@type Completion return type -@param[in] none -@threshold none -@return void -@retval none -@trace -**************************************************************************** */ -void DeadReckoningInitLongitudeDr(void) { // LCOV_EXCL_START 8: dead code. - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - memset(&(gst_longitude), 0x00, sizeof(DEADRECKONING_DATA_MASTER)); - gst_longitude.ul_did = VEHICLE_DID_DR_LONGITUDE; - gst_longitude.us_size = VEHICLE_DSIZE_LONGITUDE; - gst_longitude.uc_rcv_flag = DEADRECKONING_RCVFLAG_OFF; - gst_longitude.dr_status = SENSORLOCATION_DRSTATUS_INVALID; - gst_longitude.uc_data[0] = VEHICLE_DINIT_LONGITUDE; -} - -/************************************************************************ -@brief Longitude Dead Reckoning SET function -@outline To update the master data Longitude. -@type Completion return type -@param[in] DEADRECKONING_DATA_MASTER *p_st_data : The pointer to GPS incoming message data -@threshold none -@return u_int8 -@retval DEADRECKONING_EQ : No data changes -@retval DEADRECKONING_NEQ : With data changes -@trace -*****************************************************************************/ -u_int8 DeadReckoningSetLongitudeDr(const DEADRECKONING_DATA_MASTER *p_st_data) { - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - u_int8 uc_ret; - DEADRECKONING_DATA_MASTER *p_st_master; - - p_st_master = &gst_longitude; - - /** Compare data master and received data */ - uc_ret = DeadReckoningMemcmp(p_st_master->uc_data, p_st_data->uc_data, p_st_data->us_size); - - /** Received data is set in the data master. */ - p_st_master->ul_did = p_st_data->ul_did; - p_st_master->us_size = p_st_data->us_size; - p_st_master->uc_rcv_flag = DEADRECKONING_RCVFLAG_ON; - p_st_master->dr_status = p_st_data->dr_status; - - memcpy(p_st_master->uc_data, p_st_data->uc_data, p_st_data->us_size); - - return (uc_ret); -} - -/************************************************************************ -@brief Longitude Dead Reckoning GET function -@outline Master Data provides the Longitude -@type Completion return type -@param[in] DEADRECKONING_DATA_MASTER *p_st_data : Where to get a pointer to the data master -@threshold none -@return void -@retval none -@trace -*****************************************************************************/ -void DeadReckoningGetLongitudeDr(DEADRECKONING_DATA_MASTER *p_st_data) { - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - const DEADRECKONING_DATA_MASTER *p_st_master; - - p_st_master = &gst_longitude; - - /** Store the data master in the specified destination. */ - p_st_data->ul_did = p_st_master->ul_did; - p_st_data->us_size = p_st_master->us_size; - p_st_data->uc_rcv_flag = p_st_master->uc_rcv_flag; - p_st_data->dr_status = p_st_master->dr_status; - memcpy(p_st_data->uc_data, p_st_master->uc_data, p_st_master->us_size); -} -// LCOV_EXCL_STOP diff --git a/vehicleservice/positioning/server/src/Sensor/DeadReckoning_Did_SnsCounter.cpp b/vehicleservice/positioning/server/src/Sensor/DeadReckoning_Did_SnsCounter.cpp deleted file mode 100755 index 6bf3ed7..0000000 --- a/vehicleservice/positioning/server/src/Sensor/DeadReckoning_Did_SnsCounter.cpp +++ /dev/null @@ -1,103 +0,0 @@ -/* - * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/******************************************************************************* - * File name :DeadReckoning_Did_SnsCounter.cpp - * System name :PastModel002 - * Subsystem name :Vehicle sensor process - * Program name :Vehicle sensor data master(VEHICLE_DID_SNS_COUNTER) - * Module configuration :DeadReckoningInitSnsCounterDr() Vehicle sensor SNS_COUNTER initialization function - * :DeadReckoningSetSnsCounterDr() Vehicle sensor SNS_COUNTER SET function - * :DeadReckoningGetSnsCounterDr() Vehicle sensor SNS_COUNTER GET function - ******************************************************************************/ - -#include <vehicle_service/positioning_base_library.h> -#include "DeadReckoning_DataMaster.h" - -/*************************************************/ -/* Global variable */ -/*************************************************/ -static DEADRECKONING_DATA_MASTER gst_snscounter_dr; // NOLINT(readability/nolint) - -/******************************************************************************* -* MODULE : DeadReckoningInitSnsCounterDr -* ABSTRACT : Vehicle sensor SNS_COUNTER initialization function -* FUNCTION : SNS_COUNTER data master initialization processing -* ARGUMENT : void -* NOTE : -* RETURN : void -******************************************************************************/ -void DeadReckoningInitSnsCounterDr(void) { // LCOV_EXCL_START 8: dead code. - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - memset(&(gst_snscounter_dr), 0x00, sizeof(DEADRECKONING_DATA_MASTER)); - gst_snscounter_dr.ul_did = VEHICLE_DID_DR_SNS_COUNTER; - gst_snscounter_dr.us_size = VEHICLE_DSIZE_DR_SNS_COUNTER; - gst_snscounter_dr.uc_rcv_flag = DEADRECKONING_RCVFLAG_OFF; - gst_snscounter_dr.dr_status = SENSORLOCATION_DRSTATUS_INVALID; - gst_snscounter_dr.uc_data[0] = VEHICLE_DINIT_DR_SNS_COUNTER; -} - -/******************************************************************************* -* MODULE : DeadReckoningSetSnsCounterDr -* ABSTRACT : Vehicle sensor SNS_COUNTER SET function -* FUNCTION : Update the SNS_COUNTER data master -* ARGUMENT : *p_st_data : Pointer to the message data received by the direct line -* NOTE : -* RETURN : VEHICLESENS_EQ : No data change -* VEHICLESENS_NEQ : Data change -******************************************************************************/ -u_int8 DeadReckoningSetSnsCounterDr(const DEADRECKONING_DATA_MASTER *p_st_data) { - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - u_int8 uc_ret; - DEADRECKONING_DATA_MASTER *p_st_master; - - p_st_master = &gst_snscounter_dr; - - /* Compare data master and received data */ - uc_ret = DeadReckoningMemcmp(p_st_master->uc_data, p_st_data->uc_data, p_st_data->us_size); - - /* Received data is set in the data master. */ - p_st_master->ul_did = p_st_data->ul_did; - p_st_master->us_size = p_st_data->us_size; - p_st_master->uc_rcv_flag = DEADRECKONING_RCVFLAG_ON; - p_st_master->dr_status = p_st_data->dr_status; - memcpy(p_st_master->uc_data, p_st_data->uc_data, p_st_data->us_size); - - return (uc_ret); -} - -/******************************************************************************* -* MODULE : DeadReckoningGetSnsCounterDr -* ABSTRACT : Vehicle sensor SNS_COUNTER GET function -* FUNCTION : Provide the SNS_COUNTER data master -* ARGUMENT : *p_st_data : Pointer to the data master acquisition destination -* NOTE : -* RETURN : void -******************************************************************************/ -void DeadReckoningGetSnsCounterDr(DEADRECKONING_DATA_MASTER *p_st_data) { - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - const DEADRECKONING_DATA_MASTER *p_st_master; - - p_st_master = &gst_snscounter_dr; - - /* Store the data master in the specified destination. */ - p_st_data->ul_did = p_st_master->ul_did; - p_st_data->us_size = p_st_master->us_size; - p_st_data->uc_rcv_flag = p_st_master->uc_rcv_flag; - p_st_data->dr_status = p_st_master->dr_status; - memcpy(p_st_data->uc_data, p_st_master->uc_data, p_st_master->us_size); -} -// LCOV_EXCL_STOP diff --git a/vehicleservice/positioning/server/src/Sensor/DeadReckoning_Did_SpeedPulseScaleFactorLevel_dr.cpp b/vehicleservice/positioning/server/src/Sensor/DeadReckoning_Did_SpeedPulseScaleFactorLevel_dr.cpp deleted file mode 100755 index dc7022f..0000000 --- a/vehicleservice/positioning/server/src/Sensor/DeadReckoning_Did_SpeedPulseScaleFactorLevel_dr.cpp +++ /dev/null @@ -1,116 +0,0 @@ -/* - * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/************************************************************************ -@file DeadReckoning_Did_SpeedPulseScaleFactorLevel_dr.cpp -@detail DeadReckoning data Master(VEHICLE_DID_DR_SPEED_PULSE_SCALE_FACTOR_LEVEL) -*****************************************************************************/ - -#include <vehicle_service/positioning_base_library.h> -#include "DeadReckoning_DataMaster.h" - -/*************************************************/ -/* Global variable */ -/*************************************************/ -static DEADRECKONING_DATA_MASTER gst_speedpulsescalefactor_level; // NOLINT(readability/nolint) - -/************************************************************************ -@brief SpeedPulseScaleFactorLevel initialization function -@outline SpeedPulseScaleFactorLevel initialization process data master -@type Completion return type -@param[in] none -@threshold none -@return void -@retval none -@trace -**************************************************************************** */ -void DeadReckoningInitSpeedPulseScaleFactorLevelDr(void) { // LCOV_EXCL_START 8: dead code. - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - (void)memset(reinterpret_cast<void *>(&gst_speedpulsescalefactor_level), 0x00, - sizeof(gst_speedpulsescalefactor_level)); - gst_speedpulsescalefactor_level.ul_did = VEHICLE_DID_DR_SPEED_PULSE_SCALE_FACTOR_LEVEL; - gst_speedpulsescalefactor_level.us_size = VEHICLE_DSIZE_SPEED_PULSE_SCALE_FACTOR_LEVEL; - gst_speedpulsescalefactor_level.uc_rcv_flag = DEADRECKONING_RCVFLAG_OFF; - gst_speedpulsescalefactor_level.dr_status = 0U; /* Not used */ -} - -/************************************************************************ -@brief SpeedPulseScaleFactorLevel SET function -@outline To update the master data SpeedPulseScaleFactorLevel -@type Completion return type -@param[in] DEADRECKONING_DATA_MASTER *p_st_data : The pointer to incoming message data -@threshold none -@return u_int8 -@retval DEADRECKONING_EQ : No data changes -@retval DEADRECKONING_NEQ : With data changes -@trace -*****************************************************************************/ -u_int8 DeadReckoningSetSpeedPulseScaleFactorLevelDr(const DEADRECKONING_DATA_MASTER *p_st_data) { - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - u_int8 uc_ret = DEADRECKONING_EQ; - DEADRECKONING_DATA_MASTER *p_st_master; - - if (p_st_data == NULL) { - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "p_st_data == NULL\r\n"); - } else { - p_st_master = &gst_speedpulsescalefactor_level; - - /** Compare data master and received data */ - uc_ret = DeadReckoningMemcmp(reinterpret_cast<void *>(&(p_st_master->uc_data)), - (const void *)(&(p_st_data->uc_data)), (size_t)(p_st_data->us_size)); - - /** Received data is set in the data master. */ - p_st_master->ul_did = p_st_data->ul_did; - p_st_master->us_size = p_st_data->us_size; - p_st_master->uc_rcv_flag = DEADRECKONING_RCVFLAG_ON; - p_st_master->dr_status = 0U; /* Not used */ - - (void)memcpy(reinterpret_cast<void *>(&(p_st_master->uc_data)), - (const void *)(&(p_st_data->uc_data)), sizeof(p_st_master->uc_data)); - } - - return (uc_ret); -} - -/************************************************************************ -@brief SpeedPulseScaleFactorLevel GET function -@outline Master Data provides the SpeedPulseScaleFactorLevel -@type Completion return type -@param[in] DEADRECKONING_DATA_MASTER *p_st_data : Where to get a pointer to the data master -@threshold none -@return void -@retval none -@trace -*****************************************************************************/ -void DeadReckoningGetSpeedPulseScaleFactorLevelDr(DEADRECKONING_DATA_MASTER *p_st_data) { - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - const DEADRECKONING_DATA_MASTER *p_st_master; - - if (p_st_data == NULL) { - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "p_st_data == NULL\r\n"); - } else { - p_st_master = &gst_speedpulsescalefactor_level; - - /** Store the data master in the specified destination. */ - p_st_data->ul_did = p_st_master->ul_did; - p_st_data->us_size = p_st_master->us_size; - p_st_data->uc_rcv_flag = p_st_master->uc_rcv_flag; - p_st_data->dr_status = p_st_master->dr_status; /* Not used(Set DataMaster defaults) */ - (void)memcpy(reinterpret_cast<void *>(&(p_st_data->uc_data)), - (const void *)(&(p_st_master->uc_data)), (size_t)p_st_master->us_size); - } -} -// LCOV_EXCL_STOP diff --git a/vehicleservice/positioning/server/src/Sensor/DeadReckoning_Did_SpeedPulseScaleFactor_dr.cpp b/vehicleservice/positioning/server/src/Sensor/DeadReckoning_Did_SpeedPulseScaleFactor_dr.cpp deleted file mode 100755 index cd27141..0000000 --- a/vehicleservice/positioning/server/src/Sensor/DeadReckoning_Did_SpeedPulseScaleFactor_dr.cpp +++ /dev/null @@ -1,115 +0,0 @@ -/* - * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/************************************************************************* -@file DeadReckoning_Did_SpeedPulseScaleFactor_dr.cpp -@detail DeadReckoning data Master(VEHICLE_DID_DR_SPEED_PULSE_SCALE_FACTOR) -*****************************************************************************/ - -#include <vehicle_service/positioning_base_library.h> -#include "DeadReckoning_DataMaster.h" - -/*************************************************/ -/* Global variable */ -/*************************************************/ -static DEADRECKONING_DATA_MASTER gst_speedpulsescalefactor; // NOLINT(readability/nolint) - -/*********************************************************************** -@brief SpeedPulseScaleFactor initialization function -@outline SpeedPulseScaleFactor initialization process data master -@type Completion return type -@param[in] none -@threshold none -@return void -@retval none -@trace -**************************************************************************** */ -void DeadReckoningInitSpeedPulseScaleFactorDr(void) { // LCOV_EXCL_START 8: dead code. - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - (void)memset(reinterpret_cast<void *>(&gst_speedpulsescalefactor), 0x00, sizeof(gst_speedpulsescalefactor)); - gst_speedpulsescalefactor.ul_did = VEHICLE_DID_DR_SPEED_PULSE_SCALE_FACTOR; - gst_speedpulsescalefactor.us_size = VEHICLE_DSIZE_SPEED_PULSE_SCALE_FACTOR; - gst_speedpulsescalefactor.uc_rcv_flag = DEADRECKONING_RCVFLAG_OFF; - gst_speedpulsescalefactor.dr_status = 0U; /* Not used */ -} - -/************************************************************************* -@brief SpeedPulseScaleFactor SET function -@outline To update the master data SpeedPulseScaleFactor -@type Completion return type -@param[in] DEADRECKONING_DATA_MASTER *p_st_data : The pointer to incoming message data -@threshold none -@return u_int8 -@retval DEADRECKONING_EQ : No data changes -@retval DEADRECKONING_NEQ : With data changes -@trace -*****************************************************************************/ -u_int8 DeadReckoningSetSpeedPulseScaleFactorDr(const DEADRECKONING_DATA_MASTER *p_st_data) { - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - u_int8 uc_ret = DEADRECKONING_EQ; - DEADRECKONING_DATA_MASTER *p_st_master; - - if (p_st_data == NULL) { - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "p_st_data == NULL\r\n"); - } else { - p_st_master = &gst_speedpulsescalefactor; - - /** Compare data master and received data */ - uc_ret = DeadReckoningMemcmp(reinterpret_cast<void *>(&(p_st_master->uc_data)), - (const void *)(&(p_st_data->uc_data) ), (size_t)(p_st_data->us_size)); - - /** Received data is set in the data master. */ - p_st_master->ul_did = p_st_data->ul_did; - p_st_master->us_size = p_st_data->us_size; - p_st_master->uc_rcv_flag = DEADRECKONING_RCVFLAG_ON; - p_st_master->dr_status = 0U; /* Not used */ - - (void)memcpy(reinterpret_cast<void *>(&(p_st_master->uc_data)), - (const void *)(&(p_st_data->uc_data)), sizeof(p_st_master->uc_data)); - } - - return (uc_ret); -} - -/************************************************************************ -@brief SpeedPulseScaleFactor GET function -@outline Master Data provides the SpeedPulseScaleFactor -@type Completion return type -@param[in] DEADRECKONING_DATA_MASTER *p_st_data : Where to get a pointer to the data master -@threshold none -@return void -@retval none -@trace -*****************************************************************************/ -void DeadReckoningGetSpeedPulseScaleFactorDr(DEADRECKONING_DATA_MASTER *p_st_data) { - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - const DEADRECKONING_DATA_MASTER *p_st_master; - - if (p_st_data == NULL) { - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "p_st_data == NULL\r\n"); - } else { - p_st_master = &gst_speedpulsescalefactor; - - /** Store the data master in the specified destination. */ - p_st_data->ul_did = p_st_master->ul_did; - p_st_data->us_size = p_st_master->us_size; - p_st_data->uc_rcv_flag = p_st_master->uc_rcv_flag; - p_st_data->dr_status = p_st_master->dr_status; /* Not used(Set DataMaster defaults) */ - (void)memcpy(reinterpret_cast<void *>(&(p_st_data->uc_data)), - (const void *)(&(p_st_master->uc_data)), (size_t)p_st_master->us_size); - } -} -// LCOV_EXCL_STOP diff --git a/vehicleservice/positioning/server/src/Sensor/DeadReckoning_Did_Speed_dr.cpp b/vehicleservice/positioning/server/src/Sensor/DeadReckoning_Did_Speed_dr.cpp deleted file mode 100755 index b2b1f88..0000000 --- a/vehicleservice/positioning/server/src/Sensor/DeadReckoning_Did_Speed_dr.cpp +++ /dev/null @@ -1,105 +0,0 @@ -/* - * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/************************************************************************* -@file DeadReckoning_Did_Speed.cpp -@detail DeadReckoning data Master(VEHICLE_DID_DR_SPEED) -*****************************************************************************/ - -#include <vehicle_service/positioning_base_library.h> -#include "DeadReckoning_DataMaster.h" - -/*************************************************/ -/* Global variable */ -/*************************************************/ -static DEADRECKONING_DATA_MASTER gst_speed; // NOLINT(readability/nolint) - -/************************************************************************ -@brief Speed Dead Reckoning initialization function -@outline Speed initialization process data master -@type Completion return type -@param[in] none -@threshold none -@return void -@retval none -@trace -**************************************************************************** */ -void DeadReckoningInitSpeedDr(void) { // LCOV_EXCL_START 8: dead code. - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - memset(&(gst_speed), 0x00, sizeof(DEADRECKONING_DATA_MASTER)); - gst_speed.ul_did = VEHICLE_DID_DR_SPEED; - gst_speed.us_size = VEHICLE_DSIZE_SPEED; - gst_speed.uc_rcv_flag = DEADRECKONING_RCVFLAG_OFF; - gst_speed.dr_status = SENSORMOTION_DRSTATUS_INVALID; - gst_speed.uc_data[0] = VEHICLE_DINIT_SPEED; -} - -/************************************************************************ -@brief Speed Dead Reckoning SET function -@outline To update the master data Speed. -@type Completion return type -@param[in] DEADRECKONING_DATA_MASTER *p_st_data : The pointer to GPS incoming message data -@threshold none -@return u_int8 -@retval DEADRECKONING_EQ : No data changes -@retval DEADRECKONING_NEQ : With data changes -@trace -*****************************************************************************/ -u_int8 DeadReckoningSetSpeedDr(const DEADRECKONING_DATA_MASTER *p_st_data) { - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - u_int8 uc_ret; - DEADRECKONING_DATA_MASTER *p_st_master; - - p_st_master = &gst_speed; - - /** Compare data master and received data */ - uc_ret = DeadReckoningMemcmp(p_st_master->uc_data, p_st_data->uc_data, p_st_data->us_size); - - /** Received data is set in the data master. */ - p_st_master->ul_did = p_st_data->ul_did; - p_st_master->us_size = p_st_data->us_size; - p_st_master->uc_rcv_flag = DEADRECKONING_RCVFLAG_ON; - p_st_master->dr_status = p_st_data->dr_status; - - memcpy(p_st_master->uc_data, p_st_data->uc_data, p_st_data->us_size); - - return (uc_ret); -} - -/************************************************************************* -@brief Speed Dead Reckoning GET function -@outline Master Data provides the Speed -@type Completion return type -@param[in] DEADRECKONING_DATA_MASTER *p_st_data : Where to get a pointer to the data master -@threshold none -@return void -@retval none -@trace -*****************************************************************************/ -void DeadReckoningGetSpeedDr(DEADRECKONING_DATA_MASTER *p_st_data) { - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - const DEADRECKONING_DATA_MASTER *p_st_master; - - p_st_master = &gst_speed; - - /** Store the data master in the specified destination. */ - p_st_data->ul_did = p_st_master->ul_did; - p_st_data->us_size = p_st_master->us_size; - p_st_data->uc_rcv_flag = p_st_master->uc_rcv_flag; - p_st_data->dr_status = p_st_master->dr_status; - memcpy(p_st_data->uc_data, p_st_master->uc_data, p_st_master->us_size); -} -// LCOV_EXCL_STOP diff --git a/vehicleservice/positioning/server/src/Sensor/DeadReckoning_main.cpp b/vehicleservice/positioning/server/src/Sensor/DeadReckoning_main.cpp deleted file mode 100755 index 1d956b7..0000000 --- a/vehicleservice/positioning/server/src/Sensor/DeadReckoning_main.cpp +++ /dev/null @@ -1,1086 +0,0 @@ -/* - * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/******************************************************************************* - * File name :DeadReckoning_Main.cpp - * System name :_CWORD107_ - * Subsystem name :DeadReckoning Mains - * Program name :DeadReckoning Mains - * Module configuration :DeadReckoningInit() Guessed navigation initialization processing - * :DeadReckoningRcvMsg() DR Component MSG Receive Processing - ******************************************************************************/ - -#include <positioning_hal.h> - -#include "DeadReckoning_main.h" - -#include "Sensor_Common_API.h" -#include "DeadReckoning_DataMaster.h" -#include "Dead_Reckoning_Local_Api.h" - -#include "DeadReckoning_DbgLogSim.h" - -#include "POS_private.h" - -static RET_API DeadReckoningWriteSharedMemory(VEHICLEDEBUG_MSG_LOGINFO_DAT* loginfo); -static void DeadReckoningSetEvent(PNO pno, RET_API ret); -static void DeadReckoningLinkSharedMemory(char *shared_memory_name, void **share_addr); - -#define DEAD_RECKONING_MAIN_DEBUG 0 -#define DR_DEBUG 0 -#define DR_DEBUG_ENG_MODE 0 - -/*************************************************/ -/* Constant */ -/*************************************************/ - -#define DEAD_RECKONING_BUF_SIZE 7 -#define DR_MASK_WORD_L 0x00FF -#define DR_MASK_WORD_U 0xFF00 - -/*************************************************/ -/* Global variable */ -/*************************************************/ - -/* Data receive confirmation flag */ -BOOL g_gps_data_get_flg = FALSE; -BOOL g_sens_data_get_flg = FALSE; -BOOL g_fst_sens_data_get_flg = FALSE; - -/* Reception flag for each data */ -BOOL g_sens_data_get_sns_cnt_flg = FALSE; -BOOL g_sens_data_get_gyro_x_flg = FALSE; -BOOL g_sens_data_get_gyro_y_flg = FALSE; -BOOL g_sens_data_get_gyro_z_flg = FALSE; -BOOL g_sens_data_get_rev_flg = FALSE; -BOOL g_sens_data_get_spdpulse_flg = FALSE; -BOOL g_sens_data_get_spdpulse_chk_flg = FALSE; - -BOOL g_sens_data_get_gyro_x_fst_flg = FALSE; -BOOL g_sens_data_get_gyro_y_fst_flg = FALSE; -BOOL g_sens_data_get_gyro_z_fst_flg = FALSE; -BOOL g_sens_data_get_rev_fst_flg = FALSE; -BOOL g_sens_data_get_spdpulse_fst_flg = FALSE; -BOOL g_sens_data_get_spdpulse_chk_fst_flg = FALSE; - -/* Receive data storage buffer */ -/* [0]:SNS_COUNTER [1]:REV [2]:SPEED_PULSE_FLAG [3]:SPEED_PULSE [4]:GYRO_X [5]:GYRO_Y [6]:GYRO_Z */ -DEAD_RECKONING_RCVDATA_SENSOR g_sns_buf[DEAD_RECKONING_BUF_SIZE]; -DEAD_RECKONING_SAVEDATA_SENSOR_FIRST g_fst_sns_buf; - -/******************************************************************************* - * MODULE : DeadReckoningInit - * ABSTRACT : Guessed navigation initialization processing - * FUNCTION : Initialize inferred navigation processing - * ARGUMENT : None - * NOTE : - * RETURN : RET_NORMAL :Success in initialization - * RET_ERROR :Master Clear failed - ******************************************************************************/ -int32 DeadReckoningInit(void) { // LCOV_EXCL_START 8: dead code. - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - return RET_NORMAL; -} - -/******************************************************************************* - * MODULE : DeadReckoningRcvMsg - * ABSTRACT : DR Component MSG Receive Processing - * FUNCTION : Receive the DR component MSG - * ARGUMENT : *msg : message buffer - * NOTE : - * RETURN : None - ******************************************************************************/ -void DeadReckoningRcvMsg(const DEAD_RECKONING_RCVDATA *msg, DEAD_RECKONING_LONLAT_INFO *location_info) { - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - if ((msg == NULL) || (location_info == NULL)) { - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "msg == NULL\r\n"); - } else { - const SENSOR_MSG_GPSDATA_DAT *rcv_gps_msg = NULL; - const VEHICLESENS_DATA_MASTER *rcv_sensor_msg = NULL; - const VEHICLESENS_DATA_MASTER_FST *rcv_sensor_msg_fst = NULL; - - Struct_GpsData send_gps_msg; - Struct_SensData send_sensor_msg; - - /* Initialization */ - (void)memset(reinterpret_cast<void *>(&send_gps_msg), 0, sizeof(Struct_GpsData)); - (void)memset(reinterpret_cast<void *>(&send_sensor_msg), 0, sizeof(Struct_SensData)); - - /* Flag is set to FALSE */ - location_info->calc_called = static_cast<u_int8>(FALSE); - location_info->available = static_cast<u_int8>(FALSE); - - if (CID_DEAD_RECKONING_GPS_DATA == msg->hdr.hdr.cid) { - rcv_gps_msg = (const SENSOR_MSG_GPSDATA_DAT *)(&(msg->data[0])); - /* #QAC confirmation Rule11.4 Use structure for member reference(Cast according to shared memory link IF) */ - - /* Receiving GPS Data for DR */ - switch (rcv_gps_msg->ul_did) { - case VEHICLE_DID_GPS_UBLOX_NAV_POSLLH : - case VEHICLE_DID_GPS_UBLOX_NAV_STATUS : - case VEHICLE_DID_GPS_UBLOX_NAV_TIMEUTC : - case VEHICLE_DID_GPS_UBLOX_NAV_VELNED : - case VEHICLE_DID_GPS_UBLOX_NAV_DOP : - case VEHICLE_DID_GPS_UBLOX_NAV_SVINFO : - case VEHICLE_DID_GPS_UBLOX_NAV_CLOCK : - { - g_gps_data_get_flg = TRUE; - break; - } - default: - break; - } - } else if (CID_DEAD_RECKONING_SENS_DATA == msg->hdr.hdr.cid) { - rcv_sensor_msg = (const VEHICLESENS_DATA_MASTER *)(&(msg->data[0])); - /* #QAC confirmation Rule11.4 Use structure for member reference(Cast according to shared memory link IF) */ - - /* Sensor data reception for DR */ - switch (rcv_sensor_msg->ul_did) { - case POSHAL_DID_SNS_COUNTER : - { - g_sns_buf[0].did = rcv_sensor_msg->ul_did; - g_sns_buf[0].size = static_cast<u_int8>(rcv_sensor_msg->us_size); - g_sns_buf[0].data[0] = rcv_sensor_msg->uc_data[0]; - g_sens_data_get_sns_cnt_flg = TRUE; - break; - } - case POSHAL_DID_REV : - { - g_sns_buf[1].did = rcv_sensor_msg->ul_did; - g_sns_buf[1].size = static_cast<u_int8>(rcv_sensor_msg->us_size); - (void)memcpy(reinterpret_cast<void *>(&(g_sns_buf[1].data[0])), - (const void *)(&(rcv_sensor_msg->uc_data[0])), (size_t)rcv_sensor_msg->us_size); - g_sens_data_get_rev_flg = TRUE; - break; - } - case POSHAL_DID_SPEED_PULSE_FLAG : - { - g_sns_buf[2].did = rcv_sensor_msg->ul_did; - g_sns_buf[2].size = static_cast<u_int8>(rcv_sensor_msg->us_size); - (void)memcpy(reinterpret_cast<void *>(&(g_sns_buf[2].data[0])), - (const void *)(&(rcv_sensor_msg->uc_data[0])), (size_t)rcv_sensor_msg->us_size); - g_sens_data_get_spdpulse_chk_flg = TRUE; - break; - } - case POSHAL_DID_SPEED_PULSE : - { - g_sns_buf[3].did = rcv_sensor_msg->ul_did; - g_sns_buf[3].size = static_cast<u_int8>(rcv_sensor_msg->us_size); - (void)memcpy(reinterpret_cast<void *>(&(g_sns_buf[3].data[0])), - (const void *)(&(rcv_sensor_msg->uc_data[0])), (size_t)rcv_sensor_msg->us_size); - g_sens_data_get_spdpulse_flg = TRUE; - break; - } - case POSHAL_DID_GYRO_X : - { - g_sns_buf[4].did = rcv_sensor_msg->ul_did; - g_sns_buf[4].size = static_cast<u_int8>(rcv_sensor_msg->us_size); - (void)memcpy(reinterpret_cast<void *>(&(g_sns_buf[4].data[0])), - (const void *)(&(rcv_sensor_msg->uc_data[0])), (size_t)rcv_sensor_msg->us_size); - g_sens_data_get_gyro_x_flg = TRUE; - break; - } - case POSHAL_DID_GYRO_Y : - { - g_sns_buf[5].did = rcv_sensor_msg->ul_did; - g_sns_buf[5].size = static_cast<u_int8>(rcv_sensor_msg->us_size); - (void)memcpy(reinterpret_cast<void *>(&(g_sns_buf[5].data[0])), - (const void *)(&(rcv_sensor_msg->uc_data[0])), (size_t)rcv_sensor_msg->us_size); - g_sens_data_get_gyro_y_flg = TRUE; - break; - } - case POSHAL_DID_GYRO_Z : - { - g_sns_buf[6].did = rcv_sensor_msg->ul_did; - g_sns_buf[6].size = static_cast<u_int8>(rcv_sensor_msg->us_size); - (void)memcpy(reinterpret_cast<void *>(&(g_sns_buf[6].data[0])), - (const void *)(&(rcv_sensor_msg->uc_data[0])), (size_t)rcv_sensor_msg->us_size); - g_sens_data_get_gyro_z_flg = TRUE; - break; - } - default: - break; - } - } else if (CID_DEAD_RECKONING_SENS_FST_DATA == msg->hdr.hdr.cid) { - u_int16 rev_data_size; - - rcv_sensor_msg_fst = (const VEHICLESENS_DATA_MASTER_FST *)(&(msg->data[0])); - /* #QAC confirmation Rule11.4 Use structure for member reference(Cast according to shared memory link IF) */ - rev_data_size = static_cast<u_int16>(msg->hdr.hdr.msgbodysize - VEHICLESENS_DELIVERY_FSTSNS_HDR_SIZE); - -#if DEAD_RECKONING_MAIN_DEBUG - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, " DID = %08X, rev_data_size = %d ", - rcv_sensor_msg_fst->ul_did, rev_data_size); -#endif - - /* Sensor data reception for DR */ - switch (rcv_sensor_msg_fst->ul_did) { - case POSHAL_DID_REV_FST : - { - (void)memcpy( - reinterpret_cast<void *>(&(g_fst_sns_buf.rev_data[g_fst_sns_buf.rev_rcv_size - / sizeof(g_fst_sns_buf.rev_data[0])])), - (const void *)(&(rcv_sensor_msg_fst->uc_data[0])), - (size_t)(rev_data_size)); - - g_fst_sns_buf.rev_rcv_size = static_cast<u_int16>( - g_fst_sns_buf.rev_rcv_size + rev_data_size); - - if (g_fst_sns_buf.rev_rcv_size == rcv_sensor_msg_fst->us_size) { - g_sens_data_get_rev_fst_flg = TRUE; -#if DEAD_RECKONING_MAIN_DEBUG - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, " REV receive flag = TRUE "); -#endif - } - break; - } - case POSHAL_DID_SPEED_PULSE_FLAG_FST : - { - (void)memcpy( - reinterpret_cast<void *>(&(g_fst_sns_buf.spd_pulse_check_data[g_fst_sns_buf.spd_pulse_check_rcv_size - / sizeof(g_fst_sns_buf.spd_pulse_check_data[0])])), - (const void *)(&(rcv_sensor_msg_fst->uc_data[0])), - (size_t)(rev_data_size)); - - g_fst_sns_buf.spd_pulse_check_rcv_size = static_cast<u_int16>( - g_fst_sns_buf.spd_pulse_check_rcv_size + rev_data_size); - - if (g_fst_sns_buf.spd_pulse_check_rcv_size == rcv_sensor_msg_fst->us_size) { - g_sens_data_get_spdpulse_chk_fst_flg = TRUE; -#if DEAD_RECKONING_MAIN_DEBUG - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, " SPF receive flag = TRUE "); -#endif - } - break; - } - case POSHAL_DID_SPEED_PULSE_FST : - { - (void)memcpy( - reinterpret_cast<void *>(&(g_fst_sns_buf.spd_pulse_data[g_fst_sns_buf.spd_pulse_rcv_size - / sizeof(g_fst_sns_buf.spd_pulse_data[0])])), - (const void *)(&(rcv_sensor_msg_fst->uc_data[0])), - (size_t)(rev_data_size)); - - g_fst_sns_buf.spd_pulse_rcv_size = static_cast<u_int16>(g_fst_sns_buf.spd_pulse_rcv_size + \ - rev_data_size); - - if (g_fst_sns_buf.spd_pulse_rcv_size == rcv_sensor_msg_fst->us_size) { - g_sens_data_get_spdpulse_fst_flg = TRUE; -#if DEAD_RECKONING_MAIN_DEBUG - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, " SP receive flag = TRUE "); -#endif - } - break; - } - case POSHAL_DID_GYRO_X_FST : - { - (void)memcpy( - reinterpret_cast<void *>(&(g_fst_sns_buf.gyro_x_data[g_fst_sns_buf.gyro_x_rcv_size - / sizeof(g_fst_sns_buf.gyro_x_data[0])])), - (const void *)(&(rcv_sensor_msg_fst->uc_data[0])), - (size_t)(rev_data_size)); - - g_fst_sns_buf.gyro_x_rcv_size = static_cast<u_int16>(g_fst_sns_buf.gyro_x_rcv_size + rev_data_size); - -#if DEAD_RECKONING_MAIN_DEBUG - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, - " g_fst_sns_buf.gyro_x_rcv_size = %d, rcv_sensor_msg_fst->us_size = %d ", - g_fst_sns_buf.gyro_x_rcv_size, rcv_sensor_msg_fst->us_size); -#endif - if (g_fst_sns_buf.gyro_x_rcv_size == rcv_sensor_msg_fst->us_size) { - g_sens_data_get_gyro_x_fst_flg = TRUE; -#if DEAD_RECKONING_MAIN_DEBUG - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, " GYRO_X receive flag = TRUE "); -#endif - } - break; - } - case POSHAL_DID_GYRO_Y_FST : - { - (void)memcpy( - reinterpret_cast<void *>(&(g_fst_sns_buf.gyro_y_data[g_fst_sns_buf.gyro_y_rcv_size - / sizeof(g_fst_sns_buf.gyro_y_data[0])])), - (const void *)(&(rcv_sensor_msg_fst->uc_data[0])), - (size_t)(rev_data_size)); - - g_fst_sns_buf.gyro_y_rcv_size = static_cast<u_int16>(g_fst_sns_buf.gyro_y_rcv_size + rev_data_size); - -#if DEAD_RECKONING_MAIN_DEBUG - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, - " g_fst_sns_buf.gyro_y_rcv_size = %d, rcv_sensor_msg_fst->us_size = %d ", - g_fst_sns_buf.gyro_y_rcv_size, rcv_sensor_msg_fst->us_size); -#endif - if (g_fst_sns_buf.gyro_y_rcv_size == rcv_sensor_msg_fst->us_size) { - g_sens_data_get_gyro_y_fst_flg = TRUE; -#if DEAD_RECKONING_MAIN_DEBUG - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, " GYRO_Y receive flag = TRUE "); -#endif - } - break; - } - case POSHAL_DID_GYRO_Z_FST : - { - (void)memcpy( - reinterpret_cast<void *>(&(g_fst_sns_buf.gyro_z_data[g_fst_sns_buf.gyro_z_rcv_size - / sizeof(g_fst_sns_buf.gyro_z_data[0])])), - (const void *)(&(rcv_sensor_msg_fst->uc_data[0])), - (size_t)(rev_data_size)); - - g_fst_sns_buf.gyro_z_rcv_size = static_cast<u_int16>(g_fst_sns_buf.gyro_z_rcv_size + rev_data_size); - -#if DEAD_RECKONING_MAIN_DEBUG - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, - " g_fst_sns_buf.gyro_z_rcv_size = %d, rcv_sensor_msg_fst->us_size = %d ", - g_fst_sns_buf.gyro_z_rcv_size, rcv_sensor_msg_fst->us_size); -#endif - if (g_fst_sns_buf.gyro_z_rcv_size == rcv_sensor_msg_fst->us_size) { - g_sens_data_get_gyro_z_fst_flg = TRUE; -#if DEAD_RECKONING_MAIN_DEBUG - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, " GYRO_Z receive flag = TRUE "); -#endif - } - break; - } - default: - break; - } - } else { - /* nop */ - } - - /* 4 data received? */ - if ((g_sens_data_get_sns_cnt_flg == TRUE) && - (g_sens_data_get_rev_flg == TRUE) && - (g_sens_data_get_gyro_x_flg == TRUE) && - (g_sens_data_get_gyro_y_flg == TRUE) && - (g_sens_data_get_gyro_z_flg == TRUE) && - (g_sens_data_get_spdpulse_flg == TRUE) && - (g_sens_data_get_spdpulse_chk_flg == TRUE)) { - /* Sensor data acquisition flag ON */ - g_sens_data_get_flg = TRUE; - - /* Set all flags to FALSE */ - g_sens_data_get_sns_cnt_flg = FALSE; - g_sens_data_get_gyro_x_flg = FALSE; - g_sens_data_get_gyro_y_flg = FALSE; - g_sens_data_get_gyro_z_flg = FALSE; - g_sens_data_get_rev_flg = FALSE; - g_sens_data_get_spdpulse_flg = FALSE; - g_sens_data_get_spdpulse_chk_flg = FALSE; - } - - /* 4 data received? */ - if ((g_sens_data_get_rev_fst_flg == TRUE) && - (g_sens_data_get_gyro_x_fst_flg == TRUE) && - (g_sens_data_get_gyro_y_fst_flg == TRUE) && - (g_sens_data_get_gyro_z_fst_flg == TRUE) && - (g_sens_data_get_spdpulse_fst_flg == TRUE) && - (g_sens_data_get_spdpulse_chk_fst_flg == TRUE)) { - /* Initial sensor data acquisition flag ON */ - g_fst_sens_data_get_flg = TRUE; - - /* Set all flags to FALSE */ - g_sens_data_get_gyro_x_fst_flg = FALSE; - g_sens_data_get_gyro_y_fst_flg = FALSE; - g_sens_data_get_gyro_z_fst_flg = FALSE; - g_sens_data_get_rev_fst_flg = FALSE; - g_sens_data_get_spdpulse_fst_flg = FALSE; - g_sens_data_get_spdpulse_chk_fst_flg = FALSE; - } - - DeadReckoningRcvMsgFstSens(msg, location_info, rcv_gps_msg, &send_gps_msg, &send_sensor_msg); - } -} - -void DeadReckoningRcvMsgFstSens(const DEAD_RECKONING_RCVDATA *msg, DEAD_RECKONING_LONLAT_INFO *location_info, - const SENSOR_MSG_GPSDATA_DAT *rcv_gps_msg, Struct_GpsData* send_gps_msg, - Struct_SensData* send_sensor_msg) { - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - /* Verifying Debug Log Simulator Mode - Perform packet reading here to match some timing. - However,,Differ between GPS and SENSOR. - */ - u_int8 fst_sens_send_num = 0U; - /* For GPS data */ - if (g_gps_data_get_flg == TRUE) { -#if (DR_DEBUG == 1) /* PastModel002_DR_VEHICLE */ - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, - "DeadReckoningRcvMsg SEND GPS_DATA: DID[0x%08X] DSIZE[%d] MSG_SIZE[%d] SNS_CNT[%d] \r\n", - rcv_gps_msg.ulDid, rcv_gps_msg.ucData[4], msg->hdr.hdr.msgbodysize, rcv_gps_msg.ucSnsCnt); -#endif - - if (1) { - rcv_gps_msg = (const SENSOR_MSG_GPSDATA_DAT *)(&(msg->data[0])); - /* #QAC confirmation Rule11.4 Use structure for member reference(Cast according to shared memory link IF) */ - - /* Set and pass the data part except header/footer */ - send_gps_msg->sens_cnt = rcv_gps_msg->uc_sns_cnt; - send_gps_msg->sens_cnt_flag = rcv_gps_msg->uc_gps_cnt_flag; - send_gps_msg->gps_data_size = rcv_gps_msg->us_size; - send_gps_msg->did = rcv_gps_msg->ul_did; - send_gps_msg->gps_data = (const void *)(&rcv_gps_msg->uc_data[0]); - } - - /* Providing GPS data to DR_Lib */ - - g_gps_data_get_flg = FALSE; - - } else if (g_sens_data_get_flg == TRUE) { - Struct_DR_DATA rcv_dr_data; - DR_CALC_INFO rcv_dr_calc_info; - DEADRECKONING_DATA_MASTER send_data_master; - - if (1) { - /* Each data is stored in the data format for transmission. */ - send_sensor_msg->sens_cnt_flag = 1U; - send_sensor_msg->sens_cnt = g_sns_buf[0].data[0]; - send_sensor_msg->pulse_rev_tbl.reverse_flag = g_sns_buf[1].data[0]; - send_sensor_msg->pulse_rev_tbl.pulse_flag = g_sns_buf[2].data[0]; - send_sensor_msg->pulse_rev_tbl.pulse_sum_cyclic = static_cast<u_int16>( - ((((u_int16)g_sns_buf[3].data[0] << 0) & DR_MASK_WORD_L) | - (((u_int16)g_sns_buf[3].data[1] << 8) & DR_MASK_WORD_U))); - /* ToDo */ - (void)memcpy(reinterpret_cast<void *>(&(send_sensor_msg->gyro_x_tbl.gyro_data[0])), - (const void *)(&(g_sns_buf[4].data[0])), sizeof(u_int16) * NUM_OF_100msData); - (void)memcpy(reinterpret_cast<void *>(&(send_sensor_msg->gyro_y_tbl.gyro_data[0])), - (const void *)(&(g_sns_buf[5].data[0])), sizeof(u_int16) * NUM_OF_100msData); - (void)memcpy(reinterpret_cast<void *>(&(send_sensor_msg->gyro_z_tbl.gyro_data[0])), - (const void *)(&(g_sns_buf[6].data[0])), sizeof(u_int16) * NUM_OF_100msData); - } - -#if (DR_DEBUG == 1) /* PastModel002_DR_VEHICLE */ - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "DeadReckoningRcvMsg SEND SENSOR_COUNTER %d \r\n", - send_sensor_msg->sens_cnt); -#endif - - /* When the sensor data are ready, Call the DR-calculation process. */ - memset(&rcv_dr_data, 0x00, sizeof(rcv_dr_data)); /* Coverity CID:18805 compliant */ - memset(&rcv_dr_calc_info, 0x00, sizeof(rcv_dr_calc_info)); /* Coverity CID:18806 compliant */ - - location_info->calc_called = static_cast<u_int8>(TRUE); - location_info->lonlat.latitude = static_cast<int32>(rcv_dr_data.latitude); - location_info->lonlat.longitude = static_cast<int32>(rcv_dr_data.longitude); - - if (rcv_dr_data.dr_status != static_cast<u_int8>(SENSORLOCATION_DRSTATUS_INVALID)) { - location_info->available = static_cast<u_int8>(TRUE); - } else { - location_info->available = static_cast<u_int8>(FALSE); - } - - /* Changing the order of registration and delivery of the out structure to the data master for DR */ - - send_data_master.ul_did = VEHICLE_DID_DR_SNS_COUNTER; - send_data_master.us_size = VEHICLE_DSIZE_DR_SNS_COUNTER; - send_data_master.uc_rcv_flag = 1; - send_data_master.dr_status = rcv_dr_data.dr_status; - (void)memcpy(reinterpret_cast<void *>(&(send_data_master.uc_data[0])), - (const void *)(&(rcv_dr_data.positioning_time)), (size_t)VEHICLE_DSIZE_DR_SNS_COUNTER); - DeadReckoningSetDataMaster(&send_data_master, (PFUNC_DR_DMASTER_SET_N)DeadReckoningDeliveryProc); - - send_data_master.ul_did = VEHICLE_DID_DR_LONGITUDE; - send_data_master.us_size = VEHICLE_DSIZE_LONGITUDE; - send_data_master.uc_rcv_flag = 1; - send_data_master.dr_status = rcv_dr_data.dr_status; - (void)memcpy(reinterpret_cast<void *>(&(send_data_master.uc_data[0])), - (const void *)(&(rcv_dr_data.longitude)), (size_t)VEHICLE_DSIZE_LONGITUDE); - DeadReckoningSetDataMaster(&send_data_master, (PFUNC_DR_DMASTER_SET_N)DeadReckoningDeliveryProc); - - send_data_master.ul_did = VEHICLE_DID_DR_LATITUDE; - send_data_master.us_size = VEHICLE_DSIZE_LATITUDE; - send_data_master.uc_rcv_flag = 1; - send_data_master.dr_status = rcv_dr_data.dr_status; - (void)memcpy(reinterpret_cast<void *>(&(send_data_master.uc_data[0])), - (const void *)(&(rcv_dr_data.latitude)), (size_t)VEHICLE_DSIZE_LATITUDE); - DeadReckoningSetDataMaster(&send_data_master, (PFUNC_DR_DMASTER_SET_N)DeadReckoningDeliveryProc); - - send_data_master.ul_did = VEHICLE_DID_DR_ALTITUDE; - send_data_master.us_size = VEHICLE_DSIZE_ALTITUDE; - send_data_master.uc_rcv_flag = 1; - send_data_master.dr_status = rcv_dr_data.dr_status; - (void)memcpy(reinterpret_cast<void *>(&(send_data_master.uc_data[0])), - (const void *)(&(rcv_dr_data.altitude)), (size_t)VEHICLE_DSIZE_ALTITUDE); - DeadReckoningSetDataMaster(&send_data_master, (PFUNC_DR_DMASTER_SET_N)DeadReckoningDeliveryProc); - - send_data_master.ul_did = VEHICLE_DID_DR_SPEED; - send_data_master.us_size = VEHICLE_DSIZE_SPEED; - send_data_master.uc_rcv_flag = 1; - send_data_master.dr_status = rcv_dr_data.dr_status; - (void)memcpy(reinterpret_cast<void *>(&(send_data_master.uc_data[0])), - (const void *)(&(rcv_dr_data.rate)), (size_t)VEHICLE_DSIZE_SPEED); - DeadReckoningSetDataMaster(&send_data_master, (PFUNC_DR_DMASTER_SET_N)DeadReckoningDeliveryProc); - - send_data_master.ul_did = VEHICLE_DID_DR_HEADING; - send_data_master.us_size = VEHICLE_DSIZE_HEADING; - send_data_master.uc_rcv_flag = 1; - send_data_master.dr_status = rcv_dr_data.dr_status; - (void)memcpy(reinterpret_cast<void *>(&(send_data_master.uc_data[0])), - (const void *)(&(rcv_dr_data.heading)), (size_t)VEHICLE_DSIZE_HEADING); - DeadReckoningSetDataMaster(&send_data_master, (PFUNC_DR_DMASTER_SET_N)DeadReckoningDeliveryProc); - - /* Data master setting,Data delivery(GyroParameter) */ - /* As it is registered for delivery with DID = VEHICLE_DID_DR_GYRO_SCALE_FACTOR_LEVEL */ - /* Process in GyroOffset-> GyroScaleFactor-> GyroScelFactorLevel order(Processing order cannot be changed.) */ - send_data_master.ul_did = VEHICLE_DID_DR_GYRO_OFFSET; - send_data_master.us_size = VEHICLE_DSIZE_GYRO_OFFSET; - send_data_master.uc_rcv_flag = DEADRECKONING_RCVFLAG_ON; - send_data_master.dr_status = 0U; /* Not used */ - (void)memcpy(reinterpret_cast<void *>(&(send_data_master.uc_data[0])), - reinterpret_cast<void *>(&(rcv_dr_calc_info.gyro_offset)), (size_t)send_data_master.us_size); - DeadReckoningSetDataMaster(&send_data_master, (PFUNC_DR_DMASTER_SET_N)DeadReckoningDeliveryProc); - - send_data_master.ul_did = VEHICLE_DID_DR_GYRO_SCALE_FACTOR; - send_data_master.us_size = VEHICLE_DSIZE_GYRO_SCALE_FACTOR; - send_data_master.uc_rcv_flag = DEADRECKONING_RCVFLAG_ON; - send_data_master.dr_status = 0U; /* Not used */ - (void)memcpy(reinterpret_cast<void *>(&(send_data_master.uc_data[0])), - reinterpret_cast<void *>(&(rcv_dr_calc_info.gyro_scale_factor)), - (size_t)send_data_master.us_size); - DeadReckoningSetDataMaster(&send_data_master, (PFUNC_DR_DMASTER_SET_N)DeadReckoningDeliveryProc); - - send_data_master.ul_did = VEHICLE_DID_DR_GYRO_SCALE_FACTOR_LEVEL; - send_data_master.us_size = VEHICLE_DSIZE_GYRO_SCALE_FACTOR_LEVEL; - send_data_master.uc_rcv_flag = DEADRECKONING_RCVFLAG_ON; - send_data_master.dr_status = 0U; /* Not used */ - (void)memcpy(reinterpret_cast<void *>(&(send_data_master.uc_data[0])), - reinterpret_cast<void *>(&(rcv_dr_calc_info.gyro_scale_factor_level)), - (size_t)(send_data_master.us_size)); - DeadReckoningSetDataMaster(&send_data_master, (PFUNC_DR_DMASTER_SET_N)DeadReckoningDeliveryProc); - - /* Data master setting,Data delivery(SpeedPulseParameter) */ - /* As it is registered for delivery with DID = VEHICLE_DID_DR_SPEED_PULSE_SCALE_FACTOR_LEVEL */ - /* Process in SpeedPulseScaleFactor-> SpeedPulseScaleFactorLevel order(Processing order cannot be changed.) */ - send_data_master.ul_did = VEHICLE_DID_DR_SPEED_PULSE_SCALE_FACTOR; - send_data_master.us_size = VEHICLE_DSIZE_SPEED_PULSE_SCALE_FACTOR; - send_data_master.uc_rcv_flag = DEADRECKONING_RCVFLAG_ON; - send_data_master.dr_status = 0U; /* Not used */ - (void)memcpy(reinterpret_cast<void *>(&(send_data_master.uc_data[0])), - reinterpret_cast<void *>(&(rcv_dr_calc_info.speed_pulse_scale_factor)), - (size_t)(send_data_master.us_size)); - DeadReckoningSetDataMaster(&send_data_master, (PFUNC_DR_DMASTER_SET_N)DeadReckoningDeliveryProc); - - send_data_master.ul_did = VEHICLE_DID_DR_SPEED_PULSE_SCALE_FACTOR_LEVEL; - send_data_master.us_size = VEHICLE_DSIZE_SPEED_PULSE_SCALE_FACTOR_LEVEL; - send_data_master.uc_rcv_flag = DEADRECKONING_RCVFLAG_ON; - send_data_master.dr_status = 0U; /* Not used */ - (void)memcpy(reinterpret_cast<void *>(&(send_data_master.uc_data[0])), - reinterpret_cast<void *>(&(rcv_dr_calc_info.speed_pulse_scale_factor_level)), - (size_t)(send_data_master.us_size)); - DeadReckoningSetDataMaster(&send_data_master, (PFUNC_DR_DMASTER_SET_N)DeadReckoningDeliveryProc); - - g_sens_data_get_flg = FALSE; - } else if (g_fst_sens_data_get_flg == TRUE) { -#if (DR_DEBUG == 1) /* PastModel002_DR_VEHICLE */ - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "DeadReckoningRcvMsg FstSnsData -> DeadReckoningLibrary. \r\n"); -#endif - for (fst_sens_send_num = 0; fst_sens_send_num < g_fst_sns_buf.data_num; fst_sens_send_num++) { - /* Each data is stored in the data format for transmission. */ - send_sensor_msg->sens_cnt_flag = 0U; - send_sensor_msg->sens_cnt = 0U; - send_sensor_msg->pulse_rev_tbl.reverse_flag = g_fst_sns_buf.rev_data[fst_sens_send_num]; - send_sensor_msg->pulse_rev_tbl.pulse_flag = g_fst_sns_buf.spd_pulse_check_data[fst_sens_send_num]; - send_sensor_msg->pulse_rev_tbl.pulse_sum_cyclic = g_fst_sns_buf.spd_pulse_data[fst_sens_send_num]; - (void)memcpy(reinterpret_cast<void *>(&(send_sensor_msg->gyro_x_tbl.gyro_data[0])), - (const void *)(&(g_fst_sns_buf.gyro_x_data[fst_sens_send_num * NUM_OF_100msData])), - (size_t)((sizeof(g_fst_sns_buf.gyro_x_data[fst_sens_send_num])) * NUM_OF_100msData)); - (void)memcpy(reinterpret_cast<void *>(&(send_sensor_msg->gyro_y_tbl.gyro_data[0])), - (const void *)(&(g_fst_sns_buf.gyro_y_data[fst_sens_send_num * NUM_OF_100msData])), - (size_t)((sizeof(g_fst_sns_buf.gyro_y_data[fst_sens_send_num])) * NUM_OF_100msData)); - (void)memcpy(reinterpret_cast<void *>(&(send_sensor_msg->gyro_z_tbl.gyro_data[0])), - (const void *)(&(g_fst_sns_buf.gyro_z_data[fst_sens_send_num * NUM_OF_100msData])), - (size_t)((sizeof(g_fst_sns_buf.gyro_z_data[fst_sens_send_num])) * NUM_OF_100msData)); - -#if (DR_DEBUG == 1) /* PastModel002_DR_VEHICLE */ - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "DeadReckoningRcvMsg send_sensor_msg.sens_cnt_flag %d \r\n", - send_sensor_msg->sens_cnt_flag); - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "DeadReckoningRcvMsg SEND SENSOR_COUNTER %d \r\n", - send_sensor_msg->sens_cnt); -#endif - - /* Sleep to reduce CPU load */ - MilliSecSleep(DR_FST_SENS_CALC_SLEEP_TIME); - - /* When the sensor data are ready, Call the DR-calculation process. */ - } - - g_sens_data_get_flg = FALSE; - - g_fst_sens_data_get_flg = FALSE; - - } else { - /* nop */ - } -} - -/******************************************************************************* -* MODULE : DeadReckoningGetDRData -* ABSTRACT : Vehicle sensor information acquisition -* FUNCTION : -* ARGUMENT : *msg : message buffer -* NOTE : -* RETURN : void -******************************************************************************/ -void DeadReckoningGetDRData(const DEADRECKONING_MSG_GET_DR_DATA *msg) { - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - void *share_top; /* Start address of shared memory */ - u_int32 share_size; /* Size of shared memory area */ - RET_API ret_api; - int32 ret; - int32 event_val = VEHICLE_RET_NORMAL; - EventID event_id; - DEADRECKONING_DATA_MASTER dr_master; /* GPS Data Master */ - - DEADRECKONING_MSG_GET_DR_DATA msg_buf; - - /* Defines the data master for each API. */ - SENSORLOCATION_MSG_LONLATINFO_DAT msg_lonlat_info; - SENSORLOCATION_MSG_ALTITUDEINFO_DAT msg_altitude_info; - SENSORMOTION_MSG_SPEEDINFO_DAT msg_speed_info; - SENSORMOTION_MSG_HEADINGINFO_DAT msg_heading_info; - - (void)memset(reinterpret_cast<void *>(&msg_buf), 0, sizeof(DEADRECKONING_MSG_GET_DR_DATA)); - memcpy(&(msg_buf), msg, sizeof(DEADRECKONING_MSG_GET_DR_DATA)); - - /* Check the DID */ - ret = DeadReckoningCheckDid(msg_buf.data.did); - - if (VEHICLESENS_INVALID != ret) { - /* DID normal */ - - /* Link to shared memory */ - ret_api = _pb_LinkShareData(const_cast<char *>(VEHICLE_SHARE_NAME), &share_top, &share_size); - if (RET_NORMAL == ret_api) { - /* Acquire the specified data from the data master. */ - (void)memset(reinterpret_cast<void *>(&dr_master), 0, sizeof(DEADRECKONING_DATA_MASTER)); - DeadReckoningGetDataMaster(msg_buf.data.did, &dr_master); - - /* Align data from the data master for API I/F */ - switch ((u_int32)(msg_buf.data.did)) { - /* Describes the process for each DID. */ - case VEHICLE_DID_DR_LATITUDE: - { - (void)memset(reinterpret_cast<void *>(&msg_lonlat_info), - 0, sizeof(SENSORLOCATION_MSG_LONLATINFO_DAT)); - - /* Size storage(LATITUDE) */ - msg_lonlat_info.size = static_cast<u_int16>(sizeof(SENSORLOCATION_MSG_LONLATINFO_DAT)); - - /* DR status setting */ - msg_lonlat_info.dr_status = dr_master.dr_status; - - /* The DR enable flag is set to DR status. */ - msg_lonlat_info.is_exist_dr = dr_master.dr_status; - - /* Set the Latitude */ - memcpy(&(msg_lonlat_info.latitude), &(dr_master.uc_data[0]), dr_master.us_size); - - /* Obtain the data master Longitude */ - (void)memset(reinterpret_cast<void *>(&dr_master), 0, sizeof(DEADRECKONING_DATA_MASTER)); - DeadReckoningGetDataMaster(VEHICLE_DID_DR_LONGITUDE, &dr_master); - - /* Set the Longitude */ - memcpy(&(msg_lonlat_info.longitude), &(dr_master.uc_data[0]), dr_master.us_size); - - /* Acquire data master SensorCnt */ - (void)memset(reinterpret_cast<void *>(&dr_master), 0, sizeof(DEADRECKONING_DATA_MASTER)); - DeadReckoningGetDataMaster(VEHICLE_DID_DR_SNS_COUNTER, &dr_master); - - /* Set the SensorCnt */ - memcpy(&(msg_lonlat_info.sensor_cnt), &(dr_master.uc_data[0]), dr_master.us_size); - - /* Write data master to shared memory */ - PosSetShareData(share_top, - msg_buf.data.offset, - (const void *)&msg_lonlat_info, - sizeof(msg_lonlat_info)); - - /* Set Successful Completion */ - event_val = VEHICLE_RET_NORMAL; - - break; - } - case VEHICLE_DID_DR_ALTITUDE: - { - (void)memset(reinterpret_cast<void *>(&msg_altitude_info), - 0, sizeof(SENSORLOCATION_MSG_ALTITUDEINFO_DAT)); - - msg_altitude_info.size = static_cast<u_int16>(sizeof(SENSORLOCATION_MSG_ALTITUDEINFO_DAT)); - /* The DR enable flag is set to DR status. */ - msg_altitude_info.is_exist_dr = dr_master.dr_status; - msg_altitude_info.dr_status = dr_master.dr_status; - - /* Set the Speed */ - memcpy(&(msg_altitude_info.altitude), &(dr_master.uc_data[0]), dr_master.us_size); - - /* Acquire data master SensorCnt */ - (void)memset(reinterpret_cast<void *>(&dr_master), 0, sizeof(DEADRECKONING_DATA_MASTER)); - DeadReckoningGetDataMaster(VEHICLE_DID_DR_SNS_COUNTER, &dr_master); - - /* Set the SensorCnt */ - memcpy(&(msg_altitude_info.sensor_cnt), &(dr_master.uc_data[0]), dr_master.us_size); - - /* Write data master to shared memory */ - PosSetShareData(share_top, - msg_buf.data.offset, - (const void *)&msg_altitude_info, - sizeof(msg_altitude_info)); - - /* Set Successful Completion */ - event_val = VEHICLE_RET_NORMAL; - - break; - } - case VEHICLE_DID_DR_SPEED: - { - (void)memset(reinterpret_cast<void *>(&msg_speed_info), - 0, sizeof(SENSORMOTION_MSG_SPEEDINFO_DAT)); - - msg_speed_info.size = static_cast<u_int16>(sizeof(SENSORMOTION_MSG_SPEEDINFO_DAT)); - /* The DR enable flag is set to DR status. */ - msg_speed_info.is_exist_dr = dr_master.dr_status; - msg_speed_info.dr_status = dr_master.dr_status; - - /* Set the Speed */ - memcpy(&(msg_speed_info.speed), &(dr_master.uc_data[0]), dr_master.us_size); - - /* Acquire data master SensorCnt */ - (void)memset(reinterpret_cast<void *>(&dr_master), 0, sizeof(DEADRECKONING_DATA_MASTER)); - DeadReckoningGetDataMaster(VEHICLE_DID_DR_SNS_COUNTER, &dr_master); - /* Set the SensorCnt */ - memcpy(&(msg_speed_info.sensor_cnt), &(dr_master.uc_data[0]), dr_master.us_size); - - /* Write data master to shared memory */ - PosSetShareData(share_top, - msg_buf.data.offset, - (const void *)&msg_speed_info, - sizeof(msg_speed_info)); - - /* Set Successful Completion */ - event_val = VEHICLE_RET_NORMAL; - - break; - } - case VEHICLE_DID_DR_HEADING: - { - (void)memset(reinterpret_cast<void *>(&msg_heading_info), - 0, sizeof(SENSORMOTION_MSG_HEADINGINFO_DAT)); - - msg_heading_info.size = static_cast<u_int16>(sizeof(SENSORMOTION_MSG_HEADINGINFO_DAT)); - /* The DR enable flag is set to DR status. */ - msg_heading_info.is_exist_dr = dr_master.dr_status; - msg_heading_info.dr_status = dr_master.dr_status; - - /* Set the Heading */ - memcpy(&(msg_heading_info.heading), &(dr_master.uc_data[0]), dr_master.us_size); - - /* Acquire data master SensorCnt */ - (void)memset(reinterpret_cast<void *>(&dr_master), 0, sizeof(DEADRECKONING_DATA_MASTER)); - DeadReckoningGetDataMaster(VEHICLE_DID_DR_SNS_COUNTER, &dr_master); - /* Set the SensorCnt */ - memcpy(&(msg_heading_info.sensor_cnt), &(dr_master.uc_data[0]), dr_master.us_size); - - /* Write data master to shared memory */ - PosSetShareData(share_top, - msg_buf.data.offset, - (const void *)&msg_heading_info, - sizeof(msg_heading_info)); - /* Set Successful Completion */ - event_val = VEHICLE_RET_NORMAL; - - break; - } - /* Other than the above */ - default: - /* Do not edit. */ - break; - } - - /* Check the data size */ - if (msg_buf.data.size < dr_master.us_size) { - /* Shared memory error(Insufficient storage size) */ - event_val = VEHICLE_RET_ERROR_OUTOF_MEMORY; - } - } else { - /* Shared memory error */ - event_val = VEHICLE_RET_ERROR_OUTOF_MEMORY; - } - } else { - /* DID error */ - event_val = VEHICLE_RET_ERROR_DID; - } - - /* Event Generation */ - event_id = VehicleCreateEvent(msg_buf.data.pno); - - /* Publish Events */ - ret_api = _pb_SetEvent(event_id, SAPI_EVSET_ABSOLUTE, event_val); -} - -/******************************************************************************* -* MODULE : DeadReckoningSetMapMatchingData -* ABSTRACT : Map-Matching information setting -* FUNCTION : Setting Map-Matching Information -* ARGUMENT : *msg : message buffer -* NOTE : -* RETURN : void -******************************************************************************/ -void DeadReckoningSetMapMatchingData(const DR_MSG_MAP_MATCHING_DATA *msg) { - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert -} - -/******************************************************************************* -* MODULE : DeadReckoningClearBackupData -* ABSTRACT : Backup data clear function CALL -* FUNCTION : Call the backup data clear function. -* ARGUMENT : *msg : message buffer -* NOTE : -* RETURN : None -******************************************************************************/ -void DeadReckoningClearBackupData(const DR_MSG_CLEAR_BACKUP_DATA *msg) { - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - char event_name[32]; /* Event name character string buffer */ - EventID event_id; /* Event ID */ - int32 event_val; /* Event value to set*/ - RET_API ret_api; /* System API return value */ - - if (msg != NULL) { - /* DR backup data initialization function call */ - event_val = RET_NORMAL; - - /* Initialization of event name character string buffer */ - (void)memset(reinterpret_cast<void *>(event_name), 0, sizeof(event_name)); - - /* Event name creation */ - snprintf(event_name, sizeof(event_name), "DR_API_%X", msg->hdr.hdr.sndpno); - /* Match DR_API.cpp side with name */ - - /* Event Generation */ - event_id = _pb_CreateEvent(_CWORD64_EVENT_MANUALRESET_OFF, DR_EVENT_VAL_INIT, event_name); - - if (event_id != 0) { - /* For successful event generation */ - /* Set the event */ - ret_api = _pb_SetEvent(event_id, SAPI_EVSET_ABSOLUTE, event_val); - - if (ret_api == RET_NORMAL) { - /* Successful event set */ - } else { - /* Event set failed */ - /* Delete Event and Return Event Generation Failed */ - ret_api = _pb_DeleteEvent(event_id); - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "_pb_SetEvent Failed\r\n"); - } - } - } -} - -/******************************************************************************* -* MODULE : DeadReckoningSetEvent -* ABSTRACT : Set of events -* FUNCTION : Set event to return successful or unsuccessful log configuration retrieval -* ARGUMENT : PNO pno : Caller Pno -* : RET_API ret : Log setting acquisition Success/Fail -* : RET_NORMAL: Log setting acquisition success -* : RET_ERROR: Log setting acquisition failure -* NOTE : -* RETURN : None -******************************************************************************/ -static void DeadReckoningSetEvent(PNO pno, RET_API ret) { - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - char event_name[32]; /* Event name character string buffer */ - EventID event_id; /* Event ID */ - RET_API ret_api; /* System API return value */ - - /* Initialization of event name character string buffer */ - (void)memset(reinterpret_cast<void *>(event_name), 0, sizeof(event_name)); - - /* Event name creation */ - snprintf(event_name, sizeof(event_name), "VehicleDebug_%X", pno); - /* Event name should match VehicleDebug_API.cpp */ - - /* Event Generation */ - event_id = _pb_CreateEvent(_CWORD64_EVENT_MANUALRESET_OFF, VEHICLEDEBUG_EVENT_VAL_INIT, event_name); - - if (event_id != 0) { - /* For successful event generation */ - /* Set the event */ - ret_api = _pb_SetEvent(event_id, SAPI_EVSET_ABSOLUTE, ret); - - if (ret_api == RET_NORMAL) { - /* Successful event set */ - } else { - /* Event set failed */ - /* Delete Event */ - ret_api = _pb_DeleteEvent(event_id); - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "_pb_SetEvent Failed\r\n"); - } - } -} - -/******************************************************************************* -* MODULE : DeadReckoningLinkSharedMemory -* ABSTRACT : Shared memory link -* FUNCTION : Link to shared memory -* ARGUMENT : char *shared_memory_name : Name of shared memory to link -* : void **share_addr : Pointer to a variable that stores the address of the linked shared memory. -* NOTE : -* RETURN : None -******************************************************************************/ -static void DeadReckoningLinkSharedMemory(char *shared_memory_name, void **share_addr) { - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - RET_API ret_api; - void *pv_share_mem; /* Store Shared Memory Address */ - u_int32 share_mem_size; /* Size of the linked shared memory */ - - if ((shared_memory_name != NULL) && (share_addr != NULL)) { - /* Link to the handle storage area */ - ret_api = _pb_LinkShareData(shared_memory_name, &pv_share_mem, &share_mem_size); - - if (ret_api == RET_NORMAL) { - /* If the link is successful */ - if (share_mem_size == VEHICLEDEBUG_MSGBUF_DSIZE) { - /* When the size of the linked shared memory is correct */ - *share_addr = pv_share_mem; /* Set the address */ - } else { - /* The size of the linked shared memory is incorrect. */ - *share_addr = NULL; - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "Bad shared memory size\r\n"); - } - } else { - /* If the link fails */ - *share_addr = NULL; - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "Can't link shared memory\r\n"); - } - } -} - -/******************************************************************************* -* MODULE : DeadReckoningWriteSharedMemory -* ABSTRACT : Write Shared Memory -* FUNCTION : Write Shared Memory -* ARGUMENT : VEHICLEDEBUG_MSG_LOGINFO_DAT* loginfo : Logging information -* RETURN : RET_API : Whether writing to shared memory was successful -* : : RET_NORMAL Success -* : : RET_ERROR Failed -* NOTE : -******************************************************************************/ -static RET_API DeadReckoningWriteSharedMemory(VEHICLEDEBUG_MSG_LOGINFO_DAT* loginfo) { - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - static VEHICLEDEBUG_MSG_LOGINFO_DAT *share_addr = NULL; /* Store Shared Memory Address */ - static SemID sem_id = 0; /* ID of shared memory exclusive semaphore */ - - RET_API ret = RET_NORMAL; /* Return of the functions */ - RET_API ret_api; /* Return of the functions */ - -#if DEAD_RECKONING_MAIN_DEBUG - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "Call %s\r\n", __func__); -#endif - - /* Get Semaphore ID */ - if (sem_id == 0) { - sem_id = _pb_CreateSemaphore(const_cast<char *>(SENSOR_LOG_SETTING_SEMAPHO_NAME)); - } - - if (sem_id != 0) { - /* Semaphore ID successfully acquired */ - ret_api = _pb_SemLock(sem_id); /* Semaphore Lock */ - - if (ret_api == RET_NORMAL) { - /* Semaphore lock successful */ - - /* When the shared memory is not linked */ - if (share_addr == NULL) { - /* Link to shared memory */ - DeadReckoningLinkSharedMemory(const_cast<char *>(LOG_SETTING_SHARE_MEMORY_NAME), - reinterpret_cast<void **>(&share_addr)); - /* #QAC confirmation Rule11.4 Use structure for member reference(Cast according to shared memory link IF) */ - } - - if (share_addr != NULL) { - /* The link to shared memory is successful. */ - /* Writing Data to Shared Memory */ - share_addr->log_sw = loginfo->log_sw; - (void)memcpy(reinterpret_cast<void *>(share_addr->severity), - (const void *)(loginfo->severity), sizeof(share_addr->severity)); - } else { - /* Failed to link to shared memory */ - ret = RET_ERROR; - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "DeadReckoningLinkSharedMemory Failed"); - } - /* Semaphore unlock */ - (void)_pb_SemUnlock(sem_id); - } else { - /* Semaphore lock failed */ - ret = RET_ERROR; - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "_pb_SemLock Failed"); - } - } else { - ret = RET_ERROR; - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "sem_id == 0"); - } - - return ret; -} - -/******************************************************************************* -* MODULE : DeadReckoningGetLocationLogStatus -* ABSTRACT : CALL of functions for acquiring logging settings -* FUNCTION : Call the log setting acquisition function. -* ARGUMENT : None -* NOTE : -* RETURN : void -******************************************************************************/ -void DeadReckoningGetLocationLogStatus(PNO pno) { - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - RET_API ret_api; /* System API return value */ - RET_API ret; - VEHICLEDEBUG_MSG_LOGINFO_DAT loginfo; /* Logging information */ - BOOL log_sw = FALSE; - - /* CALL of functions for acquiring logging settings */ - ret_api = RET_NORMAL; - - if (ret_api == RET_NORMAL) { - /* Log setting acquisition function succeeded */ - loginfo.log_sw = (u_int32)(log_sw); - - /* Write to shared memory */ - ret = DeadReckoningWriteSharedMemory(&loginfo); - - /* Event publishing */ - DeadReckoningSetEvent(pno, ret); - } else { - /* Log setting acquisition function failed */ - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "GetLocationLogSetting Failed"); - - /* Event publishing */ - DeadReckoningSetEvent(pno, RET_ERROR); - } -} - -/******************************************************************************* -* MODULE : DeadReckoningSetLocationLogStatus -* ABSTRACT : CALL of log-setting-request-function -* FUNCTION : Call the log setting request function. -* ARGUMENT : u_int32 log_sw : Log type -* : u_int8 severity : Output level -* NOTE : -* RETURN : void -******************************************************************************/ -void DeadReckoningSetLocationLogStatus(BOOL log_sw, u_int8 severity) { - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert -} - -// LCOV_EXCL_STOP diff --git a/vehicleservice/positioning/server/src/Sensor/GpsInt.cpp b/vehicleservice/positioning/server/src/Sensor/GpsInt.cpp deleted file mode 100755 index 75fb890..0000000 --- a/vehicleservice/positioning/server/src/Sensor/GpsInt.cpp +++ /dev/null @@ -1,171 +0,0 @@ -/* - * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/******************************************************************************* - * File name :GpsInt.cpp - * System name :PastModel002 - * Subsystem name :GPS interrupt thread - ******************************************************************************/ - -/******************************************************************************* -* Include File -*******************************************************************************/ -#include <vehicle_service/positioning_base_library.h> -#include "POS_private.h" -#include "GpsInt.h" - -#define RD_REG32(reg) \ - (*(volatile ULONG * const)(reg)) - -#define COMREGMSK_OR 1 -#define ALLINTMASK 0x0f - -#ifdef __cplusplus -extern "C" { -#endif -void com_regmsk_dword(ULONG *, ULONG, UCHAR, UCHAR); // NOLINT(readability/nolint) -#ifdef __cplusplus -} -#endif - -/******************************************************************************* -* Define -*******************************************************************************/ -#define GPS_INT_THREAD_DEBUG_SWITCH 0 /* 0:OFF 1:ON */ - -/******************************************************************************* -* Global Parameter -*******************************************************************************/ -GPS_INT_DATA g_gps_int_data; - -/******************************************************************************* -* Module -*******************************************************************************/ -/******************************************************************************* - * MODULE : DEVGpsIntUnMapDevice - * ABSTRACT : Register mapping release processing - * FUNCTION : Release the register mapping - * ARGUMENT : None - * NOTE : - * RETURN : None - ******************************************************************************/ -void DEVGpsIntUnMapDevice(void) { - /* Release GPIO Register Mapping */ - if ((g_gps_int_data.irq_status_reg != 0) - || (g_gps_int_data.irq_status_set_reg != 0) - || (g_gps_int_data.rising_detect_reg != 0)) { - /* When GPIO registers are mapped */ - /* #QAC confirmation Rule11.3 Data Size Equivalent (4Byte),No problem due to unsigned relation */ - MunMapDeviceIo((HANDLE)g_gps_int_data.irq_status_reg, sizeof(g_gps_int_data.irq_status_reg)); - /* #QAC confirmation Rule11.3 Data Size Equivalent (4Byte),No problem due to unsigned relation */ - MunMapDeviceIo((HANDLE)g_gps_int_data.irq_status_set_reg, sizeof(g_gps_int_data.irq_status_set_reg)); - /* #QAC confirmation Rule11.3 Data Size Equivalent (4Byte),No problem due to unsigned relation */ - MunMapDeviceIo((HANDLE)g_gps_int_data.rising_detect_reg, sizeof(g_gps_int_data.rising_detect_reg)); - - g_gps_int_data.irq_status_reg = 0; - g_gps_int_data.irq_status_set_reg = 0; - g_gps_int_data.rising_detect_reg = 0; - } -} - -/******************************************************************************* - * MODULE : DEVGpsIntSetInterupt - * ABSTRACT : GPS interrupt setting - * FUNCTION : Setting GPS Interrupt - * ARGUMENT : None - * NOTE : - * RETURN : TRUE : Interrupt setting success - * : FALSE : Interrupt setting failure - ******************************************************************************/ -void DEVGpsIntSetInterupt(void) { -#if GPS_INT_THREAD_DEBUG_SWITCH - /* Dummy read */ - itr_ret = RD_REG32(g_gps_int_data.irq_status_set_reg); - - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "GpsInt.cpp, IRQSTATUS_SET reg value(before) = 0x%08X ", itr_ret); -#endif - - /* GPS interrupt Enable setting */ - /* Dummy read */ - /* #QAC confirmation Rule11.3 Data Size Equivalent (4Byte),No problem due to unsigned relation */ - (void)RD_REG32(g_gps_int_data.irq_status_set_reg); - -#if GPS_INT_THREAD_DEBUG_SWITCH - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "GpsInt.cpp, IRQSTATUS_SET reg value(after) = 0x%08X ", itr_ret); -#endif - - - -#if GPS_INT_THREAD_DEBUG_SWITCH - /* Dummy read */ - itr_ret = RD_REG32(g_gps_int_data.rising_detect_reg); - - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "GpsInt.cpp, RISINGDETECT reg value(before) = 0x%08X ", itr_ret); -#endif - - /* GPS Interrupt Detection Method Setting */ - /* #QAC confirmation Rule11.3 Data Size Equivalent (4Byte),No problem due to unsigned relation */ - com_regmsk_dword(reinterpret_cast<ULONG *>(g_gps_int_data.rising_detect_reg), \ - GPS_MASK_6BIT, COMREGMSK_OR, ALLINTMASK); - - /* Dummy read */ - /* #QAC confirmation Rule11.3 Data Size Equivalent (4Byte),No problem due to unsigned relation */ - (void)RD_REG32(g_gps_int_data.rising_detect_reg); - -#if GPS_INT_THREAD_DEBUG_SWITCH - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "GpsInt.cpp, RISINGDETECT reg value(after) = 0x%08X ", itr_ret); -#endif -} - -/******************************************************************************* - * MODULE : DEVGpsIntIntRegClear - * ABSTRACT : Interrupt cause register clear processing - * FUNCTION : Clear the interrupt cause register - * ARGUMENT : None - * NOTE : - * RETURN : None - ******************************************************************************/ -void DEVGpsIntIntRegClear(void) { -#if GPS_INT_THREAD_DEBUG_SWITCH - /* Dummy read */ - itr_ret = RD_REG32(g_gps_int_data.irq_status_reg); - - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "GpsInt.cpp, IRQSTATUS reg value(before) = 0x%08X ", itr_ret); -#endif - - /* Clear Interrupt Source Register */ - /* Dummy read */ - /* #QAC confirmation Rule11.3 Data Size Equivalent (4Byte),No problem due to unsigned relation */ - (void)RD_REG32(g_gps_int_data.irq_status_reg); - -#if GPS_INT_THREAD_DEBUG_SWITCH - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "GpsInt.cpp, IRQSTATUS reg value(after) = 0x%08X ", itr_ret); -#endif -} - -/******************************************************************************* - * MODULE : DEVGpsIntSndMsg - * ABSTRACT : Send GPS interrupt occurrence notification - * FUNCTION : Notify GPS communication management that an interrupt has occurred. - * ARGUMENT : None - * NOTE : - * RETURN : RET_NORMAL : Normal completion - * : Other than the above : Processing error - ******************************************************************************/ -RET_API DEVGpsIntSndMsg(void) { - return RET_NORMAL; -} - diff --git a/vehicleservice/positioning/server/src/Sensor/Makefile b/vehicleservice/positioning/server/src/Sensor/Makefile deleted file mode 100755 index bb70229..0000000 --- a/vehicleservice/positioning/server/src/Sensor/Makefile +++ /dev/null @@ -1,181 +0,0 @@ -# -# @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -######### installed library(*.a) ############# -INST_LIBS = libPOS_Sensor - -######### compiled sources ############# -libPOS_Sensor_SRCS += DeadReckoning_main.cpp -libPOS_Sensor_SRCS += DeadReckoning_Common.cpp -libPOS_Sensor_SRCS += DeadReckoning_Did_GyroScaleFactorLevel_dr.cpp -libPOS_Sensor_SRCS += DeadReckoning_Did_Heading_dr.cpp -libPOS_Sensor_SRCS += DeadReckoning_Did_GyroOffset_dr.cpp -libPOS_Sensor_SRCS += DeadReckoning_Did_Speed_dr.cpp -libPOS_Sensor_SRCS += DeadReckoning_Did_Longitude_dr.cpp -libPOS_Sensor_SRCS += DeadReckoning_Did_SnsCounter.cpp -libPOS_Sensor_SRCS += DeadReckoning_Did_Altitude_dr.cpp -libPOS_Sensor_SRCS += DeadReckoning_Did_GyroScaleFactor_dr.cpp -libPOS_Sensor_SRCS += DeadReckoning_DataMasterMain.cpp -libPOS_Sensor_SRCS += DeadReckoning_Did_Latitude_dr.cpp -libPOS_Sensor_SRCS += DeadReckoning_Did_SpeedPulseScaleFactor_dr.cpp -libPOS_Sensor_SRCS += DeadReckoning_Did_SpeedPulseScaleFactorLevel_dr.cpp -libPOS_Sensor_SRCS += DeadReckoning_DeliveryCtrl.cpp -libPOS_Sensor_SRCS += ClockUtility.cpp -libPOS_Sensor_SRCS += VehicleUtility.cpp -libPOS_Sensor_SRCS += GpsInt.cpp -libPOS_Sensor_SRCS += VehicleSens_Thread.cpp -libPOS_Sensor_SRCS += VehicleSens_FromAccess.cpp -libPOS_Sensor_SRCS += VehicleSens_Common.cpp -libPOS_Sensor_SRCS += VehicleSens_SelectionItemList.cpp -libPOS_Sensor_SRCS += VehicleSens_SharedMemory.cpp -libPOS_Sensor_SRCS += VehicleSens_Did_MainGpsInterruptSignal.cpp -libPOS_Sensor_SRCS += VehicleSens_Did_GpsAntennaStatus.cpp -libPOS_Sensor_SRCS += VehicleSens_Did_Rev.cpp -libPOS_Sensor_SRCS += VehicleSens_Did_GpsCounter_g.cpp -libPOS_Sensor_SRCS += VehicleSens_Did_SpeedPulse_l.cpp -libPOS_Sensor_SRCS += VehicleSens_Did_Rev_l.cpp -libPOS_Sensor_SRCS += VehicleSens_Did_SpeedPulseExt_l.cpp -libPOS_Sensor_SRCS += VehicleSens_Did_Mon_Hw_g.cpp -libPOS_Sensor_SRCS += VehicleSens_Did_Nav_Clock_g.cpp -libPOS_Sensor_SRCS += VehicleSens_Did_SysGpsInterruptSignal.cpp -libPOS_Sensor_SRCS += VehicleSens_Did_SnsCounter_l.cpp -libPOS_Sensor_SRCS += VehicleSens_Did_GyroExt_l.cpp -libPOS_Sensor_SRCS += VehicleSens_Did_GyroYExt_l.cpp -libPOS_Sensor_SRCS += VehicleSens_Did_GyroZExt_l.cpp -libPOS_Sensor_SRCS += VehicleSens_Did_GyroX.cpp -libPOS_Sensor_SRCS += VehicleSens_Did_GyroY.cpp -libPOS_Sensor_SRCS += VehicleSens_Did_GyroZ.cpp -libPOS_Sensor_SRCS += VehicleSens_Did_Nav_Dop_g.cpp -libPOS_Sensor_SRCS += VehicleSens_Did_GyroTrouble.cpp -libPOS_Sensor_SRCS += VehicleSens_Did_SnsCounterExt_l.cpp -libPOS_Sensor_SRCS += VehicleSens_Did_Gps_CWORD82__CWORD44_Gp4_g.cpp -libPOS_Sensor_SRCS += VehicleSens_Did_GyroX_l.cpp -libPOS_Sensor_SRCS += VehicleSens_Did_GyroY_l.cpp -libPOS_Sensor_SRCS += VehicleSens_Did_GyroZ_l.cpp -libPOS_Sensor_SRCS += VehicleSens_Did_GyroConnectStatus.cpp -libPOS_Sensor_SRCS += VehicleSens_Did_RevFst_l.cpp -libPOS_Sensor_SRCS += VehicleSens_Did_RevExt_l.cpp -libPOS_Sensor_SRCS += VehicleSens_Did_Nav_SvInfo_g.cpp -libPOS_Sensor_SRCS += VehicleSens_Did_Gps_CWORD82_FullBinary_g.cpp -libPOS_Sensor_SRCS += VehicleSens_Did_GPSInterruptFlag.cpp -libPOS_Sensor_SRCS += VehicleSens_Did_SpeedPulseFlag.cpp -libPOS_Sensor_SRCS += VehicleSens_Did_Nav_TimeGps_g.cpp -libPOS_Sensor_SRCS += VehicleSens_Did_Nav_TimeUtc_g.cpp -libPOS_Sensor_SRCS += VehicleSens_Did_SpeedPulseFlagFst_l.cpp -libPOS_Sensor_SRCS += VehicleSens_Did_SnsCounter.cpp -libPOS_Sensor_SRCS += VehicleSens_Did_SpeedPulseFst_l.cpp -libPOS_Sensor_SRCS += VehicleSens_Did_GyroXFst_l.cpp -libPOS_Sensor_SRCS += VehicleSens_Did_GyroYFst_l.cpp -libPOS_Sensor_SRCS += VehicleSens_Did_GyroZFst_l.cpp -libPOS_Sensor_SRCS += VehicleSens_Did_Nav_Status_g.cpp -libPOS_Sensor_SRCS += VehicleSens_Did_Gps_CWORD82_Nmea_g.cpp -libPOS_Sensor_SRCS += VehicleSens_Did_SpeedPulse.cpp -libPOS_Sensor_SRCS += VehicleSens_DataMasterMain.cpp -libPOS_Sensor_SRCS += VehicleSens_Did_Nav_Velned_g.cpp -libPOS_Sensor_SRCS += VehicleSens_Did_Nav_Posllh_g.cpp -libPOS_Sensor_SRCS += VehicleSens_Did_GpsAntenna.cpp -libPOS_Sensor_SRCS += VehicleSens_Did_GpsAntenna_l.cpp -libPOS_Sensor_SRCS += VehicleSens_Did_SpeedKmph.cpp -libPOS_Sensor_SRCS += VehicleSens_Did_SpeedKmph_l.cpp -libPOS_Sensor_SRCS += VehicleSens_Did_LocationLonLat.cpp -libPOS_Sensor_SRCS += VehicleSens_Did_LocationLonLat_g.cpp -libPOS_Sensor_SRCS += VehicleSens_Did_LocationAltitude.cpp -libPOS_Sensor_SRCS += VehicleSens_Did_LocationAltitude_g.cpp -libPOS_Sensor_SRCS += VehicleSens_Did_MotionSpeed.cpp -libPOS_Sensor_SRCS += VehicleSens_Did_MotionSpeed_g.cpp -libPOS_Sensor_SRCS += VehicleSens_Did_MotionSpeed_n.cpp -libPOS_Sensor_SRCS += VehicleSens_Did_MotionSpeed_i.cpp -libPOS_Sensor_SRCS += VehicleSens_Did_MotionHeading.cpp -libPOS_Sensor_SRCS += VehicleSens_Did_MotionHeading_g.cpp -libPOS_Sensor_SRCS += VehicleSens_Did_GpsTime.cpp -libPOS_Sensor_SRCS += VehicleSens_Did_GpsTime_g.cpp -libPOS_Sensor_SRCS += VehicleSens_Did_GpsTimeRaw.cpp -libPOS_Sensor_SRCS += VehicleSens_Did_GpsTimeRaw_g.cpp -libPOS_Sensor_SRCS += VehicleSens_Did_NaviinfoDiagGPS_g.cpp -libPOS_Sensor_SRCS += VehicleSens_Did_GsnsX.cpp -libPOS_Sensor_SRCS += VehicleSens_Did_GsnsX_l.cpp -libPOS_Sensor_SRCS += VehicleSens_Did_GsnsXExt_l.cpp -libPOS_Sensor_SRCS += VehicleSens_Did_GsnsXFst_l.cpp -libPOS_Sensor_SRCS += VehicleSens_Did_GsnsY.cpp -libPOS_Sensor_SRCS += VehicleSens_Did_GsnsY_l.cpp -libPOS_Sensor_SRCS += VehicleSens_Did_GsnsYExt_l.cpp -libPOS_Sensor_SRCS += VehicleSens_Did_GsnsYFst_l.cpp -libPOS_Sensor_SRCS += VehicleSens_Did_GsnsZ.cpp -libPOS_Sensor_SRCS += VehicleSens_Did_GsnsZ_l.cpp -libPOS_Sensor_SRCS += VehicleSens_Did_GsnsZExt_l.cpp -libPOS_Sensor_SRCS += VehicleSens_Did_GsnsZFst_l.cpp -libPOS_Sensor_SRCS += VehicleSens_Did_GyroTemp.cpp -libPOS_Sensor_SRCS += VehicleSens_Did_GyroTemp_l.cpp -libPOS_Sensor_SRCS += VehicleSens_Did_GyroTempExt_l.cpp -libPOS_Sensor_SRCS += VehicleSens_Did_GyroTempFst_l.cpp -libPOS_Sensor_SRCS += VehicleSens_Did_GpsNmea_g.cpp -libPOS_Sensor_SRCS += VehicleSens_Did_LocationLonLat_n.cpp -libPOS_Sensor_SRCS += VehicleSens_Did_LocationAltitude_n.cpp -libPOS_Sensor_SRCS += VehicleSens_Did_MotionSpeed_n.cpp -libPOS_Sensor_SRCS += VehicleSens_Did_MotionHeading_n.cpp -libPOS_Sensor_SRCS += VehicleSens_Did_SettingTime.cpp -libPOS_Sensor_SRCS += VehicleSens_Did_SettingTime_clock.cpp -libPOS_Sensor_SRCS += VehicleSens_Did_PulseTime.cpp -libPOS_Sensor_SRCS += VehicleSens_Did_PulseTime_l.cpp -libPOS_Sensor_SRCS += VehicleSens_Did_PulseTimeExt_l.cpp -libPOS_Sensor_SRCS += VehicleSens_Did_WknRollover.cpp -libPOS_Sensor_SRCS += VehicleSens_Did_WknRollover_g.cpp -libPOS_Sensor_SRCS += VehicleSens_Did_GpsClockDrift.cpp -libPOS_Sensor_SRCS += VehicleSens_Did_GpsClockDrift_g.cpp -libPOS_Sensor_SRCS += VehicleSens_Did_GpsClockFreq.cpp -libPOS_Sensor_SRCS += VehicleSens_Did_GpsClockFreq_g.cpp - -libPOS_Sensor_SRCS += VehicleSens_Did_LocationInfoNmea.cpp -libPOS_Sensor_SRCS += VehicleSens_Did_LocationInfoNmea_n.cpp - -libPOS_Sensor_SRCS += VehicleSens_CanDeliveryEntry.cpp -libPOS_Sensor_SRCS += VehicleSens_DeliveryCtrl.cpp -libPOS_Sensor_SRCS += SensorLog.cpp - -######### add include path ############# -CPPFLAGS += -I../../include/Sensor -CPPFLAGS += -I../../include/nsfw -CPPFLAGS += -I../../include/ServiceInterface -CPPFLAGS += -I../../../client/include - -CPPFLAGS += -I../ServiceInterface/VehicleIf -CPPFLAGS += -I../nsfw/include -#CPPFLAGS += -I../../../../diag_code/library/include - -CPPFLAGS += -I$(SDKTARGETSYSROOT)/usr/agl/include/vehicle_service - -######### add compile option ############# -CPPFLAGS += -DLINUX - -LDFLAGS += -Wl,--no-undefined -LDFLAGS += -Wl,--no-as-needed -CPPFLAGS += -Werror=implicit-function-declaration -CPPFLAGS += -Werror=format-security -CPPFLAGS += -Wconversion -CPPFLAGS += -Wint-to-pointer-cast -CPPFLAGS += -Wpointer-arith -CPPFLAGS += -Wformat - -######### add library path ############# -LDFLAGS += - -INSTALL = install -CREATE_DIR = $(DESTDIR)/nv/BS/vs/positioning/rwdata -install-data: - $(INSTALL) -d -m 775 $(CREATE_DIR) - -include ../../../../vehicle_service.mk - diff --git a/vehicleservice/positioning/server/src/Sensor/SensorLog.cpp b/vehicleservice/positioning/server/src/Sensor/SensorLog.cpp deleted file mode 100755 index eed514f..0000000 --- a/vehicleservice/positioning/server/src/Sensor/SensorLog.cpp +++ /dev/null @@ -1,1307 +0,0 @@ -/* - * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @file - * SensorLog.cpp - * @brief - * Sensor Logging service functionality - */ - -/*---------------------------------------------------------------------------------* - * Include Files * - *---------------------------------------------------------------------------------*/ - -#ifdef __cplusplus -extern "C" { -#endif - -#ifdef __cplusplus -} -#endif - -#include <positioning_hal.h> -#include <unistd.h> -#include "SensorLog.h" -#include "Sensor_Common_API.h" -#include <zlib.h> -#include "POS_private.h" - -/*---------------------------------------------------------------------------------* - * Definition * - *---------------------------------------------------------------------------------*/ -/* Sensor Log Type */ -typedef enum { - SENSLOG_TYPE_SYS_INPUT = 0, /* Sensor Log Type-SYS (INPUT) */ - SENSLOG_TYPE_SYS_OUTPUT, /* Sensor Log Type-SYS (OUTPUT) */ - SENSLOG_TYPE_GPS_INPUT, /* Sensor Log Type-GPS (INPUT) */ - SENSLOG_TYPE_GPS_OUTPUT, /* Sensor Log Type-GPS (OUTPUT) */ - SENSLOG_TYPE_NAVI_INPUT, /* Sensor Log Type-NAVI(INPUT) */ - SENSLOG_TYPE_NAVI_OUTPUT, /* Sensor Log Type-NAVI(OUTPUT) */ - SENSLOG_TYPE_POS_OUTPUT, /* Sensor Log Type-POS (OUTPUT) */ - SENSLOG_TYPE_CMD_INPUT, /* Sensor Log Type-CMD (INPUT) */ - SENSLOG_TYPE_CMD_OUTPUT, /* Sensor Log Type-CMD (OUTPUT) */ - - SENSLOG_TYPE_COUNT /* Sensor Log Type-Counting */ -} SENSLOG_TYPE; - -#define SENSLOG_VALIDFLAG_ON (1) /* Effective specific flag ON */ -#define SENSLOG_VALIDFLAG_OFF (0) /* Enable flag OFF */ -#define SENSLOG_FILEPATH_SIZE (128) /* Output path size */ -#define SENSLOG_FILENAME_SIZE (64) /* Output file name size */ -#define SENSLOG_CONFIG_TEXT_SIZE (128) /* config file size/line */ -#define SENSLOG_LEN_MIN (1) /* Record Length-Minimum */ -#define SENSLOG_LEN_MAX (900) /* Record Length-Maximum */ -#define SENSLOG_LEN_DEFAULT (300) /* Record length-default value */ -#define SENSLOG_GEN_MIN (1) /* Number of generations-minimum value */ -#define SENSLOG_GEN_MAX (999) /* Number of generations-maximum value */ -#define SENSLOG_GEN_DEFAULT (100) /* Number of generations-default value */ -#define SENSLOG_BUF_MIN (2272) /* Buffer Size-Minimum */ -#define SENSLOG_BUF_MAX (11360) /* Buffer size-maximum value */ -#define SENSLOG_BUF_DEFAULT (4544) /* Buffer size-default value */ -#define SENSLOG_OUTPUTFLAG_NEW (0) /* Output Flag-New */ -#define SENSLOG_OUTPUTFLAG_ADD (1) /* Output Flag-Add */ -#define SENSLOG_PNAME_MAX (16) /* Maximum number of characters of process name */ - -#define SENSLOG_SEMAPHO_NAME ("SENSLOG_SEMAPHO") /* Semaphore name(MAX 32Byte) */ - -#define SENSLOG_CONFIG_FILE_PATH_1 "/nv/BS/vs/positioning/rwdata/" /* Sensor log-Config filepath-1 */ -#define SENSLOG_CONFIG_FILE_PATH_2 "/mnt/sda1/" /* Sensor log-Config filepath-2 */ -#define SENSLOG_CONFIG_FILE_NAME_SYS "POS_sys_log.cfg" /* Sensor log-Config filename-SYS */ -#define SENSLOG_CONFIG_FILE_NAME_GPS "POS_gps_log.cfg" /* Sensor log-Config filename-GPS */ -#define SENSLOG_CONFIG_FILE_NAME_NAVI "POS_nav_log.cfg" /* Sensor log-Config filename-NAVI */ -#define SENSLOG_CONFIG_FILE_NAME_POS "POS_pos_log.cfg" /* Sensor log-Config filename-POS */ -#define SENSLOG_CONFIG_FILE_NAME_CMD "POS_cmd_log.cfg" /* Sensor log-Config filename-CMD */ -#define SENSLOG_CONFIG_KEY_LEN "POS_log_len" /* Sensor log-config file-Record length */ -#define SENSLOG_CONFIG_KEY_GEN "POS_log_gen" /* Sensor log-config file-Number of generations */ -#define SENSLOG_CONFIG_KEY_BUF "POS_log_buf" /* Sensor log-config file-Buffer size */ -#define SENSLOG_NAV_SVINFO_FILE_NAME "POS_NAV_SVINFO" /* Sensor log-NAV-SVINFOFile name(Log output when file exists)*/ -#define SENSLOG_SEQ_START ">>>>" /* Sensor log sequence(Start) */ -#define SENSLOG_SEQ_END "<<<<" /* Sensor log sequence(End) */ -#define SENSLOG_SEQ_SIZE (4) /* Sensor Log Sequence Size */ - -/*---------------------------------------------------------------------------------* - * Structre * - *---------------------------------------------------------------------------------*/ -/*! - @brief Structure to create SensorLog data -*/ -typedef struct { - uint16_t us_len; /* Number of records */ - uint16_t uc_gen; /* Number of generations */ -} SENSLOG_GEN; - -/*! - @brief Structure to create SensorLog data -*/ -typedef struct { - uint8_t uc_valid_flag; /* Output enable flag */ - SENSLOG_GEN st_gen; /* Generation information */ - uint16_t us_file_rec_count; /* Number of file output records */ - uint16_t us_rec_count; /* Number of output records */ - uint16_t us_gen_count; /* Number of generations */ - uint8_t uc_file_path[SENSLOG_FILEPATH_SIZE]; /* Output path */ - uint8_t uc_file_name[SENSLOG_FILENAME_SIZE]; /* Output file name */ - uint8_t uc_gen_fname[SENSLOG_FILENAME_SIZE]; /* Generation information output file name */ - uint8_t uc_text_buf[SENSLOG_BUF_MAX]; /* Buffering area(Static) */ - uint32_t ul_text_buf_size; /* Buffering area size */ - uint32_t ul_text_buf_len; /* Data size in the buffer */ - uint8_t uc_output_flag; /* Output flag */ - uint8_t uc_temp_buf[SENSLOG_BUF_MAX]; /* Output data temporary area */ - uint8_t uc_positioninglog_buf[SENSLOG_BUF_MAX]; /* FRAMEWORKUNIFIEDLOG outputs */ -} SENSLOG_INFO; - -/*! - @brief Structure to get System time -*/ -typedef struct { - uint16_t us_year; - uint16_t us_month; - uint16_t us_day_of_week; - uint16_t us_day; - uint16_t us_hour; - uint16_t us_minute; - uint16_t us_second; - uint16_t us_milli_seconds; -} SENSLOG_SYSTEMTIME; - -/*! - @brief Structure to create SensorLog data -*/ -typedef struct { - uint16_t us_data_type; /* Data type */ - SENSLOG_SYSTEMTIME st_sys_time; /* Current time */ - DID ul_did; /* Data ID */ - int8_t c_pname[SENSLOG_PNAME_MAX]; /* Destination information */ - uint8_t uc_unit_type; /* Hardware configuration type(GRADE1 / GRADE2) */ - uint8_t uc_result; /* Send/Receive result(Success:0 / Fail:1) */ - uint16_t us_data_size; /* Size of the data */ -} SENSLOG_DATA_HEADER; - - -/*! - @brief Structure to create SensorLog ID table -*/ -typedef struct { - uint16_t us_data_type; /* Data type */ - DID ul_did; /* Data ID */ - uint16_t us_file_type; /* Sensor Log Type */ - uint16_t us_write_type; /* FRAMEWORKUNIFIEDLOG Output Type */ -} SENSLOG_ID_TBL; - -/*---------------------------------------------------------------------------------* - * Local Function Prototype * - *---------------------------------------------------------------------------------*/ -static void SensLogGetConfig(const uint8_t*, SENSLOG_INFO*); -static void SensLogGetConfigVal(uint8_t*, uint8_t*); -static void SensLogCheckNAVSVINFOFile(void); -static void SensLogWrite(uint16_t, uint16_t, uint16_t, DID did, PNO pno, uint8_t*, uint16_t, uint8_t, uint8_t, uint8_t); -static uint16_t SensLogGetFileType(const SENSLOG_ID_TBL*, uint16_t*, uint16_t*, DID did); -static void SensLogOutputFile(uint8_t); -static void SensLogOutputGenFile(uint8_t); -static void SensLogGetSystemTime(SENSLOG_SYSTEMTIME*); -static void Num2String2Digit(uint8_t* buf, uint32_t num); -static void Num2String3Digit(uint8_t* buf, uint32_t num); -static void Num2String4Digit(uint8_t* buf, uint32_t num); -static void Num2HexString(uint8_t* buf, uint8_t digits, uint32_t num); -static void SensLogmakeHeader(uint8_t* buf, SENSLOG_DATA_HEADER data_header); - -/*---------------------------------------------------------------------------------* - * Grobal Value * - *---------------------------------------------------------------------------------*/ -/* Sensor log information */ -static SENSLOG_INFO g_sens_log_info[SENSLOG_TYPE_COUNT]; // NOLINT(readability/nolint) -static uint8_t g_navsv_info_flag = FALSE; -uint8_t g_mount_path[SENSLOG_FILEPATH_SIZE]; /* Mount path */ -UNIT_TYPE g_unit_type = UNIT_TYPE_NONE; /* HW configuration type */ -SemID g_sem_id = 0; /* Lock semaphore ID */ - -/* Sensor log type definition table */ -const SENSLOG_ID_TBL kSensLogInputTbl[] = { - /* Data type DID Sensor Log Type FRAMEWORKUNIFIEDLOG Output Type */ - {SENSLOG_DATA_I_SYS, 0, SENSLOG_TYPE_SYS_INPUT, POS_SENSLOG_TYPE_SYS }, - {SENSLOG_DATA_I_SYS_STS, 0, SENSLOG_TYPE_SYS_INPUT, POS_SENSLOG_TYPE_SYS }, - {SENSLOG_DATA_I_GPS, 0, SENSLOG_TYPE_GPS_INPUT, POS_SENSLOG_TYPE_GPS }, - {SENSLOG_DATA_I_LOC, POSHAL_DID_GPS_CUSTOMDATA_NAVI, SENSLOG_TYPE_NAVI_INPUT, POS_SENSLOG_TYPE_NAV }, - {SENSLOG_DATA_I_SPEED, VEHICLE_DID_MOTION_SPEED_NAVI, SENSLOG_TYPE_NAVI_INPUT, POS_SENSLOG_TYPE_NAV }, - {SENSLOG_DATA_I_TIME, VEHICLE_DID_SETTINGTIME, SENSLOG_TYPE_NAVI_INPUT, POS_SENSLOG_TYPE_NAV }, - {SENSLOG_DATA_I_TIME, POSHAL_DID_GPS_TIME, SENSLOG_TYPE_GPS_INPUT, POS_SENSLOG_TYPE_GPS }, - {SENSLOG_DATA_I_GPSINF, 0, SENSLOG_TYPE_NAVI_INPUT, POS_SENSLOG_TYPE_NAV }, - {SENSLOG_DATA_I_GPSRST, 0, SENSLOG_TYPE_CMD_INPUT, POS_SENSLOG_TYPE_CMD }, - {SENSLOG_DATA_I_GPSSET, 0, SENSLOG_TYPE_CMD_INPUT, POS_SENSLOG_TYPE_CMD }, - {SENSLOG_DATA_I_NAVSVINFO, 0, SENSLOG_TYPE_GPS_INPUT, POS_SENSLOG_TYPE_GPS }, - {SENSLOG_DATA_I_SYS_ABNORMAL, 0, SENSLOG_TYPE_SYS_INPUT, POS_SENSLOG_TYPE_SYS }, - {SENSLOG_DATA_I_UNSPECIFIED, 0, SENSLOG_TYPE_COUNT, POS_SENSLOG_TYPE_NONE } -}; - -const SENSLOG_ID_TBL kSensLogOutputTbl[] = { - /* Data type DID Sensor Log Type FRAMEWORKUNIFIEDLOG Output Type */ - {SENSLOG_DATA_O_SYS, POSHAL_DID_SPEED_PULSE, SENSLOG_TYPE_SYS_OUTPUT, POS_SENSLOG_TYPE_NONE }, - {SENSLOG_DATA_O_SYS, POSHAL_DID_SPEED_KMPH, SENSLOG_TYPE_SYS_OUTPUT, POS_SENSLOG_TYPE_NONE }, - {SENSLOG_DATA_O_SYS, POSHAL_DID_GYRO_X, SENSLOG_TYPE_SYS_OUTPUT, POS_SENSLOG_TYPE_NONE }, - {SENSLOG_DATA_O_SYS, POSHAL_DID_GYRO_Y, SENSLOG_TYPE_SYS_OUTPUT, POS_SENSLOG_TYPE_NONE }, - {SENSLOG_DATA_O_SYS, POSHAL_DID_GYRO_Z, SENSLOG_TYPE_SYS_OUTPUT, POS_SENSLOG_TYPE_NONE }, - {SENSLOG_DATA_O_SYS, POSHAL_DID_GSNS_X, SENSLOG_TYPE_SYS_OUTPUT, POS_SENSLOG_TYPE_NONE }, - {SENSLOG_DATA_O_SYS, POSHAL_DID_GSNS_Y, SENSLOG_TYPE_SYS_OUTPUT, POS_SENSLOG_TYPE_NONE }, - {SENSLOG_DATA_O_SYS, POSHAL_DID_GSNS_Z, SENSLOG_TYPE_SYS_OUTPUT, POS_SENSLOG_TYPE_NONE }, - {SENSLOG_DATA_O_SYS, POSHAL_DID_GPS_ANTENNA, SENSLOG_TYPE_SYS_OUTPUT, POS_SENSLOG_TYPE_NONE }, - {SENSLOG_DATA_O_SYS, POSHAL_DID_SNS_COUNTER, SENSLOG_TYPE_SYS_OUTPUT, POS_SENSLOG_TYPE_NONE }, - {SENSLOG_DATA_O_SYS, POSHAL_DID_SPEED_PULSE_FST, SENSLOG_TYPE_SYS_OUTPUT, POS_SENSLOG_TYPE_NONE }, - {SENSLOG_DATA_O_SYS, POSHAL_DID_GYRO_X_FST, SENSLOG_TYPE_SYS_OUTPUT, POS_SENSLOG_TYPE_NONE }, - {SENSLOG_DATA_O_SYS, POSHAL_DID_GYRO_Y_FST, SENSLOG_TYPE_SYS_OUTPUT, POS_SENSLOG_TYPE_NONE }, - {SENSLOG_DATA_O_SYS, POSHAL_DID_GYRO_Z_FST, SENSLOG_TYPE_SYS_OUTPUT, POS_SENSLOG_TYPE_NONE }, - {SENSLOG_DATA_O_SYS, VEHICLE_DID_GPS__CWORD82__NMEA, SENSLOG_TYPE_GPS_OUTPUT, POS_SENSLOG_TYPE_NONE }, - {SENSLOG_DATA_O_SYS, POSHAL_DID_GPS__CWORD82___CWORD44_GP4, SENSLOG_TYPE_GPS_OUTPUT, POS_SENSLOG_TYPE_NONE }, - {SENSLOG_DATA_O_SYS, POSHAL_DID_GPS__CWORD82__FULLBINARY, SENSLOG_TYPE_GPS_OUTPUT, POS_SENSLOG_TYPE_NONE }, - {SENSLOG_DATA_O_SYS, POSHAL_DID_GPS_NMEA, SENSLOG_TYPE_GPS_OUTPUT, POS_SENSLOG_TYPE_NONE }, - {SENSLOG_DATA_O_SYS, POSHAL_DID_REV, SENSLOG_TYPE_SYS_OUTPUT, POS_SENSLOG_TYPE_NONE }, - {SENSLOG_DATA_O_SYS, POSHAL_DID_REV_FST, SENSLOG_TYPE_SYS_OUTPUT, POS_SENSLOG_TYPE_NONE }, - {SENSLOG_DATA_O_SYS, POSHAL_DID_GYRO_TEMP, SENSLOG_TYPE_SYS_OUTPUT, POS_SENSLOG_TYPE_NONE }, - {SENSLOG_DATA_O_SYS, POSHAL_DID_GYRO_TEMP_FST, SENSLOG_TYPE_SYS_OUTPUT, POS_SENSLOG_TYPE_NONE }, - {SENSLOG_DATA_O_SYS, POSHAL_DID_GSNS_X_FST, SENSLOG_TYPE_SYS_OUTPUT, POS_SENSLOG_TYPE_NONE }, - {SENSLOG_DATA_O_SYS, POSHAL_DID_GSNS_Y_FST, SENSLOG_TYPE_SYS_OUTPUT, POS_SENSLOG_TYPE_NONE }, - {SENSLOG_DATA_O_SYS, POSHAL_DID_GSNS_Z_FST, SENSLOG_TYPE_SYS_OUTPUT, POS_SENSLOG_TYPE_NONE }, - {SENSLOG_DATA_O_SYS, POSHAL_DID_PULSE_TIME, SENSLOG_TYPE_SYS_OUTPUT, POS_SENSLOG_TYPE_NONE }, - {SENSLOG_DATA_O_SYS, POSHAL_DID_GPS_CLOCK_DRIFT, SENSLOG_TYPE_GPS_OUTPUT, POS_SENSLOG_TYPE_NONE }, - {SENSLOG_DATA_O_SYS, POSHAL_DID_GPS_CLOCK_FREQ, SENSLOG_TYPE_GPS_OUTPUT, POS_SENSLOG_TYPE_NONE }, - {SENSLOG_DATA_O_SYS_PKG, 0, SENSLOG_TYPE_SYS_OUTPUT, POS_SENSLOG_TYPE_NONE }, - {SENSLOG_DATA_O_GPS, 0, SENSLOG_TYPE_CMD_OUTPUT, POS_SENSLOG_TYPE_NONE }, - {SENSLOG_DATA_O_LONLAT_N, VEHICLE_DID_LOCATION_LONLAT_NAVI, SENSLOG_TYPE_NAVI_OUTPUT, POS_SENSLOG_TYPE_NONE }, - {SENSLOG_DATA_O_LONLAT_G, VEHICLE_DID_LOCATION_LONLAT, SENSLOG_TYPE_GPS_OUTPUT, POS_SENSLOG_TYPE_NONE }, - {SENSLOG_DATA_O_ALT, VEHICLE_DID_LOCATION_ALTITUDE, SENSLOG_TYPE_GPS_OUTPUT, POS_SENSLOG_TYPE_NONE }, - {SENSLOG_DATA_O_SPEED_N, VEHICLE_DID_MOTION_SPEED_NAVI, SENSLOG_TYPE_NAVI_OUTPUT, POS_SENSLOG_TYPE_NONE }, - {SENSLOG_DATA_O_SPEED_P, VEHICLE_DID_MOTION_SPEED_INTERNAL, SENSLOG_TYPE_POS_OUTPUT, POS_SENSLOG_TYPE_NONE }, - {SENSLOG_DATA_O_HEAD_N, VEHICLE_DID_MOTION_HEADING_NAVI, SENSLOG_TYPE_NAVI_OUTPUT, POS_SENSLOG_TYPE_NONE }, - {SENSLOG_DATA_O_HEAD_G, VEHICLE_DID_MOTION_HEADING, SENSLOG_TYPE_GPS_OUTPUT, POS_SENSLOG_TYPE_NONE }, - {SENSLOG_DATA_O_TIME_SETREQ, VEHICLE_DID_SETTINGTIME, SENSLOG_TYPE_GPS_OUTPUT, POS_SENSLOG_TYPE_NONE }, - {SENSLOG_DATA_O_TIME, POSHAL_DID_GPS_TIME, SENSLOG_TYPE_GPS_OUTPUT, POS_SENSLOG_TYPE_NONE }, - {SENSLOG_DATA_O_GPSINF, VEHICLE_DID_NAVIINFO_DIAG_GPS, SENSLOG_TYPE_NAVI_OUTPUT, POS_SENSLOG_TYPE_NONE }, - {SENSLOG_DATA_O_TIME_CS, 0, SENSLOG_TYPE_GPS_OUTPUT, POS_SENSLOG_TYPE_NONE }, - {SENSLOG_DATA_O_GPSRST, 0, SENSLOG_TYPE_GPS_OUTPUT, POS_SENSLOG_TYPE_NONE }, - - {SENSLOG_DATA_O_UNSPECIFIED, 0, SENSLOG_TYPE_COUNT, POS_SENSLOG_TYPE_NONE } -}; - -/*---------------------------------------------------------------------------------* - * Function * - *---------------------------------------------------------------------------------*/ -/** - * @brief - * Sensor Log Initial Processing - * - * @param[in] p_mount_path Mount path - */ -void SensLogInitialize(uint8_t *p_mount_path) { - static SENSLOG_INFO st_sens_log_info; /* Coverity CID:23609 compliant */ - uint8_t uc_hw[16]; /* HW name */ - uint8_t ret = 0; - uint8_t i; - static uint8_t tzset_flag = 0; /* Not initialized */ - - FRAMEWORKUNIFIEDLOG(ZONE_INIT, __FUNCTION__, "+"); - - /* Not initialized */ - if (tzset_flag == 0) { - tzset(); - tzset_flag = 1; /* Initialization complete */ - } - - /* Initialization of sensor log information structure */ - memset(&g_sens_log_info, 0, sizeof(g_sens_log_info)); - - /* Get mount path */ - memset(&g_mount_path[0], 0, sizeof(g_mount_path)); - if (NULL == p_mount_path) { - snprintf(reinterpret_cast<char*>(&g_mount_path[0]), sizeof(g_mount_path), SENSLOG_CONFIG_FILE_PATH_2); - } else { - snprintf(reinterpret_cast<char*>(&g_mount_path[0]), sizeof(g_mount_path), "%s/", p_mount_path); - } - FRAMEWORKUNIFIEDLOG(ZONE_INIT, __FUNCTION__, "mount path[%s]", g_mount_path); - - /* HW judgment */ - memset(&uc_hw[0], 0, sizeof(uc_hw)); - g_unit_type = GetEnvSupportInfo(); - if (UNIT_TYPE_GRADE1 == g_unit_type) { - /* GRADE1 */ - snprintf(reinterpret_cast<char*>(&uc_hw[0]), sizeof(uc_hw), "GRADE1"); - } else if (UNIT_TYPE_GRADE2 == g_unit_type) { - /* - * Note. - * This feature branches processing depending on the unit type. - */ - } else { - /* Environment error */ - /* Do not output sensor log */ - FRAMEWORKUNIFIEDLOG(ZONE_WARN, __FUNCTION__, "Environment Error."); - ret = 1; - } - - /* Get Semaphore ID */ - g_sem_id = _pb_CreateSemaphore(const_cast<char *>(SENSLOG_SEMAPHO_NAME)); - if (g_sem_id == 0) { // LCOV_EXCL_BR_LINE 200: can not return zero - // LCOV_EXCL_START 8: invalid - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - FRAMEWORKUNIFIEDLOG(ZONE_WARN, __FUNCTION__, "Semaphore create Error.(ID = 0)"); - ret = 1; - // LCOV_EXCL_STOP - } - - if (ret == 0) { - /* Read config files */ - /* SYS */ - memset(&st_sens_log_info, 0, sizeof(SENSLOG_INFO)); - SensLogGetConfig((const uint8_t*)SENSLOG_CONFIG_FILE_NAME_SYS, &st_sens_log_info); - if (st_sens_log_info.uc_valid_flag == SENSLOG_VALIDFLAG_ON) { - st_sens_log_info.us_gen_count = 1; - memcpy(&g_sens_log_info[SENSLOG_TYPE_SYS_INPUT], &st_sens_log_info, sizeof(SENSLOG_INFO)); - memcpy(&g_sens_log_info[SENSLOG_TYPE_SYS_OUTPUT], &st_sens_log_info, sizeof(SENSLOG_INFO)); - snprintf(reinterpret_cast<char*>(&(g_sens_log_info[SENSLOG_TYPE_SYS_INPUT].uc_file_name[0])), - sizeof(g_sens_log_info[SENSLOG_TYPE_SYS_INPUT].uc_file_name), "POS_%s_sys_i_%%03d.log", uc_hw); - snprintf(reinterpret_cast<char*>(&(g_sens_log_info[SENSLOG_TYPE_SYS_OUTPUT].uc_file_name[0])), - sizeof(g_sens_log_info[SENSLOG_TYPE_SYS_OUTPUT].uc_file_name), "POS_%s_sys_o_%%03d.log", uc_hw); - snprintf(reinterpret_cast<char*>(&(g_sens_log_info[SENSLOG_TYPE_SYS_INPUT].uc_gen_fname[0])), - sizeof(g_sens_log_info[SENSLOG_TYPE_SYS_INPUT].uc_gen_fname), "POS_%s_sys_i_gen.dat", uc_hw); - snprintf(reinterpret_cast<char*>(&(g_sens_log_info[SENSLOG_TYPE_SYS_OUTPUT].uc_gen_fname[0])), - sizeof(g_sens_log_info[SENSLOG_TYPE_SYS_OUTPUT].uc_gen_fname), "POS_%s_sys_o_gen.dat", uc_hw); - SensLogOutputGenFile(SENSLOG_TYPE_SYS_INPUT); - SensLogOutputGenFile(SENSLOG_TYPE_SYS_OUTPUT); - } - - /* GPS */ - memset(&st_sens_log_info, 0, sizeof(SENSLOG_INFO)); - SensLogGetConfig((const uint8_t*)SENSLOG_CONFIG_FILE_NAME_GPS, &st_sens_log_info); - if (st_sens_log_info.uc_valid_flag == SENSLOG_VALIDFLAG_ON) { - st_sens_log_info.us_gen_count = 1; - memcpy(&g_sens_log_info[SENSLOG_TYPE_GPS_INPUT], &st_sens_log_info, sizeof(SENSLOG_INFO)); - memcpy(&g_sens_log_info[SENSLOG_TYPE_GPS_OUTPUT], &st_sens_log_info, sizeof(SENSLOG_INFO)); - snprintf(reinterpret_cast<char*>(&(g_sens_log_info[SENSLOG_TYPE_GPS_INPUT].uc_file_name[0])), - sizeof(g_sens_log_info[SENSLOG_TYPE_GPS_INPUT].uc_file_name), "POS_%s_gps_i_%%03d.log", uc_hw); - snprintf(reinterpret_cast<char*>(&(g_sens_log_info[SENSLOG_TYPE_GPS_OUTPUT].uc_file_name[0])), - sizeof(g_sens_log_info[SENSLOG_TYPE_GPS_OUTPUT].uc_file_name), "POS_%s_gps_o_%%03d.log", uc_hw); - snprintf(reinterpret_cast<char*>(&(g_sens_log_info[SENSLOG_TYPE_GPS_INPUT].uc_gen_fname[0])), - sizeof(g_sens_log_info[SENSLOG_TYPE_GPS_INPUT].uc_gen_fname), "POS_%s_gps_i_gen.dat", uc_hw); - snprintf(reinterpret_cast<char*>(&(g_sens_log_info[SENSLOG_TYPE_GPS_OUTPUT].uc_gen_fname[0])), - sizeof(g_sens_log_info[SENSLOG_TYPE_GPS_OUTPUT].uc_gen_fname), "POS_%s_gps_o_gen.dat", uc_hw); - SensLogOutputGenFile(SENSLOG_TYPE_GPS_INPUT); - SensLogOutputGenFile(SENSLOG_TYPE_GPS_OUTPUT); - } - - /* NAVI */ - memset(&st_sens_log_info, 0, sizeof(SENSLOG_INFO)); - SensLogGetConfig((const uint8_t*)SENSLOG_CONFIG_FILE_NAME_NAVI, &st_sens_log_info); - if (st_sens_log_info.uc_valid_flag == SENSLOG_VALIDFLAG_ON) { - st_sens_log_info.us_gen_count = 1; - memcpy(&g_sens_log_info[SENSLOG_TYPE_NAVI_INPUT], &st_sens_log_info, sizeof(SENSLOG_INFO)); - memcpy(&g_sens_log_info[SENSLOG_TYPE_NAVI_OUTPUT], &st_sens_log_info, sizeof(SENSLOG_INFO)); - snprintf(reinterpret_cast<char*>(&(g_sens_log_info[SENSLOG_TYPE_NAVI_INPUT].uc_file_name[0])), - sizeof(g_sens_log_info[SENSLOG_TYPE_NAVI_INPUT].uc_file_name), "POS_%s_nav_i_%%03d.log", uc_hw); - snprintf(reinterpret_cast<char*>(&(g_sens_log_info[SENSLOG_TYPE_NAVI_OUTPUT].uc_file_name[0])), - sizeof(g_sens_log_info[SENSLOG_TYPE_NAVI_OUTPUT].uc_file_name), "POS_%s_nav_o_%%03d.log", uc_hw); - snprintf(reinterpret_cast<char*>(&(g_sens_log_info[SENSLOG_TYPE_NAVI_INPUT].uc_gen_fname[0])), - sizeof(g_sens_log_info[SENSLOG_TYPE_NAVI_INPUT].uc_gen_fname), "POS_%s_nav_i_gen.dat", uc_hw); - snprintf(reinterpret_cast<char*>(&(g_sens_log_info[SENSLOG_TYPE_NAVI_OUTPUT].uc_gen_fname[0])), - sizeof(g_sens_log_info[SENSLOG_TYPE_NAVI_OUTPUT].uc_gen_fname), "POS_%s_nav_o_gen.dat", uc_hw); - SensLogOutputGenFile(SENSLOG_TYPE_NAVI_INPUT); - SensLogOutputGenFile(SENSLOG_TYPE_NAVI_OUTPUT); - } - - /* POS */ - memset(&st_sens_log_info, 0, sizeof(SENSLOG_INFO)); - SensLogGetConfig((const uint8_t*)SENSLOG_CONFIG_FILE_NAME_POS, &st_sens_log_info); - if (st_sens_log_info.uc_valid_flag == SENSLOG_VALIDFLAG_ON) { - st_sens_log_info.us_gen_count = 1; - memcpy(&g_sens_log_info[SENSLOG_TYPE_POS_OUTPUT], &st_sens_log_info, sizeof(SENSLOG_INFO)); - snprintf(reinterpret_cast<char*>(&(g_sens_log_info[SENSLOG_TYPE_POS_OUTPUT].uc_file_name[0])), - sizeof(g_sens_log_info[SENSLOG_TYPE_POS_OUTPUT].uc_file_name), "POS_%s_pos_o_%%03d.log", uc_hw); - snprintf(reinterpret_cast<char*>(&(g_sens_log_info[SENSLOG_TYPE_POS_OUTPUT].uc_gen_fname[0])), - sizeof(g_sens_log_info[SENSLOG_TYPE_POS_OUTPUT].uc_gen_fname), "POS_%s_pos_o_gen.dat", uc_hw); - SensLogOutputGenFile(SENSLOG_TYPE_POS_OUTPUT); - } - - /* CMD */ - memset(&st_sens_log_info, 0, sizeof(SENSLOG_INFO)); - SensLogGetConfig((const uint8_t*)SENSLOG_CONFIG_FILE_NAME_CMD, &st_sens_log_info); - if (st_sens_log_info.uc_valid_flag == SENSLOG_VALIDFLAG_ON) { - st_sens_log_info.us_gen_count = 1; - memcpy(&g_sens_log_info[SENSLOG_TYPE_CMD_INPUT], &st_sens_log_info, sizeof(SENSLOG_INFO)); - memcpy(&g_sens_log_info[SENSLOG_TYPE_CMD_OUTPUT], &st_sens_log_info, sizeof(SENSLOG_INFO)); - snprintf(reinterpret_cast<char*>(&(g_sens_log_info[SENSLOG_TYPE_CMD_INPUT].uc_file_name[0])), - sizeof(g_sens_log_info[SENSLOG_TYPE_CMD_INPUT].uc_file_name), "POS_%s_cmd_i_%%03d.log", uc_hw); - snprintf(reinterpret_cast<char*>(&(g_sens_log_info[SENSLOG_TYPE_CMD_OUTPUT].uc_file_name[0])), - sizeof(g_sens_log_info[SENSLOG_TYPE_CMD_OUTPUT].uc_file_name), "POS_%s_cmd_o_%%03d.log", uc_hw); - snprintf(reinterpret_cast<char*>(&(g_sens_log_info[SENSLOG_TYPE_CMD_INPUT].uc_gen_fname[0])), - sizeof(g_sens_log_info[SENSLOG_TYPE_CMD_INPUT].uc_gen_fname), "POS_%s_cmd_i_gen.dat", uc_hw); - snprintf(reinterpret_cast<char*>(&(g_sens_log_info[SENSLOG_TYPE_CMD_OUTPUT].uc_gen_fname[0])), - sizeof(g_sens_log_info[SENSLOG_TYPE_CMD_OUTPUT].uc_gen_fname), "POS_%s_cmd_o_gen.dat", uc_hw); - SensLogOutputGenFile(SENSLOG_TYPE_CMD_INPUT); - SensLogOutputGenFile(SENSLOG_TYPE_CMD_OUTPUT); - } - - /* NAV-SVINFO */ - SensLogCheckNAVSVINFOFile(); - } - - for (i = 0; i < SENSLOG_TYPE_COUNT; i++) { - if (g_sens_log_info[i].uc_valid_flag == SENSLOG_VALIDFLAG_ON) { - FRAMEWORKUNIFIEDLOG(ZONE_INIT, __FUNCTION__, \ - "g_sens_log_info[%d].uc_valid_flag:%d", i, g_sens_log_info[i].uc_valid_flag); - FRAMEWORKUNIFIEDLOG(ZONE_INIT, __FUNCTION__, \ - "g_sens_log_info[%d].st_gen.us_len:%d", i, g_sens_log_info[i].st_gen.us_len); - FRAMEWORKUNIFIEDLOG(ZONE_INIT, __FUNCTION__, \ - "g_sens_log_info[%d].st_gen.uc_gen:%d", i, g_sens_log_info[i].st_gen.uc_gen); - FRAMEWORKUNIFIEDLOG(ZONE_INIT, __FUNCTION__, \ - "g_sens_log_info[%d].us_file_rec_count:%d", i, g_sens_log_info[i].us_file_rec_count); - FRAMEWORKUNIFIEDLOG(ZONE_INIT, __FUNCTION__, \ - "g_sens_log_info[%d].us_rec_count:%d", i, g_sens_log_info[i].us_rec_count); - FRAMEWORKUNIFIEDLOG(ZONE_INIT, __FUNCTION__, \ - "g_sens_log_info[%d].us_gen_count:%d", i, g_sens_log_info[i].us_gen_count); - FRAMEWORKUNIFIEDLOG(ZONE_INIT, __FUNCTION__, \ - "g_sens_log_info[%d].uc_file_path:%s", i, g_sens_log_info[i].uc_file_path); - FRAMEWORKUNIFIEDLOG(ZONE_INIT, __FUNCTION__, \ - "g_sens_log_info[%d].uc_file_name:%s", i, g_sens_log_info[i].uc_file_name); - FRAMEWORKUNIFIEDLOG(ZONE_INIT, __FUNCTION__, \ - "g_sens_log_info[%d].uc_gen_fname:%s", i, g_sens_log_info[i].uc_gen_fname); - FRAMEWORKUNIFIEDLOG(ZONE_INIT, __FUNCTION__, \ - "g_sens_log_info[%d].ul_text_buf_size:%d", i, g_sens_log_info[i].ul_text_buf_size); - } - } - FRAMEWORKUNIFIEDLOG(ZONE_INIT, __FUNCTION__, "-"); - - return; -} - -/** - * @brief - * Sensor log stop processing - */ -void SensLogTerminate(void) { - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "+"); - - /* Initialization of sensor log information structure */ - memset(&g_sens_log_info, 0, sizeof(g_sens_log_info)); - - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "-"); - - return; -} - -/** - * @brief - * Sensor log saving process - */ -void SensLogStore(void) { // LCOV_EXCL_START 8 : dead code - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - uint8_t i; - - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "+"); - - for (i = 0; i < SENSLOG_TYPE_COUNT; i++) { - /* Output buffering log */ - if ((g_sens_log_info[i].uc_valid_flag == SENSLOG_VALIDFLAG_ON) && - (g_sens_log_info[i].ul_text_buf_len > 0)) { - SensLogOutputFile(i); - } - } - - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "-"); - return; -} -// LCOV_EXCL_STOP - -/** - * @brief - * Sensor log config file information acquisition - * - * @param[in] uc_config_file Config filename - * @param[out] st_sens_log_info Sensor log information - */ -static void SensLogGetConfig(const uint8_t* uc_config_file, SENSLOG_INFO* st_sens_log_info) { - FILE* fp; - uint8_t uc_file_path[SENSLOG_FILEPATH_SIZE]; - uint8_t uc_file_name[SENSLOG_FILEPATH_SIZE + SENSLOG_FILENAME_SIZE]; - uint8_t ucBuf[SENSLOG_CONFIG_TEXT_SIZE]; - uint8_t uc_val[SENSLOG_CONFIG_TEXT_SIZE]; - uint8_t flag = 0; - - FRAMEWORKUNIFIEDLOG(ZONE_28, __FUNCTION__, "+"); - - if ((uc_config_file == NULL) || (st_sens_log_info == NULL)) { // LCOV_EXCL_BR_LINE 200: can not NULL - // LCOV_EXCL_START 8: invalid - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - /* Unprocessed if the argument is invalid. */ - FRAMEWORKUNIFIEDLOG(ZONE_WARN, __FUNCTION__, "Parameter Error."); - // LCOV_EXCL_STOP - } else { - memset(&uc_file_path, 0, sizeof(uc_file_path)); - memset(&uc_file_name, 0, sizeof(uc_file_name)); - - /* Refer to the config files in the built-in memory. */ - snprintf(reinterpret_cast<char*>(&uc_file_path[0]), sizeof(uc_file_path), \ - SENSLOG_CONFIG_FILE_PATH_1); - snprintf(reinterpret_cast<char*>(&uc_file_name[0]), sizeof(uc_file_name), \ - "%s%s", uc_file_path, uc_config_file); - fp = fopen(reinterpret_cast<char*>(&uc_file_name[0]), "r"); - if (NULL == fp) { - /* If there are no config files in the built-in memory, refer to the USB memory. */ - snprintf(reinterpret_cast<char*>(&uc_file_path[0]), sizeof(uc_file_path), \ - "%s", (const char*)&g_mount_path[0]); - snprintf(reinterpret_cast<char*>(&uc_file_name[0]), sizeof(uc_file_name), \ - "%s%s", uc_file_path, uc_config_file); - fp = fopen(reinterpret_cast<char*>(&uc_file_name[0]), "r"); - } - - if (NULL == fp) { - /* Do not print when there are no config files.(Console log output)*/ - FRAMEWORKUNIFIEDLOG(ZONE_INIT, __FUNCTION__, \ - "Not SensorLog config file. [%s]", uc_file_name); - } else { - /* Read config files */ - for (;;) { - if (fgets(reinterpret_cast<char*>(&ucBuf), SENSLOG_CONFIG_TEXT_SIZE, fp) == NULL) { - /* EOF detection(Fail-safe:Normally it does not pass because it is break at the flag judgment place.)*/ - break; - } - memset(&uc_val, 0, sizeof(uc_val)); - if ((strncmp(reinterpret_cast<char*>(&ucBuf), SENSLOG_CONFIG_KEY_LEN, \ - strlen(SENSLOG_CONFIG_KEY_LEN)) == 0) && ((flag & 0x01) != 0x01)) { - /* Get record length */ - SensLogGetConfigVal(ucBuf, uc_val); - st_sens_log_info->st_gen.us_len = static_cast<uint16_t>(atoi((const char *)uc_val)); - flag ^= 0x01; - } else if ((strncmp(reinterpret_cast<char*>(&ucBuf), SENSLOG_CONFIG_KEY_GEN, \ - strlen(SENSLOG_CONFIG_KEY_GEN)) == 0) && ((flag & 0x02) != 0x02)) { - /* Get number of generations */ - SensLogGetConfigVal(ucBuf, uc_val); - st_sens_log_info->st_gen.uc_gen = static_cast<uint16_t>(atoi((const char *)uc_val)); - flag ^= 0x02; - } else { - /* nop */ - } - - if (flag == 0x03) { - break; - } - } - fclose(fp); - - FRAMEWORKUNIFIEDLOG(ZONE_INIT, __FUNCTION__, \ - "SensorLog read : file[%s] : config[0x%02x]", uc_file_name, flag); - - if ((st_sens_log_info->st_gen.us_len < SENSLOG_LEN_MIN) \ - || (st_sens_log_info->st_gen.us_len > SENSLOG_LEN_MAX)) { - /* The default value is applied if it is outside the valid range. */ - st_sens_log_info->st_gen.us_len = SENSLOG_LEN_DEFAULT; - } - if ((st_sens_log_info->st_gen.uc_gen < SENSLOG_GEN_MIN) \ - || (st_sens_log_info->st_gen.uc_gen > SENSLOG_GEN_MAX)) { - /* The default value is applied if it is outside the valid range. */ - st_sens_log_info->st_gen.uc_gen = SENSLOG_GEN_DEFAULT; - } - st_sens_log_info->ul_text_buf_size = SENSLOG_BUF_MAX; /* Static area(Maximum security) */ - - st_sens_log_info->uc_valid_flag = SENSLOG_VALIDFLAG_ON; - st_sens_log_info->uc_output_flag = SENSLOG_OUTPUTFLAG_NEW; - /* The log output path should be the same path as the config file. */ - memcpy(st_sens_log_info->uc_file_path, uc_file_path, SENSLOG_FILEPATH_SIZE); - } - } - FRAMEWORKUNIFIEDLOG(ZONE_28, __FUNCTION__, "-"); - - return; -} - -/** - * @brief - * Sensor log config file setting value acquisition - * - * @param[in] uc_text Config setting information - * @param[out] uc_val Config setting - */ -static void SensLogGetConfigVal(uint8_t* uc_text, uint8_t* uc_val) { - uint8_t ucBuf[SENSLOG_CONFIG_TEXT_SIZE]; - uint16_t i = 0; - uint16_t j = 0; - - FRAMEWORKUNIFIEDLOG(ZONE_28, __FUNCTION__, "+"); - - if ((uc_text == NULL) || (uc_val == NULL)) { // LCOV_EXCL_BR_LINE 200: can not NULL - // LCOV_EXCL_START 8: invalid - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - /* Unprocessed if the argument is invalid. */ - FRAMEWORKUNIFIEDLOG(ZONE_WARN, __FUNCTION__, "Parameter Error."); - // LCOV_EXCL_STOP - } else { - memset(ucBuf, 0, sizeof(ucBuf)); - while ((*uc_text != ':') && (*uc_text != '\0')) { - uc_text++; - i++; - if (i >= (SENSLOG_CONFIG_TEXT_SIZE - 1)) { - break; - } - } - while ((*uc_text != '\r') && (*uc_text != '\n') && (*uc_text != '\0')) { - uc_text++; - i++; - ucBuf[j++] = *uc_text; - if (i >= SENSLOG_CONFIG_TEXT_SIZE) { // LCOV_EXCL_BR_LINE 200: can not exceed size - // LCOV_EXCL_START 8: invalid - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - memset(&ucBuf, 0, sizeof(ucBuf)); - break; - // LCOV_EXCL_STOP - } - } - memcpy(uc_val, ucBuf, sizeof(ucBuf)); - } - FRAMEWORKUNIFIEDLOG(ZONE_28, __FUNCTION__, "-"); - - return; -} - -/** - * @brief - * Acquisition of sensor log NAV-SVINFO file information - * - * @param[in] none - */ -static void SensLogCheckNAVSVINFOFile(void) { - FILE* fp; - const uint8_t* uc_config_file; - uint8_t uc_file_path[SENSLOG_FILEPATH_SIZE]; - uint8_t uc_file_name[SENSLOG_FILEPATH_SIZE + SENSLOG_FILENAME_SIZE]; - - FRAMEWORKUNIFIEDLOG(ZONE_28, __FUNCTION__, "+"); - - uc_config_file = (const uint8_t*)SENSLOG_NAV_SVINFO_FILE_NAME; - - memset(&uc_file_path, 0, sizeof(uc_file_path)); - memset(&uc_file_name, 0, sizeof(uc_file_name)); - - /* Refer to the config files in the built-in memory. */ - snprintf(reinterpret_cast<char*>(&uc_file_path[0]), sizeof(uc_file_path), SENSLOG_CONFIG_FILE_PATH_1); - snprintf(reinterpret_cast<char*>(&uc_file_name[0]), sizeof(uc_file_name), "%s%s", uc_file_path, uc_config_file); - fp = fopen(reinterpret_cast<char*>(&uc_file_name[0]), "r"); - if (NULL == fp) { - /* If there are no config files in the built-in memory, refer to the USB memory. */ - snprintf(reinterpret_cast<char*>(&uc_file_path[0]), sizeof(uc_file_path), \ - "%s", (const char*)&g_mount_path[0]); - snprintf(reinterpret_cast<char*>(&uc_file_name[0]), sizeof(uc_file_name), \ - "%s%s", uc_file_path, uc_config_file); - fp = fopen(reinterpret_cast<char*>(&uc_file_name[0]), "r"); - } - - if (NULL == fp) { - /* Do not print when there are no config files.(Console log output)*/ - FRAMEWORKUNIFIEDLOG(ZONE_INIT, __FUNCTION__, "Not SensorLog config file. [%s]", uc_file_name); - g_navsv_info_flag = FALSE; - } else { - fclose(fp); - FRAMEWORKUNIFIEDLOG(ZONE_INIT, __FUNCTION__, "SensorLog read : file[%s]", uc_file_name); - g_navsv_info_flag = TRUE; - } - FRAMEWORKUNIFIEDLOG(ZONE_28, __FUNCTION__, "-"); - - return; -} - -/** - * @brief - * Acquisition of sensor log NAV-SVINFO file information - * - * @param[in] none - * - * @return Destination sensor log file type - */ -uint8_t SensLogGetNavSvinfoFlag(void) { // LCOV_EXCL_START 8: dead code. - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - return g_navsv_info_flag; -} -// LCOV_EXCL_STOP -/** - * @brief - * Sensor log output(Input information) - * - * Writes the specified log (input information) to the buffer area - * - * @param[in] us_data_type Data type - * @param[in] ul_did Data ID - * @param[in] us_pno Destination PNO - * @param[in] p_data Write data pointer - * @param[in] us_size Write data size - * @param[in] uc_result Reception result - * @param[in] u_write_flag ability to write sensor log - * @param[in] u_write_abnormal_flag When an error occurs ability to write sensor log - */ -void SensLogWriteInputData(uint16_t us_data_type, DID ul_did, PNO us_pno, uint8_t *p_data, \ - uint16_t us_size, uint8_t uc_result, uint8_t u_write_flag, uint8_t u_write_abnormal_flag) { - uint16_t file_type = 0; - uint16_t data_type = us_data_type; - uint16_t write_type = POS_SENSLOG_TYPE_NONE; - RET_API lret_sem = RET_ERROR; - - /* Sensor log file type determination */ - file_type = SensLogGetFileType(kSensLogInputTbl, &data_type, &write_type, ul_did); - - /* For the target type,Perform exclusive control */ - /* Currently, only GPS input can be written from multiple threads. */ - if (file_type == SENSLOG_TYPE_GPS_INPUT) { - /* Semaphore ID determination */ - if (g_sem_id != 0) { // LCOV_EXCL_BR_LINE 200: can not zero - lret_sem = _pb_SemLock(g_sem_id); /* Semaphore Lock */ - if (lret_sem != RET_NORMAL) { // LCOV_EXCL_BR_LINE 200: can not return error - // LCOV_EXCL_START 8: invalid - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - FRAMEWORKUNIFIEDLOG(ZONE_WARN, __FUNCTION__, "SemLock Error."); - // LCOV_EXCL_STOP - } else { - /* Sensor log output */ - SensLogWrite(file_type, data_type, write_type, ul_did, us_pno, p_data, \ - us_size, uc_result, u_write_flag, u_write_abnormal_flag); - (void)_pb_SemUnlock(g_sem_id); /* Semaphore unlock */ - } - } - } else { - /* Sensor log output */ - SensLogWrite(file_type, data_type, write_type, ul_did, us_pno, p_data, us_size, \ - uc_result, u_write_flag, u_write_abnormal_flag); - } - - return; -} - -/** - * @brief - * Sensor log output(Outputs the information) - * - * Writes the specified log (output information) to the buffer area - * - * @param[in] us_data_type Data type - * @param[in] ul_did Data ID - * @param[in] us_pno Destination PNO - * @param[in] p_data Write data pointer - * @param[in] us_size Write data size - * @param[in] uc_result Reception result - */ -void SensLogWriteOutputData(uint16_t us_data_type, DID ul_did, PNO us_pno, uint8_t *p_data, \ - uint16_t us_size, uint8_t uc_result) { - uint16_t file_type = 0; - uint16_t data_type = us_data_type; - uint16_t write_type = POS_SENSLOG_TYPE_NONE; - RET_API lret_sem = RET_ERROR; - - /* Sensor log file type determination */ - file_type = SensLogGetFileType(kSensLogOutputTbl, &data_type, &write_type, ul_did); - - /* For the target type,Perform exclusive control */ - /* Currently, only GPS output can be written from multiple threads. */ - if (file_type == SENSLOG_TYPE_GPS_OUTPUT) { - /* Semaphore ID determination */ - if (g_sem_id != 0) { // LCOV_EXCL_BR_LINE 200: can not zero - lret_sem = _pb_SemLock(g_sem_id); /* Semaphore Lock */ - if (lret_sem != RET_NORMAL) { // LCOV_EXCL_BR_LINE 200: can not return error - // LCOV_EXCL_START 8: invalid - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - FRAMEWORKUNIFIEDLOG(ZONE_WARN, __FUNCTION__, "SemLock Error."); - // LCOV_EXCL_STOP - } else { - /* Sensor log output */ - SensLogWrite(file_type, data_type, write_type, ul_did, us_pno, p_data, \ - us_size, uc_result, SENSLOG_ON, SENSLOG_OFF); - (void)_pb_SemUnlock(g_sem_id); /* Semaphore unlock */ - } - } - } else { - /* Sensor log output */ - SensLogWrite(file_type, data_type, write_type, ul_did, us_pno, p_data, us_size, \ - uc_result, SENSLOG_ON, SENSLOG_OFF); - } - return; -} - -/** - * @brief - * Convert number to ASCII code(For two digits,Fill up to zero) - * - * @param[out] buf Data saving - * @param[in] num Numbers to be converted - */ -static void Num2String2Digit(uint8_t* buf, uint32_t num) { - int8_t c; - if (num >= 100) { // LCOV_EXCL_BR_LINE 200: can not exceed size - // LCOV_EXCL_START 8: invalid - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - *buf++ = '0'; - *buf = '0'; - // LCOV_EXCL_STOP - } else { - c = static_cast<int8_t>(num / 10); - *buf++ = static_cast<uint8_t>(c + '0'); - *buf = static_cast<uint8_t>(num - (c * 10) + '0'); - } -} - -/** - * @brief - * Convert number to ASCII code(For 3 digits,Fill up to zero) - * - * @param[out] buf Data saving - * @param[in] num Numbers to be converted - */ -static void Num2String3Digit(uint8_t* buf, uint32_t num) { - int8_t c; - if (num >= 1000) { // LCOV_EXCL_BR_LINE 200: can not exceed size - // LCOV_EXCL_START 8: invalid - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - *buf++ = '0'; - *buf++ = '0'; - *buf = '0'; - // LCOV_EXCL_STOP - } else { - c = static_cast<int8_t>(num / 100); - *buf++ = static_cast<uint8_t>(c + '0'); - num = num - (c * 100); - c = static_cast<int8_t>(num / 10); - *buf++ = static_cast<uint8_t>(c + '0'); - *buf = static_cast<uint8_t>(num - (c * 10) + '0'); - } -} - -/** - * @brief - * Convert number to ASCII code(For 4 digits,Fill up to zero) - * - * @param[out] buf Data saving - * @param[in] num Numbers to be converted - */ -static void Num2String4Digit(uint8_t* buf, uint32_t num) { - int8_t c; - if (num >= 10000) { // LCOV_EXCL_BR_LINE 200: can not exceed size - // LCOV_EXCL_START 8: invalid - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - *buf++ = '0'; - *buf++ = '0'; - *buf++ = '0'; - *buf = '0'; - // LCOV_EXCL_STOP - } else { - c = static_cast<int8_t>(num / 1000); - *buf++ = static_cast<uint8_t>(c + '0'); - num = num - (c * 1000); - c = static_cast<int8_t>(num / 100); - *buf++ = static_cast<uint8_t>(c + '0'); - num = num - (c * 100); - c = static_cast<int8_t>(num / 10); - *buf++ = static_cast<uint8_t>(c + '0'); - *buf = static_cast<uint8_t>(num - (c * 10) + '0'); - } -} - -/** - * @brief - * Convert digits to hexadecimal ASCII code(Fill up to zero) - * - * @param[out] buf Data saving - * @param[in] Number of digits to be converted to digits - * @param[in] num Numbers to be converted - */ -static void Num2HexString(uint8_t* buf, uint8_t digits, uint32_t num) { - uint8_t* p = buf + digits; - uint8_t calc; - int32_t i; - - /* Only within the displayable range,Convert */ - if ((digits == 8) || (num < (uint32_t)(1 << (4 *digits)))) { - while (num) { - calc = num % 16; - if (10 > calc) { - calc = static_cast<uint8_t>(calc + 0x30); // 0x30 is 0 character - } else { - calc = static_cast<uint8_t>(calc + (0x61 - 0x0A)); // 0x41 is the letter of a - } - *(--p) = calc; - num /= 16; - digits--; - } - } - - /* Insert 0 in the remaining significant digits. */ - for (i = 0; i < digits; i++) { - *(--p) = '0'; - } -} - -/** - * @brief - * Sensor Log Header Creation - * - * @param[out] buf Data saving - * @param[in] DataHeader data headers - * @note For buf, Up to 62 bytes are used. As 64 bytes are allocated in the upper digit, Without current problems, dataHeader.c_pname size increase, - * Need to be reviewed when changing the format. - */ -static void SensLogmakeHeader(uint8_t* buf, SENSLOG_DATA_HEADER dataHeader) { - /* "%02d %04d/%02d/%02d %02d:%02d:%02d.%03d %08x %s %01x %01x %04d " */ - int8_t *p; - uint16_t i = 0; - Num2String2Digit(buf, dataHeader.us_data_type); - buf += 2; - *(buf++) = ' '; - Num2String4Digit(buf, dataHeader.st_sys_time.us_year); - buf += 4; - *(buf++) = '/'; - Num2String2Digit(buf, dataHeader.st_sys_time.us_month); - buf += 2; - *(buf++) = '/'; - Num2String2Digit(buf, dataHeader.st_sys_time.us_day); - buf += 2; - *(buf++) = ' '; - Num2String2Digit(buf, dataHeader.st_sys_time.us_hour); - buf += 2; - *(buf++) = ':'; - Num2String2Digit(buf, dataHeader.st_sys_time.us_minute); - buf += 2; - *(buf++) = ':'; - Num2String2Digit(buf, dataHeader.st_sys_time.us_second); - buf += 2; - *(buf++) = '.'; - Num2String3Digit(buf, dataHeader.st_sys_time.us_milli_seconds); - buf += 3; - *(buf++) = ' '; - Num2HexString(buf, 8, dataHeader.ul_did); - buf += 8; - *(buf++) = ' '; - p = dataHeader.c_pname; - for (i = 0; i < sizeof(dataHeader.c_pname); i++) { - if (*p == 0) { - break; - } - *(buf++) = *(p++); - } - *(buf++) = ' '; - Num2HexString((buf++), 1, dataHeader.uc_unit_type); - *(buf++) = ' '; - Num2HexString((buf++), 1, dataHeader.uc_result); - *(buf++) = ' '; - Num2String4Digit(buf, dataHeader.us_data_size); - buf += 4; - *(buf++) = ' '; - - return; -} - -/** - * @brief - * Sensor log output - * - * Write specified log to buffer area(Common process) - * - * @param[in] us_file_type File type - * @param[in] us_data_type Data type - * @param[in] us_write_type FRAMEWORKUNIFIEDLOG Output Type - * @param[in] ul_did Data ID - * @param[in] us_pno Destination PNO - * @param[in] p_data Write data pointer - * @param[in] us_size Write data size - * @param[in] uc_result Reception result - * @param[in] uWriteFlag ability to write sensor log - * @param[in] u_write_abnormal_flag When an error occursability to write sensor log - */ -static void SensLogWrite(uint16_t us_file_type, uint16_t us_data_type, uint16_t us_write_type, \ - DID ul_did, PNO us_pno, uint8_t *p_data, uint16_t us_size, uint8_t uc_result, uint8_t uWriteFlag, \ - uint8_t u_write_abnormal_flag) { - uint32_t len = 0; - SENSLOG_DATA_HEADER dataHeader; - uint16_t headSize = sizeof(SENSLOG_DATA_HEADER); - uint16_t i = 0; - uint8_t workBuf[64]; - uint16_t workBufLen = 0; - PCSTR pPname = NULL; - uint32_t ulTempBufLen; - uint32_t ulPositioninglogBufLen = SENSLOG_BUF_MAX; - uint32_t retComp; - - if ((p_data == NULL) || (us_size == 0) || (us_size > SENSLOG_BUF_MIN)) { // LCOV_EXCL_BR_LINE 200: can not NULL - /* Unprocessed if write specified log data is invalid */ - FRAMEWORKUNIFIEDLOG(ZONE_WARN, __FUNCTION__, - "Parameter Error. File[%d] Data[%d] DID[%d] Size[%d]", - us_file_type, us_data_type, ul_did, us_size); - } else { - /* Sensor log file type determination */ - if (us_file_type < SENSLOG_TYPE_COUNT) { - if ((g_sens_log_info[us_file_type].uc_valid_flag == SENSLOG_VALIDFLAG_ON) || - (us_write_type != POS_SENSLOG_TYPE_NONE)) { - /* Setting of header information */ - memset(&dataHeader, 0x00, sizeof(dataHeader)); - dataHeader.us_data_type = us_data_type; - SensLogGetSystemTime(&dataHeader.st_sys_time); - dataHeader.ul_did = ul_did; - pPname = _pb_CnvPno2Name(us_pno); - if (pPname == NULL) { - dataHeader.c_pname[0] = '-'; - } else { - snprintf(reinterpret_cast<char *>(&(dataHeader.c_pname[0])), \ - sizeof(dataHeader.c_pname), "%s", pPname); - } - dataHeader.uc_unit_type = (uint8_t)g_unit_type; - dataHeader.uc_result = uc_result; - dataHeader.us_data_size = us_size; - - /* Buffer storage(Header)*/ - memset(&workBuf[0], 0x00, sizeof(workBuf)); - SensLogmakeHeader(workBuf, dataHeader); - workBufLen = static_cast<uint16_t>(strlen(reinterpret_cast<char *>(&(workBuf[0])))); - memcpy(reinterpret_cast<char *>(&(g_sens_log_info[us_file_type].uc_temp_buf[0])), \ - &workBuf[0], workBufLen); - - /* Buffer storage(Data portion)*/ - for (i = 0; i < us_size; i++) { - Num2HexString(&(g_sens_log_info[us_file_type].uc_temp_buf[workBufLen + i * 3]), 2, *p_data); - g_sens_log_info[us_file_type].uc_temp_buf[workBufLen + i * 3 + 2] = ' '; - g_sens_log_info[us_file_type].uc_temp_buf[workBufLen + i * 3 + 3] = 0; /* NULL */ - p_data++; - } - g_sens_log_info[us_file_type].uc_temp_buf[workBufLen + (us_size * 3)] = '\r'; - g_sens_log_info[us_file_type].uc_temp_buf[workBufLen + (us_size * 3) + 1] = '\n'; - ulTempBufLen = workBufLen + (us_size * 3) + 2; - - /* FRAMEWORKUNIFIEDLOG out */ - if ((us_file_type == SENSLOG_TYPE_NAVI_INPUT) || (us_file_type == SENSLOG_TYPE_NAVI_OUTPUT)) { - if (g_unit_type != UNIT_TYPE_GRADE1) { - /* Sensor log is not output when an error occurs except for _CWORD80_ in NAV. */ - u_write_abnormal_flag = 0; - } - } - if ((us_write_type != POS_SENSLOG_TYPE_NONE) && (u_write_abnormal_flag == SENSLOG_ON)) { - /* Data compression */ - retComp = compress2(reinterpret_cast<Bytef*>(&(g_sens_log_info[us_file_type]. \ - uc_positioninglog_buf[SENSLOG_SEQ_SIZE + sizeof(ulPositioninglogBufLen)])), \ - reinterpret_cast<uLongf*>(&ulPositioninglogBufLen), \ - reinterpret_cast<Bytef*>(&(g_sens_log_info[us_file_type].uc_temp_buf[0])), \ - ulTempBufLen, Z_DEFAULT_COMPRESSION); - - if (retComp == Z_OK) { - memcpy(&(g_sens_log_info[us_file_type].uc_positioninglog_buf[0]), \ - SENSLOG_SEQ_START, SENSLOG_SEQ_SIZE); - memcpy(&(g_sens_log_info[us_file_type].uc_positioninglog_buf[SENSLOG_SEQ_SIZE]), \ - &ulPositioninglogBufLen, sizeof(ulPositioninglogBufLen)); - memcpy(&(g_sens_log_info[us_file_type].uc_positioninglog_buf[SENSLOG_SEQ_SIZE \ - + sizeof(ulPositioninglogBufLen) + ulPositioninglogBufLen]), SENSLOG_SEQ_END, SENSLOG_SEQ_SIZE); - g_sens_log_info[us_file_type].uc_positioninglog_buf[SENSLOG_SEQ_SIZE + sizeof(ulPositioninglogBufLen) \ - + ulPositioninglogBufLen + SENSLOG_SEQ_SIZE] = '\n'; - ulPositioninglogBufLen = static_cast<uint32_t>(SENSLOG_SEQ_SIZE + sizeof(ulPositioninglogBufLen) \ - + ulPositioninglogBufLen + SENSLOG_SEQ_SIZE + 1); - POS_SENSLOG(us_write_type, (PCSTR)&(g_sens_log_info[us_file_type].uc_positioninglog_buf[0]), \ - ulPositioninglogBufLen); - } else { - FRAMEWORKUNIFIEDLOG(ZONE_WARN, __FUNCTION__, \ - "compress error[retComp = %d]", retComp); - } - } - - if ((g_sens_log_info[us_file_type].uc_valid_flag == SENSLOG_VALIDFLAG_ON) \ - && (uWriteFlag == SENSLOG_ON)) { - /* For executing file output */ - /* Buffer size determination */ - len = g_sens_log_info[us_file_type].ul_text_buf_len; - if (g_sens_log_info[us_file_type].ul_text_buf_size <= (len + ((headSize + us_size) * 3))) { - FRAMEWORKUNIFIEDLOG(ZONE_WARN, __FUNCTION__, "[%d]:DataSize[%d]/BufLen[%d]", - us_data_type, us_size, len); - - /* In case of buffer upper limit,Write File */ - SensLogOutputFile(static_cast<uint8_t>(us_file_type)); - - /* Buffer clear */ - memset(&(g_sens_log_info[us_file_type].uc_text_buf[0]), 0x00, - g_sens_log_info[us_file_type].ul_text_buf_size); - len = 0; - } - - /* Buffer storage */ - memcpy(reinterpret_cast<char*>(&(g_sens_log_info[us_file_type].uc_text_buf[len])), \ - &g_sens_log_info[us_file_type].uc_temp_buf[0], ulTempBufLen); - g_sens_log_info[us_file_type].ul_text_buf_len = len + ulTempBufLen; - g_sens_log_info[us_file_type].us_rec_count++; - - /* Determining whether the number of file write records is the upper limit (the number of records per file) */ - if (g_sens_log_info[us_file_type].st_gen.us_len <= g_sens_log_info[us_file_type].us_rec_count) { - FRAMEWORKUNIFIEDLOG(ZONE_28, __FUNCTION__, "[%d]:RecCnt[%d/%d]", - us_data_type, g_sens_log_info[us_file_type].us_rec_count, \ - g_sens_log_info[us_file_type].st_gen.us_len); - - /* In case of buffer upper limit,Write File */ - SensLogOutputFile(static_cast<uint8_t>(us_file_type)); - - /* Buffer clear */ - memset(&(g_sens_log_info[us_file_type].uc_text_buf[0]), 0x00, \ - g_sens_log_info[us_file_type].ul_text_buf_size); - g_sens_log_info[us_file_type].ul_text_buf_len = 0; - g_sens_log_info[us_file_type].us_rec_count = 0; - /* Update the number of generations */ - g_sens_log_info[us_file_type].us_gen_count++; - if (g_sens_log_info[us_file_type].st_gen.uc_gen < g_sens_log_info[us_file_type].us_gen_count) { - g_sens_log_info[us_file_type].us_gen_count = 1; - } - g_sens_log_info[us_file_type].uc_output_flag = SENSLOG_OUTPUTFLAG_NEW; - } - } - } - } - } - - return; -} - -/** - * @brief - * Sensor log file type determination - * - * Determine the type of the output destination sensor log file - * - * @param[in] pstTbl Sensor log type definition table - * @param[in] Pus_data_type Data type - * @param[out] pus_write_type FRAMEWORKUNIFIEDLOG Output Type - * @param[in] ul_did Data ID - * - * @return Destination sensor log file type - */ -static uint16_t SensLogGetFileType(const SENSLOG_ID_TBL *pstTbl, uint16_t *pus_data_type, \ - uint16_t *pus_write_type, DID ul_did) { - uint16_t file_type = SENSLOG_TYPE_COUNT; - uint16_t cnt = 0; - - /* Determination of output log file type */ - /* DID,Prioritize the beginning of the table for both data types. */ - /* If DID is specified, it is judged by DID.*/ - if (ul_did != 0) { - for (cnt = 0; pstTbl[cnt].us_file_type != SENSLOG_TYPE_COUNT; cnt++) { - if (pstTbl[cnt].ul_did == ul_did) { - *pus_data_type = pstTbl[cnt].us_data_type; - file_type = pstTbl[cnt].us_file_type; - *pus_write_type = pstTbl[cnt].us_write_type; - break; - } - } - } - /* If no DID is specified or cannot be found, judge according to the data type. */ - if (file_type == SENSLOG_TYPE_COUNT) { - for (cnt = 0; pstTbl[cnt].us_file_type != SENSLOG_TYPE_COUNT; cnt++) { - if (pstTbl[cnt].us_data_type == *pus_data_type) { - file_type = pstTbl[cnt].us_file_type; - *pus_write_type = pstTbl[cnt].us_write_type; - break; - } - } - } - return file_type; -} - -/** - * @brief - * Sensor log file output - * - * Write the log data in the buffer area to a file - * - * @param[in] ucFileType File type - */ -static void SensLogOutputFile(uint8_t ucFileType) { - FILE *fp; - int fd; - uint8_t uc_file_name_base[SENSLOG_FILEPATH_SIZE + SENSLOG_FILENAME_SIZE]; - uint8_t uc_file_name[SENSLOG_FILEPATH_SIZE + SENSLOG_FILENAME_SIZE]; - - if (ucFileType < SENSLOG_TYPE_COUNT) { // LCOV_EXCL_BR_LINE 200: can not exceed type - /* File path generation */ - snprintf(reinterpret_cast<char*>(&uc_file_name_base[0]), sizeof(uc_file_name_base), - "%s%s", - g_sens_log_info[ucFileType].uc_file_path, g_sens_log_info[ucFileType].uc_file_name); - snprintf(reinterpret_cast<char*>(&uc_file_name[0]), sizeof(uc_file_name), - reinterpret_cast<char*>(&uc_file_name_base[0]), - g_sens_log_info[ucFileType].us_gen_count); - - /* Writing to a File */ - if (g_sens_log_info[ucFileType].uc_output_flag == SENSLOG_OUTPUTFLAG_NEW) { - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, \ - "SensLog create file. : file[%s] : uc_output_flag[%d]", \ - uc_file_name, g_sens_log_info[ucFileType].uc_output_flag); - - /* Export New File(Write From Beginning)*/ - fp = fopen(reinterpret_cast<char*>(&uc_file_name[0]), "w+"); - g_sens_log_info[ucFileType].uc_output_flag = SENSLOG_OUTPUTFLAG_ADD; - - /* Update generation information file */ - SensLogOutputGenFile(ucFileType); - } else { - /* Append export */ - fp = fopen(reinterpret_cast<char*>(&uc_file_name[0]), "a+"); - } - - if (NULL != fp) { // LCOV_EXCL_BR_LINE 200: can not NULL - /* Log file output(ASCII)*/ - fd = fileno(fp); - fwrite(&(g_sens_log_info[ucFileType].uc_text_buf[0]), g_sens_log_info[ucFileType].ul_text_buf_len, 1, fp); - fflush(fp); /* Flush the userspace buffers provided by the C library */ - fdatasync(fd); /* Flush cache of files referenced by fd to disk */ - fclose(fp); /* Coverity CID:23371 compliant */ - } else { - // LCOV_EXCL_START 8: invalid - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, \ - "SensLog fopen fail. : file[%s] : uc_output_flag[%d]", \ - uc_file_name, g_sens_log_info[ucFileType].uc_output_flag); - // LCOV_EXCL_STOP - } - } - return; -} - -/** - * @brief - * Generation information file output - * - * Holds the number of generations being output in the generation information file. - * - * @param[in] ucFileType File type - */ -static void SensLogOutputGenFile(uint8_t ucFileType) { - FILE *fp; - int fd; - uint8_t uc_file_name_base[SENSLOG_FILEPATH_SIZE + SENSLOG_FILENAME_SIZE]; - uint8_t uc_file_name[SENSLOG_FILEPATH_SIZE + SENSLOG_FILENAME_SIZE]; - - if (ucFileType < SENSLOG_TYPE_COUNT) { // LCOV_EXCL_BR_LINE 200: can not exceed type - /* File path generation */ - snprintf(reinterpret_cast<char*>(&uc_file_name_base[0]), sizeof(uc_file_name_base), - "%s%s", - g_sens_log_info[ucFileType].uc_file_path, g_sens_log_info[ucFileType].uc_gen_fname); - snprintf(reinterpret_cast<char*>(&uc_file_name[0]), sizeof(uc_file_name), - reinterpret_cast<char*>(&uc_file_name_base[0]), - g_sens_log_info[ucFileType].us_gen_count); - - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "SensLog create file. : file[%s] : us_gen_count[%d]", - uc_file_name, g_sens_log_info[ucFileType].us_gen_count); - - /* Export New File(Write From Beginning)*/ - fp = fopen(reinterpret_cast<char*>(&uc_file_name[0]), "w+"); - if (NULL != fp) { // LCOV_EXCL_BR_LINE 200: can not NULL - /* Generation control number output */ - fd = fileno(fp); - fprintf(fp, "%03d", g_sens_log_info[ucFileType].us_gen_count); - fflush(fp); /* Flush the userspace buffers provided by the C library */ - fdatasync(fd); /* Flush cache of files referenced by fd to disk */ - fclose(fp); /* Coverity CID:23372 compliant */ - } else { - // LCOV_EXCL_START 8: invalid - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, \ - "SensLog fopen fail. : file[%s] : us_gen_count[%d]", \ - uc_file_name, g_sens_log_info[ucFileType].us_gen_count); - // LCOV_EXCL_STOP - } - } - return; -} - -/** - * @brief - * Get system time - * - * Get the system time(Millisecond) - * - * @param[out] st_sys_time System time - */ -void SensLogGetSystemTime(SENSLOG_SYSTEMTIME *st_sys_time) { - time_t time_sec = 0; - struct timespec tp = {0}; - struct tm time_cal= {0}; - - if (NULL != st_sys_time) { // LCOV_EXCL_BR_LINE 200: not NULL - if (0 == clock_gettime(CLOCK_REALTIME, &tp)) { - time_sec = tp.tv_sec; - localtime_r(&time_sec, &time_cal); - st_sys_time->us_year = static_cast<uint16_t>((WORD)time_cal.tm_year + 1900); - st_sys_time->us_month = static_cast<uint16_t>((WORD)time_cal.tm_mon + 1); - st_sys_time->us_day_of_week = (WORD)time_cal.tm_wday; - st_sys_time->us_day = (WORD)time_cal.tm_mday; - st_sys_time->us_hour = (WORD)time_cal.tm_hour; - st_sys_time->us_minute = (WORD)time_cal.tm_min; - st_sys_time->us_second = (WORD)time_cal.tm_sec; - st_sys_time->us_milli_seconds = (WORD)(static_cast<double>(tp.tv_nsec) * 1e-6); /* Calculating milliseconds */ - } - } - return; -} - -/* end of file */ diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_CanDeliveryEntry.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_CanDeliveryEntry.cpp deleted file mode 100755 index f1cd695..0000000 --- a/vehicleservice/positioning/server/src/Sensor/VehicleSens_CanDeliveryEntry.cpp +++ /dev/null @@ -1,47 +0,0 @@ -/* - * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/******************************************************************************* - * File name :VehicleSensCanDeliveryEntry.cpp - * System name :_CWORD107_ - * Subsystem name :Vehicle sensor process - * Program name :CAN data delivery registration - * Module configuration :VehicleSensCanDeliveryEntry() CAN data delivery registration - ******************************************************************************/ - -#include <vehicle_service/positioning_base_library.h> -#include "VehicleSens_DeliveryCtrl.h" - -/*************************************************/ -/* Global variable */ -/*************************************************/ - -/******************************************************************************* -* MODULE : VehicleSensCanDeliveryEntry -* ABSTRACT : CAN data delivery registration -* FUNCTION : Register delivery of CAN data required as vehicle sensor middleware -* ARGUMENT : void -* NOTE : -* RETURN : CANIF_RET_NORMAL :Normal completion -* CANIF_RET_ERROR_CREATE_EVENT :Event generation failure -* CANIF_RET_ERROR_PARAM :Parameter error -* CANIF_RET_ERROR_BUFFULL :FULL of delivery registers -* CANIF_RET_ERROR_CANIDFULL :FULL of delivery CAN ID numbers -******************************************************************************/ -RET_API VehicleSensCanDeliveryEntry(void) { - return RET_NORMAL; -} - diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Common.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Common.cpp deleted file mode 100755 index aeb180e..0000000 --- a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Common.cpp +++ /dev/null @@ -1,429 +0,0 @@ -/* - * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/******************************************************************************* - * File name :VehicleSens_Common.cpp - * System name :_CWORD107_ - * Subsystem name :Vehicle sensor process - * Program name :Vehicle sensor common processing(VEHICLE_COMMON) - * Module configuration :VehicleSensmemcmp() Functions for Common Processing Memory Block Comparisons - * VehicleSensCheckDid() Common Processing Data ID Check Function - * VehicleSensGetDataMasterOffset() Get function for common processing data master offset value - ******************************************************************************/ - -#include <vehicle_service/positioning_base_library.h> -#include "VehicleSens_Common.h" -#include "POS_private.h" -#include <system_service/ss_ver.h> -#include <system_service/ss_package.h> -#include "gps_hal.h" -#include "VehicleSens_DataMaster.h" - - -#define _pb_strcat(pdest, psrc, size) (strncat(pdest, psrc, size) , (0)) - - -/*************************************************/ -/* Global variable */ -/*************************************************/ -static const VEHICLESENS_DID_OFFSET_TBL kGstDidList[] = { - /* Data ID Offset size Reserved */ - { VEHICLE_DID_DESTINATION, VEHICLESENS_OFFSET_NORMAL, {0, 0} }, - { VEHICLE_DID_HV, VEHICLESENS_OFFSET_NORMAL, {0, 0} }, - { VEHICLE_DID_STEERING_WHEEL, VEHICLESENS_OFFSET_NORMAL, {0, 0} }, - { VEHICLE_DID_VB, VEHICLESENS_OFFSET_NORMAL, {0, 0} }, - { VEHICLE_DID_IG, VEHICLESENS_OFFSET_NORMAL, {0, 0} }, - { VEHICLE_DID_MIC, VEHICLESENS_OFFSET_NORMAL, {0, 0} }, - { VEHICLE_DID_BACKDOOR, VEHICLESENS_OFFSET_NORMAL, {0, 0} }, - { VEHICLE_DID_PKB, VEHICLESENS_OFFSET_NORMAL, {0, 0} }, - { VEHICLE_DID_ADIM, VEHICLESENS_OFFSET_NORMAL, {0, 0} }, - { VEHICLE_DID_ILL, VEHICLESENS_OFFSET_NORMAL, {0, 0} }, - { VEHICLE_DID_RHEOSTAT, VEHICLESENS_OFFSET_NORMAL, {0, 0} }, - { VEHICLE_DID_SYSTEMP, VEHICLESENS_OFFSET_NORMAL, {0, 0} }, - { POSHAL_DID_SPEED_PULSE, VEHICLESENS_OFFSET_20WORD, {0, 0} }, - { POSHAL_DID_SPEED_PULSE_FLAG, VEHICLESENS_OFFSET_20WORD, {0, 0} }, - { POSHAL_DID_SPEED_KMPH, VEHICLESENS_OFFSET_NORMAL, {0, 0} }, - { POSHAL_DID_GYRO_X, VEHICLESENS_OFFSET_20WORD, {0, 0} }, - { POSHAL_DID_GYRO_Y, VEHICLESENS_OFFSET_20WORD, {0, 0} }, - { POSHAL_DID_GYRO_Z, VEHICLESENS_OFFSET_20WORD, {0, 0} }, - { POSHAL_DID_GSNS_X, VEHICLESENS_OFFSET_NORMAL, {0, 0} }, - { POSHAL_DID_GSNS_Y, VEHICLESENS_OFFSET_NORMAL, {0, 0} }, - { POSHAL_DID_GSNS_Z, VEHICLESENS_OFFSET_NORMAL, {0, 0} }, - { POSHAL_DID_REV, VEHICLESENS_OFFSET_NORMAL, {0, 0} }, - { POSHAL_DID_GPS_ANTENNA, VEHICLESENS_OFFSET_NORMAL, {0, 0} }, - { POSHAL_DID_SNS_COUNTER, VEHICLESENS_OFFSET_NORMAL, {0, 0} }, - { VEHICLE_DID_GPS_COUNTER, VEHICLESENS_OFFSET_NORMAL, {0, 0} }, - { POSHAL_DID_GPS_VERSION, VEHICLESENS_OFFSET_GPS_FORMAT, {0, 0} }, - { VEHICLE_DID_LOCATION, VEHICLESENS_OFFSET_GPS_FORMAT, {0, 0} }, - /* ++GPS _CWORD82_ support */ - { POSHAL_DID_GPS__CWORD82___CWORD44_GP4, VEHICLESENS_OFFSET_GPS_FORMAT, {0, 0} }, - { VEHICLE_DID_GPS__CWORD82__NMEA, VEHICLESENS_OFFSET_GPS_NMEA, {0, 0} }, - { POSHAL_DID_GPS_NMEA, VEHICLESENS_OFFSET_GPS_NMEA, {0, 0} }, - { POSHAL_DID_GPS__CWORD82__FULLBINARY, VEHICLESENS_OFFSET_GPS_FORMAT, {0, 0} }, - /* --GPS _CWORD82_ support */ - { VEHICLE_DID_REV_LINE, VEHICLESENS_OFFSET_NORMAL, {0, 0} }, - { VEHICLE_DID_REV_CAN, VEHICLESENS_OFFSET_NORMAL, {0, 0} }, -#if CONFIG_SENSOR_EXT_VALID /* Initial Sensor Support */ - { POSHAL_DID_GYRO_EXT, VEHICLESENS_OFFSET_20WORD, {0, 0} }, - { POSHAL_DID_SPEED_PULSE_FST, VEHICLESENS_OFFSET_NORMAL, {0, 0} }, - { POSHAL_DID_GYRO_X_FST, VEHICLESENS_OFFSET_NORMAL, {0, 0} }, - { POSHAL_DID_GYRO_Y_FST, VEHICLESENS_OFFSET_NORMAL, {0, 0} }, - { POSHAL_DID_GYRO_Z_FST, VEHICLESENS_OFFSET_NORMAL, {0, 0} }, - { POSHAL_DID_SPEED_PULSE_FLAG_FST, VEHICLESENS_OFFSET_20WORD_FST, {0, 0} }, - { POSHAL_DID_REV_FST, VEHICLESENS_OFFSET_20WORD_FST, {0, 0} }, -#endif - /* ++ PastModel002 support */ - { VEHICLE_DID_GPS_UBLOX_NAV_POSLLH, VEHICLESENS_OFFSET_GPS_UBLOX, {0, 0} }, - { VEHICLE_DID_GPS_UBLOX_NAV_STATUS, VEHICLESENS_OFFSET_GPS_UBLOX, {0, 0} }, - { VEHICLE_DID_GPS_UBLOX_NAV_TIMEUTC, VEHICLESENS_OFFSET_GPS_UBLOX, {0, 0} }, - { VEHICLE_DID_GPS_UBLOX_NAV_VELNED, VEHICLESENS_OFFSET_GPS_UBLOX, {0, 0} }, - { VEHICLE_DID_GPS_UBLOX_NAV_DOP, VEHICLESENS_OFFSET_GPS_UBLOX, {0, 0} }, - { VEHICLE_DID_GPS_UBLOX_NAV_TIMEGPS, VEHICLESENS_OFFSET_GPS_UBLOX, {0, 0} }, - { VEHICLE_DID_GPS_UBLOX_NAV_SVINFO, VEHICLESENS_OFFSET_GPS_UBLOX, {0, 0} }, - { VEHICLE_DID_GPS_UBLOX_NAV_CLOCK, VEHICLESENS_OFFSET_GPS_UBLOX, {0, 0} }, - { VEHICLE_DID_GPS_UBLOX_MON_HW, VEHICLESENS_OFFSET_GPS_UBLOX, {0, 0} }, - { VEHICLE_DID_GYRO_TROUBLE, VEHICLESENS_OFFSET_NORMAL, {0, 0} }, - { VEHICLE_DID_MAIN_GPS_INTERRUPT_SIGNAL, VEHICLESENS_OFFSET_NORMAL, {0, 0} }, - { VEHICLE_DID_SYS_GPS_INTERRUPT_SIGNAL, VEHICLESENS_OFFSET_NORMAL, {0, 0} }, - { VEHICLE_DID_GYRO_CONNECT_STATUS, VEHICLESENS_OFFSET_NORMAL, {0, 0} }, - /* -- PastModel002 support */ - { POSHAL_DID_GPS_TIME, VEHICLESENS_OFFSET_NORMAL, {0, 0} }, - { POSHAL_DID_GPS_TIME_RAW, VEHICLESENS_OFFSET_NORMAL, {0, 0} }, - { POSHAL_DID_GPS_WKNROLLOVER, VEHICLESENS_OFFSET_NORMAL, {0, 0} }, - { VEHICLE_DID_NAVIINFO_DIAG_GPS, VEHICLESENS_OFFSET_NORMAL, {0, 0} }, - { POSHAL_DID_GYRO_TEMP, VEHICLESENS_OFFSET_NORMAL, {0, 0} }, - { POSHAL_DID_GYRO_TEMP_FST, VEHICLESENS_OFFSET_NORMAL, {0, 0} }, - { POSHAL_DID_GSNS_X_FST, VEHICLESENS_OFFSET_NORMAL, {0, 0} }, - { POSHAL_DID_GSNS_Y_FST, VEHICLESENS_OFFSET_NORMAL, {0, 0} }, - { POSHAL_DID_GSNS_Z_FST, VEHICLESENS_OFFSET_NORMAL, {0, 0} }, - { POSHAL_DID_PULSE_TIME, VEHICLESENS_OFFSET_NORMAL, {0, 0} }, - { VEHICLE_DID_LOCATION_LONLAT, VEHICLESENS_OFFSET_NORMAL, {0, 0} }, - { VEHICLE_DID_LOCATION_ALTITUDE, VEHICLESENS_OFFSET_NORMAL, {0, 0} }, - { VEHICLE_DID_MOTION_SPEED, VEHICLESENS_OFFSET_NORMAL, {0, 0} }, - { VEHICLE_DID_MOTION_HEADING, VEHICLESENS_OFFSET_NORMAL, {0, 0} }, - { VEHICLE_DID_LOCATION_LONLAT_NAVI, VEHICLESENS_OFFSET_NORMAL, {0, 0} }, - { VEHICLE_DID_LOCATION_ALTITUDE_NAVI, VEHICLESENS_OFFSET_NORMAL, {0, 0} }, - { VEHICLE_DID_MOTION_SPEED_NAVI, VEHICLESENS_OFFSET_NORMAL, {0, 0} }, - { VEHICLE_DID_MOTION_HEADING_NAVI, VEHICLESENS_OFFSET_NORMAL, {0, 0} }, - { VEHICLE_DID_SETTINGTIME, VEHICLESENS_OFFSET_NORMAL, {0, 0} }, - { VEHICLE_DID_MOTION_SPEED_INTERNAL, VEHICLESENS_OFFSET_NORMAL, {0, 0} }, - { POSHAL_DID_GPS_CLOCK_DRIFT, VEHICLESENS_OFFSET_NORMAL, {0, 0} }, - { POSHAL_DID_GPS_CLOCK_FREQ, VEHICLESENS_OFFSET_NORMAL, {0, 0} }, - { 0, 0, {0, 0} } /* Termination code */ -}; - -/******************************************************************************* -* MODULE : VehicleSensmemcmp -* ABSTRACT : Functions for Common Processing Memory Block Comparisons -* FUNCTION : Memory block comparison processing -* ARGUMENT : *vp_data1 : Comparison target address 1 -* : *vp_data2 : Comparison target address 2 -* : uc_size : Comparison Size -* NOTE : -* RETURN : VEHICLESENS_EQ : No data change -* : VEHICLESENS_NEQ : Data change -******************************************************************************/ -u_int8 VehicleSensmemcmp(const void *vp_data1, const void *vp_data2, size_t uc_size) { - u_int8 ret = VEHICLESENS_EQ; - const u_int8 *ucp_data1 = (const u_int8 *)vp_data1; - const u_int8 *ucp_data2 = (const u_int8 *)vp_data2; - - /* Loop by data size */ - while (uc_size > 0) { - if (*ucp_data1 != *ucp_data2) { - /* Data mismatch */ - ret = VEHICLESENS_NEQ; - break; - } - ucp_data1++; - ucp_data2++; - uc_size--; - } - return( ret ); -} - -/******************************************************************************* -* MODULE : VehicleSensCheckDid -* ABSTRACT : Common Processing Data ID Check Function -* FUNCTION : Check if the specified DID corresponds to the vehicle sensor information -* ARGUMENT : ul_did : Data ID -* NOTE : -* RETURN : VEHICLESENS_INVALID :Disabled -* : VEHICLESENS_EFFECTIVE :Enabled -******************************************************************************/ -int32 VehicleSensCheckDid(DID ul_did) { - int32 i = 0; - int32 ret = VEHICLESENS_INVALID; - - while (0 != kGstDidList[i].ul_did) { // LCOV_EXCL_BR_LINE 200: did always valid - if (kGstDidList[i].ul_did == ul_did) { - /* DID enabled */ - ret = VEHICLESENS_EFFECTIVE; - break; - } - i++; - } - return( ret ); -} - -/******************************************************************************* -* MODULE : VehicleSensGetDataMasterOffset -* ABSTRACT : Get function for common processing data master offset value -* FUNCTION : Get the fixed offset value for a given DID -* ARGUMENT : ul_did : Data ID -* NOTE : -* RETURN : Offset value(Returns 0 if DID is invalid) -******************************************************************************/ -u_int16 VehicleSensGetDataMasterOffset(DID ul_did) { - int32 i = 0; /* Generic counters */ - u_int16 ret = 0; /* Return value of this function */ - - while (0 != kGstDidList[i].ul_did) { // LCOV_EXCL_BR_LINE 200: did always valid - if (kGstDidList[i].ul_did == ul_did) { - /* DID enabled */ - ret = kGstDidList[i].us_offset; - break; - } - i++; - } - return( ret ); -} - -/* Ignore->MISRA-C++:2008 Rule 2-7-2 */ -#if CONFIG_SENSOR_EXT_VALID /* Initial Sensor Support */ -/******************************************************************************* -* MODULE : VehicleSensGetDataMasterExtOffset -* ABSTRACT : Get function for common processing data master offset value -* FUNCTION : Get the fixed offset value for the first package delivery of the specified DID -* ARGUMENT : ul_did : Data ID -* NOTE : -* RETURN : Offset value(Returns 0 for unspecified DID) -******************************************************************************/ -u_int16 VehicleSensGetDataMasterExtOffset(DID ul_did) { - u_int16 usRet = 0; /* Return value of this function */ - - switch (ul_did) { - case POSHAL_DID_GYRO_EXT: - case POSHAL_DID_GYRO_X: - case POSHAL_DID_GYRO_Y: - case POSHAL_DID_GYRO_Z: - case POSHAL_DID_GSNS_X: /* Ignore->MISRA-C++:2008 Rule 2-7-2 */ - case POSHAL_DID_GSNS_Y: /* Ignore->MISRA-C++:2008 Rule 2-7-2 */ - case POSHAL_DID_GSNS_Z: - case POSHAL_DID_SPEED_PULSE: - { - /* Returns the extended package size (one data 2byte) at the time of initial delivery */ - usRet = VEHICLESENS_OFFSET_10WORD_PKG_EXT; - break; - } - case POSHAL_DID_SNS_COUNTER: - case POSHAL_DID_REV: - { - /* Returns the extended package size (one data 1byte) at the time of initial delivery */ - usRet = VEHICLESENS_OFFSET_BYTE_PKG_EXT; - break; - } - case POSHAL_DID_GYRO_TEMP: - { - /* Returns the extended package size (one data 2byte) at the time of initial delivery */ - usRet = VEHICLESENS_OFFSET_WORD_PKG_EXT; - break; - } - case POSHAL_DID_PULSE_TIME: - { - /* Returns the expansion package size (132 bytes per data) at the time of initial delivery */ - usRet = VEHICLESENS_OFFSET_32LONG_PKG_EXT; - break; - } - default: /* Other than the above */ /* Ignore->MISRA-C++:2008 Rule 6-3-1, 6-4-1 */ - break; - } - return( usRet ); -} -#endif -/* Ignore->MISRA-C++:2008 Rule 2-7-2 */ - -/** - * @brief - * GPS version information setting request - * - * Request to set GPS version information to SS - * - * @param[in] pstData Pointer to received message data - */ -void VehicleSensSetGpsVersion(const SENSOR_MSG_GPSDATA_DAT *pstData) { - static BOOL isExistGpsVersion = FALSE; - SSVER_PkgInfo info; - CSSVer cssVer; - UNIT_TYPE eType = UNIT_TYPE_NONE; /* Supported HW Configuration Type */ - EFrameworkunifiedStatus ret; - - if (isExistGpsVersion == FALSE) { - memset(&info, 0x00, sizeof(info)); - /* Supported HW Configuration Check */ - eType = GetEnvSupportInfo(); - if (UNIT_TYPE_GRADE1 == eType) { // LCOV_EXCL_BR_LINE 6:cannot be this env - // LCOV_EXCL_START 8 : dead code - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - /* GRADE1 */ - memcpy(info.version, pstData->uc_data, sizeof(info.version)); - - /* Calling setPkgInfo() */ - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, - "--- VehicleUtility_SetGpsVersion setPkgInfo -->"); - ret = cssVer.setPkgInfo(SS_PKG_NAVI_GPS, info); - if (ret == eFrameworkunifiedStatusOK) { - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, - "--- VehicleUtility_SetGpsVersion setPkgInfo <-- GPSVersion = %s", info.version); - isExistGpsVersion = TRUE; /* Update Flag */ - } else { - /* Error log */ - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, - "Failed to set PkgInfo EpositioningStatus = %d", ret); - } - // LCOV_EXCL_STOP - } else if ( UNIT_TYPE_GRADE2 == eType ) { - /* - * Note. - * This feature branches processing depending on the unit type. - */ - } else { - /* nop */ - } - } - return; -} - -/** - * @brief -* Acquisition of location and time information (dump) - * - * @param[out] pBuf Dump information - * @param[in] Uc_get_method Retrieval method - */ -void VehicleSensGetDebugPosDate(void* pBuf, u_int8 uc_get_method) { // LCOV_EXCL_START 7: uesd only in FrameworkunifiedOnDebugDump - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - static uint8_t buf[DEBUG_DUMP_MAX_SIZE]; - static uint8_t bufTmp[256]; - VEHICLESENS_DATA_MASTER stSnsData; - SENSORLOCATION_LONLATINFO_DAT *pstLonLat; - SENSORLOCATION_ALTITUDEINFO_DAT *pstAltitude; - SENSORMOTION_HEADINGINFO_DAT *pstHeading; - SENSOR_MSG_GPSDATA_DAT stGpsData; - SENSOR_MSG_GPSTIME *pstDateTimeGps; - NAVIINFO_DIAG_GPS *pstDiagGps; - uint8_t i; - - memset(&buf, 0x00, sizeof(buf)); - /* Title */ - switch ( uc_get_method ) { - case VEHICLESENS_GETMETHOD_GPS: - snprintf(reinterpret_cast<char *>(&buf), sizeof(buf), "GPS Info"); - break; - case VEHICLESENS_GETMETHOD_NAVI: - snprintf(reinterpret_cast<char *>(&buf), sizeof(buf), "Navi Info"); - break; - default: - /* nop */ - break; - } - - /* Latitude,Longitude */ - VehicleSensGetLocationLonLat(&stSnsData, uc_get_method); - pstLonLat = reinterpret_cast<SENSORLOCATION_LONLATINFO_DAT*>(stSnsData.uc_data); - memset(&bufTmp[0], 0x00, sizeof(bufTmp)); - snprintf( reinterpret_cast<char *>(&bufTmp[0]), sizeof(bufTmp), - "\n [LonLat] sync:%3d, Enable:%01d, Lon:%10d, Lat:%10d, PosSts:0x%02x, PosAcc:0x%04x", - pstLonLat->SyncCnt, - pstLonLat->isEnable, - pstLonLat->Longitude, - pstLonLat->Latitude, - pstLonLat->posSts, - pstLonLat->posAcc); - _pb_strcat(reinterpret_cast<char *>(&buf[0]), reinterpret_cast<char *>(&bufTmp[0]), sizeof(bufTmp)); - - /* Altitude */ - VehicleSensGetLocationAltitude(&stSnsData, uc_get_method); - pstAltitude = reinterpret_cast<SENSORLOCATION_ALTITUDEINFO_DAT*>(stSnsData.uc_data); - memset(&bufTmp[0], 0x00, sizeof(bufTmp)); - snprintf(reinterpret_cast<char *>(&bufTmp[0]), sizeof(bufTmp), - "\n [Alt] sync:%3d, Enable:%01d, Alt:%10d", - pstAltitude->SyncCnt, - pstAltitude->isEnable, - pstAltitude->Altitude); - _pb_strcat(reinterpret_cast<char *>(&buf[0]), reinterpret_cast<char *>(&bufTmp[0]), sizeof(bufTmp)); - - /* Orientation */ - VehicleSensGetMotionHeading(&stSnsData, uc_get_method); - pstHeading = reinterpret_cast<SENSORMOTION_HEADINGINFO_DAT*>(stSnsData.uc_data); - memset(&bufTmp[0], 0x00, sizeof(bufTmp)); - snprintf(reinterpret_cast<char *>(&bufTmp[0]), sizeof(bufTmp), - "\n [Head] sync:%3d, Enable:%01d, Head:%5d, PosSts:0x%02x", - pstHeading->SyncCnt, - pstHeading->isEnable, - pstHeading->Heading, - pstHeading->posSts); - _pb_strcat(reinterpret_cast<char *>(&buf[0]), reinterpret_cast<char *>(&bufTmp[0]), sizeof(bufTmp)); - - switch ( uc_get_method ) { - case VEHICLESENS_GETMETHOD_GPS: - /* Satellite information */ - VehicleSensGetNaviinfoDiagGPSg(&stGpsData); - pstDiagGps = reinterpret_cast<NAVIINFO_DIAG_GPS*>(stGpsData.uc_data); - memset(&bufTmp[0], 0x00, sizeof(bufTmp)); - snprintf(reinterpret_cast<char *>(&bufTmp[0]), sizeof(bufTmp), - "\n [Diag]\n FixSts:0x%02x", - pstDiagGps->stFix.ucFixSts); - _pb_strcat(reinterpret_cast<char *>(&buf[0]), reinterpret_cast<char *>(&bufTmp[0]), sizeof(bufTmp)); - for (i = 0; i < 12; i++) { - memset(&bufTmp[0], 0x00, sizeof(bufTmp)); - snprintf(reinterpret_cast<char *>(&bufTmp[0]), sizeof(bufTmp), - "\n [%02d] RcvSts:0x%02x, prn:0x%02x, elv:0x%02x, Lv:0x%02x, azm:0x%04x", - i, - pstDiagGps->stSat.stPrn[i].ucRcvSts, - pstDiagGps->stSat.stPrn[i].ucPrn, - pstDiagGps->stSat.stPrn[i].ucelv, - pstDiagGps->stSat.stPrn[i].ucLv, - pstDiagGps->stSat.stPrn[i].usAzm); - _pb_strcat(reinterpret_cast<char *>(&buf[0]), reinterpret_cast<char *>(&bufTmp[0]), sizeof(bufTmp)); - } - - /* Time */ - VehicleSensGetGpsTime(&stGpsData, VEHICLESENS_GETMETHOD_GPS); - pstDateTimeGps = reinterpret_cast<SENSOR_MSG_GPSTIME*>(stGpsData.uc_data); - memset(&bufTmp[0], 0x00, sizeof(bufTmp)); - snprintf(reinterpret_cast<char *>(&bufTmp[0]), sizeof(bufTmp), - "\n [Time] %04d/%02d/%02d %02d:%02d:%02d, sts:%d", - pstDateTimeGps->utc.year, - pstDateTimeGps->utc.month, - pstDateTimeGps->utc.date, - pstDateTimeGps->utc.hour, - pstDateTimeGps->utc.minute, - pstDateTimeGps->utc.second, - pstDateTimeGps->tdsts); - _pb_strcat(reinterpret_cast<char *>(&buf[0]), reinterpret_cast<char *>(&bufTmp[0]), sizeof(bufTmp)); - break; - case VEHICLESENS_GETMETHOD_NAVI: - /* nop */ - break; - default: - /* nop */ - break; - } - memcpy(pBuf, &buf[0], sizeof(buf)); - return; -} -// LCOV_EXCL_STOP diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_DataMasterMain.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_DataMasterMain.cpp deleted file mode 100755 index 7bf40d1..0000000 --- a/vehicleservice/positioning/server/src/Sensor/VehicleSens_DataMasterMain.cpp +++ /dev/null @@ -1,1880 +0,0 @@ -/* - * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/******************************************************************************* - * File name :VehicleSens_DataMasterMain.cpp - * System name :_CWORD107_ - * Subsystem name :Vehicle sensor process - * Program name :Vehicle sensor data master - * Module configuration :VehicleSensInitDataMaster() Vehicle data master initialization function - * :VehicleSensSetDataMasterCan() Vehicle sensor data master CAN data set processing - * :VehicleSensSetDataMasterLineSens() Vehicle sensor data master LineSensor data set process - * :VehicleSensSetDataMasterGps() Vehicle Sensor Data Master GPS Data Set Processing - * :VehicleSensGetDataMaster() Vehicle Sensor Data Master Get Processing - * :VehicleSensGetGpsDataMaster() Vehicle Sensor Data Master GPS Data Get Processing - * :VehicleSensGetGps_CWORD82_NmeaSensorCnt() Vehicle sensor GPS_sensor counter GET function - * :VehicleSensSetDataMaster_CWORD82_() Vehicle sensor data master GPS data (_CWORD82_) set processing - ******************************************************************************/ - -#include <vehicle_service/positioning_base_library.h> -#include "VehicleSens_DataMaster.h" -#include "gps_hal.h" -#include "POS_private.h" -#include "DeadReckoning_main.h" -#include "VehicleSens_DeliveryCtrl.h" -#include "Vehicle_API.h" -#include "CommonDefine.h" -#include <vehicle_service/POS_common_API.h> -#include "SensorMotion_API.h" -#include "SensorLog.h" -#include "ClockIf.h" -#include "DiagSrvIf.h" - -/*************************************************/ -/* Global variable */ -/*************************************************/ -#if CONFIG_SENSOR_EXT_VALID /* Initial Sensor Support */ -VEHICLESENS_PKG_DELIVERY_TEMP_EXT gstPkgTempExt; // NOLINT(readability/nolint) -#endif - -#define DR_DEBUG 0 -#define GPS_DEBUG 0 - -/*************************************************/ -/* Function prototype */ -/*************************************************/ -static uint8_t VehicleSensGetSensorCnt(void); - - -/******************************************************************************* -* MODULE : VehicleSensInitDataMaster -* ABSTRACT : Vehicle sensor data master initialization -* FUNCTION : Initializing Vehicle Sensor Data Master -* ARGUMENT : void -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensInitDataMaster(void) { - /* Vehicle sensor data master initialization */ - - VehicleSensInitSpeedPulsel(); - VehicleSensInitSpeedKmphl(); - VehicleSensInitGyroXl(); - VehicleSensInitGyroYl(); - VehicleSensInitGyroZl(); - VehicleSensInitGsnsXl(); - VehicleSensInitGsnsYl(); - VehicleSensInitGsnsZl(); - VehicleSensInitRevl(); - VehicleSensInitGpsAntennal(); - VehicleSensInitSnsCounterl(); - VehicleSensInitGpsCounterg(); -#if CONFIG_SENSOR_EXT_VALID /* Initial Sensor Support */ - VehicleSensInitGyroRevl(); - VehicleSensInitSnsCounterExtl(); - VehicleSensInitGyroExtl(); - VehicleSensInitGyroYExtl(); - VehicleSensInitGyroZExtl(); - VehicleSensInitSpeedPulseExtl(); - VehicleSensInitRevExtl(); - VehicleSensInitGsnsXExtl(); - VehicleSensInitGsnsYExtl(); - VehicleSensInitGsnsZExtl(); - VehicleSensInitGsnsXFstl(); - VehicleSensInitGsnsYFstl(); - VehicleSensInitGsnsZFstl(); - VehicleSensInitGyroXFstl(); - VehicleSensInitGyroYFstl(); - VehicleSensInitGyroZFstl(); - VehicleSensInitSpeedPulseFstl(); - VehicleSensInitSpeedPulseFlagFstl(); - VehicleSensInitRevFstl(); -#endif - /* ++ GPS _CWORD82_ support */ - VehicleSensInitGps_CWORD82_FullBinaryG(); - VehicleSensInitGps_CWORD82_NmeaG(); - VehicleSensInitGps_CWORD82__CWORD44_Gp4G(); - VehicleSensInitGpsNmeaG(); - /* -- GPS _CWORD82_ support */ - - /* ++ PastModel002 support */ - VehicleSensInitNavVelnedG(); - VehicleSensInitNavTimeUtcG(); - VehicleSensInitNavTimeGpsG(); - VehicleSensInitNavSvInfoG(); - VehicleSensInitNavStatusG(); - VehicleSensInitNavPosllhG(); - VehicleSensInitNavClockG(); - VehicleSensInitNavDopG(); - VehicleSensInitMonHwG(); - - VehicleSensInitSpeedPulseFlag(); - VehicleSensInitGpsInterruptFlag(); - - VehicleSensInitGyroTrouble(); - VehicleSensInitMainGpsInterruptSignal(); - VehicleSensInitSysGpsInterruptSignal(); - VehicleSensInitGyroConnectStatus(); - VehicleSensInitGpsAntennaStatus(); - /* -- PastModel002 support */ - - VehicleSensInitGyroTempFstl(); - VehicleSensInitGyroTempExtl(); - VehicleSensInitGyroTempl(); - VehicleSensInitPulseTimeExtl(); - VehicleSensInitPulseTimel(); - - VehicleSensInitLocationLonLatG(); - VehicleSensInitLocationAltitudeG(); - VehicleSensInitMotionSpeedG(); - VehicleSensInitMotionHeadingG(); - VehicleSensInitNaviinfoDiagGPSg(); - VehicleSensInitGpsTimeG(); - VehicleSensInitGpsTimeRawG(); - VehicleSensInitWknRolloverG(); - VehicleSensInitLocationLonLatN(); - VehicleSensInitLocationAltitudeN(); - VehicleSensInitMotionSpeedN(); - VehicleSensInitMotionHeadingN(); - VehicleSensInitSettingTimeclock(); - VehicleSensInitMotionSpeedI(); - VehicleSensInitGpsClockDriftG(); - VehicleSensInitGpsClockFreqG(); - - VehicleSens_InitLocationInfoNmea_n(); -} - -/******************************************************************************* -* MODULE : VehicleSensSetDataMasterLineSens -* ABSTRACT : Vehicle sensor data master LineSensor data set process -* FUNCTION : Set LineSensor data -* ARGUMENT : *pst_data : LineSensor Vehicle Signal Notification Data -* : p_data_master_set_n : Data Master Set Notification(Callback function) -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensSetDataMasterLineSens(const LSDRV_LSDATA *pst_data, - PFUNC_DMASTER_SET_N p_data_master_set_n, - BOOL b_sens_ext) { - u_int8 uc_chg_type; - - /*------------------------------------------------------*/ - /* Call the data set processing associated with the DID */ - /* Call the data master set notification process */ - /*------------------------------------------------------*/ - switch (pst_data->ul_did) { - case POSHAL_DID_SPEED_PULSE: - { - uc_chg_type = VehicleSensSetSpeedPulsel(pst_data); - (*p_data_master_set_n)(pst_data->ul_did, uc_chg_type, VEHICLESENS_GETMETHOD_LINE); - - break; - } -// case POSHAL_DID_GYRO_X: -// { -// uc_chg_type = VehicleSensSetGyroXl(pst_data); -// (*p_data_master_set_n)(pst_data->ul_did, uc_chg_type, VEHICLESENS_GETMETHOD_LINE); -// break; -// } - case POSHAL_DID_GYRO_Y: - { - uc_chg_type = VehicleSensSetGyroYl(pst_data); - (*p_data_master_set_n)(pst_data->ul_did, uc_chg_type, VEHICLESENS_GETMETHOD_LINE); - break; - } - case POSHAL_DID_GYRO_Z: - { - uc_chg_type = VehicleSensSetGyroZl(pst_data); - (*p_data_master_set_n)(pst_data->ul_did, uc_chg_type, VEHICLESENS_GETMETHOD_LINE); - break; - } - case POSHAL_DID_REV: - { - uc_chg_type = VehicleSensSetRevl(pst_data); -#if (DR_DEBUG == 1) /* PastModel002_DR_VEHICLE */ - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "VehicleSens_SetDataMaster POSHAL_DID_REV \r\n"); -#endif - (*p_data_master_set_n)(pst_data->ul_did, uc_chg_type, VEHICLESENS_GETMETHOD_LINE); - /* ++ PastModel002 support DR */ - VehicleSensDeliveryProcDR(pst_data->ul_did, uc_chg_type, VEHICLESENS_GETMETHOD_LINE); - /* -- PastModel002 support DR */ - break; - } - case POSHAL_DID_GPS_ANTENNA: - { - uc_chg_type = VehicleSensSetGpsAntennal(pst_data); - (*p_data_master_set_n)(pst_data->ul_did, uc_chg_type, VEHICLESENS_GETMETHOD_LINE); - break; - } - case POSHAL_DID_GYRO_X: - case POSHAL_DID_GYRO_EXT: /* 3 to 14bit A/D value,0bit:REV */ - { - uc_chg_type = VehicleSensSetGyroRevl(pst_data); -// if (b_sens_ext == TRUE) { -// VehicleSensSetGyroExtl(pst_data); -// } - (*p_data_master_set_n)(pst_data->ul_did, uc_chg_type, VEHICLESENS_GETMETHOD_LINE); - break; - } - default: - break; - } -} - -/******************************************************************************* -* MODULE : VehicleSensSetDataMasterLineSensG -* ABSTRACT : Vehicle sensor data master LineSensor data set process -* FUNCTION : Set LineSensor data -* ARGUMENT : *pst_data : LineSensor Vehicle Signal Notification Data -* : p_data_master_set_n : Data Master Set Notification(Callback function) -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensSetDataMasterLineSensG(const LSDRV_LSDATA_G *pst_data, - PFUNC_DMASTER_SET_N p_data_master_set_n, - BOOL b_sens_ext) { - u_int8 uc_chg_type; - SENSORMOTION_SPEEDINFO_DAT stSpeed; - const VEHICLESENS_DATA_MASTER* pst_master; - u_int16 usSP_KMPH = 0; /* Vehicle speed(km/h) */ - - /*------------------------------------------------------*/ - /* Call the data set processing associated with the DID */ - /* Call the data master set notification process */ - /*------------------------------------------------------*/ - switch (pst_data->ul_did) { - case POSHAL_DID_SPEED_PULSE: - { - uc_chg_type = VehicleSensSetSpeedPulselG(pst_data); -#if (DR_DEBUG == 1) /* PastModel002_DR_VEHICLE */ - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "VehicleSens_SetDataMaster POSHAL_DID_SPEED_PULSE \r\n"); -#endif - if (b_sens_ext == TRUE) { - VehicleSensSetSpeedPulseExtlG(pst_data); - } - (*p_data_master_set_n)(pst_data->ul_did, uc_chg_type, VEHICLESENS_GETMETHOD_LINE); - /* ++ PastModel002 support DR */ - VehicleSensDeliveryProcDR(pst_data->ul_did, uc_chg_type, VEHICLESENS_GETMETHOD_LINE); - /* -- PastModel002 support DR */ - break; - } - case POSHAL_DID_SPEED_KMPH: - { - uc_chg_type = VehicleSensSetSpeedKmphlG(pst_data); - (*p_data_master_set_n)(pst_data->ul_did, uc_chg_type, VEHICLESENS_GETMETHOD_LINE); - - /* Set the data master of Motion Seepd (Internal) */ - pst_master = (const VEHICLESENS_DATA_MASTER*)pst_data; - memset(&stSpeed, 0x00, sizeof(SENSORMOTION_SPEEDINFO_DAT)); - /* When the notified size is ""0"",The vehicle speed cannot be calculated with the line sensor. */ - if (pst_master->us_size == 0) { - stSpeed.isEnable = FALSE; - } else { - stSpeed.isEnable = TRUE; - memcpy(&usSP_KMPH, pst_master->uc_data, sizeof(u_int16)); - } - stSpeed.getMethod = SENSOR_GET_METHOD_POS; - /* Unit conversion [0.01km/h] -> [0.01m/s] */ - stSpeed.Speed = static_cast<uint16_t>((1000 * usSP_KMPH) / 3600); - - uc_chg_type = VehicleSensSetMotionSpeedI(&stSpeed); - (*p_data_master_set_n)(VEHICLE_DID_MOTION_SPEED_INTERNAL, uc_chg_type, VEHICLESENS_GETMETHOD_INTERNAL); - break; - } -// case POSHAL_DID_GYRO_X: -// { -// uc_chg_type = VehicleSensSetGyroXlG(pst_data); -//#if (DR_DEBUG == 1) /* PastModel002_DR_VEHICLE */ -// FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "VehicleSens_SetDataMaster POSHAL_DID_GYRO_X \r\n"); -//#endif -// (*p_data_master_set_n)(pst_data->ul_did, uc_chg_type, VEHICLESENS_GETMETHOD_LINE); -// /* ++ PastModel002 support DR */ -// VehicleSensDeliveryProcDR(pst_data->ul_did, uc_chg_type, VEHICLESENS_GETMETHOD_LINE); -// /* -- PastModel002 support DR */ -// break; -// } - case POSHAL_DID_GYRO_Y: - { - uc_chg_type = VehicleSensSetGyroYlG(pst_data); - if (b_sens_ext == TRUE) { - VehicleSensSetGyroYExtlG(pst_data); - } -#if (DR_DEBUG == 1) - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "VehicleSens_SetDataMaster POSHAL_DID_GYRO_Y \r\n"); -#endif - (*p_data_master_set_n)(pst_data->ul_did, uc_chg_type, VEHICLESENS_GETMETHOD_LINE); - VehicleSensDeliveryProcDR(pst_data->ul_did, uc_chg_type, VEHICLESENS_GETMETHOD_LINE); - break; - } - case POSHAL_DID_GYRO_Z: - { - uc_chg_type = VehicleSensSetGyroZlG(pst_data); - if (b_sens_ext == TRUE) { - VehicleSensSetGyroZExtlG(pst_data); - } -#if (DR_DEBUG == 1) - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "VehicleSens_SetDataMaster POSHAL_DID_GYRO_Z \r\n"); -#endif - (*p_data_master_set_n)(pst_data->ul_did, uc_chg_type, VEHICLESENS_GETMETHOD_LINE); - VehicleSensDeliveryProcDR(pst_data->ul_did, uc_chg_type, VEHICLESENS_GETMETHOD_LINE); - break; - } - case POSHAL_DID_SNS_COUNTER: - { -#if (DR_DEBUG == 1) /* PastModel002_DR_VEHICLE */ - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "VehicleSens_SetDataMaster POSHAL_DID_SNS_COUNTER \r\n"); -#endif - uc_chg_type = VehicleSensSetSnsCounterlG(pst_data); - if (b_sens_ext == TRUE) { - VehicleSensSetSnsCounterExtlG(pst_data); - } - (*p_data_master_set_n)(pst_data->ul_did, uc_chg_type, VEHICLESENS_GETMETHOD_LINE); - /* ++ PastModel002 support DR */ - VehicleSensDeliveryProcDR(pst_data->ul_did, uc_chg_type, VEHICLESENS_GETMETHOD_LINE); - /* -- PastModel002 support DR */ - break; - } - case POSHAL_DID_GYRO_X: - case POSHAL_DID_GYRO_EXT: /* 3 to 14bit A/D value,0bit:REV */ - { - uc_chg_type = VehicleSensSetGyroRevlG(pst_data); - - if (b_sens_ext == TRUE) { - VehicleSensSetGyroExtlG(pst_data); - } - (*p_data_master_set_n)(pst_data->ul_did, uc_chg_type, VEHICLESENS_GETMETHOD_LINE); - - break; - } - - case POSHAL_DID_SPEED_PULSE_FLAG: - { - uc_chg_type = VehicleSensSetSpeedPulseFlag((const LSDRV_LSDATA_G *)pst_data); - - (*p_data_master_set_n)(pst_data->ul_did, uc_chg_type, VEHICLESENS_GETMETHOD_LINE); - /* ++ PastModel002 support DR */ - VehicleSensDeliveryProcDR(pst_data->ul_did, uc_chg_type, VEHICLESENS_GETMETHOD_LINE); - /* -- PastModel002 support DR */ - - break; - } - case POSHAL_DID_GPS_INTERRUPT_FLAG: - { - uc_chg_type = VehicleSensSetGpsInterruptFlag((const LSDRV_LSDATA_G *)pst_data); - - (*p_data_master_set_n)(pst_data->ul_did, uc_chg_type, VEHICLESENS_GETMETHOD_LINE); - - break; - } - case POSHAL_DID_REV: - { - uc_chg_type = VehicleSensSetRevlG(pst_data); - if (b_sens_ext == TRUE) { - VehicleSensSetRevExtlG(pst_data); - } - (*p_data_master_set_n)(pst_data->ul_did, uc_chg_type, VEHICLESENS_GETMETHOD_LINE); - break; - } - case POSHAL_DID_GYRO_TEMP: - { - uc_chg_type = VehicleSensSetGyroTemplG(pst_data); - if (b_sens_ext == TRUE) { - VehicleSensSetGyroTempExtlG(pst_data); - } - (*p_data_master_set_n)(pst_data->ul_did, uc_chg_type, VEHICLESENS_GETMETHOD_LINE); - break; - } - case POSHAL_DID_GSNS_X: - { - uc_chg_type = VehicleSensSetGsnsXlG(pst_data); - if (b_sens_ext == TRUE) { - VehicleSensSetGsnsXExtlG(pst_data); - } - (*p_data_master_set_n)(pst_data->ul_did, uc_chg_type, VEHICLESENS_GETMETHOD_LINE); - break; - } - case POSHAL_DID_GSNS_Y: - { - uc_chg_type = VehicleSensSetGsnsYlG(pst_data); - if (b_sens_ext == TRUE) { - VehicleSensSetGsnsYExtlG(pst_data); - } - (*p_data_master_set_n)(pst_data->ul_did, uc_chg_type, VEHICLESENS_GETMETHOD_LINE); - break; - } - case POSHAL_DID_GSNS_Z: - { - uc_chg_type = VehicleSensSetGsnsZlG(pst_data); - if (b_sens_ext == TRUE) { - VehicleSensSetGsnsZExtlG(pst_data); - } - (*p_data_master_set_n)(pst_data->ul_did, uc_chg_type, VEHICLESENS_GETMETHOD_LINE); - break; - } - case POSHAL_DID_PULSE_TIME: - { - uc_chg_type = VehicleSensSetPulseTimelG(pst_data); - if (b_sens_ext == TRUE) { - VehicleSensSetPulseTimeExtlG(pst_data); - } - (*p_data_master_set_n)(pst_data->ul_did, uc_chg_type, VEHICLESENS_GETMETHOD_LINE); - break; - } - default: - break; - } -} - -#if CONFIG_SENSOR_EXT_VALID /* Initial Sensor Support */ -/******************************************************************************* -* MODULE : VehicleSensSetDataMasterLineSensFst -* ABSTRACT : Vehicle sensor data master LineSensor data set process -* FUNCTION : Set LineSensor data -* ARGUMENT : *pst_data : LineSensor Vehicle Signal Notification Data -* : p_data_master_set_n : Data Master Set Notification(Callback function) -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensSetDataMasterLineSensFst(const LSDRV_LSDATA_FST *pst_data, PFUNC_DMASTER_SET_N p_data_master_set_n) { // LCOV_EXCL_START 8: dead code // // NOLINT(whitespace/line_length) - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - u_int8 uc_chg_type; - - /*------------------------------------------------------*/ - /* Call the data set processing associated with the DID */ - /* Call the data master set notification process */ - /*------------------------------------------------------*/ - switch (pst_data->ul_did) { - case POSHAL_DID_GYRO_X_FST: /* 3 to 14bit A/D value,0bit:REV */ - { - uc_chg_type = VehicleSensSetGyroXFstl(pst_data); - (*p_data_master_set_n)(pst_data->ul_did, uc_chg_type, VEHICLESENS_GETMETHOD_LINE); - break; - } - case POSHAL_DID_GYRO_Y_FST: /* 3 to 14bit A/D value,0bit:REV */ - { - uc_chg_type = VehicleSensSetGyroYFstl(pst_data); - (*p_data_master_set_n)(pst_data->ul_did, uc_chg_type, VEHICLESENS_GETMETHOD_LINE); - break; - } - case POSHAL_DID_GYRO_Z_FST: /* 3 to 14bit A/D value,0bit:REV */ - { - uc_chg_type = VehicleSensSetGyroZFstl(pst_data); - (*p_data_master_set_n)(pst_data->ul_did, uc_chg_type, VEHICLESENS_GETMETHOD_LINE); - break; - } - case POSHAL_DID_SPEED_PULSE_FST: - { - uc_chg_type = VehicleSensSetSpeedPulseFstl(pst_data); - (*p_data_master_set_n)(pst_data->ul_did, uc_chg_type, VEHICLESENS_GETMETHOD_LINE); - break; - } - default: - break; - } -} -// LCOV_EXCL_STOP -/******************************************************************************* -* MODULE : VehicleSensSetDataMasterLineSensFstG -* ABSTRACT : Vehicle sensor data master LineSensor data set process -* FUNCTION : Set LineSensor data -* ARGUMENT : *pst_data : LineSensor Vehicle Signal Notification Data -* : p_data_master_set_n : Data Master Set Notification(Callback function) -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensSetDataMasterLineSensFstG(const LSDRV_MSG_LSDATA_DAT_FST *pst_data, - PFUNC_DMASTER_SET_N p_data_master_set_n) { - u_int8 uc_chg_type; - - /* Internal debug log output */ - FRAMEWORKUNIFIEDLOG(ZONE_26, __FUNCTION__, "+"); - - /*------------------------------------------------------*/ - /* Call the data set processing associated with the DID */ - /* Call the data master set notification process */ - /*------------------------------------------------------*/ - switch (pst_data->st_gyro_x.ul_did) { - case POSHAL_DID_GYRO_X_FST: - { - uc_chg_type = VehicleSensSetGyroXFstG(&(pst_data->st_gyro_x)); - if (pst_data->st_gyro_x.uc_partition_max == pst_data->st_gyro_x.uc_partition_num) - { - (*p_data_master_set_n)(pst_data->st_gyro_x.ul_did, uc_chg_type, VEHICLESENS_GETMETHOD_LINE); - } - break; - } - default: - break; - } - - switch (pst_data->st_gyro_y.ul_did) { - case POSHAL_DID_GYRO_Y_FST: - { - uc_chg_type = VehicleSensSetGyroYFstG(&(pst_data->st_gyro_y)); - if (pst_data->st_gyro_y.uc_partition_max == pst_data->st_gyro_y.uc_partition_num) { - (*p_data_master_set_n)(pst_data->st_gyro_y.ul_did, uc_chg_type, VEHICLESENS_GETMETHOD_LINE); - } - break; - } - default: - break; - } - - switch (pst_data->st_gyro_z.ul_did) { - case POSHAL_DID_GYRO_Z_FST: - { - uc_chg_type = VehicleSensSetGyroZFstG(&(pst_data->st_gyro_z)); - if (pst_data->st_gyro_z.uc_partition_max == pst_data->st_gyro_z.uc_partition_num) { - (*p_data_master_set_n)(pst_data->st_gyro_z.ul_did, uc_chg_type, VEHICLESENS_GETMETHOD_LINE); - } - break; - } - default: - break; - } - - switch (pst_data->st_speed.ul_did) { - case POSHAL_DID_SPEED_PULSE_FST: - { - uc_chg_type = VehicleSensSetSpeedPulseFstG(&(pst_data->st_speed)); - if (pst_data->st_speed.uc_partition_max == pst_data->st_speed.uc_partition_num) - { - (*p_data_master_set_n)(pst_data->st_speed.ul_did, uc_chg_type, VEHICLESENS_GETMETHOD_LINE); - } - break; - } - default: - break; - } - - switch (pst_data->st_spd_pulse_flg.ul_did) { - case POSHAL_DID_SPEED_PULSE_FLAG_FST: - { - uc_chg_type = VehicleSensSetSpeedPulseFlagFstG(&(pst_data->st_spd_pulse_flg)); - if (pst_data->st_spd_pulse_flg.uc_partition_max == pst_data->st_spd_pulse_flg.uc_partition_num) - { - (*p_data_master_set_n)(pst_data->st_spd_pulse_flg.ul_did, uc_chg_type, VEHICLESENS_GETMETHOD_LINE); - } - break; - } - default: - break; - } - - switch (pst_data->st_rev.ul_did) { - case POSHAL_DID_REV_FST: - { - uc_chg_type = VehicleSensSetRevFstG(&(pst_data->st_rev)); - if (pst_data->st_rev.uc_partition_max == pst_data->st_rev.uc_partition_num) - { - (*p_data_master_set_n)(pst_data->st_rev.ul_did, uc_chg_type, VEHICLESENS_GETMETHOD_LINE); - } - break; - } - default: - break; - } - - switch (pst_data->st_gyro_temp.ul_did) { - case POSHAL_DID_GYRO_TEMP_FST: - { - uc_chg_type = VehicleSensSetGyroTempFstG(&(pst_data->st_gyro_temp)); - - if (pst_data->st_gyro_temp.uc_partition_max == pst_data->st_gyro_temp.uc_partition_num) { - (*p_data_master_set_n)(pst_data->st_gyro_temp.ul_did, uc_chg_type, VEHICLESENS_GETMETHOD_LINE); - } - break; - } - default: - break; - } - - switch (pst_data->st_gsns_x.ul_did) { - case POSHAL_DID_GSNS_X_FST: - { - uc_chg_type = VehicleSensSetGsnsXFstG(&(pst_data->st_gsns_x)); - - if (pst_data->st_gsns_x.uc_partition_max == pst_data->st_gsns_x.uc_partition_num) { - (*p_data_master_set_n)(pst_data->st_gsns_x.ul_did, uc_chg_type, VEHICLESENS_GETMETHOD_LINE); - } - break; - } - default: - break; - } - - switch (pst_data->st_gsns_y.ul_did) { - case POSHAL_DID_GSNS_Y_FST: - { - uc_chg_type = VehicleSensSetGsnsYFstG(&(pst_data->st_gsns_y)); - - if (pst_data->st_gsns_y.uc_partition_max == pst_data->st_gsns_y.uc_partition_num) { - (*p_data_master_set_n)(pst_data->st_gsns_y.ul_did, uc_chg_type, VEHICLESENS_GETMETHOD_LINE); - } - break; - } - default: - break; - } - - switch (pst_data->st_gsns_z.ul_did) { - case POSHAL_DID_GSNS_Z_FST: - { - uc_chg_type = VehicleSensSetGsnsZFstG(&(pst_data->st_gsns_z)); - - if (pst_data->st_gsns_z.uc_partition_max == pst_data->st_gsns_z.uc_partition_num) { - (*p_data_master_set_n)(pst_data->st_gsns_z.ul_did, uc_chg_type, VEHICLESENS_GETMETHOD_LINE); - } - break; - } - default: - break; - } - - /* Internal debug log output */ - FRAMEWORKUNIFIEDLOG(ZONE_26, __FUNCTION__, "-"); -} -#endif - -/******************************************************************************* -* MODULE : VehicleSensSetDataMasterGps -* ABSTRACT : Vehicle Sensor Data Master GPS Data Set Processing -* FUNCTION : Set GPS data -* ARGUMENT : *pst_data : GPS received message data -* : p_data_master_set_n : Data Master Set Notification(Callback function) -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensSetDataMasterGps(SENSOR_MSG_GPSDATA_DAT *pst_data, - PFUNC_DMASTER_SET_N p_data_master_set_n) { - u_int8 uc_chg_type; - SENSORLOCATION_LONLATINFO_DAT lstLonLat; - SENSORLOCATION_ALTITUDEINFO_DAT lstAltitude; - SENSORMOTION_HEADINGINFO_DAT lstHeading; - MDEV_GPS_CUSTOMDATA *pstCustomData; - - VEHICLESENS_DATA_MASTER st_data; - u_int8 antennaState = 0; - u_int8 sensCount = 0; - u_int8 ucResult = SENSLOG_RES_SUCCESS; - - EFrameworkunifiedStatus eStatus = eFrameworkunifiedStatusFail; - BOOL bIsAvailable; - PNO us_pno; - - /* Antenna Connection Information */ - (void)memset(reinterpret_cast<void *>(&st_data), 0, sizeof(st_data)); - VehicleSensGetGpsAntennal(&st_data); - antennaState = st_data.uc_data[0]; - - /* Sensor Counter */ - (void)memset(reinterpret_cast<void *>(&st_data), 0, sizeof(st_data)); - VehicleSensGetSnsCounterl(&st_data); - /** Sensor Counter Value Calculation */ - /** Subtract sensor counter according to data amount from sensor counter.(Rounded off) */ - /** Communication speed9600bps = 1200byte/s,Sensor counter is 1 count at 100ms. */ - sensCount = st_data.uc_data[0]; - - FRAMEWORKUNIFIEDLOG(ZONE_27, __FUNCTION__, - "antennaState = %d, sensCount = %d", antennaState, sensCount); - - /*------------------------------------------------------*/ - /* Call the data set processing associated with the DID */ - /* Call the data master set notification process */ - /*------------------------------------------------------*/ - switch (pst_data->ul_did) { // LCOV_EXCL_BR_LINE 6:some DID is not used - case VEHICLE_DID_GPS_UBLOX_NAV_VELNED: - { - // LCOV_EXCL_START 8 : dead code - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert -#if (GPS_DEBUG == 1) /* PastModel002_DR_VEHICLE */ - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, - "VehicleSens_SetDataMaster VEHICLE_DID_GPS_UBLOX_NAV_VELNED \r\n"); -#endif - uc_chg_type = VehicleSensSetNavVelnedG(pst_data); - (*p_data_master_set_n)(pst_data->ul_did, uc_chg_type, VEHICLESENS_GETMETHOD_GPS); - /* ++ PastModel002 support DR */ - VehicleSensDeliveryProcDR(pst_data->ul_did, uc_chg_type, VEHICLESENS_GETMETHOD_GPS); - /* -- PastModel002 support DR */ - break; - // LCOV_EXCL_STOP - } - case VEHICLE_DID_GPS_UBLOX_NAV_TIMEUTC: - { - // LCOV_EXCL_START 8 : dead code - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert -#if (GPS_DEBUG == 1) /* PastModel002_DR_VEHICLE */ - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, - "VehicleSens_SetDataMaster VEHICLE_DID_GPS_UBLOX_NAV_TIMEUTC \r\n"); -#endif - uc_chg_type = VehicleSensSetNavTimeUtcG(pst_data); - (*p_data_master_set_n)(pst_data->ul_did, uc_chg_type, VEHICLESENS_GETMETHOD_GPS); - /* ++ PastModel002 support DR */ - VehicleSensDeliveryProcDR(pst_data->ul_did, uc_chg_type, VEHICLESENS_GETMETHOD_GPS); - /* -- PastModel002 support DR */ - break; - // LCOV_EXCL_STOP - } - case VEHICLE_DID_GPS_UBLOX_NAV_TIMEGPS: - { - // LCOV_EXCL_START 8 : dead code - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert -#if (GPS_DEBUG == 1) /* PastModel002_DR_VEHICLE */ - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, - "VehicleSens_SetDataMaster VEHICLE_DID_GPS_UBLOX_NAV_TIMEGPS \r\n"); -#endif - uc_chg_type = VehicleSensSetNavTimeGpsG(pst_data); - (*p_data_master_set_n)(pst_data->ul_did, uc_chg_type, VEHICLESENS_GETMETHOD_GPS); - break; - // LCOV_EXCL_STOP - } - case VEHICLE_DID_GPS_UBLOX_NAV_SVINFO: - { - // LCOV_EXCL_START 8 : dead code - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert -#if (GPS_DEBUG == 1) /* PastModel002_DR_VEHICLE */ - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, - "VehicleSens_SetDataMaster VEHICLE_DID_GPS_UBLOX_NAV_SVINFO \r\n"); -#endif - uc_chg_type = VehicleSensSetNavSvInfoG(pst_data); - (*p_data_master_set_n)(pst_data->ul_did, uc_chg_type, VEHICLESENS_GETMETHOD_GPS); - /* ++ PastModel002 support DR */ - VehicleSensDeliveryProcDR(pst_data->ul_did, uc_chg_type, VEHICLESENS_GETMETHOD_GPS); - /* -- PastModel002 support DR */ - break; - // LCOV_EXCL_STOP - } - case VEHICLE_DID_GPS_UBLOX_NAV_STATUS: - { - // LCOV_EXCL_START 8 : dead code - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert -#if (GPS_DEBUG == 1) /* PastModel002_DR_VEHICLE */ - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, - "VehicleSens_SetDataMaster VEHICLE_DID_GPS_UBLOX_NAV_STATUS \r\n"); -#endif - uc_chg_type = VehicleSensSetNavStatusG(pst_data); - (*p_data_master_set_n)(pst_data->ul_did, uc_chg_type, VEHICLESENS_GETMETHOD_GPS); - /* ++ PastModel002 support DR */ - VehicleSensDeliveryProcDR(pst_data->ul_did, uc_chg_type, VEHICLESENS_GETMETHOD_GPS); - /* -- PastModel002 support DR */ - break; - // LCOV_EXCL_STOP - } - case VEHICLE_DID_GPS_UBLOX_NAV_POSLLH: - { - // LCOV_EXCL_START 8 : dead code - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert -#if (GPS_DEBUG == 1) /* PastModel002_DR_VEHICLE */ - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, - "VehicleSens_SetDataMaster VEHICLE_DID_GPS_UBLOX_NAV_POSLLH \r\n"); -#endif - uc_chg_type = VehicleSensSetNavPosllhG(pst_data); - (*p_data_master_set_n)(pst_data->ul_did, uc_chg_type, VEHICLESENS_GETMETHOD_GPS); - /* ++ PastModel002 support DR */ - VehicleSensDeliveryProcDR(pst_data->ul_did, uc_chg_type, VEHICLESENS_GETMETHOD_GPS); - /* -- PastModel002 support DR */ - break; - // LCOV_EXCL_STOP - } - case VEHICLE_DID_GPS_UBLOX_NAV_CLOCK: - { - // LCOV_EXCL_START 8 : dead code - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert -#if (GPS_DEBUG == 1) /* PastModel002_DR_VEHICLE */ - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, - "VehicleSens_SetDataMaster VEHICLE_DID_GPS_UBLOX_NAV_CLOCK \r\n"); -#endif - uc_chg_type = VehicleSensSetNavClockG(pst_data); - (*p_data_master_set_n)(pst_data->ul_did, uc_chg_type, VEHICLESENS_GETMETHOD_GPS); - /* ++ PastModel002 support DR */ - VehicleSensDeliveryProcDR(pst_data->ul_did, uc_chg_type, VEHICLESENS_GETMETHOD_GPS); - /* -- PastModel002 support DR */ - break; - // LCOV_EXCL_STOP - } - case VEHICLE_DID_GPS_UBLOX_NAV_DOP: - { - // LCOV_EXCL_START 8 : dead code - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert -#if (GPS_DEBUG == 1) /* PastModel002_DR_VEHICLE */ - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, - "VehicleSens_SetDataMaster VEHICLE_DID_GPS_UBLOX_NAV_DOP \r\n"); -#endif - uc_chg_type = VehicleSensSetNavDopG(pst_data); - (*p_data_master_set_n)(pst_data->ul_did, uc_chg_type, VEHICLESENS_GETMETHOD_GPS); - /* ++ PastModel002 support DR */ - VehicleSensDeliveryProcDR(pst_data->ul_did, uc_chg_type, VEHICLESENS_GETMETHOD_GPS); - /* -- PastModel002 support DR */ - break; - // LCOV_EXCL_STOP - } - case VEHICLE_DID_GPS_UBLOX_MON_HW: - { - // LCOV_EXCL_START 8 : dead code - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert -#if (GPS_DEBUG == 1) /* PastModel002_DR_VEHICLE */ - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "VehicleSens_SetDataMaster VEHICLE_DID_GPS_UBLOX_MON_HW \r\n"); -#endif - uc_chg_type = VehicleSensSetMonHwG(pst_data); - (*p_data_master_set_n)(pst_data->ul_did, uc_chg_type, VEHICLESENS_GETMETHOD_GPS); - break; - // LCOV_EXCL_STOP - } - case VEHICLE_DID_GPS_COUNTER: - { - // LCOV_EXCL_START 8 : dead code - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - uc_chg_type = VehicleSensSetGpsCounterg(pst_data); - (*p_data_master_set_n)(pst_data->ul_did, uc_chg_type, VEHICLESENS_GETMETHOD_GPS); - break; - // LCOV_EXCL_STOP - } - /* GPS raw data(_CWORD82_ NMEA) */ - case VEHICLE_DID_GPS__CWORD82__NMEA: - { - /* NMEA data */ - FRAMEWORKUNIFIEDLOG(ZONE_27, __FUNCTION__, - "VehicleSens_GpsDataDelivery VEHICLE_DID_GPS__CWORD82__NMEA -->"); - - /* Insert Antenna Connection Status and Sensor Counter */ - pst_data->uc_data[1] = antennaState; /* Insert Antennas into 2byte Eyes */ - /* Place counters at 3byte */ - pst_data->uc_data[2] = static_cast<u_int8>(sensCount - (u_int8)(((GPS_NMEA_SZ * 10) / 1200) + 1)); - - uc_chg_type = VehicleSensSetGps_CWORD82_NmeaG(pst_data); /* Ignore->MISRA-C++:2008 Rule 5-2-5 */ - (*p_data_master_set_n)(pst_data->ul_did, uc_chg_type, VEHICLESENS_GETMETHOD_GPS); - FRAMEWORKUNIFIEDLOG(ZONE_27, __FUNCTION__, - "VehicleSens_GpsDataDelivery VEHICLE_DID_GPS__CWORD82__NMEA <--"); - break; - } - /* GPS raw data(FullBinary) */ - case POSHAL_DID_GPS__CWORD82__FULLBINARY: - { - /* FullBin data */ - FRAMEWORKUNIFIEDLOG(ZONE_27, __FUNCTION__, - "VehicleSens_GpsDataDelivery POSHAL_DID_GPS__CWORD82__FULLBINARY -->"); - - /* Insert Antenna Connection Status and Sensor Counter */ - pst_data->uc_data[0] = antennaState; /* Insert Antennas into 1byte Eyes */ - /* Place counters at 2byte */ - pst_data->uc_data[1] = static_cast<u_int8>(sensCount - (u_int8)(((GPS_CMD_FULLBIN_SZ * 10) / 1200) + 1)); - - uc_chg_type = VehicleSensSetGps_CWORD82_FullBinaryG(pst_data); - (*p_data_master_set_n)(pst_data->ul_did, uc_chg_type, VEHICLESENS_GETMETHOD_GPS); - FRAMEWORKUNIFIEDLOG(ZONE_27, __FUNCTION__, - "VehicleSens_GpsDataDelivery POSHAL_DID_GPS__CWORD82__FULLBINARY <--"); - break; - } - /* GPS raw data(Specific information) */ - case POSHAL_DID_GPS__CWORD82___CWORD44_GP4: - { - /* GPS-specific information */ - uc_chg_type = VehicleSensSetGps_CWORD82__CWORD44_Gp4G(pst_data); /* Ignore->MISRA-C++:2008 Rule 5-2-5 */ - (*p_data_master_set_n)(pst_data->ul_did, uc_chg_type, VEHICLESENS_GETMETHOD_GPS); - break; - } - case POSHAL_DID_GPS_CUSTOMDATA: - { - pstCustomData = reinterpret_cast<MDEV_GPS_CUSTOMDATA*>(pst_data->uc_data); - /* Latitude/LongitudeInformation */ - (void)memcpy(&lstLonLat, &(pstCustomData->st_lonlat), sizeof(SENSORLOCATION_LONLATINFO_DAT)); - lstLonLat.SyncCnt = VehicleSensGetSensorCnt(); /* Synchronization counter setting */ - uc_chg_type = VehicleSensSetLocationLonLatG(&lstLonLat); - (*p_data_master_set_n)(VEHICLE_DID_LOCATION_LONLAT, uc_chg_type, VEHICLESENS_GETMETHOD_GPS); - - /* Altitude information */ - (void)memcpy(&lstAltitude, &(pstCustomData->st_altitude), sizeof(SENSORLOCATION_ALTITUDEINFO_DAT)); - lstAltitude.SyncCnt = VehicleSensGetSensorCnt(); /* Synchronization counter setting */ - uc_chg_type = VehicleSensSetLocationAltitudeG(&lstAltitude); - (*p_data_master_set_n)(VEHICLE_DID_LOCATION_ALTITUDE, uc_chg_type, VEHICLESENS_GETMETHOD_GPS); - - /* Bearing information */ - (void)memcpy(&lstHeading, &(pstCustomData->st_heading), sizeof(SENSORMOTION_HEADINGINFO_DAT)); - lstHeading.SyncCnt = VehicleSensGetSensorCnt(); /* Synchronization counter setting */ - uc_chg_type = VehicleSensSetMotionHeadingG(&lstHeading); - (*p_data_master_set_n)(VEHICLE_DID_MOTION_HEADING, uc_chg_type, VEHICLESENS_GETMETHOD_GPS); - - /* GPS time information */ - uc_chg_type = VehicleSensSetGpsTimeG(&(pstCustomData->st_gps_time)); - (*p_data_master_set_n)(POSHAL_DID_GPS_TIME, uc_chg_type, VEHICLESENS_GETMETHOD_GPS); - - /* Set GPS time to CLOCK */ - eStatus = ClockIfDtimeSetGpsTime(&(pstCustomData->st_gps_time), &bIsAvailable); - if ((bIsAvailable == TRUE) && (eStatus != eFrameworkunifiedStatusOK)) { - ucResult = SENSLOG_RES_FAIL; - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, - "ClockIfDtimeSetGpsTime ERROR!! [ret=%d, y=%d, m=%d, d=%d, h=%d, n=%d, s=%d, sts=%d]", - eStatus, pstCustomData->st_gps_time.utc.year, pstCustomData->st_gps_time.utc.month, - pstCustomData->st_gps_time.utc.date, - pstCustomData->st_gps_time.utc.hour, pstCustomData->st_gps_time.utc.minute, - pstCustomData->st_gps_time.utc.second, pstCustomData->st_gps_time.tdsts); - } - us_pno = _pb_CnvName2Pno(SENSLOG_PNAME_CLOCK); - SensLogWriteOutputData(SENSLOG_DATA_O_TIME_CS, 0, us_pno, - reinterpret_cast<uint8_t *>(&(pstCustomData->st_gps_time)), - sizeof(pstCustomData->st_gps_time), ucResult); - - /* Diag Info */ - uc_chg_type = VehicleSensSetNaviinfoDiagGPSg(&(pstCustomData->st_diag_gps)); - (*p_data_master_set_n)(VEHICLE_DID_NAVIINFO_DIAG_GPS, uc_chg_type, VEHICLESENS_GETMETHOD_GPS); - break; - } - /* GPS raw data(NMEA except _CWORD82_) */ - case POSHAL_DID_GPS_NMEA: - { - /* NMEA data */ - uc_chg_type = VehicleSensSetGpsNmeaG(pst_data); - (*p_data_master_set_n)(pst_data->ul_did, uc_chg_type, VEHICLESENS_GETMETHOD_GPS); - break; - } - /* GPS version(except _CWORD82_) */ - case POSHAL_DID_GPS_VERSION: - { - VehicleSensSetGpsVersion(pst_data); - break; - } - /* Raw GPS time data */ - case POSHAL_DID_GPS_TIME_RAW: - { - (void)VehicleSensSetGpsTimeRawG(reinterpret_cast<SENSOR_GPSTIME_RAW*>(pst_data->uc_data)); - break; - } - case POSHAL_DID_GPS_TIME: - { - uc_chg_type = VehicleSensSetGpsTimeG(reinterpret_cast<SENSOR_MSG_GPSTIME*>(pst_data->uc_data)); - (*p_data_master_set_n)(pst_data->ul_did, uc_chg_type, VEHICLESENS_GETMETHOD_GPS); - break; - } - case POSHAL_DID_GPS_WKNROLLOVER: - { - (void)VehicleSensSetWknRolloverG(reinterpret_cast<SENSOR_WKNROLLOVER*>(pst_data->uc_data)); - break; - } - /* GPS clock drift */ - case POSHAL_DID_GPS_CLOCK_DRIFT: - { - uc_chg_type = VehicleSensSetGpsClockDriftG(reinterpret_cast<int32_t*>(pst_data->uc_data)); - (*p_data_master_set_n)(pst_data->ul_did, uc_chg_type, VEHICLESENS_GETMETHOD_GPS); - break; - } - /* GPS clock frequency */ - case POSHAL_DID_GPS_CLOCK_FREQ: - { - uc_chg_type = VehicleSensSetGpsClockFreqG(reinterpret_cast<uint32_t*>(pst_data->uc_data)); - (*p_data_master_set_n)(pst_data->ul_did, uc_chg_type, VEHICLESENS_GETMETHOD_GPS); - break; - } - - default: - break; - } -} - -/******************************************************************************* - * MODULE : VehicleSensSetDataMasterData - * ABSTRACT : Vehicle sensor data master common data set processing - * FUNCTION : Set vehicle data - * ARGUMENT : *pstMsg : Received message data - * : p_data_master_set_n : Data Master Set Notification(Callback function) - * NOTE : - * RETURN : void - ******************************************************************************/ -void VehicleSensSetDataMasterData(const POS_MSGINFO *pstMsg, - PFUNC_DMASTER_SET_N p_data_master_set_n) { - u_int8 uc_chg_type = 0; - const POS_POSDATA *pstPosData = NULL; - const u_int16 *pucSpeed = 0; - SENSORLOCATION_LONLATINFO_DAT stLonLat; - SENSORLOCATION_ALTITUDEINFO_DAT stAltitude; - SENSORMOTION_SPEEDINFO_DAT stSpeed; - SENSORMOTION_HEADINGINFO_DAT stHeading; - const SENSOR_MSG_GPSTIME *pstGpsTime; - -// RET_API ret; - -// char* pEnvPositioning_CWORD86_ = NULL; -// BOOL sndFlg; - - - EFrameworkunifiedStatus eStatus = eFrameworkunifiedStatusFail; - BOOL bIsAvailable; - u_int8 ucResult = SENSLOG_RES_SUCCESS; - PNO us_pno; - - /*------------------------------------------------------*/ - /* Call the data set processing associated with the DID */ - /* Call the data master set notification process */ - /*------------------------------------------------------*/ - switch (pstMsg->did) { - case POSHAL_DID_GPS_CUSTOMDATA_NAVI: - { - pstPosData = (const POS_POSDATA *) & (pstMsg->data); - - /* Latitude/LongitudeInformation */ - if (((pstPosData->status & POS_LOC_INFO_LAT) == POS_LOC_INFO_LAT) || - ((pstPosData->status & POS_LOC_INFO_LON) == POS_LOC_INFO_LON)) { - memset(&stLonLat, 0x00, sizeof(stLonLat)); - stLonLat.getMethod = SENSOR_GET_METHOD_NAVI; - stLonLat.SyncCnt = VehicleSensGetSensorCnt(); - stLonLat.isEnable = SENSORLOCATION_STATUS_ENABLE; - stLonLat.posSts = pstPosData->posSts; - stLonLat.posAcc = pstPosData->posAcc; - stLonLat.Longitude = pstPosData->longitude; - stLonLat.Latitude = pstPosData->latitude; - uc_chg_type = VehicleSensSetLocationLonLatN((const SENSORLOCATION_LONLATINFO_DAT *)&stLonLat); - (*p_data_master_set_n)(VEHICLE_DID_LOCATION_LONLAT_NAVI, uc_chg_type, VEHICLESENS_GETMETHOD_NAVI); - } - - /* Altitude information */ - if ((pstPosData->status & POS_LOC_INFO_ALT) == POS_LOC_INFO_ALT) { - memset(&stAltitude, 0x00, sizeof(stAltitude)); - stAltitude.getMethod = SENSOR_GET_METHOD_NAVI; - stAltitude.SyncCnt = VehicleSensGetSensorCnt(); - stAltitude.isEnable = SENSORLOCATION_STATUS_ENABLE; - stAltitude.Altitude = pstPosData->altitude; - uc_chg_type = VehicleSensSetLocationAltitudeN((const SENSORLOCATION_ALTITUDEINFO_DAT *)&stAltitude); - (*p_data_master_set_n)(VEHICLE_DID_LOCATION_ALTITUDE_NAVI, uc_chg_type, VEHICLESENS_GETMETHOD_NAVI); - } - - /* Bearing information */ - if ((pstPosData->status & POS_LOC_INFO_HEAD) == POS_LOC_INFO_HEAD) { - memset(&stHeading, 0x00, sizeof(stHeading)); - stHeading.getMethod = SENSOR_GET_METHOD_NAVI; - stHeading.SyncCnt = VehicleSensGetSensorCnt(); - stHeading.isEnable = SENSORMOTION_STATUS_ENABLE; - stHeading.posSts = pstPosData->posSts; - stHeading.Heading = pstPosData->heading; - uc_chg_type = VehicleSensSetMotionHeadingN((const SENSORMOTION_HEADINGINFO_DAT *)&stHeading); - (*p_data_master_set_n)(VEHICLE_DID_MOTION_HEADING_NAVI, uc_chg_type, VEHICLESENS_GETMETHOD_NAVI); - } - - ( *p_data_master_set_n )( POSHAL_DID_GPS_CUSTOMDATA_NAVI, VEHICLESENS_NEQ, VEHICLESENS_GETMETHOD_NAVI ); - - break; - } - case VEHICLE_DID_MOTION_SPEED_NAVI: - { - pucSpeed = (const u_int16 *) & (pstMsg->data); - - /* Vehicle speed information */ - memset(&stSpeed, 0x00, sizeof(stSpeed)); - stSpeed.getMethod = SENSOR_GET_METHOD_NAVI; - stSpeed.SyncCnt = VehicleSensGetSensorCnt(); - stSpeed.isEnable = SENSORMOTION_STATUS_ENABLE; - stSpeed.Speed = *pucSpeed; - uc_chg_type = VehicleSensSetMotionSpeedN((const SENSORMOTION_SPEEDINFO_DAT *)&stSpeed); - (*p_data_master_set_n)(VEHICLE_DID_MOTION_SPEED_NAVI, uc_chg_type, VEHICLESENS_GETMETHOD_NAVI); - break; - } - case POSHAL_DID_GPS_TIME: - { - pstGpsTime = (const SENSOR_MSG_GPSTIME*)(pstMsg->data); - uc_chg_type = VehicleSensSetGpsTimeG((const SENSOR_MSG_GPSTIME *)pstGpsTime); - (*p_data_master_set_n)(POSHAL_DID_GPS_TIME, uc_chg_type, VEHICLESENS_GETMETHOD_GPS); - - /* Set GPS time to CLOCK */ - eStatus = ClockIfDtimeSetGpsTime(pstGpsTime, &bIsAvailable); - if ((bIsAvailable == TRUE) && (eStatus != eFrameworkunifiedStatusOK)) { - ucResult = SENSLOG_RES_FAIL; - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, - "ClockIfDtimeSetGpsTime ERROR!! [ret=%d, y=%d, m=%d, d=%d, h=%d, n=%d, s=%d, sts=%d]", - eStatus, pstGpsTime->utc.year, pstGpsTime->utc.month, pstGpsTime->utc.date, - pstGpsTime->utc.hour, pstGpsTime->utc.minute, pstGpsTime->utc.second, pstGpsTime->tdsts); - } - us_pno = _pb_CnvName2Pno(SENSLOG_PNAME_CLOCK); - SensLogWriteOutputData(SENSLOG_DATA_O_TIME_CS, 0, us_pno, - (uint8_t *)(pstGpsTime), // NOLINT(readability/casting) - sizeof(SENSOR_MSG_GPSTIME), ucResult); - break; - } - case VEHICLE_DID_SETTINGTIME: - { - /* GPS time information */ - uc_chg_type = VehicleSensSetSettingTimeclock((const POS_DATETIME *) & (pstMsg->data)); - (*p_data_master_set_n)(VEHICLE_DID_SETTINGTIME, uc_chg_type, VEHICLESENS_GETMETHOD_OTHER); - break; - } - - case VEHICLE_DID_LOCATIONINFO_NMEA_NAVI: - { - uc_chg_type = VehicleSens_SetLocationInfoNmea_n((const POS_LOCATIONINFO_NMEA*)&(pstMsg->data)); - (*p_data_master_set_n)(VEHICLE_DID_LOCATIONINFO_NMEA_NAVI, uc_chg_type, VEHICLESENS_GETMETHOD_NAVI ); - break; - } - - default: - break; - } - return; -} - -/******************************************************************************* -* MODULE : VehicleSensSetDataMasterGyroTrouble -* ABSTRACT : Vehicle Sensor Data Master Gyro Failure Status Setting Process -* FUNCTION : Set a gyro fault condition -* ARGUMENT : *pst_data : Gyro Failure Status Notification Data -* : p_data_master_set_n : Data Master Set Notification(Callback function) -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensSetDataMasterGyroTrouble(const LSDRV_MSG_LSDATA_DAT_GYRO_TROUBLE *pst_data, PFUNC_DMASTER_SET_N p_data_master_set_n) { // LCOV_EXCL_START 8: dead code. // NOLINT(whitespace/line_length) - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - u_int8 uc_chg_type; - - if ((pst_data != NULL) && (p_data_master_set_n != NULL)) { - if (pst_data->ul_did == VEHICLE_DID_GYRO_TROUBLE) { - uc_chg_type = VehicleSensSetGyroTrouble(pst_data); - (*p_data_master_set_n)(pst_data->ul_did, uc_chg_type, VEHICLESENS_GETMETHOD_LINE); - } else { - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "UNKNOWN DID(%x) \r\n", pst_data->ul_did); - } - } else { - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "ARGUMENT is NULL\r\n"); - } -} -// LCOV_EXCL_STOP -/******************************************************************************* -* MODULE : VehicleSensSetDataMasterSysGpsInterruptSignal -* ABSTRACT : Vehicle Sensor Data Master SYS GPS Interrupt Signal Setting -* FUNCTION : Setting SYS GPS Interrupt Signals -* ARGUMENT : *pst_data : SYS GPS interrupt notification -* : p_data_master_set_shared_memory : Data Master Set Notification(Callback function) -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensSetDataMasterSysGpsInterruptSignal(const LSDRV_MSG_LSDATA_DAT_GPS_INTERRUPT_SIGNAL *pst_data, PFUNC_DMASTER_SET_SHARED_MEMORY p_data_master_set_shared_memory) { // LCOV_EXCL_START 8: dead code. // NOLINT(whitespace/line_length) - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - u_int8 uc_chg_type; - if ((pst_data != NULL) && (p_data_master_set_shared_memory != NULL)) { - if (pst_data->ul_did == VEHICLE_DID_SYS_GPS_INTERRUPT_SIGNAL) { - uc_chg_type = VehicleSensSetSysGpsInterruptSignal(pst_data); - /* As SYS GPS interrupt signals are not registered for delivery, */ - /* Disposal quantity,To avoid risks,DeliveryProc shall not be called. */ - (*p_data_master_set_shared_memory)(pst_data->ul_did, uc_chg_type); - } else { - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "UNKNOWN DID(%x) \r\n", pst_data->ul_did); - } - } else { - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "ARGUMENT is NULL\r\n"); - } -} -// LCOV_EXCL_STOP - -/******************************************************************************* -* MODULE : VehicleSensSetDataMasterMainGpsInterruptSignal -* ABSTRACT : Vehicle Sensor Data Master MAIN GPS Interrupt Signal Setting -* FUNCTION : Setting MAIN GPS Interrupt Signals -* ARGUMENT : *pst_data : MAIN GPS interrupt notification -* : p_data_master_set_shared_memory : Data Master Set Notification(Callback function) -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensSetDataMasterMainGpsInterruptSignal(const SENSOR_MSG_GPSDATA_DAT *pst_data, PFUNC_DMASTER_SET_SHARED_MEMORY p_data_master_set_shared_memory) { // LCOV_EXCL_START 8: dead code. // NOLINT(whitespace/line_length) - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - u_int8 uc_chg_type; - - if ((pst_data != NULL) && - (p_data_master_set_shared_memory != NULL)) { - if (pst_data->ul_did == VEHICLE_DID_MAIN_GPS_INTERRUPT_SIGNAL) { - uc_chg_type = VehicleSensSetMainGpsInterruptSignal(pst_data); - /* As MAIN GPS interrupt signals are not registered for delivery, */ - /* Disposal quantity,To avoid risks,DeliveryProc shall not be called. */ - (*p_data_master_set_shared_memory)(pst_data->ul_did, uc_chg_type); - } else { - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "UNKNOWN DID(%x) \r\n", pst_data->ul_did); - } - } else { - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "ARGUMENT is NULL\r\n"); - } -} -// LCOV_EXCL_STOP - -/******************************************************************************* -* MODULE : VehicleSensSetDataMasterGyroConnectStatus -* ABSTRACT : Vehicle Sensor Data Master Gyro Connection Status Setting Processing -* FUNCTION : Set the state of the gyro connection -* ARGUMENT : *pst_data : Gyro Connect Status Notification Data -* : p_data_master_set_n : Data Master Set Notification(Callback function) -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensSetDataMasterGyroConnectStatus(const LSDRV_MSG_LSDATA_DAT_GYRO_CONNECT_STATUS *pst_data, PFUNC_DMASTER_SET_SHARED_MEMORY p_data_master_set_shared_memory) { // LCOV_EXCL_START 8: dead code. // NOLINT(whitespace/line_length) - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - u_int8 uc_chg_type; - - if ((pst_data != NULL) && - (p_data_master_set_shared_memory != NULL)) { - if (pst_data->ul_did == VEHICLE_DID_GYRO_CONNECT_STATUS) { - uc_chg_type = VehicleSensSetGyroConnectStatus(pst_data); - /* As MAIN GPS interrupt signals are not registered for delivery, */ - /* Disposal quantity,To avoid risks,DeliveryProc shall not be called. */ - (*p_data_master_set_shared_memory)(pst_data->ul_did, uc_chg_type); - } else { - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "UNKNOWN DID(%x) \r\n", pst_data->ul_did); - } - } else { - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "ARGUMENT is NULL\r\n"); - } -} -// LCOV_EXCL_STOP - -/******************************************************************************* -* MODULE : VehicleSensSetDataMasterGpsAntennaStatus -* ABSTRACT : Vehicle Sensor Data Master GPS Antenna Connection Status Setting Processing -* FUNCTION : Setting the GPS Antenna Connection Status -* ARGUMENT : *pst_data : GPS antenna connection status notification data -* : p_data_master_set_n : Data Master Set Notification(Callback function) -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensSetDataMasterGpsAntennaStatus(const LSDRV_MSG_LSDATA_DAT_GPS_ANTENNA_STATUS *pst_data, PFUNC_DMASTER_SET_N p_data_master_set_n) { // LCOV_EXCL_START 8: dead code. // NOLINT(whitespace/line_length) - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - u_int8 uc_chg_type; - - if ((pst_data != NULL) && (p_data_master_set_n != NULL)) { - if (pst_data->ul_did == POSHAL_DID_GPS_ANTENNA) { - uc_chg_type = VehicleSensSetGpsAntennaStatus(pst_data); - (*p_data_master_set_n)(pst_data->ul_did, uc_chg_type, VEHICLESENS_GETMETHOD_LINE); - } else { - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "UNKNOWN DID(%x) \r\n", pst_data->ul_did); - } - } else { - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "ARGUMENT is NULL\r\n"); - } -} -// LCOV_EXCL_STOP - -/******************************************************************************* -* MODULE : VehicleSensGetDataMaster -* ABSTRACT : Vehicle Sensor Data Master Get Processing -* FUNCTION : Provide vehicle sensor data master -* ARGUMENT : ul_did : Data ID corresponding to the vehicle information -* : uc_get_method : Data collection way -* : VEHICLESENS_GETMETHOD_CAN: CAN communication -* : VEHICLESENS_GETMETHOD_LINE: LineSensor drivers -* : *pst_data : Pointer to the data master provider -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensGetDataMaster(DID ul_did, - u_int8 uc_get_method, - VEHICLESENS_DATA_MASTER *pst_data) { - /*------------------------------------------------------*/ - /* Call the data Get processing associated with the DID */ - /*------------------------------------------------------*/ - switch (ul_did) { // LCOV_EXCL_BR_LINE 6:some DID is not used - /*------------------------------------------------------*/ - /* Vehicle sensor data group */ - /*------------------------------------------------------*/ - case POSHAL_DID_SPEED_PULSE: - { - VehicleSensGetSpeedPulse(pst_data, uc_get_method); - break; - } -// case POSHAL_DID_GYRO_X: -// { -// VehicleSensGetGyroX(pst_data, uc_get_method); -// break; -// } - case POSHAL_DID_GYRO_Y: - { - VehicleSensGetGyroY(pst_data, uc_get_method); - break; - } - case POSHAL_DID_GYRO_Z: - { - VehicleSensGetGyroZ(pst_data, uc_get_method); - break; - } - case POSHAL_DID_GYRO_X: - case POSHAL_DID_GYRO_EXT: /* 3 to 14bit A/D value,0bit:REV */ - { - VehicleSensGetGyroRev(pst_data, uc_get_method); - break; - } - case POSHAL_DID_GSNS_X: - { - VehicleSensGetGsnsX(pst_data, uc_get_method); - break; - } - case POSHAL_DID_GSNS_Y: - { - VehicleSensGetGsnsY(pst_data, uc_get_method); - break; - } - case POSHAL_DID_GSNS_Z: - { - VehicleSensGetGsnsZ(pst_data, uc_get_method); - break; - } - case POSHAL_DID_REV: - { - VehicleSensGetRev(pst_data, uc_get_method); - break; - } - case POSHAL_DID_SPEED_PULSE_FLAG: - { - /* Data acquisition not selected */ - VehicleSensGetSpeedPulseFlag(pst_data); - break; - } - case POSHAL_DID_GPS_ANTENNA: - { - VehicleSensGetGpsAntenna(pst_data, uc_get_method); - break; - } - case POSHAL_DID_SNS_COUNTER: - { - VehicleSensGetSnsCounter(pst_data, uc_get_method); - break; - } - case POSHAL_DID_GPS_INTERRUPT_FLAG: - { - // LCOV_EXCL_START 8 : dead code - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - /* Data acquisition not selected */ - VehicleSensGetGpsInterruptFlag(pst_data); - break; - // LCOV_EXCL_STOP - } - case POSHAL_DID_SPEED_KMPH: - { - VehicleSensGetSpeedKmph(pst_data, uc_get_method); - break; - } - case POSHAL_DID_GYRO_TEMP: - { - VehicleSensGetGyroTemp(pst_data, uc_get_method); - break; - } - case POSHAL_DID_PULSE_TIME: - { - VehicleSensGetPulseTime(pst_data, uc_get_method); - break; - } - case VEHICLE_DID_LOCATION_LONLAT: - case VEHICLE_DID_LOCATION_LONLAT_NAVI: - { - VehicleSensGetLocationLonLat(pst_data, uc_get_method); - break; - } - case VEHICLE_DID_LOCATION_ALTITUDE: - case VEHICLE_DID_LOCATION_ALTITUDE_NAVI: - { - VehicleSensGetLocationAltitude(pst_data, uc_get_method); - break; - } - case VEHICLE_DID_MOTION_SPEED_NAVI: - case VEHICLE_DID_MOTION_SPEED_INTERNAL: - { - VehicleSensGetMotionSpeed(pst_data, uc_get_method); - break; - } - case VEHICLE_DID_MOTION_HEADING: - case VEHICLE_DID_MOTION_HEADING_NAVI: - { - VehicleSensGetMotionHeading(pst_data, uc_get_method); - break; - } - case VEHICLE_DID_SETTINGTIME: - { - VehicleSensGetSettingTime(pst_data, uc_get_method); - break; - } - - default: - break; - } -} - -#if CONFIG_SENSOR_EXT_VALID /* Initial Sensor Support */ -/******************************************************************************* -* MODULE : VehicleSensGetDataMasterExt -* ABSTRACT : Vehicle Sensor Data Master Get Processing(Initial delivery) -* FUNCTION : Provide vehicle sensor data master -* ARGUMENT : ul_did : Data ID corresponding to the vehicle information -* : uc_get_method : Data collection way -* : VEHICLESENS_GETMETHOD_CAN: CAN communication -* : VEHICLESENS_GETMETHOD_LINE: LineSensor drivers -* : VEHICLESENS_GETMETHOD_NAVI: Navi -* : VEHICLESENS_GETMETHOD_CLOCK:Clock -* : *pst_data : Pointer to the data master provider -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensGetDataMasterExt(DID ul_did, - u_int8 uc_get_method, - VEHICLESENS_DATA_MASTER_EXT *pst_data) { - /*------------------------------------------------------*/ - /* Call the data Get processing associated with the DID */ - /*------------------------------------------------------*/ - switch (ul_did) { - /*------------------------------------------------------*/ - /* Vehicle sensor data group */ - /*------------------------------------------------------*/ - case POSHAL_DID_SPEED_PULSE: - { - VehicleSensGetSpeedPulseExt(pst_data, uc_get_method); - break; - } - case POSHAL_DID_GSNS_X: - { - VehicleSensGetGsnsXExt(pst_data, uc_get_method); - break; - } - case POSHAL_DID_GSNS_Y: - { - VehicleSensGetGsnsYExt(pst_data, uc_get_method); - break; - } - case POSHAL_DID_GSNS_Z: - { - VehicleSensGetGsnsZExt(pst_data, uc_get_method); - break; - } - case POSHAL_DID_SNS_COUNTER: - { - VehicleSensGetSnsCounterExt(pst_data, uc_get_method); - break; - } - case POSHAL_DID_GYRO_X: - case POSHAL_DID_GYRO_EXT: /* 3 to 14bit A/D value,0bit:REV */ - { - VehicleSensGetGyroExt(pst_data, uc_get_method); - break; - } - case POSHAL_DID_GYRO_Y: - { - VehicleSensGetGyroYExt(pst_data, uc_get_method); - break; - } - case POSHAL_DID_GYRO_Z: - { - VehicleSensGetGyroZExt(pst_data, uc_get_method); - break; - } - case POSHAL_DID_REV: - { - VehicleSensGetRevExt(pst_data, uc_get_method); - break; - } - case POSHAL_DID_GYRO_TEMP: - { - VehicleSensGetGyroTempExt(pst_data, uc_get_method); - break; - } - case POSHAL_DID_PULSE_TIME: - { - VehicleSensGetPulseTimeExt(pst_data, uc_get_method); - break; - } - default: /* Ignore->MISRA-C++:2008 Rule 6-3-1, 6-4-1 */ - break; - } -} - -/******************************************************************************* -* MODULE : VehicleSensGetDataMasterFst -* ABSTRACT : Vehicle Sensor Data Master Get Processing(Initial transmission data) -* FUNCTION : Provide vehicle sensor data master -* ARGUMENT : ul_did : Data ID corresponding to the vehicle information -* : uc_get_method : Data collection way -* : VEHICLESENS_GETMETHOD_CAN: CAN communication -* : VEHICLESENS_GETMETHOD_LINE: LineSensor drivers -* : *pst_data : Pointer to the data master provider -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensGetDataMasterFst(DID ul_did, - u_int8 uc_get_method, - VEHICLESENS_DATA_MASTER_FST *pst_data) { - /*------------------------------------------------------*/ - /* Call the data Get processing associated with the DID */ - /*------------------------------------------------------*/ - switch (ul_did) { - /*------------------------------------------------------*/ - /* Vehicle sensor data group */ - /*------------------------------------------------------*/ - case POSHAL_DID_GYRO_X_FST: /* 3 to 14bit A/D value,0bit:REV */ - { - VehicleSensGetGyroXFst(pst_data, uc_get_method); - break; - } - case POSHAL_DID_GYRO_Y_FST: /* 3 to 14bit A/D value,0bit:REV */ - { - VehicleSensGetGyroYFst(pst_data, uc_get_method); - break; - } - case POSHAL_DID_GYRO_Z_FST: /* 3 to 14bit A/D value,0bit:REV */ - { - VehicleSensGetGyroZFst(pst_data, uc_get_method); - break; - } - case POSHAL_DID_SPEED_PULSE_FST: - { - VehicleSensGetSpeedPulseFst(pst_data, uc_get_method); - break; - } - case POSHAL_DID_SPEED_PULSE_FLAG_FST: - { - VehicleSensGetSpeedPulseFlagFst(pst_data, uc_get_method); - break; - } - case POSHAL_DID_REV_FST: - { - VehicleSensGetRevFst(pst_data, uc_get_method); - break; - } - case POSHAL_DID_GYRO_TEMP_FST: - { - VehicleSensGetGyroTempFst(pst_data, uc_get_method); - break; - } - case POSHAL_DID_GSNS_X_FST: - { - VehicleSensGetGsnsXFst(pst_data, uc_get_method); - break; - } - case POSHAL_DID_GSNS_Y_FST: - { - VehicleSensGetGsnsYFst(pst_data, uc_get_method); - break; - } - case POSHAL_DID_GSNS_Z_FST: - { - VehicleSensGetGsnsZFst(pst_data, uc_get_method); - break; - } - default: - break; - } -} -#endif - -/******************************************************************************* -* MODULE : VehicleSensGetGpsDataMaster -* ABSTRACT : Vehicle Sensor Data Master GPS Data Get Processing -* FUNCTION : Provide vehicle sensor data master GPS data -* ARGUMENT : ul_did : Data ID corresponding to the vehicle information -* : uc_get_method : Data collection way -* : VEHICLESENS_GETMETHOD_GPS: GPS -* : *pst_data : Pointer to the data master provider -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensGetGpsDataMaster(DID ul_did, - u_int8 uc_get_method, - SENSOR_MSG_GPSDATA_DAT *pst_data) { - /*------------------------------------------------------*/ - /* Call the data Get processing associated with the DID */ - /*------------------------------------------------------*/ - switch (ul_did) { // LCOV_EXCL_BR_LINE 6:some DID is not used - /*------------------------------------------------------*/ - /* GPS data group */ - /*------------------------------------------------------*/ - - case VEHICLE_DID_GPS_UBLOX_NAV_VELNED: - { - // LCOV_EXCL_START 8 : dead code - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - VehicleSensGetNavVelnedG(pst_data); - break; - // LCOV_EXCL_STOP - } - case VEHICLE_DID_GPS_UBLOX_NAV_TIMEUTC: - { - // LCOV_EXCL_START 8 : dead code - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - VehicleSensGetNavTimeUtcG(pst_data); - break; - // LCOV_EXCL_STOP - } - case VEHICLE_DID_GPS_UBLOX_NAV_TIMEGPS: - { - // LCOV_EXCL_START 8 : dead code - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - VehicleSensGetNavTimeGpsG(pst_data); - break; - // LCOV_EXCL_STOP - } - case VEHICLE_DID_GPS_UBLOX_NAV_SVINFO: - { - // LCOV_EXCL_START 8 : dead code - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - VehicleSensGetNavSvInfoG(pst_data); - break; - // LCOV_EXCL_STOP - } - case VEHICLE_DID_GPS_UBLOX_NAV_STATUS: - { - // LCOV_EXCL_START 8 : dead code - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - VehicleSensGetNavStatusG(pst_data); - break; - // LCOV_EXCL_STOP - } - case VEHICLE_DID_GPS_UBLOX_NAV_POSLLH: - { - // LCOV_EXCL_START 8 : dead code - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - VehicleSensGetNavPosllhG(pst_data); - break; - // LCOV_EXCL_STOP - } - case VEHICLE_DID_GPS_UBLOX_NAV_CLOCK: - { - // LCOV_EXCL_START 8 : dead code - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - VehicleSensGetNavClockG(pst_data); - break; - // LCOV_EXCL_STOP - } - case VEHICLE_DID_GPS_UBLOX_NAV_DOP: - { - // LCOV_EXCL_START 8 : dead code - AGL_ASSERT_NOT_TESTED(); - VehicleSensGetNavDopG(pst_data); - break; - // LCOV_EXCL_STOP - } - case VEHICLE_DID_GPS_UBLOX_MON_HW: - { - // LCOV_EXCL_START 8 : dead code - AGL_ASSERT_NOT_TESTED(); - VehicleSensGetMonHwG(pst_data); - break; - // LCOV_EXCL_STOP - } - case VEHICLE_DID_GPS_COUNTER: - { - // LCOV_EXCL_START 8 : dead code - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - VehicleSensGetGpsCounterg(pst_data); - break; - // LCOV_EXCL_STOP - } - case VEHICLE_DID_GPS__CWORD82__NMEA: - { - VehicleSensGetGps_CWORD82_NmeaG(pst_data); - break; - } - case POSHAL_DID_GPS__CWORD82__FULLBINARY: - { - VehicleSensGetGps_CWORD82_FullBinaryG(pst_data); - break; - } - case POSHAL_DID_GPS__CWORD82___CWORD44_GP4: - { - VehicleSensGetGps_CWORD82__CWORD44_Gp4G(pst_data); - break; - } - case VEHICLE_DID_NAVIINFO_DIAG_GPS: - { - VehicleSensGetNaviinfoDiagGPSg(pst_data); - break; - } - case POSHAL_DID_GPS_TIME: - { - VehicleSensGetGpsTimeG(pst_data); - break; - } - case POSHAL_DID_GPS_TIME_RAW: - { - VehicleSensGetGpsTimeRawG(pst_data); - break; - } - case POSHAL_DID_GPS_NMEA: - { - VehicleSensGetGpsNmeaG(pst_data); - break; - } - case POSHAL_DID_GPS_WKNROLLOVER: - { - VehicleSensGetWknRolloverG(pst_data); - break; - } - case POSHAL_DID_GPS_CLOCK_DRIFT: - { - VehicleSensGetGpsClockDriftG(pst_data); - break; - } - case POSHAL_DID_GPS_CLOCK_FREQ: - { - VehicleSensGetGpsClockFreqG(pst_data); - break; - } - default: - break; - } -} - -/******************************************************************************* -* MODULE : VehicleSensGetDataMasterGyroTrouble -* ABSTRACT : Vehicle Sensor Data Master Gyro Failure Status Get Processing -* FUNCTION : Provide a gyro fault condition -* ARGUMENT : ul_did : Data ID -* : uc_get_method : Data collection way(Not used) -* : VEHICLESENS_GETMETHOD_CAN : CAN communication -* : VEHICLESENS_GETMETHOD_LINE : LineSensor drivers -* : VEHICLESENS_GETMETHOD_GPS : GPS -* : *pst_data : Pointer to the data master provider -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensGetDataMasterGyroTrouble(DID ul_did, u_int8 uc_get_method, VEHICLESENS_DATA_MASTER_GYRO_TROUBLE *pst_data) { // LCOV_EXCL_START 8: dead code. // NOLINT(whitespace/line_length) - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - if (pst_data != NULL) { - if (ul_did == VEHICLE_DID_GYRO_TROUBLE) { - VehicleSensGetGyroTrouble(pst_data); - } else { - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "UNKNOWN DID(%x) \r\n", ul_did); - } - } else { - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "pst_data == NULL\r\n"); - } -} - -/******************************************************************************* -* MODULE : VehicleSensGetDataMasterSysGpsInterruptSignal -* ABSTRACT : Vehicle Sensor Data Master SYS GPS Interrupt Signal Get Processing -* FUNCTION : Provide SYS GPS interrupt signals -* ARGUMENT : ul_did : Data ID -* : uc_get_method : Data collection way(Not used) -* : VEHICLESENS_GETMETHOD_CAN : CAN communication -* : VEHICLESENS_GETMETHOD_LINE : LineSensor drivers -* : VEHICLESENS_GETMETHOD_GPS : GPS -* : *pst_data : Pointer to the data master provider -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensGetDataMasterSysGpsInterruptSignal(DID ul_did, - u_int8 uc_get_method, - VEHICLESENS_DATA_MASTER_GPS_INTERRUPT_SIGNAL *pst_data) { - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - if (pst_data != NULL) { - if (ul_did == VEHICLE_DID_SYS_GPS_INTERRUPT_SIGNAL) { - VehicleSensGetSysGpsInterruptSignal(pst_data); - } else { - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "UNKNOWN DID(%x) \r\n", ul_did); - } - } else { - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "pst_data == NULL\r\n"); - } -} - -/******************************************************************************* -* MODULE : VehicleSensGetDataMasterMainGpsInterruptSignal -* ABSTRACT : Vehicle Sensor Data Master MAIN GPS Interrupt Signal Get Processing -* FUNCTION : Provide MAIN GPS interrupt signals -* ARGUMENT : ul_did : Data ID -* : uc_get_method : Data collection way(Not used) -* : VEHICLESENS_GETMETHOD_CAN : CAN communication -* : VEHICLESENS_GETMETHOD_LINE : LineSensor drivers -* : VEHICLESENS_GETMETHOD_GPS : GPS -* : *pst_data : Pointer to the data master provider -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensGetDataMasterMainGpsInterruptSignal(DID ul_did, - u_int8 uc_get_method, - VEHICLESENS_DATA_MASTER_GPS_INTERRUPT_SIGNAL *pst_data) { - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - if (pst_data != NULL) { - if (ul_did == VEHICLE_DID_MAIN_GPS_INTERRUPT_SIGNAL) { - VehicleSensGetMainGpsInterruptSignal(pst_data); - } else { - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "UNKNOWN DID(%x) \r\n", ul_did); - } - } else { - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "pst_data == NULL\r\n"); - } -} - -/******************************************************************************* -* MODULE : VehicleSensGetDataMasterGyroConnectStatus -* ABSTRACT : Vehicle Sensor Data Master Gyro Connection Status Get Processing -* FUNCTION : Provide the status of the gyro connection -* ARGUMENT : ul_did : Data ID -* : uc_get_method : Data collection way(Not used) -* : VEHICLESENS_GETMETHOD_CAN : CAN communication -* : VEHICLESENS_GETMETHOD_LINE : LineSensor drivers -* : VEHICLESENS_GETMETHOD_GPS : GPS -* : *pst_data : Pointer to the data master provider -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensGetDataMasterGyroConnectStatus(DID ul_did, - u_int8 uc_get_method, - VEHICLESENS_DATA_MASTER_GYRO_CONNECT_STATUS *pst_data) { - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - if (pst_data != NULL) { - if (ul_did == VEHICLE_DID_GYRO_CONNECT_STATUS) { - VehicleSensGetGyroConnectStatus(pst_data); - } else { - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "UNKNOWN DID(%x)\r\n", ul_did); - } - } else { - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "pst_data == NULL\r\n"); - } -} - -/******************************************************************************* -* MODULE : VehicleSensGetDataMasterGpsAntennaStatus -* ABSTRACT : Vehicle Sensor Data Master GPS Antenna Connection Status Get Processing -* FUNCTION : Provide GPS antenna connection status -* ARGUMENT : ul_did : Data ID -* : uc_get_method : Data collection way(Not used) -* : VEHICLESENS_GETMETHOD_CAN : CAN communication -* : VEHICLESENS_GETMETHOD_LINE : LineSensor drivers -* : VEHICLESENS_GETMETHOD_GPS : GPS -* : *pst_data : Pointer to the data master provider -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensGetDataMasterGpsAntennaStatus(DID ul_did, - u_int8 uc_get_method, - VEHICLESENS_DATA_MASTER_GPS_ANTENNA_STATUS *pst_data) { - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - if (pst_data != NULL) { - if (ul_did == POSHAL_DID_GPS_ANTENNA) { - VehicleSensGetGpsAntennaStatus(pst_data); - } else { - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "UNKNOWN DID(%x) \r\n", ul_did); - } - } else { - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "pst_data == NULL\r\n"); - } -} -// LCOV_EXCL_STOP - -/** - * @brief - * Sensor counter acquisition - * - * @return Sensor Counter - * - */ -static uint8_t VehicleSensGetSensorCnt(void) { - VEHICLESENS_DATA_MASTER st_data; - uint8_t sensCnt; - - /* Synchronous counter acquisition */ - VehicleSensGetSnsCounterl(&st_data); - - sensCnt = st_data.uc_data[0]; - - return sensCnt; -} diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_DeliveryCtrl.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_DeliveryCtrl.cpp deleted file mode 100755 index 15aabff..0000000 --- a/vehicleservice/positioning/server/src/Sensor/VehicleSens_DeliveryCtrl.cpp +++ /dev/null @@ -1,2243 +0,0 @@ -/* - * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/******************************************************************************* - * File name :VehicleSens_DeliveryCtrl.cpp - * System name :GPF - * Subsystem name :Vehicle sensor process - * Program name :Vehicle Sensor Destination Management - * Module configuration VehicleSensInitDeliveryCtrlTbl() Vehicle sensor delivery destination management table initialization function - * VehicleSensInitDeliveryCtrlTblMng() Vehicle sensor delivery destination management table management area initialization function - * VehicleSensInitPkgDeliveryTblMng() Vehicle Sensor Package Delivery Management Table Initialization Function - * VehicleSensEntryDeliveryCtrl() Vehicle sensor delivery destination management registration function - * VehicleSensAddDeliveryCtrlTbl() Vehicle sensor delivery destination management table addition function - * VehicleSensUpdateDeliveryCtrlTbl() Vehicle sensor delivery destination management table update function - * VehicleSensUpdatePkgDeliveryCtrlTbl() Vehicle Sensor Delivery Destination Management Table Package Delivery Data Update Function - * VehicleSensAddDeliveryCtrlTblMng() Vehicle sensor delivery destination management table management addition function - * VehicleSensUpdateDeliveryCtrlTblMng() Vehicle sensor delivery destination management table management update function - * VehicleSensAddPkgDeliveryTblMng() Vehicle Sensor Package Delivery Management Table Additional Function - * VehicleSensEntryPkgDeliveryCtrl() Vehicle sensor package delivery management registration function - * VehicleSensMakeDeliveryPnoTbl() Vehicle Sensor Destination PNO Table Creation Function - * VehicleSensAddPnoTbl() Vehicle Sensor Destination PNO Table Addition Function - * VehicleSensDeliveryProc() Vehicle Sensor Data Delivery Process - * VehicleSensFirstDelivery() Vehicle Sensor Initial Data Delivery Process - * VehicleSensFirstPkgDelivery() Vehicle Sensor Initial Package Data Delivery Process - ******************************************************************************/ - -#include <vehicle_service/positioning_base_library.h> -#include <vehicle_service/POS_common_API.h> -#include <vehicle_service/POS_gps_API.h> -#include "VehicleSens_DeliveryCtrl.h" -#include "Dead_Reckoning_Local_Api.h" -#include "SensorLog.h" -#include "POS_private.h" - -#define VEHICLE_SENS_DELIVERY_CTRL_DEBUG 0 -#define VEHICLE_SENS_DELIVERY_CTRL_DEBUG_DIAG 0 - -#define GYRO_NORMAL (0U) -#define GYRO_ERROR (1U) -#define GYRO_UNFIXED (2U) - -#define _pb_strcat(pdest, psrc, size) (strncat(pdest, psrc, size) , (0)) - -/*************************************************/ -/* Global variable */ -/*************************************************/ -static VEHICLESENS_DELIVERY_CTRL_TBL g_stdelivery_ctrl_tbl; -static VEHICLESENS_DELIVERY_CTRL_TBL_MNG g_stdelivery_ctrl_tbl_mng; -static VEHICLESENS_PKG_DELIVERY_TBL_MNG g_stpkgdelivery_tbl_mng; -static VEHICLESENS_DELIVERY_PNO_TBL g_stdelivery_pno_tbl; - -/* ++ PastModel002 response DR */ -static VEHICLESENS_DELIVERY_CTRL_TBL g_stdelivery_ctrl_tbl_dr; -static VEHICLESENS_DELIVERY_CTRL_TBL_MNG g_stdelivery_ctrl_tbl_mng_dr; -static VEHICLESENS_DELIVERY_PNO_TBL g_stdelivery_pno_tbl_dr; - -/* -- PastModel002 response DR */ - -#if CONFIG_HW_PORTSET_TYPE_C -u_int16 gusSeqNum; /* Sequence number for split transmission */ -#endif - -/******************************************************************************* -* MODULE : VehicleSensInitDeliveryCtrlTbl -* ABSTRACT : Vehicle sensor delivery destination management table initialization function -* FUNCTION : Delivery destination management table initialization processing -* ARGUMENT : void -* NOTE : -******************************************************************************/ -void VehicleSensInitDeliveryCtrlTbl(void) { - memset(&g_stdelivery_ctrl_tbl, 0x00, sizeof(VEHICLESENS_DELIVERY_CTRL_TBL)); -} - -/******************************************************************************* -* MODULE : VehicleSensInitDeliveryCtrlTblMng -* ABSTRACT : Vehicle Sensor DR Internal Delivery Destination Management Table Management Area Initialization Function -* FUNCTION : Delivery destination management table management area initialization processing -* ARGUMENT : void -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensInitDeliveryCtrlTblMng(void) { - memset(&g_stdelivery_ctrl_tbl_mng, 0x00, sizeof(VEHICLESENS_DELIVERY_CTRL_TBL_MNG)); -} - -/* ++ PastModel002 response DR */ -/******************************************************************************* -* MODULE : VehicleSensInitDeliveryCtrlTblDR -* ABSTRACT : Vehicle sensor delivery destination management table initialization function -* FUNCTION : DR distribution target management table initialization processing -* ARGUMENT : void -* NOTE : -******************************************************************************/ -void VehicleSensInitDeliveryCtrlTblDR(void) { // LCOV_EXCL_START 8: dead code. - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - memset(&g_stdelivery_ctrl_tbl_dr, 0x00, sizeof(VEHICLESENS_DELIVERY_CTRL_TBL)); -} -// LCOV_EXCL_STOP - -/******************************************************************************* -* MODULE : VehicleSensInitDeliveryCtrlTblMngDR -* ABSTRACT : Vehicle sensor delivery destination management table management area initialization function -* FUNCTION : Initialization processing for the management table area of the delivery destination management table for DR -* ARGUMENT : void -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensInitDeliveryCtrlTblMngDR(void) { // LCOV_EXCL_START 8 : dead code - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - memset(&g_stdelivery_ctrl_tbl_mng_dr, 0x00, sizeof(VEHICLESENS_DELIVERY_CTRL_TBL_MNG)); -} -// LCOV_EXCL_STOP - -/* -- PastModel002 response DR */ - -/******************************************************************************* -* MODULE : VehicleSensInitPkgDeliveryTblMng -* ABSTRACT : Vehicle Sensor Package Delivery Management Table Initialization Function -* FUNCTION : Delivery Package Management Table Initialization Processing -* ARGUMENT : void -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensInitPkgDeliveryTblMng(void) { - memset(&g_stpkgdelivery_tbl_mng, 0x00, sizeof(VEHICLESENS_PKG_DELIVERY_TBL_MNG)); -} - -#if CONFIG_HW_PORTSET_TYPE_C -/******************************************************************************* -* MODULE : VehicleSensInitSeqNum -* ABSTRACT : Sequence number initialization function for split transmission -* FUNCTION : Sequence number initialization processing for split transmission -* ARGUMENT : void -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensInitSeqNum(void) { - gusSeqNum = 0; -} -#endif - -/******************************************************************************* -* MODULE : VehicleSensEntryDeliveryCtrl -* ABSTRACT : Vehicle sensor delivery destination management registration function -* FUNCTION : Shipping management table,Update the shipping management table management. -* ARGUMENT : pst_delivery_entry : Pointer to the delivery registration information -* NOTE : -* RETURN : VEHICLE_RET_NORMAL :Successful registration -******************************************************************************/ -VEHICLE_RET_API VehicleSensEntryDeliveryCtrl(const VEHICLE_MSG_DELIVERY_ENTRY *pst_delivery_entry) { - int32 i; - u_int8 uc_action_type = VEHICLESENS_ACTION_TYPE_ADD; - int32 uc_did_flag; - DID ulentry_did = pst_delivery_entry->data.did; - VEHICLESENS_DELIVERY_CTRL_TBL_MNG_DATA *pst_existing_mng_data = NULL; - VEHICLE_RET_API ret = VEHICLE_RET_NORMAL; /* _CWORD71_:QAC++4020:Multiple exit points found. MISRA-C++ Rule 6-6-5 */ - BOOL bexist_flag = FALSE; - - /* Check if the data ID exists. */ - uc_did_flag = VehicleSensCheckDid(ulentry_did); - if (uc_did_flag == 0) { // LCOV_EXCL_BR_LINE 6:alway be 1 - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - - ret = VEHICLE_RET_ERROR_DID; /* _CWORD71_:QAC++4020:Multiple exit points found. MISRA-C++ Rule 6-6-5 */ // LCOV_EXCL_LINE 8: dead code // NOLINT(whitespace/line_length) - } - - /* Check the number of registered shipments. */ - if ((ret == VEHICLE_RET_NORMAL) && /* _CWORD71_:QAC++4020:Multiple exit points found. MISRA-C++ Rule 6-6-5 */ - (g_stdelivery_ctrl_tbl.us_dnum >= VEHICLESENS_DELIVERY_INFO_MAX)) { - /* Return the FULL of delivery registrations*/ - ret = VEHICLE_RET_ERROR_BUFFULL; /* _CWORD71_:QAC++4020:Multiple exit points found. MISRA-C++ Rule 6-6-5 */ - } - - if (ret == VEHICLE_RET_NORMAL) { /* _CWORD71_:QAC++4020:Multiple exit points found. MISRA-C++ Rule 6-6-5 */ - /* Duplicate delivery registration check*/ - for (i = 0; i < g_stdelivery_ctrl_tbl.us_dnum; i++) { - if ((g_stdelivery_ctrl_tbl.st_ctrl_data[i].ul_did == ulentry_did) && - (g_stdelivery_ctrl_tbl.st_ctrl_data[i].us_pno == pst_delivery_entry->data.pno) && - (g_stdelivery_ctrl_tbl.st_ctrl_data[i].uc_method == VEHICLESENS_DELIVERY_METHOD_NORMAL)) { - /* When the same shipping address (PNO) and shipping DID are already registered,Update registration information and exit */ - g_stdelivery_ctrl_tbl.st_ctrl_data[i].uc_chg_type = pst_delivery_entry->data.delivery_timing; - bexist_flag = TRUE; - break; - } - } - - if (bexist_flag == TRUE) { - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, - "Duplicate DID=0x%x PNO=0x%x ChgType=%d", - ulentry_did, - pst_delivery_entry->data.pno, - pst_delivery_entry->data.delivery_timing); - } else { - /* By searching for the delivery registration of the relevant DID,Hold the address. */ - for (i = 0; i < g_stdelivery_ctrl_tbl_mng.us_dnum; i++) { - if (g_stdelivery_ctrl_tbl_mng.st_ctrl_tbl_mng_data[i].ul_did == ulentry_did) { - uc_action_type = VEHICLESENS_ACTION_TYPE_UPDATE; - pst_existing_mng_data = &g_stdelivery_ctrl_tbl_mng.st_ctrl_tbl_mng_data[i]; - } - } - /* Add to the shipping management table.*/ - VehicleSensAddDeliveryCtrlTbl(pst_delivery_entry); - - /* Processing when updating existing data*/ - if (uc_action_type == VEHICLESENS_ACTION_TYPE_UPDATE) { - /* Update the shipping management table.*/ - VehicleSensUpdateDeliveryCtrlTbl(pst_existing_mng_data); - - /* Update the shipping destination management table management information.*/ - VehicleSensUpdateDeliveryCtrlTblMng(pst_existing_mng_data); - } else { /* Newly added processing*/ - /* Add to the shipping management table management information.*/ - VehicleSensAddDeliveryCtrlTblMng(pst_delivery_entry); - } - } - } - return ret; /* _CWORD71_:QAC++4020:Multiple exit points found. MISRA-C++ Rule 6-6-5 */ -} - -/******************************************************************************* -* MODULE : VehicleSensAddDeliveryCtrlTbl -* ABSTRACT : Vehicle sensor delivery destination management table addition function -* FUNCTION : Add to the shipping management table. -* ARGUMENT : *pst_delivery_entry : Pointer to the delivery registration information -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensAddDeliveryCtrlTbl(const VEHICLE_MSG_DELIVERY_ENTRY *pst_delivery_entry) { - VEHICLESENS_DELIVERY_CTRL_TBL_DATA *pst_ctrl_data; - - pst_ctrl_data = &g_stdelivery_ctrl_tbl.st_ctrl_data[g_stdelivery_ctrl_tbl.us_dnum]; - pst_ctrl_data->ul_did = pst_delivery_entry->data.did; - pst_ctrl_data->us_pno = pst_delivery_entry->data.pno; - pst_ctrl_data->uc_chg_type = pst_delivery_entry->data.delivery_timing; - pst_ctrl_data->uc_ctrl_flg = pst_delivery_entry->data.ctrl_flg; - pst_ctrl_data->us_link_idx = VEHICLESENS_LINK_INDEX_END; - pst_ctrl_data->us_pkg_start_idx = VEHICLESENS_LINK_INDEX_END; - pst_ctrl_data->us_pkg_end_idx = VEHICLESENS_LINK_INDEX_END; - pst_ctrl_data->uc_method = VEHICLESENS_DELIVERY_METHOD_NORMAL; - g_stdelivery_ctrl_tbl.us_dnum = static_cast<u_int16>(g_stdelivery_ctrl_tbl.us_dnum + 1); -} - -/******************************************************************************* -* MODULE : VehicleSensUpdateDeliveryCtrlTbl -* ABSTRACT : Vehicle sensor delivery destination management table update function -* FUNCTION : Update the shipping management table. -* ARGUMENT : *pstExistingMngData : Pointer to the previous data information with the same data ID -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensUpdateDeliveryCtrlTbl(VEHICLESENS_DELIVERY_CTRL_TBL_MNG_DATA *pst_existing_mng_data) { - /* Ignore->MISRA-C++:2008 Rule 7-1-2 */ - /* Update Link Index Only. - For indexes of usEndIdx values matching the data IDs in the target management table - Making usLinkIdx an Index-Registered Index */ - /* Ignore->MISRA-C++:2008 Rule 5-0-5 */ - g_stdelivery_ctrl_tbl.st_ctrl_data[pst_existing_mng_data->us_end_idx].us_link_idx = - static_cast<u_int16>(g_stdelivery_ctrl_tbl.us_dnum - 1); /* Ignore->MISRA-C++:2008 Rule 5-0-5 */ -} - -/******************************************************************************* -* MODULE : VehicleSensUpdatePkgDeliveryCtrlTbl -* ABSTRACT : Vehicle Sensor Delivery Destination Management Table Package Delivery Data Update Function -* FUNCTION : Updating Package Delivery Data in the Destination Management Table. -* ARGUMENT : us_dnum : Number of data items in the package delivery management table -* : us_pkg_num : Number of packages to create -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensUpdatePkgDeliveryCtrlTbl(u_int16 us_dnum, u_int16 us_pkg_num) { - VEHICLESENS_DELIVERY_CTRL_TBL_DATA *pst_ctrl_data; - /* Ignore->MISRA-C++:2008 Rule 5-0-5 */ - pst_ctrl_data = &g_stdelivery_ctrl_tbl.st_ctrl_data[g_stdelivery_ctrl_tbl.us_dnum - 1]; - pst_ctrl_data->us_pkg_start_idx = us_dnum; - /* Ignore->MISRA-C++:2008 Rule 5-0-5 */ - pst_ctrl_data->us_pkg_end_idx = static_cast<u_int16>(us_dnum + us_pkg_num - 1); - pst_ctrl_data->uc_method = VEHICLESENS_DELIVERY_METHOD_PACKAGE; -} - -/******************************************************************************* -* MODULE : VehicleSensAddDeliveryCtrlTblMng -* ABSTRACT : Vehicle sensor delivery destination management table management addition function -* FUNCTION : Add to the shipping management table management. -* ARGUMENT : *pst_delivery_entry : Pointer to the delivery registration information -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensAddDeliveryCtrlTblMng(const VEHICLE_MSG_DELIVERY_ENTRY *pst_delivery_entry) { - VEHICLESENS_DELIVERY_CTRL_TBL_MNG_DATA *pst_ctrl_mng_data; - - pst_ctrl_mng_data = &g_stdelivery_ctrl_tbl_mng.st_ctrl_tbl_mng_data[g_stdelivery_ctrl_tbl_mng.us_dnum]; - pst_ctrl_mng_data->ul_did = pst_delivery_entry->data.did; - /* Ignore->MISRA-C++:2008 Rule 5-0-5 */ - pst_ctrl_mng_data->us_start_idx = static_cast<u_int16>(g_stdelivery_ctrl_tbl.us_dnum - 1); - /* Ignore->MISRA-C++:2008 Rule 5-0-5 */ - pst_ctrl_mng_data->us_end_idx = static_cast<u_int16>(g_stdelivery_ctrl_tbl.us_dnum - 1); - pst_ctrl_mng_data->usdlvry_entry_num++; - g_stdelivery_ctrl_tbl_mng.us_dnum++; -} - -/******************************************************************************* -* MODULE : VehicleSensUpdateDeliveryCtrlTblMng -* ABSTRACT : Vehicle sensor delivery destination management table management update function -* FUNCTION : Update the shipping management table management. -* ARGUMENT : *pst_existing_mng_data : Pointer to the previous data information with the same data ID -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensUpdateDeliveryCtrlTblMng(VEHICLESENS_DELIVERY_CTRL_TBL_MNG_DATA *pst_existing_mng_data) { - /* Update only the end index and the number of registered shipping destinations. */ - /* Ignore->MISRA-C++:2008 Rule 5-0-5 */ - pst_existing_mng_data->us_end_idx = static_cast<u_int16>(g_stdelivery_ctrl_tbl.us_dnum - 1); - pst_existing_mng_data->usdlvry_entry_num++; -} - -/******************************************************************************* -* MODULE : VehicleSensAddPkgDeliveryTblMng -* ABSTRACT : Vehicle Sensor Package Delivery Management Table Additional Function -* FUNCTION : Add to the shipping management table management. -* ARGUMENT : *pst_pkg : Pointer to package delivery registration information -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensAddPkgDeliveryTblMng(const SENSOR_MSG_DELIVERY_ENTRY *pst_pkg) { - int32 i; /* Generic counters */ - - /* Data ID registration */ - /* Registration of delivery data index */ - for (i = 0; i < (pst_pkg->data.pkg_num); i++) { /* Ignore->MISRA-C++:2008 Rule 5-0-5 */ - g_stpkgdelivery_tbl_mng.st_pkg_data[g_stpkgdelivery_tbl_mng.us_dnum].ul_did = pst_pkg->data.did[i]; - /* Ignore->MISRA-C++:2008 Rule 5-0-5 */ - g_stpkgdelivery_tbl_mng.st_pkg_data[g_stpkgdelivery_tbl_mng.us_dnum].usdlvry_idx = \ - static_cast<u_int16>(g_stpkgdelivery_tbl_mng.us_dnum + 1); - g_stpkgdelivery_tbl_mng.us_dnum++; - } - /* The final delivery data index overwrites the terminating code */ - g_stpkgdelivery_tbl_mng.st_pkg_data[g_stpkgdelivery_tbl_mng.us_dnum - 1].usdlvry_idx = VEHICLESENS_LINK_INDEX_END; -} - -/******************************************************************************* -* MODULE : VehicleSensEntryPkgDeliveryCtrl -* ABSTRACT : Vehicle sensor package delivery management registration function -* FUNCTION : Shipping management table,Destination management table management,Update the package delivery management table. -* ARGUMENT : *pst_pkg : Pointer to package delivery registration information -* NOTE : -* RETURN : VEHICLE_RET_NORMAL : Successful registration -******************************************************************************/ -VEHICLE_RET_API VehicleSensEntryPkgDeliveryCtrl(const SENSOR_MSG_DELIVERY_ENTRY *pst_pkg , - u_int8 uc_ext_chk) { /* Ignore->MISRA-C++:2008 Rule 6-6-5 */ - int32 i; - u_int16 us_size = 0; - u_int8 uc_action_type = VEHICLESENS_ACTION_TYPE_ADD; - VEHICLESENS_DELIVERY_CTRL_TBL_MNG_DATA *pst_existing_mng_data = NULL; - VEHICLE_MSG_DELIVERY_ENTRY st_delivery_entry; - u_int16 us_boundary_adj; /* For boundary adjustment */ - u_int16 us_next_offset; /* For size calculation */ - VEHICLE_RET_API ret = VEHICLE_RET_NORMAL; /* _CWORD71_:QAC++4020:Multiple exit points found. MISRA-C++ Rule 6-6-5 */ - BOOL bexist_flag = FALSE; - - /* Check if the data ID exists. */ - for (i = 0; i < (pst_pkg->data.pkg_num); i++) { /* Ignore->MISRA-C++:2008 Rule 5-0-5 */ - if (VEHICLESENS_INVALID == VehicleSensCheckDid(pst_pkg->data.did[i])) { // LCOV_EXCL_BR_LINE 200: always Valid - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - ret = VEHICLE_RET_ERROR_DID; // // LCOV_EXCL_LINE 8 :dead code - /* _CWORD71_:QAC++4020:Multiple exit points found. MISRA-C++ Rule 6-6-5 */ - } - } - - /* Check the number of registered shipments. */ - if ((ret == VEHICLE_RET_NORMAL) && /* _CWORD71_:QAC++4020:Multiple exit points found. MISRA-C++ Rule 6-6-5 */ - (VEHICLESENS_DELIVERY_INFO_MAX <= g_stdelivery_ctrl_tbl.us_dnum)) { /* Ignore->MISRA-C++:2008 Rule 5-0-5 */ - /* Return the FULL of delivery registrations*/ - ret = VEHICLE_RET_ERROR_BUFFULL; /* _CWORD71_:QAC++4020:Multiple exit points found. MISRA-C++ Rule 6-6-5 */ - } - - /* Check the number of registered package shipments. */ - if ((ret == VEHICLE_RET_NORMAL) && /* _CWORD71_:QAC++4020:Multiple exit points found. MISRA-C++ Rule 6-6-5 */ - (VEHICLESENS_PKG_DELIVERY_INFO_MAX < (g_stpkgdelivery_tbl_mng.us_dnum + pst_pkg->data.pkg_num))) { - /* Ignore->MISRA-C++:2008 Rule 5-0-5 */ - /* Return the FULL of delivery registrations*/ - ret = VEHICLE_RET_ERROR_BUFFULL; /* _CWORD71_:QAC++4020:Multiple exit points found. MISRA-C++ Rule 6-6-5 */ - } - - if (ret == VEHICLE_RET_NORMAL) { /* _CWORD71_:QAC++4020:Multiple exit points found. MISRA-C++ Rule 6-6-5 */ - /* Check that the size of the buffer to be delivered does not exceed the maximum size. */ - /* For boundary adjustment */ - us_boundary_adj = (u_int16)VEHICLESENS_BIT1 | (u_int16)VEHICLESENS_BIT0; - for (i = 0; i < pst_pkg->data.pkg_num; i++) { /* Ignore->MISRA-C++:2008 Rule 5-0-5 */ - - /* Ignore->MISRA-C++:2008 Rule 2-7-2 */ -#if CONFIG_SENSOR_EXT_VALID /* Initial Sensor Support */ - if (uc_ext_chk == VEHICLESENS_EXT_OFF) { /* Ignore->MISRA-C++:2008 Rule 5-0-5 */ // LCOV_EXCL_BR_LINE 200: VEHICLESENS_EXT_OFF passed in function is dead code // NOLINT(whitespace/line_length) - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - us_next_offset = VehicleSensGetDataMasterOffset(pst_pkg->data.did[i]); // LCOV_EXCL_LINE 8: dead code - } else { - us_next_offset = VehicleSensGetDataMasterExtOffset(pst_pkg->data.did[i]); - } -#else - us_next_offset = VehicleSensGetDataMasterOffset(pst_pkg->data.did[i]); -#endif - /* Ignore->MISRA-C++:2008 Rule 2-7-2 */ - /* Ignore->MISRA-C++:2008 Rule 5-0-5 Ignore->MISRA-C++:2008 Rule 5-0-13, 5-0-14, 5-3-1 */ - if ((us_next_offset & us_boundary_adj) != 0) { - /* If you need to adjust */ - /* Mask Lower Bit Ignore->MISRA-C++:2008 Rule 5-0-5 Ignore->MISRA-C++:2008 Rule 5-0-21 */ - us_next_offset = static_cast<u_int16>(us_next_offset & ~us_boundary_adj); - us_next_offset = static_cast<u_int16>(us_next_offset + (u_int16)VEHICLESENS_BIT2); /* Add numbers */ - } - us_size = static_cast<u_int16>(us_size + us_next_offset); /* Ignore->MISRA-C++:2008 Rule 5-0-5 */ - } - if (SENSOR_VSINFO_DSIZE < us_size) { /* Ignore->MISRA-C++:2008 Rule 5-0-5 */ - /* Return the FULL of delivery registrations(Exceed the size of the buffer to be delivered due to the combination of packages)*/ - ret = VEHICLE_RET_ERROR_BUFFULL; /* _CWORD71_:QAC++4020:Multiple exit points found. MISRA-C++ Rule 6-6-5 */ - } - } - - if (ret == VEHICLE_RET_NORMAL) { /* _CWORD71_:QAC++4020:Multiple exit points found. MISRA-C++ Rule 6-6-5 */ - for (i = 0; i < g_stdelivery_ctrl_tbl.us_dnum; i++) { - if ((g_stdelivery_ctrl_tbl.st_ctrl_data[i].us_pno == pst_pkg->data.pno) && - (g_stdelivery_ctrl_tbl.st_ctrl_data[i].uc_method == VEHICLESENS_DELIVERY_METHOD_PACKAGE)) { - /* When the same shipping address (PNO) is already registered,Update registration information and exit */ - g_stdelivery_ctrl_tbl.st_ctrl_data[i].uc_chg_type = pst_pkg->data.delivery_timing; - bexist_flag = TRUE; - break; - } - } - - if (bexist_flag == TRUE) { - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "Duplicate PNO=0x%x ChgType=%d", - pst_pkg->data.pno, pst_pkg->data.delivery_timing); - } else { - /* By searching for the delivery registration of the relevant DID,Hold the address. */ - for (i = 0; i < g_stdelivery_ctrl_tbl_mng.us_dnum; i++) { /* Ignore->MISRA-C++:2008 Rule 5-0-5 */ - if (g_stdelivery_ctrl_tbl_mng.st_ctrl_tbl_mng_data[i].ul_did == pst_pkg->data.did[0]) { - uc_action_type = VEHICLESENS_ACTION_TYPE_UPDATE; - pst_existing_mng_data = &g_stdelivery_ctrl_tbl_mng.st_ctrl_tbl_mng_data[i]; - } - } - /* Type conversion,And copies of the data section(Because the header is unused,Not involved) */ - memset(reinterpret_cast<void *>(&st_delivery_entry), - static_cast<int32>(0), - (size_t)sizeof(VEHICLE_MSG_DELIVERY_ENTRY)); - st_delivery_entry.data.did = pst_pkg->data.did[0]; - st_delivery_entry.data.pno = pst_pkg->data.pno; - st_delivery_entry.data.delivery_timing = pst_pkg->data.delivery_timing; - st_delivery_entry.data.ctrl_flg = pst_pkg->data.ctrl_flg; - st_delivery_entry.data.event_id = pst_pkg->data.event_id; - /* Add to the shipping management table.*/ - VehicleSensAddDeliveryCtrlTbl(&st_delivery_entry); - - /* Processing when updating existing data*/ - /* Ignore->MISRA-C++:2008 Rule 5-0-13, 5-0-14, 5-3-1 */ - if (uc_action_type == VEHICLESENS_ACTION_TYPE_UPDATE) { - /* Update the shipping management table.*/ - VehicleSensUpdateDeliveryCtrlTbl(pst_existing_mng_data); - - /* Update the shipping destination management table management information.*/ - VehicleSensUpdateDeliveryCtrlTblMng(pst_existing_mng_data); - } else { /* Newly added processing*/ - /* Add to the shipping management table management information.*/ - VehicleSensAddDeliveryCtrlTblMng(&st_delivery_entry); - } - - /* Updating Package Relationship Data in the Destination Management Table.*/ - /* Ignore->MISRA-C++:2008 Rule 5-0-5 */ - VehicleSensUpdatePkgDeliveryCtrlTbl(g_stpkgdelivery_tbl_mng.us_dnum, pst_pkg->data.pkg_num); - /* Add to the package delivery management table.*/ - VehicleSensAddPkgDeliveryTblMng(pst_pkg); - } - } - - return ret; /* _CWORD71_:QAC++4020:Multiple exit points found. MISRA-C++ Rule 6-6-5 */ -} - -/******************************************************************************* -* MODULE : VehicleSensMakeDeliveryPnoTbl -* ABSTRACT : Vehicle sensor delivery destination PNO table creation function -* FUNCTION : Create the shipping destination PNO table -* ARGUMENT : ul_did Data ID -* Change_type Delivery Trigger -* NOTE : -* RETURN : VEHICLESENS_DELIVERY_PNO_TBL* Pointer to the shipping PNO table -******************************************************************************/ -VEHICLESENS_DELIVERY_PNO_TBL* VehicleSensMakeDeliveryPnoTbl(DID ul_did, u_int8 change_type) { - int32 i; - u_int8 uc_ctrl_tbl_mng_data_list; - u_int16 us_index = 0; - u_int16 us_dnum = 0; - - /* Get the start index and count of the corresponding data ID. */ - uc_ctrl_tbl_mng_data_list = static_cast<u_int8>( - (sizeof(g_stdelivery_ctrl_tbl_mng.st_ctrl_tbl_mng_data)) / - (sizeof(g_stdelivery_ctrl_tbl_mng.st_ctrl_tbl_mng_data[0]))); - for (i = 0; i < uc_ctrl_tbl_mng_data_list; i++) { - /* Stores the information of the corresponding DID.. */ - if (g_stdelivery_ctrl_tbl_mng.st_ctrl_tbl_mng_data[i].ul_did == ul_did) { - us_index = g_stdelivery_ctrl_tbl_mng.st_ctrl_tbl_mng_data[i].us_start_idx; - us_dnum = g_stdelivery_ctrl_tbl_mng.st_ctrl_tbl_mng_data[i].usdlvry_entry_num; - break; - } - } - - /* Create a PNO list */ - g_stdelivery_pno_tbl.us_dnum = 0; - if (change_type == VEHICLESENS_CHGTYPE_CHG) { - /* Processing when delivery timing is changed*/ - for (i = 0; i < us_dnum; i++) { - /* Functionalization by Increasing Structure Members */ - VehicleSensAddPnoTbl(us_index); - us_index = g_stdelivery_ctrl_tbl.st_ctrl_data[us_index].us_link_idx; - } - } else { - /* Processing when delivery timing is update */ - for (i = 0; i < us_dnum; i++) { - if (VEHICLE_DELIVERY_TIMING_UPDATE == g_stdelivery_ctrl_tbl.st_ctrl_data[us_index].uc_chg_type) { - /* Functionalization by Increasing Structure Members */ - VehicleSensAddPnoTbl(us_index); - } - us_index = g_stdelivery_ctrl_tbl.st_ctrl_data[us_index].us_link_idx; - } - } - return(&g_stdelivery_pno_tbl); -} - -/******************************************************************************* -* MODULE : VehicleSensAddPnoTbl -* ABSTRACT : Vehicle Sensor Destination PNO Table Addition Function -* FUNCTION : Add to the shipping PNO table. -* ARGUMENT : us_index : Index of the referenced destination management table -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensAddPnoTbl(u_int16 us_index) { - u_int16 us_pno_tbl_idx; - - us_pno_tbl_idx = g_stdelivery_pno_tbl.us_dnum; - g_stdelivery_pno_tbl.st_pno_data[us_pno_tbl_idx].us_pno = \ - g_stdelivery_ctrl_tbl.st_ctrl_data[us_index].us_pno; - g_stdelivery_pno_tbl.st_pno_data[us_pno_tbl_idx].us_pkg_start_idx = \ - g_stdelivery_ctrl_tbl.st_ctrl_data[us_index].us_pkg_start_idx; - g_stdelivery_pno_tbl.st_pno_data[us_pno_tbl_idx].us_pkg_end_idx = \ - g_stdelivery_ctrl_tbl.st_ctrl_data[us_index].us_pkg_end_idx; - g_stdelivery_pno_tbl.st_pno_data[us_pno_tbl_idx].uc_method = \ - g_stdelivery_ctrl_tbl.st_ctrl_data[us_index].uc_method; - g_stdelivery_pno_tbl.us_dnum++; -} - -/******************************************************************************* -* MODULE : VehicleSensDeliveryGPS -* ABSTRACT : Vehicle Sensor Data Delivery Process -* FUNCTION : Deliver data to a destination. -* ARGUMENT : ul_did :Data ID -* uc_chg_type :Delivery timing -* uc_get_method :Acquisition method -* NOTE : -* RETURN : void -******************************************************************************/ -u_int8 VehicleSensDeliveryGPS(DID ul_did, u_int8 uc_get_method, u_int8 uc_current_get_method, int32 pno_index, - u_int32* cid, - VEHICLESENS_DATA_MASTER* stmaster, - const VEHICLESENS_DELIVERY_PNO_TBL *pst_pno_tbl) { -#if CONFIG_SENSOR_EXT_VALID /* Initial Sensor Support */ - SENSORLOCATION_MSG_LONLATINFO *plonlat_msg; - SENSORLOCATION_MSG_ALTITUDEINFO *paltitude_msg; - SENSORMOTION_MSG_HEADINGINFO *pheading_msg; -#endif - - SENSOR_MSG_GPSDATA_DAT gps_master; - VEHICLESENS_DELIVERY_FORMAT delivery_data; - u_int16 length; - u_int16 senslog_len; - RET_API ret = RET_NORMAL; /* API return value */ - u_int8 uc_result = SENSLOG_RES_SUCCESS; /* Send/Receive result */ - - VehicleSensGetGpsDataMaster(ul_did, uc_current_get_method, &gps_master); - - if (ul_did == POSHAL_DID_GPS_TIME) { - /* GPS time,Because there is no header in the message to be delivered, - Padding deliveryData headers */ - (void)memcpy(reinterpret_cast<void*>(&delivery_data), - reinterpret_cast<void*>(&gps_master.uc_data[0]), gps_master.us_size); - length = gps_master.us_size; - senslog_len = length; - *cid = CID_VEHICLESENS_VEHICLE_INFO_GPS_TIME; - } else if (ul_did == VEHICLE_DID_LOCATION_LONLAT) { - plonlat_msg = reinterpret_cast<SENSORLOCATION_MSG_LONLATINFO*>(&delivery_data); - /* Acquire the applicable data information from the data master..*/ - VehicleSensGetDataMaster(ul_did, uc_current_get_method, stmaster); - (void)memcpy(reinterpret_cast<void*>(&(plonlat_msg->data)), - reinterpret_cast<void*>(&(stmaster->uc_data[0])), stmaster->us_size); - length = (u_int16)(stmaster->us_size); - senslog_len = length; - *cid = CID_POSIF_REGISTER_LISTENER_LONLAT; - } else if (ul_did == VEHICLE_DID_LOCATION_ALTITUDE) { - paltitude_msg = reinterpret_cast<SENSORLOCATION_MSG_ALTITUDEINFO*>(&delivery_data); - /* Acquire the applicable data information from the data master..*/ - VehicleSensGetDataMaster(ul_did, uc_get_method, stmaster); - (void)memcpy(reinterpret_cast<void*>(&(paltitude_msg->data)), - reinterpret_cast<void*>(&stmaster->uc_data[0]), stmaster->us_size); - length = (u_int16)(stmaster->us_size); - senslog_len = length; - *cid = CID_POSIF_REGISTER_LISTENER_ALTITUDE; - } else if (ul_did == VEHICLE_DID_MOTION_HEADING) { - pheading_msg = reinterpret_cast<SENSORMOTION_MSG_HEADINGINFO*>(&delivery_data); - /* Acquire the applicable data information from the data master..*/ - VehicleSensGetDataMaster(ul_did, uc_get_method, stmaster); - (void)memcpy(reinterpret_cast<void*>(&(pheading_msg->data)), - reinterpret_cast<void*>(&stmaster->uc_data[0]), stmaster->us_size); - length = (u_int16)(stmaster->us_size); - senslog_len = length; - *cid = CID_POSIF_REGISTER_LISTENER_HEADING; - } else { - delivery_data.header.did = gps_master.ul_did; - delivery_data.header.size = gps_master.us_size; - delivery_data.header.rcv_flag = gps_master.uc_rcv_flag; - delivery_data.header.sensor_cnt = gps_master.uc_sns_cnt; - (void)memcpy(reinterpret_cast<void *>(&delivery_data.data[0]), - reinterpret_cast<void *>(&gps_master.uc_data[0]), - (size_t)delivery_data.header.size); - - length = static_cast<u_int16>((u_int16)sizeof(delivery_data.header) + \ - delivery_data.header.size); - senslog_len = delivery_data.header.size; - *cid = CID_VEHICLESENS_VEHICLE_INFO; - } - - /* Call Vehicle Sensor Information Notification Transmission Process.*/ - ret = VehicleSndMsg(PNO_VEHICLE_SENSOR, - pst_pno_tbl->st_pno_data[pno_index].us_pno, - static_cast<CID>(*cid), - length, - (const void *)&delivery_data); - uc_result = SENSLOG_RES_SUCCESS; - if (ret != RET_NORMAL) { - uc_result = SENSLOG_RES_FAIL; - } - if (*cid != CID_VEHICLESENS_VEHICLE_INFO) { - SensLogWriteOutputData(SENSLOG_DATA_O_UNSPECIFIED, ul_did, - pst_pno_tbl->st_pno_data[pno_index].us_pno, - reinterpret_cast<uint8_t *>(&delivery_data), - senslog_len, uc_result); - } else { - SensLogWriteOutputData(SENSLOG_DATA_O_UNSPECIFIED, ul_did, - pst_pno_tbl->st_pno_data[pno_index].us_pno, - reinterpret_cast<uint8_t *>(&(delivery_data.data[0])), - senslog_len, uc_result); - } - return uc_result; -} - -u_int8 VehicleSensDeliveryFst(DID ul_did, u_int8 uc_get_method, int32 pno_index, - const VEHICLESENS_DELIVERY_PNO_TBL *pst_pno_tbl) { - VEHICLESENS_DATA_MASTER_FST st_master_fst; /* Master of initial sensor data */ - VEHICLESENS_DATA_MASTER_FST st_master_fst_temp; /* For temporary storage */ - - RET_API ret = RET_NORMAL; /* API return value */ - u_int8 uc_result = SENSLOG_RES_SUCCESS; /* Send/Receive result */ - (void)memset(reinterpret_cast<void *>(&st_master_fst), - 0, - sizeof(VEHICLESENS_DATA_MASTER_FST)); - (void)memset(reinterpret_cast<void *>(&st_master_fst_temp), - 0, - sizeof(VEHICLESENS_DATA_MASTER_FST)); - VehicleSensGetDataMasterFst(ul_did, uc_get_method, &st_master_fst); - if (st_master_fst.partition_flg == 1) { - /* When the partitioning flag is enabled,Or exceeds the size that can be sent,Perform split transmission */ - memcpy(&st_master_fst_temp, &st_master_fst, sizeof(VEHICLESENS_DATA_MASTER_FST)); - if ((ul_did == POSHAL_DID_GYRO_X_FST) || /* Ignore->MISRA-C++:2008 Rule 5-0-5 */ - (ul_did == POSHAL_DID_GYRO_Y_FST) || - (ul_did == POSHAL_DID_GYRO_Z_FST) || - (ul_did == POSHAL_DID_GSNS_X_FST) || - (ul_did == POSHAL_DID_GSNS_Y_FST) || - (ul_did == POSHAL_DID_GSNS_Z_FST)) { - /* 1st session */ - /* Call Vehicle Sensor Information Notification Transmission Process.*/ - /* Size of data that can be transmitted in one division(Same size definition used)*/ - st_master_fst_temp.us_size = LSDRV_FSTSNS_DSIZE_GYRO_X; - ret = VehicleSndMsg(PNO_VEHICLE_SENSOR, - pst_pno_tbl->st_pno_data[pno_index].us_pno, - CID_VEHICLESENS_VEHICLE_INFO, - /* Data size + data information Ignore->MISRA-C++:2008 Rule 5-0-5 */ - static_cast<u_int16>(st_master_fst_temp.us_size + 8), - (const void *)&st_master_fst_temp); - uc_result = SENSLOG_RES_SUCCESS; - if (ret != RET_NORMAL) { - uc_result = SENSLOG_RES_FAIL; - } - SensLogWriteOutputData(SENSLOG_DATA_O_SYS, - ul_did, - pst_pno_tbl->st_pno_data[pno_index].us_pno, - reinterpret_cast<uint8_t *>(&(st_master_fst_temp.uc_data[0])), - st_master_fst_temp.us_size, - uc_result); - - /* Second time */ - /* Call Vehicle Sensor Information Notification Transmission Process.*/ - (void)memset(reinterpret_cast<void *>(&st_master_fst_temp.uc_data[0]), - 0, - sizeof(u_int8) * VEHICLE_DSIZE_DATA_MASTER_FST); - /* Size of the data - Transmission size(Same size definition used)Ignore->MISRA-C++:2008 Rule 5-0-5 */ - st_master_fst_temp.us_size = static_cast<u_int16>(st_master_fst.us_size - \ - LSDRV_FSTSNS_DSIZE_GYRO_X); - memcpy(&st_master_fst_temp.uc_data[0], - &st_master_fst.uc_data[LSDRV_FSTSNS_DSIZE_GYRO_X], - st_master_fst_temp.us_size); - /* Ignore->MISRA-C++:2008 Rule 5-0-5 #Coverity_19347 */ - ret = VehicleSndMsg(PNO_VEHICLE_SENSOR, - pst_pno_tbl->st_pno_data[pno_index].us_pno, - CID_VEHICLESENS_VEHICLE_INFO, - /* Data size + data information Ignore->MISRA-C++:2008 Rule 5-0-5 */ - static_cast<u_int16>(st_master_fst_temp.us_size + 8), - (const void *)&st_master_fst_temp); - uc_result = SENSLOG_RES_SUCCESS; - if (ret != RET_NORMAL) { - uc_result = SENSLOG_RES_FAIL; - } - SensLogWriteOutputData(SENSLOG_DATA_O_SYS, - ul_did, - pst_pno_tbl->st_pno_data[pno_index].us_pno, - reinterpret_cast<uint8_t *>(&(st_master_fst_temp.uc_data[0])), - st_master_fst_temp.us_size, - uc_result); - } else if (ul_did == POSHAL_DID_REV_FST) { /* Ignore->MISRA-C++:2008 Rule 5-0-5 */ - /* 1st session */ - /* Call Vehicle Sensor Information Notification Transmission Process.*/ - /* Size of data that can be transmitted in one division */ - st_master_fst_temp.us_size = LSDRV_FSTSNS_DSIZE_REV; - ret = VehicleSndMsg(PNO_VEHICLE_SENSOR, - pst_pno_tbl->st_pno_data[pno_index].us_pno, - CID_VEHICLESENS_VEHICLE_INFO, - /* Data size + data information Ignore->MISRA-C++:2008 Rule 5-0-5 */ - static_cast<u_int16>(st_master_fst_temp.us_size + 8), - (const void *)&st_master_fst_temp); - uc_result = SENSLOG_RES_SUCCESS; - if (ret != RET_NORMAL) { - uc_result = SENSLOG_RES_FAIL; - } - SensLogWriteOutputData(SENSLOG_DATA_O_SYS, - ul_did, - pst_pno_tbl->st_pno_data[pno_index].us_pno, - reinterpret_cast<uint8_t *>(&(st_master_fst_temp.uc_data[0])), - st_master_fst_temp.us_size, - uc_result); - - /* Second time */ - /* Call Vehicle Sensor Information Notification Transmission Process.*/ - (void)memset(reinterpret_cast<void *>(&st_master_fst_temp.uc_data[0]), - 0, - sizeof(u_int8) * VEHICLE_DSIZE_DATA_MASTER_FST); - /* Size of the data - Transmission size Ignore->MISRA-C++:2008 Rule 5-0-5 */ - st_master_fst_temp.us_size = static_cast<u_int16>(st_master_fst.us_size - \ - LSDRV_FSTSNS_DSIZE_REV); - /* Ignore->MISRA-C++:2008 Rule 5-0-5 #Coverity_19347 */ - memcpy(&st_master_fst_temp.uc_data[0], - &st_master_fst.uc_data[LSDRV_FSTSNS_DSIZE_REV], - st_master_fst_temp.us_size); - ret = VehicleSndMsg(PNO_VEHICLE_SENSOR, - pst_pno_tbl->st_pno_data[pno_index].us_pno, - CID_VEHICLESENS_VEHICLE_INFO, - /* Data size + data information Ignore->MISRA-C++:2008 Rule 5-0-5 */ - static_cast<u_int16>(st_master_fst_temp.us_size + 8), - (const void *)&st_master_fst_temp); - uc_result = SENSLOG_RES_SUCCESS; - if (ret != RET_NORMAL) { - uc_result = SENSLOG_RES_FAIL; - } - SensLogWriteOutputData(SENSLOG_DATA_O_SYS, - ul_did, - pst_pno_tbl->st_pno_data[pno_index].us_pno, - reinterpret_cast<uint8_t *>(&(st_master_fst_temp.uc_data[0])), - st_master_fst_temp.us_size, - uc_result); - } else { - /* 1st session */ - /* Call Vehicle Sensor Information Notification Transmission Process.*/ - /* Size of data that can be transmitted in one division(Same size definition used)*/ - st_master_fst_temp.us_size = LSDRV_FSTSNS_DSIZE_GYRO_TEMP; - ret = VehicleSndMsg(PNO_VEHICLE_SENSOR, - pst_pno_tbl->st_pno_data[pno_index].us_pno, - CID_VEHICLESENS_VEHICLE_INFO, - /* Data size + data information Ignore->MISRA-C++:2008 Rule 5-0-5 */ - static_cast<u_int16>(st_master_fst_temp.us_size + 8), - (const void *)&st_master_fst_temp); - uc_result = SENSLOG_RES_SUCCESS; - if (ret != RET_NORMAL) { - uc_result = SENSLOG_RES_FAIL; - } - SensLogWriteOutputData(SENSLOG_DATA_O_SYS, - ul_did, - pst_pno_tbl->st_pno_data[pno_index].us_pno, - reinterpret_cast<uint8_t *>(&(st_master_fst_temp.uc_data[0])), - st_master_fst_temp.us_size, - uc_result); - /* Second time */ - /* Call Vehicle Sensor Information Notification Transmission Process.*/ - (void)memset(reinterpret_cast<void *>(&st_master_fst_temp.uc_data[0]), - 0, - sizeof(u_int8) * VEHICLE_DSIZE_DATA_MASTER_FST); - /* Size of the data - Transmission size(Same size definition used)Ignore->MISRA-C++:2008 Rule 5-0-5 */ - st_master_fst_temp.us_size = static_cast<u_int16>(st_master_fst.us_size - \ - LSDRV_FSTSNS_DSIZE_GYRO_TEMP); - memcpy(&st_master_fst_temp.uc_data[0], - &st_master_fst.uc_data[LSDRV_FSTSNS_DSIZE_GYRO_TEMP], - st_master_fst_temp.us_size); /* Ignore->MISRA-C++:2008 Rule 5-0-5 #Coverity_19347*/ - ret = VehicleSndMsg(PNO_VEHICLE_SENSOR, - pst_pno_tbl->st_pno_data[pno_index].us_pno, - CID_VEHICLESENS_VEHICLE_INFO, - /* Data size + data information Ignore->MISRA-C++:2008 Rule 5-0-5 */ - static_cast<u_int16>(st_master_fst_temp.us_size + 8), - (const void *)&st_master_fst_temp); - uc_result = SENSLOG_RES_SUCCESS; - if (ret != RET_NORMAL) { - uc_result = SENSLOG_RES_FAIL; - } - SensLogWriteOutputData(SENSLOG_DATA_O_SYS, - ul_did, - pst_pno_tbl->st_pno_data[pno_index].us_pno, - reinterpret_cast<uint8_t *>(&(st_master_fst_temp.uc_data[0])), - st_master_fst_temp.us_size, - uc_result); - } - } else { - /* Call Vehicle Sensor Information Notification Transmission Process.*/ - ret = VehicleSndMsg(PNO_VEHICLE_SENSOR, - pst_pno_tbl->st_pno_data[pno_index].us_pno, - CID_VEHICLESENS_VEHICLE_INFO, - /* Data size + data information Ignore->MISRA-C++:2008 Rule 5-0-5 */ - static_cast<u_int16>(st_master_fst.us_size + 8), - (const void *)&st_master_fst); - uc_result = SENSLOG_RES_SUCCESS; - if (ret != RET_NORMAL) { - uc_result = SENSLOG_RES_FAIL; - } - SensLogWriteOutputData(SENSLOG_DATA_O_SYS, - ul_did, - pst_pno_tbl->st_pno_data[pno_index].us_pno, - reinterpret_cast<uint8_t *>(&(st_master_fst.uc_data[0])), - st_master_fst.us_size, - uc_result); - } - - return uc_result; -} - -u_int8 VehicleSensDeliveryGyro(DID ul_did, u_int8 uc_current_get_method, int32 pno_index, const VEHICLESENS_DELIVERY_PNO_TBL *pst_pno_tbl) { // LCOV_EXCL_START 8: dead code // NOLINT(whitespace/line_length) - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - RET_API ret = RET_NORMAL; /* API return value */ - u_int8 uc_result = SENSLOG_RES_SUCCESS; /* Send/Receive result */ - - VEHICLESENS_DATA_MASTER_GYRO_TROUBLE st_master_gyro_trouble; - SENSORMOTION_MSG_GYROTROUBLEINFO_DAT st_msg_gyro_trouble_info; - - /* Initialization */ - st_msg_gyro_trouble_info.reserve = 0; - - VehicleSensGetDataMasterGyroTrouble(ul_did, uc_current_get_method, &st_master_gyro_trouble); - - /* Size storage(GYROTROUBLE) */ - st_msg_gyro_trouble_info.size = st_master_gyro_trouble.us_size; - - /* Set the GyroTrouble */ - (void)memcpy(reinterpret_cast<void *>(&(st_msg_gyro_trouble_info.gyro_trouble)), - reinterpret_cast<void *>(&(st_master_gyro_trouble.uc_data)), - sizeof(st_msg_gyro_trouble_info.gyro_trouble)); - -#if VEHICLE_SENS_DELIVERY_CTRL_DEBUG_DIAG - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, - "#[DIAG] ul_did = VEHICLE_DID_GYRO_TROUBLE"); - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, - "#[DIAG] st_msg_gyro_trouble_info.size = %d", st_msg_gyro_trouble_info.size); - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, - "#[DIAG] st_msg_gyro_trouble_info.gyro_trouble = 0x%08X \r\n", - st_msg_gyro_trouble_info.gyro_trouble); -#endif /* VEHICLE_SENS_DELIVERY_CTRL_DEBUG_DIAG */ - /* Since the undefined state is not a device specification,Do not deliver to the app side */ - if (st_msg_gyro_trouble_info.gyro_trouble != GYRO_UNFIXED) { - - /* Send GyroTrouble to API-caller */ - ret = VehicleSndMsg(PNO_VEHICLE_SENSOR, - pst_pno_tbl->st_pno_data[pno_index].us_pno, - CID_VEHICLE_SENSORMOTION_GYROTROUBLE, - sizeof(SENSORMOTION_MSG_GYROTROUBLEINFO_DAT), - (const void *)&st_msg_gyro_trouble_info); - uc_result = SENSLOG_RES_SUCCESS; - if (ret != RET_NORMAL) { - uc_result = SENSLOG_RES_FAIL; - } - SensLogWriteOutputData(SENSLOG_DATA_O_SYS, - ul_did, - pst_pno_tbl->st_pno_data[pno_index].us_pno, - reinterpret_cast<uint8_t *>(&st_msg_gyro_trouble_info), - sizeof(SENSORMOTION_MSG_GYROTROUBLEINFO_DAT), - uc_result); -#if VEHICLE_SENS_DELIVERY_CTRL_DEBUG_DIAG - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "#[DIAG] GyroTrouble Delivery"); -#endif /* VEHICLE_SENS_DELIVERY_CTRL_DEBUG_DIAG */ - } - return uc_result; -} -// LCOV_EXCL_STOP - -void VehicleSensDeliveryAntenna(DID ul_did, u_int8 uc_current_get_method, int32 pno_index, const VEHICLESENS_DELIVERY_PNO_TBL *pst_pno_tbl) { // LCOV_EXCL_START 8 : dead code // NOLINT(whitespace/line_length) - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - VEHICLESENS_DATA_MASTER_GPS_ANTENNA_STATUS gps_antenna_status; - VEHICLESENS_DELIVERY_FORMAT delivery_data; - u_int16 length; - - VehicleSensGetDataMasterGpsAntennaStatus(ul_did, uc_current_get_method, &gps_antenna_status); - - delivery_data.header.did = gps_antenna_status.ul_did; - delivery_data.header.size = gps_antenna_status.us_size; - delivery_data.header.rcv_flag = gps_antenna_status.uc_rcvflag; - delivery_data.header.sensor_cnt = gps_antenna_status.uc_sensor_cnt; - (void)memcpy(reinterpret_cast<void *>(&delivery_data.data[0]), - reinterpret_cast<void *>(&gps_antenna_status.uc_data), - (size_t)delivery_data.header.size); - - length = static_cast<u_int16>(static_cast<u_int32>(sizeof(delivery_data.header)) + delivery_data.header.size); - - /* Call Vehicle Sensor Information Notification Transmission Process.*/ - (void)VehicleSndMsg(PNO_VEHICLE_SENSOR, - pst_pno_tbl->st_pno_data[pno_index].us_pno, - CID_VEHICLESENS_VEHICLE_INFO, - length, - (const void *)&delivery_data); -} -// LCOV_EXCL_STOP - -u_int8 VehicleSensDeliveryOther(DID ul_did, u_int8 uc_current_get_method, int32 pno_index, - u_int32* cid, // NOLINT(readability/nolint) - VEHICLESENS_DATA_MASTER* stmaster, // NOLINT(readability/nolint) - const VEHICLESENS_DELIVERY_PNO_TBL *pst_pno_tbl) { - RET_API ret = RET_NORMAL; /* API return value */ - u_int8 uc_result = SENSLOG_RES_SUCCESS; /* Send/Receive result */ -/* Determine CID */ - if (ul_did == VEHICLE_DID_LOCATION_LONLAT_NAVI) { - *cid = CID_POSIF_REGISTER_LISTENER_LONLAT; - } else if (ul_did == VEHICLE_DID_LOCATION_ALTITUDE_NAVI) { // LCOV_EXCL_BR_LINE 6:VEHICLE_DID_LOCATION_ALTITUDE_NAVI no API to pass in // NOLINT(whitespace/line_length) - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - *cid = CID_POSIF_REGISTER_LISTENER_ALTITUDE; // LCOV_EXCL_LINE 8: dead code - } else if ((ul_did == VEHICLE_DID_MOTION_SPEED_NAVI) || - (ul_did == VEHICLE_DID_MOTION_SPEED_INTERNAL)) { - *cid = CID_VEHICLE_SENSORMOTION_SPEED; - } else if (ul_did == VEHICLE_DID_MOTION_HEADING_NAVI) { - *cid = CID_POSIF_REGISTER_LISTENER_HEADING; - } else if (ul_did == VEHICLE_DID_SETTINGTIME) { - *cid = CID_POSIF_REGISTER_LISTENER_GPS_TIME_SET_REQ; - } else { // LCOV_EXCL_BR_LINE 6: cannot be this one - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - *cid = 0xFFFF; /* DID error */ // LCOV_EXCL_LINE 8: dead code - } - - /* Send vehicle sensor information notification */ - if (*cid == 0xFFFF) { // LCOV_EXCL_BR_LINE 6: cannot be this one - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - /* Error log */ - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "Unknown DID [%d]", ul_did); - } else { - /* Acquire the applicable data information from the data master..*/ - (void)memset(reinterpret_cast<void *>(stmaster), 0x00, sizeof(VEHICLESENS_DATA_MASTER)); - VehicleSensGetDataMaster(ul_did, uc_current_get_method, stmaster); - - /* Call Vehicle Sensor Information Notification Transmission Process.*/ - ret = VehicleSndMsg(PNO_VEHICLE_SENSOR, - pst_pno_tbl->st_pno_data[pno_index].us_pno, - static_cast<CID>(*cid), - (u_int16)(stmaster->us_size), - (const void *)&(stmaster->uc_data[0])); - uc_result = SENSLOG_RES_SUCCESS; - if (ret != RET_NORMAL) { - uc_result = SENSLOG_RES_FAIL; - } - SensLogWriteOutputData(SENSLOG_DATA_O_UNSPECIFIED, - ul_did, - pst_pno_tbl->st_pno_data[pno_index].us_pno, - reinterpret_cast<uint8_t *>(&(stmaster->uc_data[0])), - stmaster->us_size, - uc_result); - } - - return uc_result; -} - -void VehicleSensDeliveryProc(DID ul_did, u_int8 uc_chg_type, u_int8 uc_get_method) { - VEHICLESENS_DATA_MASTER stmaster; /* Data master of normal data */ - const VEHICLESENS_DELIVERY_PNO_TBL *pst_pno_tbl; /* Vehicle Sensor Destination PNO Table Pointer */ - SENSOR_PKG_MSG_VSINFO st_pkg_master; /* Data master for package delivery */ - uint32_t cid; - uint8_t uc_result = SENSLOG_RES_SUCCESS; /* Send/Receive result */ - - /* Obtain the data acquisition method from the Vehicle Selection Item List */ - uint8_t uc_current_get_method = VehicleSensGetSelectionItemList(ul_did); - - if (uc_current_get_method == uc_get_method) { - /* When the data acquisition methods match (= delivery target) */ - - /* Obtain the shipping destination PNO */ - pst_pno_tbl = (const VEHICLESENS_DELIVERY_PNO_TBL *) VehicleSensMakeDeliveryPnoTbl(ul_did, uc_chg_type); - - if ((pst_pno_tbl->us_dnum) > 0) { - /* When there is a shipping destination PNO registration */ - /* For boundary adjustment */ - uint16_t us_boundary_adj = (u_int16) VEHICLESENS_BIT1 | (u_int16) VEHICLESENS_BIT0; /* #012 */ - /* Vehicle sensor information notification transmission process */ - for (uint32_t i = 0; i < (pst_pno_tbl->us_dnum); i++) { - if (VEHICLESENS_DELIVERY_METHOD_PACKAGE == pst_pno_tbl->st_pno_data[i].uc_method) { - /* When the delivery method is the package method */ - (void) memset(reinterpret_cast<void *>(&st_pkg_master), 0, sizeof(SENSOR_PKG_MSG_VSINFO)); - - uint16_t us_index = pst_pno_tbl->st_pno_data[i].us_pkg_start_idx; - uint8_t uc_data_cnt = 0U; - uint16_t us_offset = 0U; - for (uint32_t j = 0; j < SENSOR_PKG_DELIVERY_MAX; j++) { - DID ul_pkg_did = g_stpkgdelivery_tbl_mng.st_pkg_data[us_index].ul_did; /* Get DID */ - st_pkg_master.usOffset[uc_data_cnt] = us_offset; /* Offset setting */ - uc_current_get_method = VehicleSensGetSelectionItemList(ul_pkg_did); /* Data collection way */ - if (VEHICLESENS_GETMETHOD_GPS == uc_current_get_method) { - VehicleSensGetGpsDataMaster(ul_pkg_did, uc_current_get_method, - reinterpret_cast<SENSOR_MSG_GPSDATA_DAT *>(&st_pkg_master.ucData[us_offset])); - } - else { - VehicleSensGetDataMaster(ul_pkg_did, uc_current_get_method, - reinterpret_cast<VEHICLESENS_DATA_MASTER *>(&st_pkg_master.ucData[us_offset])); - } - uc_data_cnt++; /* Data count increment */ - if ((us_index == pst_pno_tbl->st_pno_data[i].us_pkg_end_idx) - || (VEHICLESENS_LINK_INDEX_END == g_stpkgdelivery_tbl_mng.st_pkg_data[us_index].usdlvry_idx)) { - st_pkg_master.ucDNum = uc_data_cnt; /* To save the number of data */ - break; - } - else { - /* By creating the following processing contents,Need to obtain an offset value */ - uint16_t us_next_offset = VehicleSensGetDataMasterOffset(ul_pkg_did); /* Next offset calculation */ - /* Boundary adjustment of data size */ - if ((us_next_offset & us_boundary_adj) != 0) { - /* If you need to adjust */ - /* Mask Lower Bit */ - us_next_offset = static_cast<u_int16>(us_next_offset & ~us_boundary_adj); - /* Add numbers */ - us_next_offset = static_cast<u_int16>(us_next_offset + (u_int16) VEHICLESENS_BIT2); - } - us_offset = static_cast<u_int16>(us_offset + us_next_offset); - /* Get next index */ - us_index = g_stpkgdelivery_tbl_mng.st_pkg_data[us_index].usdlvry_idx; - } - } - RET_API ret = PosSndMsg(PNO_VEHICLE_SENSOR, pst_pno_tbl->st_pno_data[i].us_pno, - CID_SENSOR_PKG_INFO, (u_int16) sizeof(SENSOR_PKG_MSG_VSINFO), (const void *) &st_pkg_master); - uc_result = SENSLOG_RES_SUCCESS; - if (ret != RET_NORMAL) { - uc_result = SENSLOG_RES_FAIL; - } - SensLogWriteOutputData(SENSLOG_DATA_O_SYS_PKG, 0, pst_pno_tbl->st_pno_data[i].us_pno, - reinterpret_cast<uint8_t *>(&st_pkg_master), sizeof(SENSOR_PKG_MSG_VSINFO), uc_result); - } - else { - /* When the delivery system is normal */ - /* Acquire the applicable data information from the data master..*/ - if (VEHICLESENS_GETMETHOD_GPS == uc_current_get_method) { - uc_result = VehicleSensDeliveryGPS(ul_did, uc_get_method, uc_current_get_method, i, &cid, &stmaster, - pst_pno_tbl); - } - else if ((VEHICLESENS_GETMETHOD_NAVI == uc_get_method) || // NOLINT(readability/braces) - (VEHICLESENS_GETMETHOD_OTHER == uc_get_method) || (VEHICLESENS_GETMETHOD_INTERNAL == uc_get_method)) { - uc_result = VehicleSensDeliveryOther(ul_did, uc_current_get_method, i, &cid, &stmaster, pst_pno_tbl); - } - -#if CONFIG_SENSOR_EXT_VALID /* Initial Sensor Support */ - /* Ignore->MISRA-C++:2008 Rule 5-0-5 */ - else if ((ul_did == POSHAL_DID_GYRO_X_FST) || // NOLINT(readability/braces) - (ul_did == POSHAL_DID_GYRO_Y_FST) || // NOLINT(readability/braces) - (ul_did == POSHAL_DID_GYRO_Z_FST) || // NOLINT(readability/braces) - (ul_did == POSHAL_DID_REV_FST) || - (ul_did == POSHAL_DID_GYRO_TEMP_FST) || - (ul_did == POSHAL_DID_GSNS_X_FST) || - (ul_did == POSHAL_DID_GSNS_Y_FST) || - (ul_did == POSHAL_DID_GSNS_Z_FST) || - (ul_did == POSHAL_DID_SPEED_PULSE_FST)) { /* Ignore->MISRA-C++:2008 Rule 5-0-5 */ - /* Acquire the applicable data information from the data master for the initial sensor..*/ - uc_result = VehicleSensDeliveryFst(ul_did, uc_get_method, i, pst_pno_tbl); - } -#endif - else if (ul_did == VEHICLE_DID_GYRO_TROUBLE) { // LCOV_EXCL_BR_LINE 6:DID is not used - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - uc_result = VehicleSensDeliveryGyro(ul_did, uc_current_get_method, i, pst_pno_tbl); // LCOV_EXCL_LINE 8: dead code // NOLINT(whitespace/line_length) - } - else { // NOLINT(readability/braces) - (void) memset(reinterpret_cast<void *>(&stmaster), 0x00, sizeof(stmaster)); - VehicleSensGetDataMaster(ul_did, uc_current_get_method, &stmaster); - - /* Call Vehicle Sensor Information Notification Transmission Process.*/ - RET_API ret = VehicleSndMsg(PNO_VEHICLE_SENSOR, pst_pno_tbl->st_pno_data[i].us_pno, - CID_VEHICLESENS_VEHICLE_INFO, (u_int16) sizeof(VEHICLESENS_DATA_MASTER), (const void *) &stmaster); - uc_result = SENSLOG_RES_SUCCESS; - if (ret != RET_NORMAL) { - uc_result = SENSLOG_RES_FAIL; - } - SensLogWriteOutputData(SENSLOG_DATA_O_SYS, ul_did, pst_pno_tbl->st_pno_data[i].us_pno, - reinterpret_cast<uint8_t *>(&(stmaster.uc_data[0])), stmaster.us_size, uc_result); - } - } - } - } - } -} - -u_int8 VehicleSensFirstDeliverySens(PNO us_pno, DID ul_did, u_int8 uc_get_method, - VEHICLESENS_DATA_MASTER_FST* stmaster_fst, - VEHICLESENS_DATA_MASTER_FST* stmaster_fst_temp) { - RET_API ret = RET_NORMAL; /* API return value */ - u_int8 uc_result = SENSLOG_RES_SUCCESS; /* Send/Receive result */ - /* Acquire the applicable data information from the data master for the initial sensor..*/ - (void)memset(reinterpret_cast<void *>(stmaster_fst), 0, sizeof(VEHICLESENS_DATA_MASTER_FST)); - (void)memset(reinterpret_cast<void *>(stmaster_fst_temp), 0, sizeof(VEHICLESENS_DATA_MASTER_FST)); - VehicleSensGetDataMasterFst(ul_did, uc_get_method, stmaster_fst); - - /* Internal debug log output */ - FRAMEWORKUNIFIEDLOG(ZONE_26, __FUNCTION__, - "[LOG:POSHAL_DID_GYRO_FST,POSHAL_DID_SPEED_PULSE_FST]"); - - if (stmaster_fst->partition_flg == 1) { - /* When the partitioning flag is enabled,Or exceeds the size that can be sent,Perform split transmission */ - memcpy(stmaster_fst_temp, stmaster_fst, sizeof(VEHICLESENS_DATA_MASTER_FST)); - if ((ul_did == POSHAL_DID_GYRO_X_FST) || /* Ignore->MISRA-C++:2008 Rule 5-0-5 */ - (ul_did == POSHAL_DID_GYRO_Y_FST) || - (ul_did == POSHAL_DID_GYRO_Z_FST) || - (ul_did == POSHAL_DID_GSNS_X_FST) || - (ul_did == POSHAL_DID_GSNS_Y_FST) || - (ul_did == POSHAL_DID_GSNS_Z_FST)) { - /* Internal debug log output */ - FRAMEWORKUNIFIEDLOG(ZONE_26, __FUNCTION__, - "[CALL:VehicleSndMsg:INPOSHAL_DID_GYRO_FST Partition]"); - - /* 1st session */ - /* Call Vehicle Sensor Information Notification Transmission Process.*/ - /* Size of data that can be transmitted in one division(Same size definition used) */ - stmaster_fst_temp->us_size = LSDRV_FSTSNS_DSIZE_GYRO_X; - ret = VehicleSndMsg(PNO_VEHICLE_SENSOR, - us_pno, - CID_VEHICLESENS_VEHICLE_INFO, - /* Data size + data information Ignore->MISRA-C++:2008 Rule 5-0-5 */ - static_cast<u_int16>(stmaster_fst_temp->us_size + 8), - (const void *)stmaster_fst_temp); - uc_result = SENSLOG_RES_SUCCESS; - if (ret != RET_NORMAL) { - uc_result = SENSLOG_RES_FAIL; - } - SensLogWriteOutputData(SENSLOG_DATA_O_SYS, - ul_did, - us_pno, - reinterpret_cast<uint8_t *>(&(stmaster_fst_temp->uc_data[0])), - stmaster_fst_temp->us_size, - uc_result); - - /* Second time */ - /* Call Vehicle Sensor Information Notification Transmission Process.*/ - (void)memset(reinterpret_cast<void *>(&stmaster_fst_temp->uc_data[0]), - 0, - sizeof(u_int8) * VEHICLE_DSIZE_DATA_MASTER_FST); - /* Size of the data - Transmission size(Same size definition used) Ignore->MISRA-C++:2008 Rule 5-0-5 */ - stmaster_fst_temp->us_size = static_cast<u_int16>(stmaster_fst->us_size - LSDRV_FSTSNS_DSIZE_GYRO_X); - /* Ignore->MISRA-C++:2008 Rule 5-0-5 */ - memcpy(&stmaster_fst_temp->uc_data[0], - &stmaster_fst->uc_data[LSDRV_FSTSNS_DSIZE_GYRO_X], - stmaster_fst_temp->us_size); - ret = VehicleSndMsg(PNO_VEHICLE_SENSOR, - us_pno, - CID_VEHICLESENS_VEHICLE_INFO, - /* Data size + data information Ignore->MISRA-C++:2008 Rule 5-0-5 */ - static_cast<u_int16>(stmaster_fst_temp->us_size + 8), - (const void *)stmaster_fst_temp); - uc_result = SENSLOG_RES_SUCCESS; - if (ret != RET_NORMAL) { - uc_result = SENSLOG_RES_FAIL; - } - SensLogWriteOutputData(SENSLOG_DATA_O_SYS, ul_did, us_pno, - reinterpret_cast<uint8_t *>(&(stmaster_fst_temp->uc_data[0])), - stmaster_fst_temp->us_size, uc_result); - } else if (ul_did == POSHAL_DID_REV_FST) { /* Ignore->MISRA-C++:2008 Rule 5-0-5 */ - /* Internal debug log output */ - FRAMEWORKUNIFIEDLOG(ZONE_26, __FUNCTION__, - "[CALL:VehicleSndMsg:INPOSHAL_DID_REV_FST Partition]"); - - /* 1st session */ - /* Call Vehicle Sensor Information Notification Transmission Process.*/ - stmaster_fst_temp->us_size = LSDRV_FSTSNS_DSIZE_REV; /* Size of data that can be transmitted in one division */ - ret = VehicleSndMsg(PNO_VEHICLE_SENSOR, - us_pno, - CID_VEHICLESENS_VEHICLE_INFO, - /* Data size + data information Ignore->MISRA-C++:2008 Rule 5-0-5 */ - static_cast<u_int16>(stmaster_fst_temp->us_size + 8), - (const void *)stmaster_fst_temp); - uc_result = SENSLOG_RES_SUCCESS; - if (ret != RET_NORMAL) { - uc_result = SENSLOG_RES_FAIL; - } - SensLogWriteOutputData(SENSLOG_DATA_O_SYS, ul_did, us_pno, - reinterpret_cast<uint8_t *>(&(stmaster_fst_temp->uc_data[0])), - stmaster_fst_temp->us_size, uc_result); - - /* Second time */ - /* Call Vehicle Sensor Information Notification Transmission Process.*/ - (void)memset(reinterpret_cast<void *>(&stmaster_fst_temp->uc_data[0]), - 0, - sizeof(u_int8) * VEHICLE_DSIZE_DATA_MASTER_FST); - /* Size of the data - Transmission size Ignore->MISRA-C++:2008 Rule 5-0-5 */ - stmaster_fst_temp->us_size = static_cast<u_int16>(stmaster_fst->us_size - LSDRV_FSTSNS_DSIZE_REV); - /* Ignore->MISRA-C++:2008 Rule 5-0-5 */ - memcpy(&stmaster_fst_temp->uc_data[0], - &stmaster_fst->uc_data[LSDRV_FSTSNS_DSIZE_REV], - stmaster_fst_temp->us_size); - ret = VehicleSndMsg(PNO_VEHICLE_SENSOR, - us_pno, - CID_VEHICLESENS_VEHICLE_INFO, - /* Data size + data information Ignore->MISRA-C++:2008 Rule 5-0-5 */ - static_cast<u_int16>(stmaster_fst_temp->us_size + 8), - (const void *)stmaster_fst_temp); - uc_result = SENSLOG_RES_SUCCESS; - if (ret != RET_NORMAL) { - uc_result = SENSLOG_RES_FAIL; - } - SensLogWriteOutputData(SENSLOG_DATA_O_SYS, ul_did, us_pno, - reinterpret_cast<uint8_t *>(&(stmaster_fst_temp->uc_data[0])), - stmaster_fst_temp->us_size, uc_result); - } else { - /* Internal debug log output */ - FRAMEWORKUNIFIEDLOG(ZONE_26, __FUNCTION__, - "[CALL:Vehicle_SndMsg:POSHAL_DID_SPEED_PULSE_FST Partition]"); - - /* 1st session */ - /* Call Vehicle Sensor Information Notification Transmission Process.*/ - /* Size of data that can be transmitted in one division(Same size definition used) */ - stmaster_fst_temp->us_size = LSDRV_FSTSNS_DSIZE_GYRO_TEMP; - ret = VehicleSndMsg(PNO_VEHICLE_SENSOR, - us_pno, - CID_VEHICLESENS_VEHICLE_INFO, - /* Data size + data information Ignore->MISRA-C++:2008 Rule 5-0-5 */ - static_cast<u_int16>(stmaster_fst_temp->us_size + 8), - (const void *)stmaster_fst_temp); - uc_result = SENSLOG_RES_SUCCESS; - if (ret != RET_NORMAL) { - uc_result = SENSLOG_RES_FAIL; - } - SensLogWriteOutputData(SENSLOG_DATA_O_SYS, ul_did, us_pno, - reinterpret_cast<uint8_t *>(&(stmaster_fst_temp->uc_data[0])), - stmaster_fst_temp->us_size, uc_result); - - /* Second time */ - /* Call Vehicle Sensor Information Notification Transmission Process.*/ - (void)memset(reinterpret_cast<void *>(&stmaster_fst_temp->uc_data[0]), - 0, - sizeof(u_int8) * VEHICLE_DSIZE_DATA_MASTER_FST); - /* Size of the data - Transmission size(Same size definition used) Ignore->MISRA-C++:2008 Rule 5-0-5 */ - stmaster_fst_temp->us_size = static_cast<u_int16>(stmaster_fst->us_size - LSDRV_FSTSNS_DSIZE_GYRO_TEMP); - /* Ignore->MISRA-C++:2008 Rule 5-0-5 */ - memcpy(&stmaster_fst_temp->uc_data[0], - &stmaster_fst->uc_data[LSDRV_FSTSNS_DSIZE_GYRO_TEMP], - stmaster_fst_temp->us_size); - ret = VehicleSndMsg(PNO_VEHICLE_SENSOR, - us_pno, - CID_VEHICLESENS_VEHICLE_INFO, - /* Data size + data information Ignore->MISRA-C++:2008 Rule 5-0-5 */ - static_cast<u_int16>(stmaster_fst_temp->us_size + 8), - (const void *)stmaster_fst_temp); - uc_result = SENSLOG_RES_SUCCESS; - if (ret != RET_NORMAL) { - uc_result = SENSLOG_RES_FAIL; - } - SensLogWriteOutputData(SENSLOG_DATA_O_SYS, ul_did, us_pno, - reinterpret_cast<uint8_t *>(&(stmaster_fst_temp->uc_data[0])), - stmaster_fst_temp->us_size, uc_result); - } - } else { - /* Internal debug log output */ - FRAMEWORKUNIFIEDLOG(ZONE_26, __FUNCTION__, "[CALL:VehicleSndMsg]"); - - /* Call Vehicle Sensor Information Notification Transmission Process.*/ - ret = VehicleSndMsg(PNO_VEHICLE_SENSOR, - us_pno, - CID_VEHICLESENS_VEHICLE_INFO, - /* Data size + data information Ignore->MISRA-C++:2008 Rule 5-0-5 */ - static_cast<u_int16>(stmaster_fst->us_size + 8), - (const void *)stmaster_fst); - uc_result = SENSLOG_RES_SUCCESS; - if (ret != RET_NORMAL) { - uc_result = SENSLOG_RES_FAIL; - } - SensLogWriteOutputData(SENSLOG_DATA_O_SYS, ul_did, us_pno, - reinterpret_cast<uint8_t *>(&(stmaster_fst->uc_data[0])), - stmaster_fst->us_size, uc_result); - } - - return uc_result; -} - -u_int8 VehicleSensFirstDeliveryOther(PNO us_pno, DID ul_did, u_int8 uc_get_method, - u_int32* cid, - VEHICLESENS_DATA_MASTER* stmaster) { - RET_API ret = RET_NORMAL; /* API return value */ - u_int8 uc_result = SENSLOG_RES_SUCCESS; /* Send/Receive result */ - /* Determine CID */ - if (ul_did == VEHICLE_DID_LOCATION_LONLAT_NAVI) { - *cid = CID_POSIF_REGISTER_LISTENER_LONLAT; - } else if (ul_did == VEHICLE_DID_LOCATION_ALTITUDE_NAVI) { // LCOV_EXCL_BR_LINE 6:VEHICLE_DID_LOCATION_ALTITUDE_NAVI no API to pass in // NOLINT(whitespace/line_length) - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - *cid = CID_POSIF_REGISTER_LISTENER_ALTITUDE; // LCOV_EXCL_LINE 8: dead code - } else if ((ul_did == VEHICLE_DID_MOTION_SPEED_NAVI) || - (ul_did == VEHICLE_DID_MOTION_SPEED_INTERNAL)) { - *cid = CID_VEHICLE_SENSORMOTION_SPEED; - } else if (ul_did == VEHICLE_DID_MOTION_HEADING_NAVI) { - *cid = CID_POSIF_REGISTER_LISTENER_HEADING; - } else if (ul_did == VEHICLE_DID_SETTINGTIME) { - *cid = CID_POSIF_REGISTER_LISTENER_GPS_TIME_SET_REQ; - } else { // LCOV_EXCL_BR_LINE 6: cannot be this one - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - *cid = 0xFFFF; /* DID error */ // LCOV_EXCL_LINE 8: dead code - } - - /* Vehicle sensor information notification transmission */ - if (*cid == 0xFFFF) { // LCOV_EXCL_BR_LINE 6: cannot be this one - /* Error log */ - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "Unknown DID [%d]", ul_did); // LCOV_EXCL_LINE 8: dead code // NOLINT(whitespace/line_length) - } else { - /* Acquire the applicable data information from the data master..*/ - (void)memset(reinterpret_cast<void *>(stmaster), 0x00, sizeof(VEHICLESENS_DATA_MASTER)); - VehicleSensGetDataMaster(ul_did, uc_get_method, stmaster); - - /* Call Vehicle Sensor Information Notification Transmission Process.*/ - ret = VehicleSndMsg(PNO_VEHICLE_SENSOR, - us_pno, - static_cast<CID>(*cid), - (u_int16)stmaster->us_size, - (const void *)&(stmaster->uc_data[0])); - uc_result = SENSLOG_RES_SUCCESS; - if (ret != RET_NORMAL) { - uc_result = SENSLOG_RES_FAIL; - } - SensLogWriteOutputData(SENSLOG_DATA_O_UNSPECIFIED, - ul_did, - us_pno, - reinterpret_cast<uint8_t *>(&(stmaster->uc_data[0])), - stmaster->us_size, - uc_result); - } - - return uc_result; -} -/******************************************************************************* -* MODULE : VehicleSensFirstDelivery -* ABSTRACT : Vehicle Sensor Initial Data Delivery Process -* FUNCTION : Deliver the initial data to the destination. -* ARGUMENT : us_pno :Addresses for delivery NO -* ul_did :Data ID -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensFirstDelivery(PNO us_pno, DID ul_did) { - u_int8 uc_get_method; - VEHICLESENS_DATA_MASTER stmaster; -#if CONFIG_SENSOR_EXT_VALID /* Initial Sensor Support */ - VEHICLESENS_DATA_MASTER_FST stMasterFst; /* Master of initial sensor data */ - VEHICLESENS_DATA_MASTER_FST stMasterFst_temp; /* For temporary storage */ - u_int32 cid; - SENSORLOCATION_MSG_LONLATINFO *pLonLatMsg; - SENSORLOCATION_MSG_ALTITUDEINFO *pAltitudeMsg; - SENSORMOTION_MSG_HEADINGINFO *pHeadingMsg; - RET_API ret = RET_NORMAL; /* API return value */ - u_int8 uc_result = SENSLOG_RES_SUCCESS; /* Send/Receive result */ -#endif - - /* Internal debug log output */ - FRAMEWORKUNIFIEDLOG(ZONE_26, __FUNCTION__, "+ [ul_did = 0x%x us_pno:0x%x]", ul_did, us_pno); - - /* Obtain the data acquisition method.*/ - uc_get_method = VehicleSensGetSelectionItemList(ul_did); - - if (VEHICLESENS_GETMETHOD_GPS == uc_get_method) { - SENSOR_MSG_GPSDATA_DAT gps_master; - VEHICLESENS_DELIVERY_FORMAT delivery_data; - u_int16 length; - u_int16 senslog_len; - - VehicleSensGetGpsDataMaster(ul_did, uc_get_method, &gps_master); - - if (ul_did == POSHAL_DID_GPS_TIME) { - /* GPS time,Because there is no header in the message to be delivered,Padding deliveryData headers */ - (void)memcpy(reinterpret_cast<void*>(&delivery_data), - reinterpret_cast<void*>(&gps_master.uc_data[0]), gps_master.us_size); - length = gps_master.us_size; - senslog_len = length; - cid = CID_VEHICLESENS_VEHICLE_INFO_GPS_TIME; - } else if (ul_did == VEHICLE_DID_LOCATION_LONLAT) { - pLonLatMsg = reinterpret_cast<SENSORLOCATION_MSG_LONLATINFO*>(&delivery_data); - /* Acquire the applicable data information from the data master..*/ - VehicleSensGetDataMaster(ul_did, uc_get_method, &stmaster); - (void)memcpy(reinterpret_cast<void*>(&(pLonLatMsg->data)), - reinterpret_cast<void*>(&(stmaster.uc_data[0])), stmaster.us_size); - length = (u_int16)stmaster.us_size; - senslog_len = length; - cid = CID_POSIF_REGISTER_LISTENER_LONLAT; - } else if (ul_did == VEHICLE_DID_LOCATION_ALTITUDE) { - pAltitudeMsg = reinterpret_cast<SENSORLOCATION_MSG_ALTITUDEINFO*>(&delivery_data); - /* Acquire the applicable data information from the data master..*/ - VehicleSensGetDataMaster(ul_did, uc_get_method, &stmaster); - (void)memcpy(reinterpret_cast<void*>(&(pAltitudeMsg->data)), - reinterpret_cast<void*>(&stmaster.uc_data[0]), stmaster.us_size); - length = (u_int16)stmaster.us_size; - senslog_len = length; - cid = CID_POSIF_REGISTER_LISTENER_ALTITUDE; - } else if (ul_did == VEHICLE_DID_MOTION_HEADING) { - pHeadingMsg = reinterpret_cast<SENSORMOTION_MSG_HEADINGINFO*>(&delivery_data); - /* Acquire the applicable data information from the data master..*/ - VehicleSensGetDataMaster(ul_did, uc_get_method, &stmaster); - (void)memcpy(reinterpret_cast<void*>(&(pHeadingMsg->data)), - reinterpret_cast<void*>(&stmaster.uc_data[0]), stmaster.us_size); - length = (u_int16)stmaster.us_size; - senslog_len = length; - cid = CID_POSIF_REGISTER_LISTENER_HEADING; - } else { - - delivery_data.header.did = gps_master.ul_did; - delivery_data.header.size = gps_master.us_size; - delivery_data.header.rcv_flag = gps_master.uc_rcv_flag; - delivery_data.header.sensor_cnt = gps_master.uc_sns_cnt; - (void)memcpy(reinterpret_cast<void *>(&delivery_data.data[0]), - reinterpret_cast<void *>(&gps_master.uc_data[0]), - (size_t)delivery_data.header.size); - - length = static_cast<u_int16>((u_int16)sizeof(delivery_data.header) + delivery_data.header.size); - senslog_len = delivery_data.header.size; - cid = CID_VEHICLESENS_VEHICLE_INFO; - } - - /* Call Vehicle Sensor Information Notification Transmission Process.*/ - ret = VehicleSndMsg(PNO_VEHICLE_SENSOR, - us_pno, - static_cast<CID>(cid), - length, - (const void *)&delivery_data); - uc_result = SENSLOG_RES_SUCCESS; - if (ret != RET_NORMAL) { - uc_result = SENSLOG_RES_FAIL; - } - if (cid != CID_VEHICLESENS_VEHICLE_INFO) { - SensLogWriteOutputData(SENSLOG_DATA_O_UNSPECIFIED, ul_did, us_pno, - reinterpret_cast<uint8_t *>(&delivery_data), senslog_len, uc_result); - } else { - SensLogWriteOutputData(SENSLOG_DATA_O_UNSPECIFIED, ul_did, us_pno, - reinterpret_cast<uint8_t *>(&(delivery_data.data[0])), senslog_len, uc_result); - } - } - else if ((VEHICLESENS_GETMETHOD_NAVI == uc_get_method) || // NOLINT(readability/braces) - (VEHICLESENS_GETMETHOD_OTHER == uc_get_method) || - (VEHICLESENS_GETMETHOD_INTERNAL == uc_get_method)) { - uc_result = VehicleSensFirstDeliveryOther(us_pno, ul_did, uc_get_method, &cid, &stmaster); - } -#if CONFIG_SENSOR_EXT_VALID /* Initial Sensor Support */ - /* Ignore->MISRA-C++:2008 Rule 5-0-5 */ - else if ((ul_did == POSHAL_DID_GYRO_X_FST) || // NOLINT(readability/braces) - (ul_did == POSHAL_DID_GYRO_Y_FST) || // NOLINT(readability/braces) - (ul_did == POSHAL_DID_GYRO_Z_FST) || // NOLINT(readability/braces) - (ul_did == POSHAL_DID_REV_FST) || - (ul_did == POSHAL_DID_GYRO_TEMP_FST) || - (ul_did == POSHAL_DID_GSNS_X_FST) || - (ul_did == POSHAL_DID_GSNS_Y_FST) || - (ul_did == POSHAL_DID_GSNS_Z_FST) || - (ul_did == POSHAL_DID_SPEED_PULSE_FST)) { /* Ignore->MISRA-C++:2008 Rule 5-0-5 */ - /* Acquire the applicable data information from the data master for the initial sensor..*/ - uc_result = VehicleSensFirstDeliverySens(us_pno, ul_did, uc_get_method, &stMasterFst, &stMasterFst_temp); - } -#endif - else if (ul_did == VEHICLE_DID_GYRO_TROUBLE) { // LCOV_EXCL_BR_LINE 8 : DID in not used - // LCOV_EXCL_START 8: DID is not used - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - VEHICLESENS_DATA_MASTER_GYRO_TROUBLE st_master_gyro_trouble; - SENSORMOTION_MSG_GYROTROUBLEINFO_DAT st_msg_gyro_trouble_info; - - /* Initialization */ - st_master_gyro_trouble.uc_reserve = 0; - st_msg_gyro_trouble_info.reserve = 0; - - VehicleSensGetDataMasterGyroTrouble(ul_did, uc_get_method, &st_master_gyro_trouble); - - /* Size storage(GYROTROUBLE) */ - st_msg_gyro_trouble_info.size = st_master_gyro_trouble.us_size; - - /* Set the GyroTrouble */ - (void)memcpy(reinterpret_cast<void *>(&(st_msg_gyro_trouble_info.gyro_trouble)), - reinterpret_cast<void *>(&(st_master_gyro_trouble.uc_data)), - sizeof(st_msg_gyro_trouble_info.gyro_trouble)); - -#if VEHICLE_SENS_DELIVERY_CTRL_DEBUG_DIAG - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "#[DIAG] ul_did = VEHICLE_DID_GYRO_TROUBLE"); - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, - "#[DIAG] st_msg_gyro_trouble_info.size = %d", - st_msg_gyro_trouble_info.size); - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, - "#[DIAG] st_msg_gyro_trouble_info.gyro_trouble = 0x%08X \r\n", - st_msg_gyro_trouble_info.gyro_trouble); -#endif /* VEHICLE_SENS_DELIVERY_CTRL_DEBUG_DIAG */ - /* Since the undefined state is not a device specification,Do not deliver to the app for the first time */ - if (st_msg_gyro_trouble_info.gyro_trouble != GYRO_UNFIXED) { - - /* Send GyroTrouble to API-caller */ - ret = VehicleSndMsg(PNO_VEHICLE_SENSOR, - us_pno, - CID_VEHICLE_SENSORMOTION_GYROTROUBLE, - sizeof(SENSORMOTION_MSG_GYROTROUBLEINFO_DAT), - (const void *)&st_msg_gyro_trouble_info); - uc_result = SENSLOG_RES_SUCCESS; - if (ret != RET_NORMAL) { - uc_result = SENSLOG_RES_FAIL; - } - SensLogWriteOutputData(SENSLOG_DATA_O_SYS, ul_did, us_pno, - reinterpret_cast<uint8_t *>(&st_msg_gyro_trouble_info), - sizeof(SENSORMOTION_MSG_GYROTROUBLEINFO_DAT), - uc_result); -#if VEHICLE_SENS_DELIVERY_CTRL_DEBUG_DIAG - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "#[DIAG] GyroTrouble FirstDelivery"); -#endif /* VEHICLE_SENS_DELIVERY_CTRL_DEBUG_DIAG */ - } - // LCOV_EXCL_STOP - } - else { // NOLINT(readability/braces) - (void)memset(reinterpret_cast<void *>(&stmaster), 0x00, sizeof(stmaster)); - /* Acquire the applicable data information from the data master..*/ - VehicleSensGetDataMaster(ul_did, uc_get_method, &stmaster); - - /* Call Vehicle Sensor Information Notification Transmission Process.*/ - ret = VehicleSndMsg(PNO_VEHICLE_SENSOR, - us_pno, - CID_VEHICLESENS_VEHICLE_INFO, - (u_int16)sizeof(VEHICLESENS_DATA_MASTER), - (const void *)&stmaster); - uc_result = SENSLOG_RES_SUCCESS; - if (ret != RET_NORMAL) { - uc_result = SENSLOG_RES_FAIL; - } - SensLogWriteOutputData(SENSLOG_DATA_O_SYS, ul_did, us_pno, - reinterpret_cast<uint8_t *>(&(stmaster.uc_data[0])), - stmaster.us_size, uc_result); - } - /* Internal debug log output */ - FRAMEWORKUNIFIEDLOG(ZONE_26, __FUNCTION__, "-"); -} - -/******************************************************************************* -* MODULE : VehicleSensFirstPkgDelivery -* ABSTRACT : Vehicle Sensor Initial Package Data Delivery Process -* FUNCTION : Deliver the initial package data to the destination. -* ARGUMENT : *pst_data :Data portion pointer of the message buffer -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensFirstPkgDelivery(const SENSOR_MSG_DELIVERY_ENTRY_DAT *pst_data) { // LCOV_EXCL_START 8: dead code - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - u_int8 uc_get_method; /* Data collection way */ - int32 i; /* Generic counters */ - SENSOR_PKG_MSG_VSINFO st_pkg_master; /* Data master for package delivery */ - DID ul_pkg_did; /* DID for package data acquisition */ - u_int16 us_offset = 0; /* For offset calculation */ - u_int16 us_next_offset; /* Next offset value */ - u_int16 us_boundary_adj; /* For boundary adjustment */ - RET_API ret = RET_NORMAL; /* API return value */ - u_int8 uc_result = 0; /* Send/Receive result */ - - (void)memset(reinterpret_cast<void *>(&st_pkg_master), 0, sizeof(SENSOR_PKG_MSG_VSINFO)); - /* For boundary adjustment */ - us_boundary_adj = (u_int16)VEHICLESENS_BIT1 | (u_int16)VEHICLESENS_BIT0; - for (i = 0; i < pst_data->pkg_num; i++) { - ul_pkg_did = pst_data->did[i]; /* Get DID */ - st_pkg_master.usOffset[i] = us_offset; /* Offset setting */ - /* Data collection way */ - uc_get_method = VehicleSensGetSelectionItemList(ul_pkg_did); - if (VEHICLESENS_GETMETHOD_GPS == uc_get_method) { - VehicleSensGetGpsDataMaster(ul_pkg_did, - uc_get_method, - reinterpret_cast<SENSOR_MSG_GPSDATA_DAT *>(&st_pkg_master.ucData[us_offset])); - } else { - VehicleSensGetDataMaster(ul_pkg_did, - uc_get_method, - reinterpret_cast<VEHICLESENS_DATA_MASTER *>(&st_pkg_master.ucData[us_offset])); - } - /* Next offset calculation */ - /* Boundary adjustment of data size */ - us_next_offset = VehicleSensGetDataMasterOffset(ul_pkg_did); - if ((us_next_offset & us_boundary_adj) != 0) { - /* If you need to adjust */ - us_next_offset = static_cast<u_int16>(us_next_offset & ~us_boundary_adj); /* Mask Lower Bit */ - us_next_offset = static_cast<u_int16>(us_next_offset + (u_int16)VEHICLESENS_BIT2); /* Add numbers */ - } - us_offset = static_cast<u_int16>(us_offset + us_next_offset); - } - - st_pkg_master.ucDNum = pst_data->pkg_num; /* To save the number of data */ - ret = PosSndMsg(PNO_VEHICLE_SENSOR, - pst_data->pno, - CID_SENSOR_PKG_INFO, - (u_int16)sizeof(SENSOR_PKG_MSG_VSINFO), - (const void *)&st_pkg_master); - uc_result = SENSLOG_RES_SUCCESS; - if (ret != RET_NORMAL) { - uc_result = SENSLOG_RES_FAIL; - } - SensLogWriteOutputData(SENSLOG_DATA_O_SYS_PKG, 0, pst_data->pno, - reinterpret_cast<uint8_t *>(&st_pkg_master), - sizeof(SENSOR_PKG_MSG_VSINFO), - uc_result); -} -// LCOV_EXCL_STOP - -/* Ignore->MISRA-C++:2008 Rule 2-7-2 */ -#if CONFIG_SENSOR_EXT_VALID /* Initial Sensor Support */ -/******************************************************************************* -* MODULE : VehicleSensFirstPkgDeliveryExt -* ABSTRACT : Vehicle Sensor Initial Expansion Package Data Delivery Process -* FUNCTION : Deliver the initial expansion package data to the destination. -* ARGUMENT : *pst_data :Data portion pointer of the message buffer -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensFirstPkgDeliveryExt(const SENSOR_MSG_DELIVERY_ENTRY_DAT *pst_data) { - u_int8 ucGetMethod; /* Data collection way */ - int32 i; /* Generic counters */ - static SENSOR_PKG_MSG_VSINFO stPkgMaster; /* Data master for package delivery */ - DID ulPkgDid; /* DID for package data acquisition */ - u_int16 usOffset = 0; /* For offset calculation */ - u_int16 usNextOffset; /* Next offset value */ - u_int16 usBoundaryAdj; /* For boundary adjustment */ - static VEHICLESENS_DATA_MASTER_EXT stExtDataTemp[11];/* Extended data master temporary storage area */ - u_int16 usDataCnt[11] = {0}; /* For storing the number of data items */ - u_int8 ucDivideCnt; /* Total number of partitions */ - u_int8 ucDivide100Cnt = 0; /* Total number of 100 partitions */ - u_int8 ucDivideSendCnt; /* Number of divided transmissions */ - u_int16 usDivideSendSize[11] = {0}; /* Split Send Size */ - u_int16 ucDivideSendPoint; /* Split transmission data acquisition position */ - u_int8 ucDataBreak; /* Storage area of all data undelivered flag */ - RET_API ret = RET_NORMAL; /* API return value */ - u_int8 uc_result = 0; /* Send/Receive result */ - - /* Internal debug log output */ - FRAMEWORKUNIFIEDLOG(ZONE_26, __FUNCTION__, "+"); - - /* For boundary adjustment */ - usBoundaryAdj = (u_int16)VEHICLESENS_BIT1 | (u_int16)VEHICLESENS_BIT0; - /* #Polaris_004 START */ /* Ignore->MISRA-C++:2008 Rule 2-7-2 */ - (void)memset(reinterpret_cast<void *>(&stExtDataTemp), 0, sizeof(stExtDataTemp)); - for (i = 0; i < pst_data->pkg_num; i++) { /* Ignore->MISRA-C++:2008 Rule 5-0-5 */ - ulPkgDid = pst_data->did[i]; /* Get DID */ - ucGetMethod = VehicleSensGetSelectionItemList(ulPkgDid); /* Data collection way */ - if (VEHICLESENS_GETMETHOD_GPS < ucGetMethod) { - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, - "VEHICLESENS_DELIVERYCTRL: VehicleSensGetSelectionItemList error :%d\r\n", ucGetMethod); - } - - if ((ulPkgDid == POSHAL_DID_GYRO_EXT) || - (ulPkgDid == POSHAL_DID_GYRO_X) || - (ulPkgDid == POSHAL_DID_GYRO_Y) || - (ulPkgDid == POSHAL_DID_GYRO_Z) || - (ulPkgDid == POSHAL_DID_GSNS_X) || - (ulPkgDid == POSHAL_DID_GSNS_Y) || - (ulPkgDid == POSHAL_DID_GSNS_Z) || - (ulPkgDid == POSHAL_DID_SPEED_PULSE) || - (ulPkgDid == POSHAL_DID_REV) || - (ulPkgDid == POSHAL_DID_GYRO_TEMP) || - (ulPkgDid == POSHAL_DID_PULSE_TIME) || - (ulPkgDid == POSHAL_DID_SNS_COUNTER)) { - /* Store in the extended data master information buffer */ - VehicleSensGetDataMasterExt(ulPkgDid, ucGetMethod, &stExtDataTemp[i]); - /* Obtain the number of data items */ - if ((ulPkgDid == POSHAL_DID_SNS_COUNTER) || - (ulPkgDid == POSHAL_DID_REV)) { - usDataCnt[i] = stExtDataTemp[i].us_size; /* 1data 1byte */ - /* Store the transmission size for 10 items */ - usDivideSendSize[i] = 10; - } else if (ulPkgDid == POSHAL_DID_GYRO_TEMP) { - usDataCnt[i] = stExtDataTemp[i].us_size / 2; /* 1data 2byte */ - /* Store the transmission size for 10 items */ - usDivideSendSize[i] = 20; - } - else if (ulPkgDid == POSHAL_DID_PULSE_TIME) { // NOLINT(readability/braces) - usDataCnt[i] = stExtDataTemp[i].us_size / 132; /* 1data 132byte */ - /* Store the transmission size for 10 items */ - usDivideSendSize[i] = 1320; - } - else { // NOLINT(readability/braces) - usDataCnt[i] = stExtDataTemp[i].us_size / 2; /* 1data 2byte Ignore->MISRA-C++:2008 Rule 5-0-5 */ - /* Store the transmission size for 100 items */ - usDivideSendSize[i] = 200; - - // divide cnt is 100 - if (((usDataCnt[i] % VEHICLESENS_PKG_EXT_SEND_MAX_10DATA) > 0) || (usDataCnt[i] == 0)) { - ucDivide100Cnt = static_cast<u_int8>((usDataCnt[i] / VEHICLESENS_PKG_EXT_SEND_MAX_10DATA) + 1); - } else { - ucDivide100Cnt = static_cast<u_int8>(usDataCnt[i] / VEHICLESENS_PKG_EXT_SEND_MAX_10DATA); - } - } - } - } - /* All-data undelivered flag holding Ignore->MISRA-C ++: 2008 Rule 5-0-5 */ - ucDataBreak = static_cast<u_int8>(gstPkgTempExt.data_break); - - /* From the number of data items in the acquired buffer,Calculate the number of transmissions */ - /* Ignore->MISRA-C++:2008 Rule 5-0-5 */ - if (((usDataCnt[0] % VEHICLESENS_PKG_EXT_SEND_MAX) > 0) || (usDataCnt[0] == 0)) { - /* If there is a remainder,,Division result + 1 */ - /* Ignore->MISRA-C++:2008 Rule 5-0-5 */ - ucDivideCnt = static_cast<u_int8>((usDataCnt[0] / VEHICLESENS_PKG_EXT_SEND_MAX) + 1); - } else { - /* If there is no remainder,,The result of division is the total number of transmissions. */ - /* Ignore->MISRA-C++:2008 Rule 5-0-5 */ - ucDivideCnt = static_cast<u_int8>(usDataCnt[0] / VEHICLESENS_PKG_EXT_SEND_MAX); - } - - // if ucDivide100cnt is valid (greater than 0) - ucDivideCnt = (ucDivide100Cnt > 0) ? ucDivide100Cnt : ucDivideCnt; - - ucDivideSendCnt = 0; /* Number of divided transmissions */ - while (ucDivideSendCnt < ucDivideCnt) { - /* Clear send message buffer */ - (void)memset(reinterpret_cast<void *>(&stPkgMaster), 0, sizeof(SENSOR_PKG_MSG_VSINFO)); - usOffset = 0; - for (i = 0; i < pst_data->pkg_num; i++) { /* Ignore->MISRA-C++:2008 Rule 5-0-5 */ - ulPkgDid = pst_data->did[i]; /* Get DID */ - stPkgMaster.usOffset[i] = usOffset; /* Offset setting */ - /* copy Data ID of extended data master structure,Size of the data,Receive flag,Reserved */ - memcpy(reinterpret_cast<void *>(&stPkgMaster.ucData[usOffset]), - reinterpret_cast<void *>(&stExtDataTemp[i]), 11); - if ((ulPkgDid == POSHAL_DID_SNS_COUNTER) || - (ulPkgDid == POSHAL_DID_REV) || - (ulPkgDid == POSHAL_DID_PULSE_TIME) || - (ulPkgDid == POSHAL_DID_GYRO_TEMP)) { - if (usDataCnt[i] > VEHICLESENS_PKG_EXT_SEND_MAX) { /* Ignore->MISRA-C++:2008 Rule 5-0-5 */ - /* Calculate the data acquisition position */ - /* Ignore->MISRA-C++:2008 Rule 5-0-5 */ - ucDivideSendPoint = static_cast<u_int16>((u_int16)ucDivideSendCnt * usDivideSendSize[i]); - /* Update the data size*/ - /* Ignore->MISRA-C++:2008 Rule 5-0-5 */ - stPkgMaster.ucData[usOffset + 4] = (u_int8)usDivideSendSize[i]; - /* Ignore->MISRA-C++:2008 Rule 5-0-5 */ - stPkgMaster.ucData[usOffset + 5] = (u_int8)(usDivideSendSize[i] >> 8); - /* Create 10 divided transmission data of sensor counters of extended data master structure */ - memcpy(reinterpret_cast<void *>(&stPkgMaster.ucData[usOffset + 8]), - reinterpret_cast<void *>(&stExtDataTemp[i].uc_data[ucDivideSendPoint]), - usDivideSendSize[i]); /* Ignore->MISRA-C++:2008 Rule 5-0-5 */ - /* Subtract the number of created transmission data */ - /* Ignore->MISRA-C++:2008 Rule 5-0-5 */ - usDataCnt[i] = static_cast<u_int16>(usDataCnt[i] - VEHICLESENS_PKG_EXT_SEND_MAX); - } else { - /* Calculate the data acquisition position */ - /* Ignore->MISRA-C++:2008 Rule 5-0-5 */ - ucDivideSendPoint = static_cast<u_int16>((u_int16)ucDivideSendCnt * usDivideSendSize[i]); - /* Update the data size*/ - /* Ignore->MISRA-C++:2008 Rule 5-0-5 */ - stPkgMaster.ucData[usOffset + 4] = (u_int8)(stExtDataTemp[i].us_size - (u_int16)ucDivideSendPoint); - /* Ignore->MISRA-C++:2008 Rule 5-0-5 Ignore->MISRA-C++:2008 Rule 5-0-21 */ - stPkgMaster.ucData[usOffset + 5] = \ - (u_int8)((stExtDataTemp[i].us_size - (u_int16)ucDivideSendPoint) >> 8); - /* Create the remaining divided send data of sensor counter of extended data master structure */ - memcpy(reinterpret_cast<void *>(&stPkgMaster.ucData[usOffset + 8]), - reinterpret_cast<void *>(&stExtDataTemp[i].uc_data[ucDivideSendPoint]), - stExtDataTemp[i].us_size - ucDivideSendPoint); /* Ignore->MISRA-C++:2008 Rule 5-0-5 */ - /* Since all buffers have been created, the number of data is set to 0. */ - usDataCnt[i] = 0; - } - } else { - if (usDataCnt[i] > VEHICLESENS_PKG_EXT_SEND_MAX_10DATA) { /* Ignore->MISRA-C++:2008 Rule 5-0-5 */ - /* Calculate the data acquisition position */ - /* Ignore->MISRA-C++:2008 Rule 5-0-5 */ - ucDivideSendPoint = static_cast<u_int16>((u_int16)ucDivideSendCnt * usDivideSendSize[i]); - /* Update the data size*/ - /* Ignore->MISRA-C++:2008 Rule 5-0-5 */ - stPkgMaster.ucData[usOffset + 4] = (u_int8)usDivideSendSize[i]; - /* Ignore->MISRA-C++:2008 Rule 5-0-5 */ - stPkgMaster.ucData[usOffset + 5] = (u_int8)(usDivideSendSize[i] >> 8); - /* Create 100 divided transmission data of vehicle sensor data of extended data master structure */ - memcpy(reinterpret_cast<void *>(&stPkgMaster.ucData[usOffset + 8]), - reinterpret_cast<void *>(&stExtDataTemp[i].uc_data[ucDivideSendPoint]), - usDivideSendSize[i]); /* Ignore->MISRA-C++:2008 Rule 5-0-5 */ - /* Subtract the number of created transmission data */ - /* Ignore->MISRA-C++:2008 Rule 5-0-5 */ - usDataCnt[i] = static_cast<u_int16>(usDataCnt[i] - VEHICLESENS_PKG_EXT_SEND_MAX_10DATA); - } else { - /* Calculate the data acquisition position */ - /* Ignore->MISRA-C++:2008 Rule 5-0-5 */ - ucDivideSendPoint = static_cast<u_int16>((u_int16)ucDivideSendCnt * usDivideSendSize[i]); - /* Update the data size*/ - /* Ignore->MISRA-C++:2008 Rule 5-0-5 */ - stPkgMaster.ucData[usOffset + 4] = \ - (u_int8)(stExtDataTemp[i].us_size - (u_int16)ucDivideSendPoint); - /* Ignore->MISRA-C++:2008 Rule 5-0-5 Ignore->MISRA-C++:2008 Rule 5-0-21 */ - stPkgMaster.ucData[usOffset + 5] = \ - (u_int8)((stExtDataTemp[i].us_size - (u_int16)ucDivideSendPoint) >> 8); - /* Create the remaining divided transmission data of the vehicle sensor data of the extended data master structure. */ - memcpy(reinterpret_cast<void *>(&stPkgMaster.ucData[usOffset + 8]), - reinterpret_cast<void *>(&stExtDataTemp[i].uc_data[ucDivideSendPoint]), - stExtDataTemp[i].us_size - ucDivideSendPoint); /* Ignore->MISRA-C++:2008 Rule 5-0-5 */ - /* Since all buffers have been created, the number of data is set to 0. */ - usDataCnt[i] = 0; - } - } - /* Next offset calculation */ - /* Boundary adjustment of data size */ - usNextOffset = VehicleSensGetDataMasterExtOffset(ulPkgDid); - /* Ignore->MISRA-C++:2008 Rule 5-0-5 Ignore->MISRA-C++:2008 Rule 5-0-13, 5-0-14, 5-3-1 */ - if ((usNextOffset & usBoundaryAdj) != 0) { - /* If you need to adjust */ - /* Mask Lower Bit Ignore->MISRA-C++:2008 Rule 5-0-5 Ignore->MISRA-C++:2008 Rule 5-0-21 */ - usNextOffset = static_cast<u_int16>(usNextOffset & ~usBoundaryAdj); - usNextOffset = static_cast<u_int16>(usNextOffset + (u_int16)VEHICLESENS_BIT2); /* Add numbers */ - } - usOffset = static_cast<u_int16>(usOffset + usNextOffset); /* Ignore->MISRA-C++:2008 Rule 5-0-5 */ - } - stPkgMaster.ucDNum = pst_data->pkg_num; /* To save the number of data */ - stPkgMaster.ucDataBreak = ucDataBreak; /* Set all data undelivered flag */ - stPkgMaster.ucDivideCnt = ucDivideCnt; /* Set total number of partitions */ - /* Division number setting Ignore->MISRA-C++:2008 Rule 5-0-5 */ - stPkgMaster.ucDivideSendCnt = static_cast<uint8_t>(ucDivideSendCnt + 1); - ret = PosSndMsg(PNO_VEHICLE_SENSOR, - pst_data->pno, - CID_SENSOR_PKG_INFO, - (u_int16)sizeof(SENSOR_PKG_MSG_VSINFO), - (const void *)&stPkgMaster); - uc_result = SENSLOG_RES_SUCCESS; - if (ret != RET_NORMAL) { - uc_result = SENSLOG_RES_FAIL; - } - SensLogWriteOutputData(SENSLOG_DATA_O_SYS_PKG, 0, pst_data->pno, - reinterpret_cast<uint8_t *>(&stPkgMaster), - sizeof(SENSOR_PKG_MSG_VSINFO), uc_result); - - ucDivideSendCnt++; - - /* Package delivery (split) confirmation debug log output */ - FRAMEWORKUNIFIEDLOG(ZONE_INIT, __FUNCTION__, - "### SENS RECV # FST PKG DELIVERY : cnt[%d/7]", ucDivideSendCnt); - if (7 <= ucDivideSendCnt) { - FRAMEWORKUNIFIEDLOG(ZONE_INIT, __FUNCTION__, - "### SENS RECV # FST PKG DELIVERY : last sns_cnt[%d][%d][%d][%d]", - stPkgMaster.ucData[8], stPkgMaster.ucData[9], stPkgMaster.ucData[10], stPkgMaster.ucData[11]); - } - } - /* Ignore->MISRA-C++:2008 Rule 2-7-2 */ - - /* Internal debug log output */ - FRAMEWORKUNIFIEDLOG(ZONE_26, __FUNCTION__, "-"); -} -#endif - -/* ++ PastModel002 response DR */ - -/******************************************************************************* - * MODULE : VehicleSensEntryDeliveryCtrlDR - * ABSTRACT : Internal delivery destination management registration function for vehicle sensor DR - * FUNCTION : Internal distribution destination management table for DR,Update the shipping management table management. - * ARGUMENT : pst_delivery_entry : Pointer to the delivery registration information - * NOTE : - * RETURN : VEHICLE_RET_NORMAL :Successful registration - ******************************************************************************/ -VEHICLE_RET_API VehicleSensEntryDeliveryCtrlDR(const DEADRECKONING_MSG_DELIVERY_ENTRY *pst_delivery_entry) { // LCOV_EXCL_START 8 : dead code // NOLINT(whitespace/line_length) - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - int32 i; - u_int8 uc_action_type = VEHICLESENS_ACTION_TYPE_ADD; - int32 uc_did_flag; - DID ulentry_did = pst_delivery_entry->data.did; - VEHICLESENS_DELIVERY_CTRL_TBL_MNG_DATA *pst_existing_mng_data = NULL; - VEHICLE_RET_API ret = VEHICLE_RET_NORMAL; /* _CWORD71_:QAC++4020:Multiple exit points found. MISRA-C++ Rule 6-6-5 */ - - /* Check if the data ID exists. */ - uc_did_flag = VehicleSensCheckDid(ulentry_did); - if (uc_did_flag == 0) { - ret = VEHICLE_RET_ERROR_DID; /* _CWORD71_:QAC++4020:Multiple exit points found. MISRA-C++ Rule 6-6-5 */ - } - - /* Check the number of registered shipments. */ - if ((ret == VEHICLE_RET_NORMAL) &&/* _CWORD71_:QAC++4020:Multiple exit points found. MISRA-C++ Rule 6-6-5 */ - (g_stdelivery_ctrl_tbl_dr.us_dnum >= VEHICLESENS_DELIVERY_INFO_MAX)) { - /* Return the FULL of delivery registrations*/ - ret = VEHICLE_RET_ERROR_BUFFULL; /* _CWORD71_:QAC++4020:Multiple exit points found. MISRA-C++ Rule 6-6-5 */ - } - - if (ret == VEHICLE_RET_NORMAL) { /* _CWORD71_:QAC++4020:Multiple exit points found. MISRA-C++ Rule 6-6-5 */ - /* By searching for the delivery registration of the relevant DID,Hold the address. */ - for (i = 0; i < g_stdelivery_ctrl_tbl_mng_dr.us_dnum; i++) { - if (g_stdelivery_ctrl_tbl_mng_dr.st_ctrl_tbl_mng_data[i].ul_did == ulentry_did) { - uc_action_type = VEHICLESENS_ACTION_TYPE_UPDATE; - pst_existing_mng_data = &g_stdelivery_ctrl_tbl_mng_dr.st_ctrl_tbl_mng_data[i]; - } - } - - /* Add to the shipping management table.*/ - VehicleSensAddDeliveryCtrlTblDR(pst_delivery_entry); - /* Processing when updating existing data*/ - if (uc_action_type == VEHICLESENS_ACTION_TYPE_UPDATE) { - /* Update the shipping management table.*/ - VehicleSensUpdateDeliveryCtrlTblDR(pst_existing_mng_data); - - /* Update the shipping destination management table management information.*/ - VehicleSensUpdateDeliveryCtrlTblMngDR(pst_existing_mng_data); - } else { /* Newly added processing*/ - /* Add to the shipping management table management information.*/ - VehicleSensAddDeliveryCtrlTblMngDR(pst_delivery_entry); - } - } - return ret; /* _CWORD71_:QAC++4020:Multiple exit points found. MISRA-C++ Rule 6-6-5 */ -} -// LCOV_EXCL_STOP - -/******************************************************************************* -* MODULE : VehicleSensMakeDeliveryPnoTblDR -* ABSTRACT : Vehicle sensor internal delivery destination PNO table creation function for DR -* FUNCTION : Create an internal delivery destination PNO table for DR -* ARGUMENT : ul_did Data ID -* Change_type Delivery Trigger -* NOTE : -* RETURN : VEHICLESENS_DELIVERY_PNO_TBL* Pointer to the shipping PNO table -******************************************************************************/ -VEHICLESENS_DELIVERY_PNO_TBL* VehicleSensMakeDeliveryPnoTblDR(DID ul_did, u_int8 change_type) { // LCOV_EXCL_START 8 : dead code // NOLINT(whitespace/line_length) - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - int32 i; - u_int8 uc_ctrl_tbl_mng_data_list; - u_int16 us_index = 0; - u_int16 us_dnum = 0; - - /* Get the start index and count of the corresponding data ID. */ - uc_ctrl_tbl_mng_data_list = static_cast<u_int8>( - (sizeof(g_stdelivery_ctrl_tbl_mng_dr.st_ctrl_tbl_mng_data)) / - (sizeof(g_stdelivery_ctrl_tbl_mng_dr.st_ctrl_tbl_mng_data[0]))); - - for (i = 0; i < uc_ctrl_tbl_mng_data_list; i++) { - /* Stores the information of the corresponding DID.. */ - if (g_stdelivery_ctrl_tbl_mng_dr.st_ctrl_tbl_mng_data[i].ul_did == ul_did) { - us_index = g_stdelivery_ctrl_tbl_mng_dr.st_ctrl_tbl_mng_data[i].us_start_idx; - us_dnum = g_stdelivery_ctrl_tbl_mng_dr.st_ctrl_tbl_mng_data[i].usdlvry_entry_num; - break; - } - } - - /* Create a PNO list */ - (void)memset(reinterpret_cast<void *>(&g_stdelivery_pno_tbl_dr), - static_cast<int32>(0), - (size_t)sizeof(g_stdelivery_pno_tbl_dr)); - if (change_type == VEHICLESENS_CHGTYPE_CHG) { - /* Processing when delivery timing is changed*/ - for (i = 0; i < us_dnum; i++) { - /* Functionalization by Increasing Structure Members */ - VehicleSensAddPnoTblDR(us_index); - us_index = g_stdelivery_ctrl_tbl_dr.st_ctrl_data[us_index].us_link_idx; - } - } else { - /* Processing when delivery timing is update */ - for (i = 0; i < us_dnum; i++) { - if (VEHICLE_DELIVERY_TIMING_UPDATE == g_stdelivery_ctrl_tbl_dr.st_ctrl_data[us_index].uc_chg_type) { - /* Functionalization by Increasing Structure Members */ - VehicleSensAddPnoTblDR(us_index); - } - us_index = g_stdelivery_ctrl_tbl_dr.st_ctrl_data[us_index].us_link_idx; - } - } - - return(&g_stdelivery_pno_tbl_dr); -} -// LCOV_EXCL_STOP - -/******************************************************************************* -* MODULE : VehicleSensAddPnoTblDR -* ABSTRACT : Vehicle sensor DR internal delivery destination PNO table addition function -* FUNCTION : Add to the internal DR shipping destination PNO table. -* ARGUMENT : us_index : Index of the referenced destination management table -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensAddPnoTblDR(u_int16 us_index) { // LCOV_EXCL_START 8: dead code - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - u_int16 us_pno_tbl_idx; - - us_pno_tbl_idx = g_stdelivery_pno_tbl_dr.us_dnum; - g_stdelivery_pno_tbl_dr.st_pno_data[us_pno_tbl_idx].us_pno = \ - g_stdelivery_ctrl_tbl_dr.st_ctrl_data[us_index].us_pno; - g_stdelivery_pno_tbl_dr.st_pno_data[us_pno_tbl_idx].us_pkg_start_idx = \ - g_stdelivery_ctrl_tbl_dr.st_ctrl_data[us_index].us_pkg_start_idx; - g_stdelivery_pno_tbl_dr.st_pno_data[us_pno_tbl_idx].us_pkg_end_idx = \ - g_stdelivery_ctrl_tbl_dr.st_ctrl_data[us_index].us_pkg_end_idx; - g_stdelivery_pno_tbl_dr.st_pno_data[us_pno_tbl_idx].uc_method = \ - g_stdelivery_ctrl_tbl_dr.st_ctrl_data[us_index].uc_method; - g_stdelivery_pno_tbl_dr.us_dnum++; -} -// LCOV_EXCL_STOP - -/******************************************************************************* -* MODULE : VehicleSensAddDeliveryCtrlTblDR -* ABSTRACT : Vehicle sensor DR internal delivery destination management table addition function -* FUNCTION : Add to the DR internal shipping management table. -* ARGUMENT : *pst_delivery_entry : Pointer to the delivery registration information -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensAddDeliveryCtrlTblDR(const DEADRECKONING_MSG_DELIVERY_ENTRY *pst_delivery_entry) { // LCOV_EXCL_START 8: dead code // NOLINT(whitespace/line_length) - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - VEHICLESENS_DELIVERY_CTRL_TBL_DATA *pst_ctrl_data; - - pst_ctrl_data = &g_stdelivery_ctrl_tbl_dr.st_ctrl_data[g_stdelivery_ctrl_tbl_dr.us_dnum]; - pst_ctrl_data->ul_did = pst_delivery_entry->data.did; - pst_ctrl_data->us_pno = pst_delivery_entry->data.pno; - pst_ctrl_data->uc_chg_type = pst_delivery_entry->data.delivery_timing; - pst_ctrl_data->uc_ctrl_flg = pst_delivery_entry->data.ctrl_flg; - pst_ctrl_data->us_link_idx = VEHICLESENS_LINK_INDEX_END; - pst_ctrl_data->us_pkg_start_idx = VEHICLESENS_LINK_INDEX_END; - pst_ctrl_data->us_pkg_end_idx = VEHICLESENS_LINK_INDEX_END; - pst_ctrl_data->uc_method = VEHICLESENS_DELIVERY_METHOD_NORMAL; - g_stdelivery_ctrl_tbl_dr.us_dnum = static_cast<u_int16>(g_stdelivery_ctrl_tbl_dr.us_dnum + 1); -} -// LCOV_EXCL_STOP - -/******************************************************************************* -* MODULE : VehicleSensAddDeliveryCtrlTblMngDR -* ABSTRACT : Internal delivery destination management table management addition function for vehicle sensor DR -* FUNCTION : Add to the DR internal shipping management table management. -* ARGUMENT : *pst_delivery_entry : Pointer to the delivery registration information -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensAddDeliveryCtrlTblMngDR(const DEADRECKONING_MSG_DELIVERY_ENTRY *pst_delivery_entry) { // LCOV_EXCL_START 8: dead code // NOLINT(whitespace/line_length) - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - VEHICLESENS_DELIVERY_CTRL_TBL_MNG_DATA *pst_ctrl_mng_data; - - pst_ctrl_mng_data = &g_stdelivery_ctrl_tbl_mng_dr.st_ctrl_tbl_mng_data[g_stdelivery_ctrl_tbl_mng_dr.us_dnum]; - pst_ctrl_mng_data->ul_did = pst_delivery_entry->data.did; - pst_ctrl_mng_data->us_start_idx = static_cast<u_int16>(g_stdelivery_ctrl_tbl_dr.us_dnum - 1); - pst_ctrl_mng_data->us_end_idx = static_cast<u_int16>(g_stdelivery_ctrl_tbl_dr.us_dnum - 1); - pst_ctrl_mng_data->usdlvry_entry_num++; - g_stdelivery_ctrl_tbl_mng_dr.us_dnum++; -} -// LCOV_EXCL_STOP - -/******************************************************************************* - * MODULE : VehicleSensUpdateDeliveryCtrlTblMngDR - * ABSTRACT : Internal delivery destination management table management update function for vehicle sensor DR - * FUNCTION : Update the internal delivery destination management table management for DR. - * ARGUMENT : *pst_existing_mng_data : Pointer to the previous data information with the same data ID - * NOTE : - * RETURN : void - ******************************************************************************/ -void VehicleSensUpdateDeliveryCtrlTblMngDR(VEHICLESENS_DELIVERY_CTRL_TBL_MNG_DATA *pst_existing_mng_data) { // LCOV_EXCL_START 8: dead code // NOLINT(whitespace/line_length) - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - /* Update only the end index and the number of registered shipping destinations. */ - pst_existing_mng_data->us_end_idx = static_cast<u_int16>(g_stdelivery_ctrl_tbl_dr.us_dnum - 1); - pst_existing_mng_data->usdlvry_entry_num++; -} -// LCOV_EXCL_STOP - -/******************************************************************************* -* MODULE : VehicleSensUpdateDeliveryCtrlTblDR -* ABSTRACT : Vehicle sensor DR internal delivery destination management table update function -* FUNCTION : Update the internal distribution destination management table for DR. -* ARGUMENT : *pst_existing_mng_data : Pointer to the previous data information with the same data ID -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensUpdateDeliveryCtrlTblDR(VEHICLESENS_DELIVERY_CTRL_TBL_MNG_DATA *pst_existing_mng_data) { // LCOV_EXCL_START 8: dead code // NOLINT(whitespace/line_length) - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - /* Update Link Index Only. - For indexes of usEndIdx values matching the data IDs in the target management table - Making usLinkIdx an Index-Registered Index */ - g_stdelivery_ctrl_tbl_dr.st_ctrl_data[pst_existing_mng_data->us_end_idx].us_link_idx = - static_cast<u_int16>(g_stdelivery_ctrl_tbl_dr.us_dnum - 1); -} -// LCOV_EXCL_STOP - -/******************************************************************************* - * MODULE : VehicleSensDeliveryProcDR - * ABSTRACT : Internal Data Delivery Process for Vehicle Sensor DR - * FUNCTION : Deliver data to internal DR destinations. - * ARGUMENT : ul_did :Data ID - * uc_chg_type :Delivery timing - * uc_get_method :Acquisition method - * NOTE : - * RETURN : void - ******************************************************************************/ -void VehicleSensDeliveryProcDR(DID ul_did, u_int8 uc_chg_type, u_int8 uc_get_method) { - return; -} - -/** - * @brief - * Obtain dump info(g_stdelivery_ctrl_tbl) - * - * @param[out] pbuf Dump information - */ -void VehicleSensGetDebugDeliveryCtrlTbl(void* pbuf) { // LCOV_EXCL_START 7: uesd only in FrameworkunifiedOnDebugDump - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - static uint8_t buf[DEBUG_DUMP_MAX_SIZE]; - static uint8_t bufTmp[256]; - u_int16 i; - - memset(&buf, 0x00, sizeof(buf)); - snprintf(reinterpret_cast<char *>(&(buf)), - 32, - "Delivery-Tbl\n DNum:%d", g_stdelivery_ctrl_tbl.us_dnum); - for (i = 0; i < g_stdelivery_ctrl_tbl.us_dnum; i++) { - if (i >= 30) { - break; - } - memset(&bufTmp[0], 0x00, sizeof(bufTmp)); - snprintf(reinterpret_cast<char *>(&bufTmp[0]), sizeof(bufTmp), - "\n [%02d] did:0x%08x, pno:0x%04x, chgT:0x%02x, ctrlFg:0x%02x, "\ - "lnkidx:0x%04x, pkgSidx:0x%04x, pkgEidx:0x%04x, Mth:0x%02x", - i, - g_stdelivery_ctrl_tbl.st_ctrl_data[i].ul_did, - g_stdelivery_ctrl_tbl.st_ctrl_data[i].us_pno, - g_stdelivery_ctrl_tbl.st_ctrl_data[i].uc_chg_type, - g_stdelivery_ctrl_tbl.st_ctrl_data[i].uc_ctrl_flg, - g_stdelivery_ctrl_tbl.st_ctrl_data[i].us_link_idx, - g_stdelivery_ctrl_tbl.st_ctrl_data[i].us_pkg_start_idx, - g_stdelivery_ctrl_tbl.st_ctrl_data[i].us_pkg_end_idx, - g_stdelivery_ctrl_tbl.st_ctrl_data[i].uc_method); - _pb_strcat(reinterpret_cast<char *>(&buf[0]), reinterpret_cast<char *>(&bufTmp[0]), sizeof(bufTmp)); - } - memcpy(pbuf, &buf[0], sizeof(buf)); - return; -} -// LCOV_EXCL_STOP - -/** - * @brief - * Obtain dump info(g_stdelivery_ctrl_tbl_mng) - * - * @param[out] pbuf Dump information - */ -void VehicleSensGetDebugDeliveryCtrlTblMng(void* pbuf) { // LCOV_EXCL_START 7: uesd only in FrameworkunifiedOnDebugDump - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - static uint8_t buf[DEBUG_DUMP_MAX_SIZE]; - static uint8_t bufTmp[256]; - u_int16 i; - - memset(&buf, 0x00, sizeof(buf)); - snprintf(reinterpret_cast<char *>(&(buf)), - 32, - "Delivery-TblMng\n DNum:%d", - g_stdelivery_ctrl_tbl_mng.us_dnum); - for (i = 0; i < g_stdelivery_ctrl_tbl_mng.us_dnum; i++) { - if (i >= 60) { - break; - } - memset(&bufTmp[0], 0x00, sizeof(bufTmp)); - snprintf(reinterpret_cast<char *>(&bufTmp[0]), sizeof(bufTmp), - "\n [%02d] did:0x%08x, Sidx:0x%04x, Eidx:0x%04x, EntNum:0x%04x", - i, - g_stdelivery_ctrl_tbl_mng.st_ctrl_tbl_mng_data[i].ul_did, - g_stdelivery_ctrl_tbl_mng.st_ctrl_tbl_mng_data[i].us_start_idx, - g_stdelivery_ctrl_tbl_mng.st_ctrl_tbl_mng_data[i].us_end_idx, - g_stdelivery_ctrl_tbl_mng.st_ctrl_tbl_mng_data[i].usdlvry_entry_num); - _pb_strcat(reinterpret_cast<char *>(&buf[0]), reinterpret_cast<char *>(&bufTmp[0]), sizeof(bufTmp)); - } - memcpy(pbuf, &buf[0], sizeof(buf)); - return; -} -// LCOV_EXCL_STOP - -/** - * @brief - * Obtain dump info(g_stpkgdelivery_tbl_mng) - * - * @param[out] pbuf Dump information - */ -void VehicleSensGetDebugPkgDeliveryTblMng(void* pbuf) { // LCOV_EXCL_START 7: uesd only in FrameworkunifiedOnDebugDump - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - static uint8_t buf[DEBUG_DUMP_MAX_SIZE]; - static uint8_t bufTmp[256]; - u_int16 i; - - memset(&buf, 0x00, sizeof(buf)); - snprintf(reinterpret_cast<char *>(&(buf)), - 32, - "Delivery-PkgTblMng\n DNum:%d", - g_stpkgdelivery_tbl_mng.us_dnum); - for (i = 0; i < g_stpkgdelivery_tbl_mng.us_dnum; i++) { - if (i >= 100) { - break; - } - memset(&bufTmp[0], 0x00, sizeof(bufTmp)); - snprintf(reinterpret_cast<char *>(&bufTmp[0]), sizeof(bufTmp), - "\n [%02d] did:0x%08x, Didx:0x%04x", - i, - g_stpkgdelivery_tbl_mng.st_pkg_data[i].ul_did, - g_stpkgdelivery_tbl_mng.st_pkg_data[i].usdlvry_idx); - _pb_strcat(reinterpret_cast<char *>(&buf[0]), reinterpret_cast<char *>(&bufTmp[0]), sizeof(bufTmp)); - } - memcpy(pbuf, &buf[0], sizeof(buf)); - return; -} -// LCOV_EXCL_STOP - -/** - * @brief - * Obtain dump info(g_stdelivery_pno_tbl) - * - * @param[out] pbuf Dump information - */ -void VehicleSensGetDebugDeliveryPnoTbl(void* pbuf) { // LCOV_EXCL_START 7: uesd only in FrameworkunifiedOnDebugDump - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - static uint8_t buf[DEBUG_DUMP_MAX_SIZE]; - static uint8_t bufTmp[256]; - u_int16 i; - - memset(&buf, 0x00, sizeof(buf)); - snprintf(reinterpret_cast<char *>(&(buf)), - 32, - "Delivery-PnoTbl\n DNum:%d", - g_stdelivery_pno_tbl.us_dnum); - for (i = 0; i < g_stdelivery_pno_tbl.us_dnum; i++) { - if (i >= 60) { - break; - } - memset(&bufTmp[0], 0x00, sizeof(bufTmp)); - snprintf(reinterpret_cast<char *>(&bufTmp[0]), sizeof(bufTmp), - "\n [%02d] pno:0x%04x, pkgSidx:0x%04x, pkgEidx:0x%04x, Mth:0x%02x", - i, - g_stdelivery_pno_tbl.st_pno_data[i].us_pno, - g_stdelivery_pno_tbl.st_pno_data[i].us_pkg_start_idx, - g_stdelivery_pno_tbl.st_pno_data[i].us_pkg_end_idx, - g_stdelivery_pno_tbl.st_pno_data[i].uc_method); - _pb_strcat(reinterpret_cast<char *>(&buf[0]), reinterpret_cast<char *>(&bufTmp[0]), sizeof(bufTmp)); - } - memcpy(pbuf, &buf[0], sizeof(buf)); - return; -} -// LCOV_EXCL_STOP -/* -- PastModel002 support DR */ diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GPSInterruptFlag.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GPSInterruptFlag.cpp deleted file mode 100755 index eefbc51..0000000 --- a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GPSInterruptFlag.cpp +++ /dev/null @@ -1,105 +0,0 @@ -/* - * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/*************************************************************************** -@file VehicleSens_Did_GPSInterruptFlag.cpp -@detail Master vehicle sensor data(VEHICLE_DID_GPS_INTERRUPT_FLAG) -*****************************************************************************/ - -#include <vehicle_service/positioning_base_library.h> -#include "VehicleSens_DataMaster.h" - -/*************************************************/ -/* Global variable */ -/*************************************************/ -static VEHICLESENS_DATA_MASTER gstGpsInterruptFlag; // NOLINT(readability/nolint) - -/*************************************************************************** -@brief VehicleSensInitGpsInterruptFlag<BR> - Vehicle sensor SPEED_PULSE initialization function -@outline SPEED_PULSE_FLAG initialization process data master -@type Completion return type -@param[in] none -@threshold none -@return void -@retval none -@trace -*****************************************************************************/ -void VehicleSensInitGpsInterruptFlag(void) { - memset(&gstGpsInterruptFlag, 0x00, sizeof(VEHICLESENS_DATA_MASTER)); - gstGpsInterruptFlag.ul_did = POSHAL_DID_GPS_INTERRUPT_FLAG; - gstGpsInterruptFlag.us_size = VEHICLE_DSIZE_GPS_INTERRUPT_FLAG; - - gstGpsInterruptFlag.uc_data[0] = VEHICLE_DINIT_GPS_INTERRUPT_FLAG; -} - -/*************************************************************************** -@brief NAV-CLOCK SET vehicle sensor function -@outline To update the master data NAV-CLOCK. -@type Completion return type -@param[in] SENSOR_MSG_GPSDATA_DAT *pst_data : The pointer to GPS incoming message data -@threshold none -@return u_int8 -@retval VEHICLESENS_EQ : No data changes -@retval VEHICLESENS_NEQ : With data changes -@trace -*****************************************************************************/ -u_int8 VehicleSensSetGpsInterruptFlag(const LSDRV_LSDATA_G *pst_data) { // LCOV_EXCL_START 8: dead code. - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - u_int8 uc_ret; - VEHICLESENS_DATA_MASTER *pst_master; - - pst_master = &gstGpsInterruptFlag; - - /** Compare data master and received data */ - uc_ret = VehicleSensmemcmp(pst_master->uc_data, pst_data->uc_data, pst_data->uc_size); - - /** Received data is set in the data master. */ - pst_master->ul_did = pst_data->ul_did; - pst_master->us_size = pst_data->uc_size; - pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON; - pst_master->uc_snscnt = pst_data->uc_sns_cnt; - (void)memcpy(reinterpret_cast<void *>(pst_master->uc_data), - (const void *)(pst_data->uc_data), (size_t)(pst_data->uc_size)); - - return(uc_ret); -} - -/*************************************************************************** -@brief Vehicle sensor function NAV-CLOCK GET -@outline Master Data provides the NAV-CLOCK -@type Completion return type -@param[in] SENSOR_MSG_GPSDATA_DAT *pst_data : Where to get a pointer to the data master -@threshold none -@return void -@retval none -@trace -*****************************************************************************/ -void VehicleSensGetGpsInterruptFlag(VEHICLESENS_DATA_MASTER *pst_data) { - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - const VEHICLESENS_DATA_MASTER *pst_masterdata; - - pst_masterdata = &gstGpsInterruptFlag; - - /** Store the data master in the specified destination. */ - pst_data->ul_did = pst_masterdata->ul_did; - pst_data->us_size = pst_masterdata->us_size; - pst_data->uc_rcvflag = pst_masterdata->uc_rcvflag; - pst_data->uc_snscnt = pst_masterdata->uc_snscnt; - (void)memcpy(reinterpret_cast<void *>(pst_data->uc_data), - (const void *)(pst_masterdata->uc_data), (size_t)(pst_masterdata->us_size)); -} -// LCOV_EXCL_STOP diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GpsAntenna.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GpsAntenna.cpp deleted file mode 100755 index bbf4965..0000000 --- a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GpsAntenna.cpp +++ /dev/null @@ -1,58 +0,0 @@ -/* - * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/******************************************************************************* - * File name :VehicleSens_Did_GpsAntenna.cpp - * System name :_CWORD107_ - * Subsystem name :Vehicle sensor process - * Program name :Vehicle sensor data master(VEHICLE_DID_GPS_ANTENNA) - * Module configuration :VehicleSensGetGpsAntenna() Vehicle Sensor GPS_ANTENNA GET Function - ******************************************************************************/ - -#include <vehicle_service/positioning_base_library.h> -#include "VehicleSens_DataMaster.h" - -/*************************************************/ -/* Global variable */ -/*************************************************/ - -/******************************************************************************* -* MODULE : VehicleSensGetGpsAntenna -* ABSTRACT : Vehicle sensor GPS_ANTENNA GET function -* FUNCTION : Provide the GPS_ANTENNA data master -* ARGUMENT : *pst_data : Pointer to the data master acquisition destination -* uc_get_method : Acquisition method(Direct Line or CAN) -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensGetGpsAntenna(VEHICLESENS_DATA_MASTER *pst_data, u_int8 uc_get_method) { - switch (uc_get_method) { // LCOV_EXCL_BR_LINE 6:VEHICLESENS_GETMETHOD_CAN cannot to pass in - case VEHICLESENS_GETMETHOD_CAN: - { - /* When acquiring from CAN data */ - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - break; // LCOV_EXCL_LINE 8: dead code - } - case VEHICLESENS_GETMETHOD_LINE: - { - /* To acquire from LineSensor */ - VehicleSensGetGpsAntennal(pst_data); - break; - } - default: /* Ignore->MISRA-C++:2008 Rule 6-3-1, 6-4-1 */ - break; - } -} diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GpsAntennaStatus.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GpsAntennaStatus.cpp deleted file mode 100755 index dc950cc..0000000 --- a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GpsAntennaStatus.cpp +++ /dev/null @@ -1,112 +0,0 @@ -/* - * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/******************************************************************************* - * File name :VehicleSens_Did_GpsAntennaStatus.cpp - * System name :PastModel002 - * Subsystem name :Vehicle sensor process - * Program name :Vehicle sensor data master(VEHICLE_DID_GPS_ANTENNA) - * Module configuration :VehicleSensInitGpsAntennaStatus() Vehicle sensor GPS_ANTENNA_STATUS initialization function - * :VehicleSensSetGpsAntennaStatus() Vehicle sensor GPS_ANTENNA_STATUS SET function - * :VehicleSensGetGpsAntennaStatus() Vehicle sensor GPS_ANTENNA_STATUS GET function - ******************************************************************************/ - -#include <vehicle_service/positioning_base_library.h> -#include "VehicleSens_DataMaster.h" - -/*************************************************/ -/* Global variable */ -/*************************************************/ -static VEHICLESENS_DATA_MASTER_GPS_ANTENNA_STATUS gstGpsAntennaStatus; // NOLINT(readability/nolint) - -/******************************************************************************* -* MODULE : VehicleSensInitGpsAntennaStatus -* ABSTRACT : Vehicle sensor GPS_ANTENNA_STATUS initialization function -* FUNCTION : GPS_ANTENNA_STATUS data master initialization processing -* ARGUMENT : void -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensInitGpsAntennaStatus(void) { - (void)memset(reinterpret_cast<void *>(&gstGpsAntennaStatus), 0, sizeof(gstGpsAntennaStatus)); - gstGpsAntennaStatus.ul_did = POSHAL_DID_GPS_ANTENNA; - gstGpsAntennaStatus.us_size = VEHICLE_DSIZE_GPS_ANTENNA; - gstGpsAntennaStatus.uc_rcvflag = VEHICLE_RCVFLAG_OFF; - gstGpsAntennaStatus.uc_sensor_cnt = 0U; - gstGpsAntennaStatus.uc_data = VEHICLE_DINIT_GPS_ANTENNA; -} - -/******************************************************************************* -* MODULE : VehicleSensSetGpsAntennaStatus -* ABSTRACT : Vehicle sensor GPS_ANTENNA_STATUS SET function -* FUNCTION : Update the GPS_ANTENNA_STATUS data master -* ARGUMENT : *pst_data : Pointer to received message data -* NOTE : -* RETURN : VEHICLESENS_EQ : No data change -* : VEHICLESENS_NEQ : Data change -******************************************************************************/ -u_int8 VehicleSensSetGpsAntennaStatus(const LSDRV_MSG_LSDATA_DAT_GPS_ANTENNA_STATUS *pst_data) { // LCOV_EXCL_START 8: dead code // NOLINT(whitespace/line_length) - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - u_int8 uc_ret = VEHICLESENS_EQ; - VEHICLESENS_DATA_MASTER_GPS_ANTENNA_STATUS *pst_master; - - if (pst_data == NULL) { - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "pst_data == NULL\r\n"); - } else { - pst_master = &gstGpsAntennaStatus; - - /* Compare data master and received data */ - uc_ret = VehicleSensmemcmp(reinterpret_cast<void *>(&(pst_master->uc_data)), - (const void *)(&(pst_data->uc_data)), (size_t)(pst_data->uc_size)); - - /* Received data is set in the data master. */ - pst_master->ul_did = pst_data->ul_did; - pst_master->us_size = (u_int16)pst_data->uc_size; - pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON; - pst_master->uc_sensor_cnt = pst_data->uc_sns_cnt; - (void)memcpy(reinterpret_cast<void *>(&(pst_master->uc_data)), - (const void *)(&(pst_data->uc_data)), sizeof(pst_master->uc_data)); - } - return(uc_ret); -} -// LCOV_EXCL_STOP - -/******************************************************************************* -* MODULE : VehicleSensGetGpsAntennaStatus -* ABSTRACT : Vehicle sensor GPS_ANTENNA_STATUS GET function -* FUNCTION : Provide the GPS_ANTENNA_STATUS data master -* ARGUMENT : *pst_data : Pointer to the data master acquisition destination -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensGetGpsAntennaStatus(VEHICLESENS_DATA_MASTER_GPS_ANTENNA_STATUS *pst_data) { // LCOV_EXCL_START 8: dead code // NOLINT(whitespace/line_length) - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - const VEHICLESENS_DATA_MASTER_GPS_ANTENNA_STATUS *pst_master; - if (pst_data == NULL) { - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "pst_data == NULL\r\n"); - } else { - pst_master = &gstGpsAntennaStatus; - - /* Store the data master in the specified destination. */ - pst_data->ul_did = pst_master->ul_did; - pst_data->us_size = pst_master->us_size; - pst_data->uc_rcvflag = pst_master->uc_rcvflag; - pst_data->uc_sensor_cnt = pst_master->uc_sensor_cnt; - (void)memcpy(reinterpret_cast<void *>(&(pst_data->uc_data)), - (const void *)(&(pst_master->uc_data)), sizeof(pst_data->uc_data)); - } -} -// LCOV_EXCL_STOP diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GpsAntenna_l.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GpsAntenna_l.cpp deleted file mode 100755 index 00db159..0000000 --- a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GpsAntenna_l.cpp +++ /dev/null @@ -1,97 +0,0 @@ -/* - * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/******************************************************************************* - * File name :VehicleSens_Did_GpsAntenna_l.cpp - * System name :_CWORD107_ - * Subsystem name :Vehicle sensor process - * Program name :Vehicle sensor data master(VEHICLE_DID_GPS_ANTENNA) - * Module configuration :VehicleSensInitGpsAntennal() Vehicle sensor GPS_ANTENNA initialization function - * :VehicleSensSetGpsAntennal() Vehicle Sensor GPS_ANTENNA SET Function - * :VehicleSensGetGpsAntennal() Vehicle Sensor GPS_ANTENNA GET Function - ******************************************************************************/ - -#include <vehicle_service/positioning_base_library.h> -#include "VehicleSens_DataMaster.h" - -/*************************************************/ -/* Global variable */ -/*************************************************/ -static VEHICLESENS_DATA_MASTER gstGpsAntenna_l; // NOLINT(readability/nolint) - -/******************************************************************************* -* MODULE : VehicleSensInitGpsAntennal -* ABSTRACT : Vehicle sensor GPS_ANTENNA initialization function -* FUNCTION : GPS_ANTENNA data master initialization processing -* ARGUMENT : void -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensInitGpsAntennal(void) { - memset(&gstGpsAntenna_l, 0x00, sizeof(VEHICLESENS_DATA_MASTER)); - gstGpsAntenna_l.ul_did = POSHAL_DID_GPS_ANTENNA; - gstGpsAntenna_l.us_size = VEHICLE_DSIZE_GPS_ANTENNA; - gstGpsAntenna_l.uc_data[0] = VEHICLE_DINIT_GPS_ANTENNA; -} - -/******************************************************************************* -* MODULE : VehicleSensSetGpsAntennal -* ABSTRACT : Vehicle Sensor GPS_ANTENNA SET Function -* FUNCTION : Update the GPS_ANTENNA data master -* ARGUMENT : *pst_data : Pointer to the message data received by the direct line -* NOTE : -* RETURN : VEHICLESENS_EQ : No data change -* VEHICLESENS_NEQ : Data change -******************************************************************************/ -u_int8 VehicleSensSetGpsAntennal(const LSDRV_LSDATA *pst_data) { - u_int8 uc_ret; - VEHICLESENS_DATA_MASTER *pst_master; - - pst_master = &gstGpsAntenna_l; - - /* Compare data master and received data */ - /* Ignore->MISRA-C++:2008 Rule 5-0-5 */ - uc_ret = VehicleSensmemcmp(pst_master->uc_data, pst_data->uc_data, pst_data->uc_size); - - /* Received data is set in the data master. */ - pst_master->ul_did = pst_data->ul_did; - pst_master->us_size = pst_data->uc_size; /* Ignore->MISRA-C++:2008 Rule 5-0-5 */ - pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON; - memset(pst_master->uc_data, 0x00, sizeof(pst_master->uc_data)); - memcpy(pst_master->uc_data, pst_data->uc_data, pst_data->uc_size); /* Ignore->MISRA-C++:2008 Rule 5-0-5 */ - - return(uc_ret); -} - -/******************************************************************************* -* MODULE : VehicleSensGetGpsAntennal -* ABSTRACT : Vehicle Sensor GPS_ANTENNA GET Function -* FUNCTION : Provide the GPS_ANTENNA data master -* ARGUMENT : *pst_data : Pointer to the data master acquisition destination -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensGetGpsAntennal(VEHICLESENS_DATA_MASTER *pst_data) { - const VEHICLESENS_DATA_MASTER *pst_master; - - pst_master = &gstGpsAntenna_l; - - /* Store the data master in the specified destination. */ - pst_data->ul_did = pst_master->ul_did; - pst_data->us_size = pst_master->us_size; - pst_data->uc_rcvflag = pst_master->uc_rcvflag; - memcpy(pst_data->uc_data, pst_master->uc_data, pst_master->us_size); /* Ignore->MISRA-C++:2008 Rule 5-0-5 */ -} diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GpsClockDrift.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GpsClockDrift.cpp deleted file mode 100755 index 955e161..0000000 --- a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GpsClockDrift.cpp +++ /dev/null @@ -1,51 +0,0 @@ -/* - * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @file - * VehicleSens_Did_GpsClockDrift.cpp - * @brief - */ - -/*---------------------------------------------------------------------------------* - * Include Files * - *---------------------------------------------------------------------------------*/ -#include <vehicle_service/positioning_base_library.h> -#include "VehicleSens_DataMaster.h" - -/*---------------------------------------------------------------------------------* - * Function * - *---------------------------------------------------------------------------------*/ -/** - * @brief - * GPS clock drift data master GET processing - * - * @param[out] SENSOR_MSG_GPSDATA_DAT* - * @param[in] u_int8 - */ -void VehicleSensGetGpsClockDrift(SENSOR_MSG_GPSDATA_DAT *pst_data, u_int8 uc_get_method) { - switch (uc_get_method) { - case VEHICLESENS_GETMETHOD_GPS: - { - /** To acquire from GPS */ - VehicleSensGetGpsClockDriftG(pst_data); - break; - } - - default: /* Ignore->MISRA-C++:2008 Rule 6-3-1, 6-4-1 */ - break; - } -} diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GpsClockDrift_g.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GpsClockDrift_g.cpp deleted file mode 100755 index ecfbb4f..0000000 --- a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GpsClockDrift_g.cpp +++ /dev/null @@ -1,102 +0,0 @@ -/* - * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @file - * VehicleSens_Did_GpsClockDrift_g.cpp - * @brief - */ - -/*---------------------------------------------------------------------------------* - * Include Files * - *---------------------------------------------------------------------------------*/ -#include <vehicle_service/positioning_base_library.h> -#include "VehicleSens_DataMaster.h" - -/*---------------------------------------------------------------------------------* - * Global Value * - *---------------------------------------------------------------------------------*/ -static VEHICLESENS_DATA_MASTER gGpsClockDrift_g; // NOLINT(readability/nolint) - -/*---------------------------------------------------------------------------------* - * Function * - *---------------------------------------------------------------------------------*/ -/** - * @brief - * GPS clock drift data master initialization process - */ -void VehicleSensInitGpsClockDriftG(void) { - int32_t l_gps_clock_drift; - - memset(&gGpsClockDrift_g, 0x00, sizeof(VEHICLESENS_DATA_MASTER)); - - /** Data ID setting */ - gGpsClockDrift_g.ul_did = POSHAL_DID_GPS_CLOCK_DRIFT; - /** Data size setting */ - gGpsClockDrift_g.us_size = sizeof(int32_t); - /** Data content setting */ - l_gps_clock_drift = 0xFFFFFFFF; - memcpy(&gGpsClockDrift_g.uc_data[0], &l_gps_clock_drift, sizeof(l_gps_clock_drift)); - - return; -} - -/** - * @brief - * GPS clock drift data master SET process - * - * @param[in] int32_t* - * - * @return u_int8 - */ -u_int8 VehicleSensSetGpsClockDriftG(const int32_t *p_data) { - u_int8 uc_ret; - VEHICLESENS_DATA_MASTER *pst_master; - - pst_master = &gGpsClockDrift_g; - - /** With the contents of the current data master,Compare received data */ - uc_ret = VehicleSensmemcmp(pst_master->uc_data, p_data, sizeof(int32_t)); - - /** Received data is set in the data master. */ - pst_master->ul_did = POSHAL_DID_GPS_CLOCK_DRIFT; - pst_master->us_size = sizeof(int32_t); - pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON; - memset(pst_master->uc_data, 0x00, sizeof(pst_master->uc_data)); - memcpy(pst_master->uc_data, p_data, sizeof(int32_t)); - - return(uc_ret); -} - -/** - * @brief - * GPS clock drift data master GET processing - * - * @param[out] SENSOR_MSG_GPSDATA_DAT* - */ -void VehicleSensGetGpsClockDriftG(SENSOR_MSG_GPSDATA_DAT *pst_data) { - const VEHICLESENS_DATA_MASTER *pst_master; - - pst_master = &gGpsClockDrift_g; - - /* Store the data master in the specified destination. */ - pst_data->ul_did = pst_master->ul_did; - pst_data->us_size = pst_master->us_size; - pst_data->uc_rcv_flag = pst_master->uc_rcvflag; - memcpy(pst_data->uc_data, pst_master->uc_data, pst_master->us_size); - - return; -} diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GpsClockFreq.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GpsClockFreq.cpp deleted file mode 100755 index 39fac42..0000000 --- a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GpsClockFreq.cpp +++ /dev/null @@ -1,51 +0,0 @@ -/* - * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @file - * VehicleSens_Did_GpsClockFreq.cpp - * @brief - */ - -/*---------------------------------------------------------------------------------* - * Include Files * - *---------------------------------------------------------------------------------*/ -#include <vehicle_service/positioning_base_library.h> -#include "VehicleSens_DataMaster.h" - -/*---------------------------------------------------------------------------------* - * Function * - *---------------------------------------------------------------------------------*/ -/** - * @brief - * GPS clock frequency data master GET processing - * - * @param[out] SENSOR_MSG_GPSDATA_DAT* - * @param[in] u_int8 - */ -void VehicleSensGetGpsClockFreq(SENSOR_MSG_GPSDATA_DAT *pst_data, u_int8 uc_get_method) { - switch (uc_get_method) { - case VEHICLESENS_GETMETHOD_GPS: - { - /** To acquire from GPS */ - VehicleSensGetGpsClockFreqG(pst_data); - break; - } - - default: /* Ignore->MISRA-C++:2008 Rule 6-3-1, 6-4-1 */ - break; - } -} diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GpsClockFreq_g.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GpsClockFreq_g.cpp deleted file mode 100755 index 85cbdd6..0000000 --- a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GpsClockFreq_g.cpp +++ /dev/null @@ -1,102 +0,0 @@ -/* - * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @file - * VehicleSens_Did_GpsClockFreq_g.cpp - * @brief - */ - -/*---------------------------------------------------------------------------------* - * Include Files * - *---------------------------------------------------------------------------------*/ -#include <vehicle_service/positioning_base_library.h> -#include "VehicleSens_DataMaster.h" - -/*---------------------------------------------------------------------------------* - * Global Value * - *---------------------------------------------------------------------------------*/ -static VEHICLESENS_DATA_MASTER gGpsClockFreq_g; // NOLINT(readability/nolint) - -/*---------------------------------------------------------------------------------* - * Function * - *---------------------------------------------------------------------------------*/ -/** - * @brief - * Initialization of GPS clock frequency data master - */ -void VehicleSensInitGpsClockFreqG(void) { - uint32_t ul_gps_clock_freq; - - memset(&gGpsClockFreq_g, 0x00, sizeof(VEHICLESENS_DATA_MASTER)); - - /** Data ID setting */ - gGpsClockFreq_g.ul_did = POSHAL_DID_GPS_CLOCK_FREQ; - /** Data size setting */ - gGpsClockFreq_g.us_size = sizeof(uint32_t); - /** Data content setting */ - ul_gps_clock_freq = 0xFFFFFFFF; - memcpy(&gGpsClockFreq_g.uc_data[0], &ul_gps_clock_freq, sizeof(ul_gps_clock_freq)); - - return; -} - -/** - * @brief - * GPS clock frequency data master SET process - * - * @param[in] uint32_t* - * - * @return u_int8 - */ -u_int8 VehicleSensSetGpsClockFreqG(const uint32_t *p_data) { - u_int8 uc_ret; - VEHICLESENS_DATA_MASTER *pst_master; - - pst_master = &gGpsClockFreq_g; - - /** With the contents of the current data master,Compare received data */ - uc_ret = VehicleSensmemcmp(pst_master->uc_data, p_data, sizeof(uint32_t)); - - /** Received data is set in the data master. */ - pst_master->ul_did = POSHAL_DID_GPS_CLOCK_FREQ; - pst_master->us_size = sizeof(uint32_t); - pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON; - memset(pst_master->uc_data, 0x00, sizeof(pst_master->uc_data)); - memcpy(pst_master->uc_data, p_data, sizeof(uint32_t)); - - return(uc_ret); -} - -/** - * @brief - * GPS clock frequency data master GET processing - * - * @param[out] SENSOR_MSG_GPSDATA_DAT* - */ -void VehicleSensGetGpsClockFreqG(SENSOR_MSG_GPSDATA_DAT *pst_data) { - const VEHICLESENS_DATA_MASTER *pst_master; - - pst_master = &gGpsClockFreq_g; - - /* Store the data master in the specified destination. */ - pst_data->ul_did = pst_master->ul_did; - pst_data->us_size = pst_master->us_size; - pst_data->uc_rcv_flag = pst_master->uc_rcvflag; - memcpy(pst_data->uc_data, pst_master->uc_data, pst_master->us_size); - - return; -} diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GpsCounter_g.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GpsCounter_g.cpp deleted file mode 100755 index d4aba14..0000000 --- a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GpsCounter_g.cpp +++ /dev/null @@ -1,98 +0,0 @@ -/* - * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/******************************************************************************* - * File name :VehicleSens_Did_GpsCounter_g.cpp - * System name :_CWORD107_ - * Subsystem name :Vehicle sensor process - * Program name :Vehicle sensor data master(VEHICLE_DID_GPS_COUNTER) - * Module configuration :VehicleSensInitGpsCounterg() Vehicle sensor GPS_COUNTER initialization function - * :VehicleSensSetGpsCounterg() Vehicle Sensor GPS_COUNTER SET Function - * :VehicleSensGetGpsCounterg() Vehicle Sensor GPS_COUNTER GET Function - ******************************************************************************/ - -#include <vehicle_service/positioning_base_library.h> -#include "VehicleSens_DataMaster.h" - -/*************************************************/ -/* Global variable */ -/*************************************************/ -static VEHICLESENS_DATA_MASTER gstGpsCounter_g; // NOLINT(readability/nolint) - -/******************************************************************************* -* MODULE : VehicleSensInitGpsCounterg -* ABSTRACT : Vehicle sensor GPS_COUNTER initialization function -* FUNCTION : GPS_COUNTER data master initialization process -* ARGUMENT : void -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensInitGpsCounterg(void) { - memset(&gstGpsCounter_g, 0x00, sizeof(VEHICLESENS_DATA_MASTER)); - gstGpsCounter_g.ul_did = VEHICLE_DID_GPS_COUNTER; - gstGpsCounter_g.us_size = VEHICLE_DSIZE_GPS_COUNTER; - gstGpsCounter_g.uc_data[0] = VEHICLE_DINIT_GPS_COUNTER; -} - -/******************************************************************************* -* MODULE : VehicleSensSetGpsCounterg -* ABSTRACT : Vehicle Sensor GPS_COUNTER SET Function -* FUNCTION : Update the GPS_COUNTER data master -* ARGUMENT : *pst_data : Pointer to CAN received message data -* NOTE : -* RETURN : VEHICLESENS_EQ : No data change -* VEHICLESENS_NEQ : Data change -******************************************************************************/ -u_int8 VehicleSensSetGpsCounterg(const SENSOR_MSG_GPSDATA_DAT *pst_data) { // LCOV_EXCL_START 8: dead code - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - u_int8 uc_ret; - VEHICLESENS_DATA_MASTER *pst_master; - - pst_master = &gstGpsCounter_g; - - /* Compare data master and received data */ - uc_ret = VehicleSensmemcmp(pst_master->uc_data, pst_data->uc_data, pst_data->us_size); - - /* Received data is set in the data master. */ - pst_master->ul_did = pst_data->ul_did; - pst_master->us_size = (u_int8)pst_data->us_size; - pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON; - memcpy(pst_master->uc_data, pst_data->uc_data, pst_data->us_size); - - return(uc_ret); -} - -/******************************************************************************* -* MODULE : VehicleSensGetGpsCounterg -* ABSTRACT : Vehicle Sensor GPS_COUNTER GET Function -* FUNCTION : Provide the GPS_COUNTER data master -* ARGUMENT : *pst_data : Pointer to the data master acquisition destination -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensGetGpsCounterg(SENSOR_MSG_GPSDATA_DAT *pst_data) { - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - const VEHICLESENS_DATA_MASTER *pst_master; - - pst_master = &gstGpsCounter_g; - - /* Store the data master in the specified destination. */ - pst_data->ul_did = pst_master->ul_did; - pst_data->us_size = pst_master->us_size; - pst_data->uc_rcv_flag = pst_master->uc_rcvflag; - memcpy(pst_data->uc_data, pst_master->uc_data, pst_master->us_size); -} -// LCOV_EXCL_STOP diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GpsNmea_g.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GpsNmea_g.cpp deleted file mode 100755 index a7b733e..0000000 --- a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GpsNmea_g.cpp +++ /dev/null @@ -1,89 +0,0 @@ -/* - * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @file - * VehicleSens_Did_GpsNmea_g.cpp - * @brief - */ - -/*---------------------------------------------------------------------------------* - * Include Files - *---------------------------------------------------------------------------------*/ - -#include <vehicle_service/positioning_base_library.h> -#include "VehicleSens_DataMaster.h" -#include "gps_hal.h" - -/*---------------------------------------------------------------------------------* - * Global Value - *---------------------------------------------------------------------------------*/ -static VEHICLESENS_DATA_MASTER_GPS_FORMAT gstGpsNmea_g; // NOLINT(readability/nolint) - -/** - * @brief - * Vehicle sensor GPS_NMEA initialization processing - */ -void VehicleSensInitGpsNmeaG(void) { - memset(&gstGpsNmea_g, 0x00, sizeof(VEHICLESENS_DATA_MASTER_GPS_FORMAT)); - gstGpsNmea_g.ul_did = POSHAL_DID_GPS_NMEA; - gstGpsNmea_g.us_size = VEHICLE_DSIZE_GPS_FORMAT; -} - -/** - * @brief - * Vehicle sensor GPS_NMEA SET processing - * - * @param[in] Pointer to received message data - * - * @return VEHICLESENS_EQ No data change<BR> - * VEHICLESENS_NEQ Data change - */ -u_int8 VehicleSensSetGpsNmeaG(const SENSOR_MSG_GPSDATA_DAT *pst_data) { - u_int8 uc_ret; - VEHICLESENS_DATA_MASTER_GPS_FORMAT *pst_master; - - pst_master = &gstGpsNmea_g; - - /* Compare data master and received data */ - uc_ret = VehicleSensmemcmp(pst_master->uc_data, pst_data->uc_data, pst_data->us_size); - - /* Received data is set in the data master. */ - pst_master->ul_did = pst_data->ul_did; - pst_master->us_size = pst_data->us_size; - pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON; - memcpy(pst_master->uc_data, pst_data->uc_data, pst_data->us_size); - - return(uc_ret); -} - -/** - * @brief - * Vehicle sensor GPS_NMEA GET processing - * - * @param[out] pst_data Pointer to the data master acquisition destination - */ -void VehicleSensGetGpsNmeaG(SENSOR_MSG_GPSDATA_DAT *pst_data) { - const VEHICLESENS_DATA_MASTER_GPS_FORMAT *pst_master; - - pst_master = &gstGpsNmea_g; - - /* Store the data master in the specified destination. */ - pst_data->ul_did = pst_master->ul_did; - pst_data->us_size = pst_master->us_size; - pst_data->uc_rcv_flag = pst_master->uc_rcvflag; - memcpy(pst_data->uc_data, pst_master->uc_data, pst_master->us_size); /* Ignore->MISRA-C++:2008 Rule 5-0-5 */ -} diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GpsTime.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GpsTime.cpp deleted file mode 100755 index 8c23e3e..0000000 --- a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GpsTime.cpp +++ /dev/null @@ -1,53 +0,0 @@ -/* - * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @file - * VehicleSens_Did_GpsTime.cpp - * @brief - */ - -/*---------------------------------------------------------------------------------* - * Include Files * - *---------------------------------------------------------------------------------*/ -#include <vehicle_service/positioning_base_library.h> -#include "VehicleSens_DataMaster.h" - -/*---------------------------------------------------------------------------------* - * Function * - *---------------------------------------------------------------------------------*/ -/** - * @brief - * GPS time information data master GET processing - * - * @param[out] VEHICLESENS_DATA_MASTER* - * @param[in] u_int8 - */ -void VehicleSensGetGpsTime(SENSOR_MSG_GPSDATA_DAT *pst_data, u_int8 uc_get_method) { // LCOV_EXCL_START 7: uesd only in FrameworkunifiedOnDebugDump // NOLINT(whitespace/line_length) - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - switch (uc_get_method) { - case VEHICLESENS_GETMETHOD_GPS: - { - /** To acquire from GPSorNAVI */ - VehicleSensGetGpsTimeG(pst_data); - break; - } - - default: /* Ignore->MISRA-C++:2008 Rule 6-3-1, 6-4-1 */ - break; - } -} -// LCOV_EXCL_STOP diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GpsTimeRaw.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GpsTimeRaw.cpp deleted file mode 100755 index 9637b72..0000000 --- a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GpsTimeRaw.cpp +++ /dev/null @@ -1,51 +0,0 @@ -/* - * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @file - * VehicleSens_Did_GpsTimeRaw.cpp - * @brief - */ - -/*---------------------------------------------------------------------------------* - * Include Files * - *---------------------------------------------------------------------------------*/ -#include <vehicle_service/positioning_base_library.h> -#include "VehicleSens_DataMaster.h" - -/*---------------------------------------------------------------------------------* - * Function * - *---------------------------------------------------------------------------------*/ -/** - * @brief - * Raw GPS time information data master GET processing - * - * @param[out] VEHICLESENS_DATA_MASTER* - * @param[in] u_int8 - */ -void VehicleSensGetGpsTimeRaw(SENSOR_MSG_GPSDATA_DAT *pst_data, u_int8 uc_get_method) { - switch (uc_get_method) { - case VEHICLESENS_GETMETHOD_GPS: - { - /** To acquire from GPS */ - VehicleSensGetGpsTimeRawG(pst_data); - break; - } - - default: /* Ignore->MISRA-C++:2008 Rule 6-3-1, 6-4-1 */ - break; - } -} diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GpsTimeRaw_g.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GpsTimeRaw_g.cpp deleted file mode 100755 index 52cda83..0000000 --- a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GpsTimeRaw_g.cpp +++ /dev/null @@ -1,107 +0,0 @@ -/* - * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @file - * VehicleSens_Did_GpsTimeRaw_g.cpp - * @brief - */ - -/*---------------------------------------------------------------------------------* - * Include Files * - *---------------------------------------------------------------------------------*/ -#include <vehicle_service/positioning_base_library.h> -#include "VehicleSens_DataMaster.h" - -/*---------------------------------------------------------------------------------* - * Global Value * - *---------------------------------------------------------------------------------*/ -static VEHICLESENS_DATA_MASTER gstGpsTimeRaw_g; // NOLINT(readability/nolint) - -/*---------------------------------------------------------------------------------* - * Function * - *---------------------------------------------------------------------------------*/ -/** - * @brief - * GPS time information data master initialization processing - */ -void VehicleSensInitGpsTimeRawG(void) { - SENSOR_GPSTIME_RAW st_gps_time_raw; - - memset(&gstGpsTimeRaw_g, 0x00, sizeof(VEHICLESENS_DATA_MASTER)); - - /** Data ID setting */ - gstGpsTimeRaw_g.ul_did = POSHAL_DID_GPS_TIME_RAW; - /** Data size setting */ - gstGpsTimeRaw_g.us_size = sizeof(SENSOR_GPSTIME_RAW); - /** Data content setting */ - memset(&st_gps_time_raw, 0x00, sizeof(st_gps_time_raw)); - memcpy(&gstGpsTimeRaw_g.uc_data[0], &st_gps_time_raw, sizeof(st_gps_time_raw)); - - return; -} - -/** - * @brief - * Raw GPS Time Data Master SET Processing - * - * @param[in] SENSOR_GPSTIME_RAW* - * - * @return u_int8 - */ -u_int8 VehicleSensSetGpsTimeRawG(const SENSOR_GPSTIME_RAW *pst_gps_time_raw) { - u_int8 uc_ret; - VEHICLESENS_DATA_MASTER *pst_master; - - pst_master = &gstGpsTimeRaw_g; - - /** With the contents of the current data master,Compare received data */ - uc_ret = VehicleSensmemcmp(pst_master->uc_data, pst_gps_time_raw, sizeof(SENSOR_GPSTIME_RAW)); - - /** Received data is set in the data master. */ - pst_master->ul_did = POSHAL_DID_GPS_TIME_RAW; - pst_master->us_size = sizeof(SENSOR_GPSTIME_RAW); - pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON; - memset(pst_master->uc_data, 0x00, sizeof(pst_master->uc_data)); - memcpy(pst_master->uc_data, pst_gps_time_raw, sizeof(SENSOR_GPSTIME_RAW)); - - FRAMEWORKUNIFIEDLOG(ZONE_27, __FUNCTION__, - "year=%04d, month=%02d, date=%02d, hour=%02d, minute=%02d, second=%02d, tdsts=%d", - pst_gps_time_raw->utc.year, pst_gps_time_raw->utc.month, pst_gps_time_raw->utc.date, - pst_gps_time_raw->utc.hour, pst_gps_time_raw->utc.minute, - pst_gps_time_raw->utc.second, pst_gps_time_raw->tdsts); - return(uc_ret); -} - -/** - * @brief - * Raw GPS time information data master GET processing - * - * @param[out] SENSOR_MSG_GPSDATA_DAT* - */ -void VehicleSensGetGpsTimeRawG(SENSOR_MSG_GPSDATA_DAT *pst_data) { - const VEHICLESENS_DATA_MASTER *pst_master; - - pst_master = &gstGpsTimeRaw_g; - - /* Store the data master in the specified destination. */ - pst_data->ul_did = pst_master->ul_did; - pst_data->us_size = pst_master->us_size; - pst_data->uc_rcv_flag = pst_master->uc_rcvflag; - memcpy(pst_data->uc_data, pst_master->uc_data, pst_master->us_size); - - return; -} diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GpsTime_g.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GpsTime_g.cpp deleted file mode 100755 index 404e60e..0000000 --- a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GpsTime_g.cpp +++ /dev/null @@ -1,102 +0,0 @@ -/* - * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @file - * VehicleSens_Did_GpsTime_g.cpp - * @brief - */ - -/*---------------------------------------------------------------------------------* - * Include Files * - *---------------------------------------------------------------------------------*/ -#include <vehicle_service/positioning_base_library.h> -#include "VehicleSens_DataMaster.h" - -/*---------------------------------------------------------------------------------* - * Global Value * - *---------------------------------------------------------------------------------*/ -static VEHICLESENS_DATA_MASTER gstGpsTime_g; // NOLINT(readability/nolint) - -/*---------------------------------------------------------------------------------* - * Function * - *---------------------------------------------------------------------------------*/ -/** - * @brief - * GPS time information data master initialization processing - */ -void VehicleSensInitGpsTimeG(void) { - SENSOR_MSG_GPSTIME st_gps_time; - - memset(&gstGpsTime_g, 0x00, sizeof(VEHICLESENS_DATA_MASTER)); - - /** Data ID setting */ - gstGpsTime_g.ul_did = POSHAL_DID_GPS_TIME; - /** Data size setting */ - gstGpsTime_g.us_size = sizeof(SENSOR_MSG_GPSTIME); - /** Data content setting */ - memset(&st_gps_time, 0x00, sizeof(st_gps_time)); - memcpy(&gstGpsTime_g.uc_data[0], &st_gps_time, sizeof(st_gps_time)); - - return; -} - -/** - * @brief - * GPS time information data master SET process - * - * @param[in] SENSOR_MSG_GPS* - * - * @return u_int8 - */ -u_int8 VehicleSensSetGpsTimeG(const SENSOR_MSG_GPSTIME *pst_gps_time) { - u_int8 uc_ret; - VEHICLESENS_DATA_MASTER *pst_master; - - pst_master = &gstGpsTime_g; - - /** With the contents of the current data master,Compare received data */ - uc_ret = VehicleSensmemcmp(pst_master->uc_data, pst_gps_time, sizeof(SENSOR_MSG_GPSTIME)); - - /** Received data is set in the data master. */ - pst_master->ul_did = POSHAL_DID_GPS_TIME; - pst_master->us_size = sizeof(SENSOR_MSG_GPSTIME); - pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON; - memset(pst_master->uc_data, 0x00, sizeof(pst_master->uc_data)); - memcpy(pst_master->uc_data, pst_gps_time, sizeof(SENSOR_MSG_GPSTIME)); - - return(uc_ret); -} - -/** - * @brief - * GPS time information data master GET processing - * - * @param[out] SENSOR_MSG_GPS* - */ -void VehicleSensGetGpsTimeG(SENSOR_MSG_GPSDATA_DAT *pst_data) { - const VEHICLESENS_DATA_MASTER *pst_master; - - pst_master = &gstGpsTime_g; - - /* Store the data master in the specified destination. */ - pst_data->ul_did = pst_master->ul_did; - pst_data->us_size = pst_master->us_size; - pst_data->uc_rcv_flag = pst_master->uc_rcvflag; - memcpy(pst_data->uc_data, pst_master->uc_data, pst_master->us_size); - - return; -} diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_Gps_CWORD82_FullBinary_g.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_Gps_CWORD82_FullBinary_g.cpp deleted file mode 100755 index 8f84200..0000000 --- a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_Gps_CWORD82_FullBinary_g.cpp +++ /dev/null @@ -1,99 +0,0 @@ -/* - * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/******************************************************************************* - * File name :VehicleSens_Did_Gps_CWORD82_FullBinary_g.cpp - * System name :_CWORD72_ - * Subsystem name :Vehicle sensor process - * Program name :Vehicle sensor data master(VEHICLE_DID_GPS__CWORD82__FULLBINARY) - * Module configuration :VehicleSensInitGps_CWORD82_FullBinaryG() Vehicle sensor GPS__CWORD82__FULLBINARY initialization function - * :VehicleSensSetGps_CWORD82_FullBinaryG() Vehicle sensor GPS__CWORD82__FULLBINARY SET function - * :VehicleSensGetGps_CWORD82_FullBinaryG() Vehicle sensor GPS__CWORD82__FULLBINARY GET function - ******************************************************************************/ - -#include <vehicle_service/positioning_base_library.h> -#include "VehicleSens_DataMaster.h" -#include "VehicleSens_Common.h" -#include "gps_hal.h" - -/*************************************************/ -/* Global variable */ -/*************************************************/ -static VEHICLESENS_DATA_MASTER_GPS_FORMAT gstGps_CWORD82_FullBinary_g; // NOLINT(readability/nolint) - -/******************************************************************************* -* MODULE : VehicleSensInitGps_CWORD82_FullBinaryG -* ABSTRACT : Vehicle sensor GPS_VERSION initialization function -* FUNCTION : GPS__CWORD82__FULLBINARY data master initialization processing -* ARGUMENT : void -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensInitGps_CWORD82_FullBinaryG(void) { - memset(&gstGps_CWORD82_FullBinary_g, 0x00, sizeof(VEHICLESENS_DATA_MASTER_GPS_FORMAT)); - gstGps_CWORD82_FullBinary_g.ul_did = POSHAL_DID_GPS__CWORD82__FULLBINARY; - /* _CWORD82_-only format with a fixed magic number */ - /* GPS antenna connection information(1byte) + Sensor Counter(1byte) + 191 */ - gstGps_CWORD82_FullBinary_g.us_size = (VEHICLE_DSIZE_GPS_ANTENNA + VEHICLE_DSIZE_SNS_COUNTER + GPS_CMD_FULLBIN_SZ); -} - -/******************************************************************************* -* MODULE : VehicleSensSetGps_CWORD82_FullBinaryG -* ABSTRACT : Vehicle sensor GPS_VERSION SET function -* FUNCTION : Update the GPS__CWORD82__FULLBINARY data master -* ARGUMENT : *pst_data : Pointer to CAN received message data -* NOTE : -* RETURN : VEHICLESENS_EQ : No data change -* VEHICLESENS_NEQ : Data change -******************************************************************************/ -u_int8 VehicleSensSetGps_CWORD82_FullBinaryG(const SENSOR_MSG_GPSDATA_DAT *pst_data) { - u_int8 uc_ret; - VEHICLESENS_DATA_MASTER_GPS_FORMAT *pst_master; - VehicleSensSetGpsVersion(pst_data); /* Pass the _CWORD82_ binary */ - - pst_master = &gstGps_CWORD82_FullBinary_g; - - /* Compare data master and received data */ - uc_ret = VehicleSensmemcmp(pst_master->uc_data, pst_data->uc_data, pst_data->us_size); - - /* Received data is set in the data master. */ - pst_master->ul_did = pst_data->ul_did; - pst_master->us_size = pst_data->us_size; - pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON; - memcpy(pst_master->uc_data, pst_data->uc_data, pst_data->us_size); - - return(uc_ret); -} - -/******************************************************************************* -* MODULE : VehicleSensGetGps_CWORD82_FullBinaryG -* ABSTRACT : Vehicle sensor GPS_VERSION GET function -* FUNCTION : Provide the GPS__CWORD82__FULLBINARY data master -* ARGUMENT : *pst_data : Pointer to the data master acquisition destination -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensGetGps_CWORD82_FullBinaryG(SENSOR_MSG_GPSDATA_DAT *pst_data) { - const VEHICLESENS_DATA_MASTER_GPS_FORMAT *pst_master; - - pst_master = &gstGps_CWORD82_FullBinary_g; - - /* Store the data master in the specified destination. */ - pst_data->ul_did = pst_master->ul_did; - pst_data->us_size = pst_master->us_size; - pst_data->uc_rcv_flag = pst_master->uc_rcvflag; - memcpy(pst_data->uc_data, pst_master->uc_data, pst_master->us_size); /* Ignore->MISRA-C++:2008 Rule 5-0-5 */ -} diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_Gps_CWORD82_Nmea_g.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_Gps_CWORD82_Nmea_g.cpp deleted file mode 100755 index 9f69054..0000000 --- a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_Gps_CWORD82_Nmea_g.cpp +++ /dev/null @@ -1,102 +0,0 @@ -/* - * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/******************************************************************************* - * File name :VehicleSens_Did_Gps_CWORD82_Nmea_g.cpp - * System name :_CWORD72_ - * Subsystem name :Vehicle sensor process - * Program name :Vehicle sensor data master(VEHICLE_DID_GPS__CWORD82__FULLBINARY) - * Module configuration :VehicleSensInitGps_CWORD82_FullBinaryG() Vehicle sensor GPS__CWORD82__FULLBINARY initialization function - * :VehicleSensSetGps_CWORD82_FullBinaryG() Vehicle sensor GPS__CWORD82__FULLBINARY SET function - * :VehicleSensGetGps_CWORD82_FullBinaryG() Vehicle sensor GPS__CWORD82__FULLBINARY GET function - ******************************************************************************/ - -#include <vehicle_service/positioning_base_library.h> -#include "VehicleSens_DataMaster.h" -#include "gps_hal.h" - -/*************************************************/ -/* Global variable */ -/*************************************************/ -static VEHICLESENS_DATA_MASTER_GPS_FORMAT gstGps_CWORD82_Nmea_g; // NOLINT(readability/nolint) - -/******************************************************************************* -* MODULE : VehicleSensInitGps_CWORD82_NmeaG -* ABSTRACT : Vehicle sensor GPS__CWORD82__NMEA initialization function -* FUNCTION : GPS__CWORD82__NMEA data master initialization processing -* ARGUMENT : void -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensInitGps_CWORD82_NmeaG(void) { - memset(&gstGps_CWORD82_Nmea_g, 0x00, sizeof(VEHICLESENS_DATA_MASTER_GPS_FORMAT)); - gstGps_CWORD82_Nmea_g.ul_did = VEHICLE_DID_GPS__CWORD82__NMEA; - /* _CWORD82_-only format with a fixed magic number */ - gstGps_CWORD82_Nmea_g.us_size = 3 /* NMEA reception flag + GPS antenna connection information + sensor counter */ - + VEHICLE_DSIZE_GPS_NMEA_DRMC - + VEHICLE_DSIZE_GPS_NMEA_GSA - + VEHICLE_DSIZE_GPS_NMEA_GSV_1 - + VEHICLE_DSIZE_GPS_NMEA_GSV_2 - + VEHICLE_DSIZE_GPS_NMEA_GSV_3 - + VEHICLE_DSIZE_GPS_NMEA_PJRDC_GP_3; -} - -/******************************************************************************* -* MODULE : VehicleSensSetGps_CWORD82_NmeaG -* ABSTRACT : Vehicle sensor GPS_NMEA SET function -* FUNCTION : Update the GPS__CWORD82___CWORD44__GP4 data master -* ARGUMENT : *pst_data : Pointer to CAN received message data -* NOTE : -* RETURN : VEHICLESENS_EQ : No data change -* VEHICLESENS_NEQ : Data change -*******************************************************************************/ -u_int8 VehicleSensSetGps_CWORD82_NmeaG(const SENSOR_MSG_GPSDATA_DAT *pst_data) { - u_int8 uc_ret; - VEHICLESENS_DATA_MASTER_GPS_FORMAT *pst_master; - - pst_master = &gstGps_CWORD82_Nmea_g; - - /* Compare data master and received data */ - uc_ret = VehicleSensmemcmp(pst_master->uc_data, pst_data->uc_data, pst_data->us_size); - - /* Received data is set in the data master. */ - pst_master->ul_did = pst_data->ul_did; - pst_master->us_size = pst_data->us_size; - pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON; - memcpy(pst_master->uc_data, pst_data->uc_data, pst_data->us_size); - - return(uc_ret); -} - -/******************************************************************************* -* MODULE : VehicleSensGetGps_CWORD82_NmeaG -* ABSTRACT : Vehicle sensor GPS__CWORD82__NMEA GET function -* FUNCTION : GPS__CWORD82__NMEA Provides a data master -* ARGUMENT : *pst_data : Pointer to the data master acquisition destination -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensGetGps_CWORD82_NmeaG(SENSOR_MSG_GPSDATA_DAT *pst_data) { - const VEHICLESENS_DATA_MASTER_GPS_FORMAT *pst_master; - - pst_master = &gstGps_CWORD82_Nmea_g; - - /* Store the data master in the specified destination. */ - pst_data->ul_did = pst_master->ul_did; - pst_data->us_size = pst_master->us_size; - pst_data->uc_rcv_flag = pst_master->uc_rcvflag; - memcpy(pst_data->uc_data, pst_master->uc_data, pst_master->us_size); /* Ignore->MISRA-C++:2008 Rule 5-0-5 */ -} diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_Gps_CWORD82__CWORD44_Gp4_g.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_Gps_CWORD82__CWORD44_Gp4_g.cpp deleted file mode 100755 index 4ce8678..0000000 --- a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_Gps_CWORD82__CWORD44_Gp4_g.cpp +++ /dev/null @@ -1,101 +0,0 @@ -/* - * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/******************************************************************************* - * File name :VehicleSens_Did_Gps_CWORD82_Nmea_g.cpp - * System name :_CWORD72_ - * Subsystem name :Vehicle sensor process - * Program name :Vehicle sensor data master(VEHICLE_DID_GPS__CWORD82__FULLBINARY) - * Module configuration :VehicleSensInitGps_CWORD82_FullBinaryG() Vehicle sensor GPS__CWORD82__FULLBINARY initialization function - * :VehicleSensSetGps_CWORD82_FullBinaryG() Vehicle sensor GPS__CWORD82__FULLBINARY SET function - * :VehicleSensGetGps_CWORD82_FullBinaryG() Vehicle sensor GPS__CWORD82__FULLBINARY GET function - ******************************************************************************/ - -#include <vehicle_service/positioning_base_library.h> -#include "VehicleSens_DataMaster.h" -#include "gps_hal.h" - -/*************************************************/ -/* Global variable */ -/*************************************************/ -static VEHICLESENS_DATA_MASTER_GPS_FORMAT gstGps_CWORD82__CWORD44_Gp4_g; // NOLINT(readability/nolint) - -/******************************************************************************* -* MODULE : VehicleSensInitGps_CWORD82__CWORD44_Gp4G -* ABSTRACT : Vehicle sensor GPS__CWORD44__GP4 initialization function -* FUNCTION : GPS__CWORD82___CWORD44__GP4 data master initialization processing -* ARGUMENT : void -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensInitGps_CWORD82__CWORD44_Gp4G(void) { - memset(&gstGps_CWORD82__CWORD44_Gp4_g, 0x00, sizeof(VEHICLESENS_DATA_MASTER_GPS_FORMAT)); - gstGps_CWORD82__CWORD44_Gp4_g.ul_did = POSHAL_DID_GPS__CWORD82___CWORD44_GP4; - /* Initialize with _CWORD82_ only and size fixed VEHICLE_DSIZE_GPS_NMEA_PJRDC_GP_4 */ - /* GPS antenna connection information(1byte) + Sensor Counter(1byte) + VEHICLE_DSIZE_GPS_NMEA_PJRDC_GP_4 */ - gstGps_CWORD82__CWORD44_Gp4_g.us_size = (VEHICLE_DSIZE_GPS_ANTENNA + VEHICLE_DSIZE_SNS_COUNTER) \ - + (VEHICLE_DSIZE_GPS_NMEA_PJRDC_GP_4); -} - -/******************************************************************************* -* MODULE : VehicleSensSetGps_CWORD82__CWORD44_Gp4G -* ABSTRACT : Vehicle sensor GPS_NMEA SET function -* FUNCTION : Update the GPS__CWORD82___CWORD44__GP4 data master -* ARGUMENT : *pst_data : Pointer to CAN received message data -* NOTE : -* RETURN : VEHICLESENS_EQ : No data change -* VEHICLESENS_NEQ : Data change -*******************************************************************************/ -u_int8 VehicleSensSetGps_CWORD82__CWORD44_Gp4G(const SENSOR_MSG_GPSDATA_DAT *pst_data) { // LCOV_EXCL_START 8: dead code - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - u_int8 uc_ret; - VEHICLESENS_DATA_MASTER_GPS_FORMAT *pst_master; - - pst_master = &gstGps_CWORD82__CWORD44_Gp4_g; - - /* Compare data master and received data */ - uc_ret = VehicleSensmemcmp(pst_master->uc_data, pst_data->uc_data, pst_data->us_size); - - /* Received data is set in the data master. */ - pst_master->ul_did = pst_data->ul_did; - pst_master->us_size = (u_int8)pst_data->us_size; - pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON; - memcpy(pst_master->uc_data, pst_data->uc_data, pst_data->us_size); - - return(uc_ret); -} - -/******************************************************************************* -* MODULE : VehicleSensGetGps_CWORD82__CWORD44_Gp4G -* ABSTRACT : Vehicle sensor GPS__CWORD44__GP4 GET function -* FUNCTION : Provide the GPS__CWORD82___CWORD44__GP4 data master -* ARGUMENT : *pst_data : Pointer to the data master acquisition destination -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensGetGps_CWORD82__CWORD44_Gp4G(SENSOR_MSG_GPSDATA_DAT *pst_data) { - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - const VEHICLESENS_DATA_MASTER_GPS_FORMAT *pst_master; - - pst_master = &gstGps_CWORD82__CWORD44_Gp4_g; - - /* Store the data master in the specified destination. */ - pst_data->ul_did = pst_master->ul_did; - pst_data->us_size = pst_master->us_size; - pst_data->uc_rcv_flag = pst_master->uc_rcvflag; - memcpy(pst_data->uc_data, pst_master->uc_data, pst_master->us_size); /* Ignore->MISRA-C++:2008 Rule 5-0-5 */ -} -// LCOV_EXCL_STOP diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GsnsX.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GsnsX.cpp deleted file mode 100755 index e68edc6..0000000 --- a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GsnsX.cpp +++ /dev/null @@ -1,119 +0,0 @@ -/* - * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/******************************************************************************* - * File name :VehicleSens_Did_GsnsX.cpp - * System name :_CWORD107_ - * Subsystem name :Vehicle sensor process - * Program name :Vehicle sensor data master(VEHICLE_DID_GSNS_X) - * Module configuration :VehicleSensGetGsnsX() Vehicle sensor GSNS_X GET function - ******************************************************************************/ - -#include <vehicle_service/positioning_base_library.h> -#include "VehicleSens_DataMaster.h" - -/*************************************************/ -/* Global variable */ -/*************************************************/ - -/******************************************************************************* -* MODULE : VehicleSensGetGsnsX -* ABSTRACT : Vehicle sensor GSNS_X GET function -* FUNCTION : Provide the GSNS_X data master -* ARGUMENT : *pst_data : Pointer to the data master acquisition destination -* uc_get_method : Acquisition method(Direct Line or CAN) -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensGetGsnsX(VEHICLESENS_DATA_MASTER *pst_data, u_int8 uc_get_method) { - switch (uc_get_method) { // LCOV_EXCL_BR_LINE 6:VEHICLESENS_GETMETHOD_CAN cannot to pass in - case VEHICLESENS_GETMETHOD_CAN: - { - /* When acquiring from CAN data */ - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - break; // LCOV_EXCL_LINE 8: dead code - } - case VEHICLESENS_GETMETHOD_LINE: - { - /* To acquire from LineSensor */ - VehicleSensGetGsnsXl(pst_data); - break; - } - default: /* Ignore->MISRA-C++:2008 Rule 6-3-1, 6-4-1 */ - break; - } -} - -/* Ignore->MISRA-C++:2008 Rule 2-7-2 */ -#if CONFIG_SENSOR_EXT_VALID /* Initial Sensor Support */ -/******************************************************************************* -* MODULE : VehicleSensGetGsnsXExt -* ABSTRACT : Vehicle sensor GSNS_X GET function -* FUNCTION : Provide the GSNS_X data master -* ARGUMENT : *pst_data : Pointer to the data master acquisition destination -* uc_get_method : Acquisition method(Direct Line or CAN) -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensGetGsnsXExt(VEHICLESENS_DATA_MASTER_EXT *pst_data, u_int8 uc_get_method) { - switch (uc_get_method) { // LCOV_EXCL_BR_LINE 6:VEHICLESENS_GETMETHOD_CAN cannot to pass in - case VEHICLESENS_GETMETHOD_CAN: - { - /* When acquiring from CAN data */ - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - break; // LCOV_EXCL_LINE 8: dead code - } - case VEHICLESENS_GETMETHOD_LINE: - { - /* To acquire from LineSensor */ - VehicleSensGetGsnsXExtl(pst_data); - break; - } - default: /* Ignore->MISRA-C++:2008 Rule 6-3-1, 6-4-1 */ - break; - } -} -#endif -/* Ignore->MISRA-C++:2008 Rule 2-7-2 */ - -/** - * @brief - * Vehicle sensor GSNS_X GET function - * - * Provide the GSNS_X data master - * - * @param[in] *pst_data: Pointer to the data master acquisition destination - * @param[in] uc_get_method: Acquisition method(Direct Line or CAN) - */ -void VehicleSensGetGsnsXFst(VEHICLESENS_DATA_MASTER_FST *pst_data, u_int8 uc_get_method) { - switch (uc_get_method) { // LCOV_EXCL_BR_LINE 6:VEHICLESENS_GETMETHOD_CAN cannot to pass in - case VEHICLESENS_GETMETHOD_CAN: - { - /* When acquiring from CAN data */ - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - break; // LCOV_EXCL_LINE 8: dead code - } - case VEHICLESENS_GETMETHOD_LINE: - { - /* To acquire from LineSensor */ - VehicleSensGetGsnsXFstl(pst_data); - break; - } - default: - break; - } -} - diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GsnsXExt_l.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GsnsXExt_l.cpp deleted file mode 100755 index 4a481bb..0000000 --- a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GsnsXExt_l.cpp +++ /dev/null @@ -1,145 +0,0 @@ -/* - * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/******************************************************************************* - * File name :VehicleSens_Did_GsnsXExt_l.cpp - * System name :_CWORD107_ - * Subsystem name :Vehicle sensor process - * Program name :Vehicle sensor data master(POSHAL_DID_GSNS_X) - * Module configuration :VehicleSensInitGsnsXExtl() Vehicle sensor GSNS_X initialization function - * :VehicleSensSetGsnsXExtlG() Vehicle sensor GSNS_X SET function - * :VehicleSensGetGsnsXExtl() Vehicle sensor GSNS_X GET function - ******************************************************************************/ - -#include <vehicle_service/positioning_base_library.h> -#include "VehicleSens_DataMaster.h" - -/* Ignore->MISRA-C++:2008 Rule 2-7-2 */ -#if CONFIG_SENSOR_EXT_VALID /* Initial Sensor Support */ -/*************************************************/ -/* Global variable */ -/*************************************************/ -static VEHICLESENS_DATA_MASTER_EXT gstGsnsXExt_l; // NOLINT(readability/nolint) - -/******************************************************************************* -* MODULE : VehicleSensInitGsnsXExtl -* ABSTRACT : Vehicle sensor GSNS_X initialization function -* FUNCTION : GSNS_X data master initialization processing -* ARGUMENT : void -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensInitGsnsXExtl(void) { - memset(&gstGsnsXExt_l, 0x00, sizeof(VEHICLESENS_DATA_MASTER_EXT)); - gstGsnsXExt_l.ul_did = POSHAL_DID_GSNS_X; - gstGsnsXExt_l.us_size = VEHICLE_DSIZE_GSNS_X_EXT_INIT; - gstGsnsXExt_l.uc_rcvflag = VEHICLE_RCVFLAG_OFF; -} - -/** - * @brief - * Vehicle sensor GSNS_X SET function - * - * Update the GSNS_X data master - * - * @param[in] *pst_data : Pointer to the message data received by the direct line - */ -void VehicleSensSetGsnsXExtlG(const LSDRV_LSDATA_G *pst_data) { - VEHICLESENS_DATA_MASTER_EXT *pst_master; - u_int16 us_start = 0; - u_int16 us_size = 0; - u_int16 us_cnt = 0; - - pst_master = &gstGsnsXExt_l; - us_size = static_cast<u_int16>(sizeof(u_int16) * 10); /* Size of one data item: 2byte * 10 data items */ - - /* Store the latest one in the internal data structure */ - us_start = gstPkgTempExt.start_point[GsnsX]; /* Location to store one received message */ - /* Stored in data master(Order of reception)*/ - if (us_start >= VEHICLE_DKEEP_MAX) { - /* Store the latest one at position 0 */ - us_start = VEHICLE_DATA_POS_00; - /* If you are discarding old data,,Set a flag */ - gstPkgTempExt.data_break = VEHICLE_SNS_BREAK; - } - pst_master->ul_did = pst_data->ul_did; - pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON; - for (us_cnt = 0; us_cnt < us_size; us_cnt++) { - pst_master->uc_data[us_start * us_size + us_cnt] = (u_int8)(pst_data->uc_data[us_cnt]); - } - - /* Update next storage start position and latest data storage position */ - us_start++; - gstPkgTempExt.start_point[GsnsX] = us_start; - - /* Update data master size */ - if (gstPkgTempExt.data_break == VEHICLE_SNS_BREAK) { - /* Make the size of all extended data masters */ - pst_master->us_size = VEHICLE_DSIZE_GSNS_X_EXT; - } else { - /* Add the size of one received data item */ - pst_master->us_size = static_cast<u_int16>(pst_master->us_size + us_size); - } -} - -/******************************************************************************* -* MODULE : VehicleSensGetGsnsXExtl -* ABSTRACT : Vehicle sensor GSNS_X GET function -* FUNCTION : Provide the GSNS_X data master -* ARGUMENT : *pst_data : Pointer to the data master acquisition destination -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensGetGsnsXExtl(VEHICLESENS_DATA_MASTER_EXT *pst_data) { - const VEHICLESENS_DATA_MASTER_EXT *pst_master; - uint16_t us_size = 0; - uint16_t us_data_cnt = 0; // Number of data contained - uint16_t us_loop_cnt = 0; // 64 over index - - /* Store the data master in the specified destination. */ - pst_master = &gstGsnsXExt_l; - pst_data->ul_did = pst_master->ul_did; - pst_data->us_size = pst_master->us_size; - pst_data->uc_rcvflag = pst_master->uc_rcvflag; - - us_size = static_cast<u_int16>(sizeof(u_int16) * 10); /* Size of one data item: 2byte * 10 data items */ - - /* Checking whether the number of stored entries is looped */ - if (gstPkgTempExt.data_break == VEHICLE_SNS_BREAK) { - us_data_cnt = VEHICLE_DKEEP_MAX; - } else { - us_data_cnt = gstPkgTempExt.start_point[GsnsX]; - } - - /* Acquire data from the oldest data master */ - for (uint16_t us_cnt = 0; us_cnt < us_data_cnt; us_cnt++) { - if (gstPkgTempExt.data_break == VEHICLE_SNS_BREAK) { - /* Get information before loop */ - if (gstPkgTempExt.start_point[GsnsX] + us_cnt < VEHICLE_DKEEP_MAX) { - memcpy(&pst_data->uc_data[us_cnt * us_size], - &pst_master->uc_data[(gstPkgTempExt.start_point[GsnsX] + us_cnt) * us_size], us_size); - } else { - memcpy(&pst_data->uc_data[us_cnt * us_size], - &pst_master->uc_data[us_loop_cnt * us_size], us_size); - us_loop_cnt++; - } - } else { - memcpy(&pst_data->uc_data[us_cnt * us_size], - &pst_master->uc_data[us_cnt * us_size], us_size); - } - } -} -#endif diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GsnsXFst_l.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GsnsXFst_l.cpp deleted file mode 100755 index 61ee990..0000000 --- a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GsnsXFst_l.cpp +++ /dev/null @@ -1,127 +0,0 @@ -/* - * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @file - * VehicleSens_Did_GsnsXFst_l.cpp - * @brief - * Vehicle sensor data master(POSHAL_DID_GSNS_X_FST) - */ - -#include <vehicle_service/positioning_base_library.h> -#include "VehicleSens_DataMaster.h" - -/*************************************************/ -/* Global variable */ -/*************************************************/ -static VEHICLESENS_DATA_MASTER_FST g_st_gsnsx_fst_l; // NOLINT(readability/nolint) - -/** - * @brief - * Vehicle sensor GSNS_X initialization function - * - * GSNS_X data master initialization processing - */ -void VehicleSensInitGsnsXFstl(void) { - memset(&g_st_gsnsx_fst_l, 0x00, sizeof(VEHICLESENS_DATA_MASTER_FST)); - g_st_gsnsx_fst_l.ul_did = POSHAL_DID_GSNS_X_FST; - g_st_gsnsx_fst_l.us_size = VEHICLE_DSIZE_GSNS_X_EXT_INIT; - g_st_gsnsx_fst_l.uc_rcvflag = VEHICLE_RCVFLAG_OFF; - g_st_gsnsx_fst_l.partition_flg = 0; -} - -/** - * @brief - * Vehicle sensor GSNS_X SET function - * - * Update the GSNS_X data master - * - * @param[in] *pst_data : Pointer to the message data received by the direct line - * - * @return VEHICLESENS_EQ No data change<br> - * VEHICLESENS_NEQ Data change - */ -u_int8 VehicleSensSetGsnsXFstG(const LSDRV_LSDATA_FST_GSENSOR_X *pst_data) { - static u_int8 uc_ret = VEHICLESENS_EQ; - VEHICLESENS_DATA_MASTER_FST *pst_master; - - u_int8 partition_max; /* Total number of partitions */ - u_int8 partition_num; /* Data number */ - - pst_master = &g_st_gsnsx_fst_l; - - partition_max = pst_data->uc_partition_max; - partition_num = pst_data->uc_partition_num; - - if (partition_max == 1) { - /* Compare data master and received data */ - uc_ret = VehicleSensmemcmp(pst_master->uc_data, pst_data->uc_data, pst_data->uc_size); - - /* Received data is set in the data master. */ - pst_master->ul_did = pst_data->ul_did; - pst_master->us_size = pst_data->uc_size; - pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON; - pst_master->partition_flg = 0; - memset(pst_master->uc_data, 0x00, sizeof(pst_master->uc_data)); - memcpy(pst_master->uc_data, pst_data->uc_data, pst_data->uc_size); - } else if (partition_max == 2) { - if (partition_num == 1) { - /* Compare data master and received data */ - uc_ret = VehicleSensmemcmp(pst_master->uc_data, pst_data->uc_data, pst_data->uc_size); - - /* Received data is set in the data master. */ - pst_master->ul_did = pst_data->ul_did; - pst_master->us_size = static_cast<u_int16>(pst_master->us_size + pst_data->uc_size); - pst_master->partition_flg = 1; - memcpy(pst_master->uc_data, pst_data->uc_data, pst_data->uc_size); - } else if (partition_num == 2) { - /* Compare data master and received data */ - if (uc_ret == VEHICLESENS_EQ) { - uc_ret = VehicleSensmemcmp(&pst_master->uc_data[VEHICLE_DSIZE_GSNSX_FST], - pst_data->uc_data, pst_data->uc_size); - } - - /* Received data is set in the data master. */ - pst_master->ul_did = pst_data->ul_did; - pst_master->us_size = static_cast<u_int16>(pst_master->us_size + pst_data->uc_size); - pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON; - pst_master->partition_flg = 1; - memcpy(&pst_master->uc_data[VEHICLE_DSIZE_GSNSX_FST], pst_data->uc_data, pst_data->uc_size); - } else { } - } else { } - return(uc_ret); -} - -/** - * @brief - * Vehicle sensor GSNS_X GET function - * - * Provide the GSNS_X data master - * - * @param[in] Pointer to the data master acquisition destination - */ -void VehicleSensGetGsnsXFstl(VEHICLESENS_DATA_MASTER_FST *pst_data) { - const VEHICLESENS_DATA_MASTER_FST *pst_master; - - pst_master = &g_st_gsnsx_fst_l; - - /* Store the data master in the specified destination. */ - pst_data->ul_did = pst_master->ul_did; - pst_data->us_size = pst_master->us_size; - pst_data->uc_rcvflag = pst_master->uc_rcvflag; - pst_data->partition_flg = pst_master->partition_flg; - memcpy(pst_data->uc_data, pst_master->uc_data, pst_master->us_size); -} diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GsnsX_l.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GsnsX_l.cpp deleted file mode 100755 index 90d16ce..0000000 --- a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GsnsX_l.cpp +++ /dev/null @@ -1,98 +0,0 @@ -/* - * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/******************************************************************************* - * File name :VehicleSens_Did_GsnsX_l.cpp - * System name :_CWORD107_ - * Subsystem name :Vehicle sensor process - * Program name :Vehicle sensor data master(POSHAL_DID_GSNS_X) - * Module configuration :VehicleSensInitGsnsXl() Vehicle sensor GSNS_X initialization function - * :VehicleSensSetGsnsXlG() Vehicle sensor GSNS_X SET function - * :VehicleSensGetGsnsXl() Vehicle sensor GSNS_X GET function - ******************************************************************************/ - -#include <vehicle_service/positioning_base_library.h> -#include "VehicleSens_DataMaster.h" - -/*************************************************/ -/* Global variable */ -/*************************************************/ -static VEHICLESENS_DATA_MASTER gstGsnsX_l; // NOLINT(readability/nolint) - -/******************************************************************************* -* MODULE : VehicleSensInitGsnsXl -* ABSTRACT : Vehicle sensor GSNS_X initialization function -* FUNCTION : GSNS_X data master initialization processing -* ARGUMENT : void -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensInitGsnsXl(void) { - memset(&gstGsnsX_l, 0x00, sizeof(VEHICLESENS_DATA_MASTER)); - gstGsnsX_l.ul_did = POSHAL_DID_GSNS_X; - gstGsnsX_l.us_size = VEHICLE_DSIZE_GSNS_X; - gstGsnsX_l.uc_rcvflag = VEHICLE_RCVFLAG_OFF; -} - -/** - * @brief - * Vehicle sensor GSNS_X SET function - * - * Update the GSNS_X data master - * - * @param[in] *pst_data : Pointer to the message data received by the direct line - * - * @return VEHICLESENS_EQ No data change<br> - * VEHICLESENS_NEQ Data change - */ -u_int8 VehicleSensSetGsnsXlG(const LSDRV_LSDATA_G *pst_data) { - u_int8 uc_ret; - VEHICLESENS_DATA_MASTER *pst_master; - - pst_master = &gstGsnsX_l; - - /* Compare data master and received data */ - uc_ret = VehicleSensmemcmp(pst_master->uc_data, pst_data->uc_data, pst_data->uc_size); - - /* Received data is set in the data master. */ - pst_master->ul_did = pst_data->ul_did; - pst_master->us_size = pst_data->uc_size; - pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON; - (void)memcpy(reinterpret_cast<void *>(pst_master->uc_data), - (const void *)(pst_data->uc_data), (size_t)(pst_data->uc_size)); - - return(uc_ret); -} - -/******************************************************************************* -* MODULE : VehicleSensGetGsnsXl -* ABSTRACT : Vehicle sensor GSNS_X GET function -* FUNCTION : Provide the GSNS_X data master -* ARGUMENT : *pst_data : Pointer to the data master acquisition destination -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensGetGsnsXl(VEHICLESENS_DATA_MASTER *pst_data) { - const VEHICLESENS_DATA_MASTER *pst_master; - - pst_master = &gstGsnsX_l; - - /* Store the data master in the specified destination. */ - pst_data->ul_did = pst_master->ul_did; - pst_data->us_size = pst_master->us_size; - pst_data->uc_rcvflag = pst_master->uc_rcvflag; - memcpy(pst_data->uc_data, pst_master->uc_data, pst_master->us_size); /* Ignore->MISRA-C++:2008 Rule 5-0-5 */ -} diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GsnsY.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GsnsY.cpp deleted file mode 100755 index 0ab4b67..0000000 --- a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GsnsY.cpp +++ /dev/null @@ -1,121 +0,0 @@ -/* - * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/******************************************************************************* - * File name :VehicleSens_Did_GsnsY.cpp - * System name :_CWORD107_ - * Subsystem name :Vehicle sensor process - * Program name :Vehicle sensor data master(VEHICLE_DID_GSNS_Y) - * Module configuration :VehicleSensGetGsnsY() Vehicle sensor GSNS_Y GET function - ******************************************************************************/ - -#include <vehicle_service/positioning_base_library.h> -#include "VehicleSens_DataMaster.h" - -/*************************************************/ -/* Global variable */ -/*************************************************/ - -/******************************************************************************* -* MODULE : VehicleSensGetGsnsY -* ABSTRACT : Vehicle sensor GSNS_Y GET function -* FUNCTION : Provide the GSNS_Y data master -* ARGUMENT : *pst_data : Pointer to the data master acquisition destination -* uc_get_method : Acquisition method(Direct Line or CAN) -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensGetGsnsY(VEHICLESENS_DATA_MASTER *pst_data, u_int8 uc_get_method) { - switch (uc_get_method) { // LCOV_EXCL_BR_LINE 6:VEHICLESENS_GETMETHOD_CAN cannot to pass in - case VEHICLESENS_GETMETHOD_CAN: - { - /* When acquiring from CAN data */ - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - break; // LCOV_EXCL_LINE 8: dead code - } - case VEHICLESENS_GETMETHOD_LINE: - { - /* To acquire from LineSensor */ - VehicleSensGetGsnsYl(pst_data); - break; - } - default: /* Ignore->MISRA-C++:2008 Rule 6-3-1, 6-4-1 */ - break; - } -} - -/* Ignore->MISRA-C++:2008 Rule 2-7-2 */ -#if CONFIG_SENSOR_EXT_VALID /* Initial Sensor Support */ -/******************************************************************************* -* MODULE : VehicleSensGetGsnsYExt -* ABSTRACT : Vehicle sensor GSNS_Y GET function -* FUNCTION : Provide the GSNS_Y data master -* ARGUMENT : *pst_data : Pointer to the data master acquisition destination -* uc_get_method : Acquisition method(Direct Line or CAN) -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensGetGsnsYExt(VEHICLESENS_DATA_MASTER_EXT *pst_data, u_int8 uc_get_method) { - switch (uc_get_method) { // LCOV_EXCL_BR_LINE 6:VEHICLESENS_GETMETHOD_CAN cannot to pass in - case VEHICLESENS_GETMETHOD_CAN: - { - /* When acquiring from CAN data */ - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - break; // LCOV_EXCL_LINE 8: dead code - } - case VEHICLESENS_GETMETHOD_LINE: - { - /* To acquire from LineSensor */ - VehicleSensGetGsnsYExtl(pst_data); - break; - } - default: /* Ignore->MISRA-C++:2008 Rule 6-3-1, 6-4-1 */ - break; - } -} -#endif -/* Ignore->MISRA-C++:2008 Rule 2-7-2 */ - -/** - * @brief - * Vehicle sensor GSNS_Y GET function - * - * Provide the GSNS_Y data master - * - * @param[in] *pst_data: Pointer to the data master acquisition destination - * @param[in] uc_get_method: Acquisition method(Direct Line or CAN) - */ -void VehicleSensGetGsnsYFst(VEHICLESENS_DATA_MASTER_FST *pst_data, u_int8 uc_get_method) { - switch (uc_get_method) { // LCOV_EXCL_BR_LINE 6:VEHICLESENS_GETMETHOD_CAN cannot to pass in - case VEHICLESENS_GETMETHOD_CAN: - { - /* When acquiring from CAN data */ - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - break; // LCOV_EXCL_LINE 8: dead code - } - - case VEHICLESENS_GETMETHOD_LINE: - { - /* To acquire from LineSensor */ - VehicleSensGetGsnsYFstl(pst_data); - break; - } - - default: - break; - } -} - diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GsnsYExt_l.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GsnsYExt_l.cpp deleted file mode 100755 index 947da7f..0000000 --- a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GsnsYExt_l.cpp +++ /dev/null @@ -1,145 +0,0 @@ -/* - * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/******************************************************************************* - * File name :VehicleSens_Did_GsnsYExt_l.cpp - * System name :_CWORD107_ - * Subsystem name :Vehicle sensor process - * Program name :Vehicle sensor data master(POSHAL_DID_GSNS_Y) - * Module configuration :VehicleSensInitGsnsYExtl() Vehicle sensor GSNS_Y initialization function - * :VehicleSensSetGsnsYExtlG() Vehicle sensor GSNS_Y SET function - * :VehicleSensGetGsnsYExtl() Vehicle sensor GSNS_Y GET function - ******************************************************************************/ - -#include <vehicle_service/positioning_base_library.h> -#include "VehicleSens_DataMaster.h" - -/* Ignore->MISRA-C++:2008 Rule 2-7-2 */ -#if CONFIG_SENSOR_EXT_VALID /* Initial Sensor Support */ -/*************************************************/ -/* Global variable */ -/*************************************************/ -static VEHICLESENS_DATA_MASTER_EXT gstGsnsYExt_l; // NOLINT(readability/nolint) - -/******************************************************************************* -* MODULE : VehicleSensInitGsnsYExtl -* ABSTRACT : Vehicle sensor GSNS_Y initialization function -* FUNCTION : GSNS_Y data master initialization processing -* ARGUMENT : void -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensInitGsnsYExtl(void) { - memset(&gstGsnsYExt_l, 0x00, sizeof(VEHICLESENS_DATA_MASTER_EXT)); - gstGsnsYExt_l.ul_did = POSHAL_DID_GSNS_Y; - gstGsnsYExt_l.us_size = VEHICLE_DSIZE_GSNS_Y_EXT_INIT; - gstGsnsYExt_l.uc_rcvflag = VEHICLE_RCVFLAG_OFF; -} - -/** - * @brief - * Vehicle sensor GSNS_Y SET function - * - * Update the GSNS_Y data master - * - * @param[in] *pst_data : Pointer to the message data received by the direct line - */ -void VehicleSensSetGsnsYExtlG(const LSDRV_LSDATA_G *pst_data) { - VEHICLESENS_DATA_MASTER_EXT *pst_master; - u_int16 us_start = 0; - u_int16 us_size = 0; - u_int16 us_cnt = 0; - - pst_master = &gstGsnsYExt_l; - us_size = static_cast<u_int16>(sizeof(u_int16) * 10); /* Size of one data item: 2byte * 10 data items */ - - /* Store the latest one in the internal data structure */ - us_start = gstPkgTempExt.start_point[GsnsY]; /* Location to store one received message */ - /* Stored in data master(Order of reception)*/ - if (us_start >= VEHICLE_DKEEP_MAX) { - /* Store the latest one at position 0 */ - us_start = VEHICLE_DATA_POS_00; - /* If you are discarding old data,,Set a flag */ - gstPkgTempExt.data_break = VEHICLE_SNS_BREAK; - } - pst_master->ul_did = pst_data->ul_did; - pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON; - for (us_cnt = 0; us_cnt < us_size; us_cnt++) { - pst_master->uc_data[us_start * us_size + us_cnt] = (u_int8)(pst_data->uc_data[us_cnt]); - } - - /* Update next storage start position and latest data storage position */ - us_start++; - gstPkgTempExt.start_point[GsnsY] = us_start; - - /* Update data master size */ - if (gstPkgTempExt.data_break == VEHICLE_SNS_BREAK) { - /* Make the size of all extended data masters */ - pst_master->us_size = VEHICLE_DSIZE_GSNS_Y_EXT; - } else { - /* Add the size of one received data item */ - pst_master->us_size = static_cast<u_int16>(pst_master->us_size + us_size); - } -} - -/******************************************************************************* -* MODULE : VehicleSensGetGsnsYExtl -* ABSTRACT : Vehicle sensor GSNS_Y GET function -* FUNCTION : Provide the GSNS_Y data master -* ARGUMENT : *pst_data : Pointer to the data master acquisition destination -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensGetGsnsYExtl(VEHICLESENS_DATA_MASTER_EXT *pst_data) { - const VEHICLESENS_DATA_MASTER_EXT *pst_master; - uint16_t us_size = 0; - uint16_t us_data_cnt = 0; // Number of data contained - uint16_t us_loop_cnt = 0; // 64 over index - - /* Store the data master in the specified destination. */ - pst_master = &gstGsnsYExt_l; - pst_data->ul_did = pst_master->ul_did; - pst_data->us_size = pst_master->us_size; - pst_data->uc_rcvflag = pst_master->uc_rcvflag; - - us_size = static_cast<u_int16>(sizeof(u_int16) * 10); /* Size of one data item: 2byte * 10 data items */ - - /* Checking whether the number of stored entries is looped */ - if (gstPkgTempExt.data_break == VEHICLE_SNS_BREAK) { - us_data_cnt = VEHICLE_DKEEP_MAX; - } else { - us_data_cnt = gstPkgTempExt.start_point[GsnsY]; - } - - /* Acquire data from the oldest data master */ - for (uint16_t us_cnt = 0; us_cnt < us_data_cnt; us_cnt++) { - if (gstPkgTempExt.data_break == VEHICLE_SNS_BREAK) { - /* Get information before loop */ - if (gstPkgTempExt.start_point[GsnsY] + us_cnt < VEHICLE_DKEEP_MAX) { - memcpy(&pst_data->uc_data[us_cnt * us_size], - &pst_master->uc_data[(gstPkgTempExt.start_point[GsnsY] + us_cnt) * us_size], us_size); - } else { - memcpy(&pst_data->uc_data[us_cnt * us_size], - &pst_master->uc_data[us_loop_cnt * us_size], us_size); - us_loop_cnt++; - } - } else { - memcpy(&pst_data->uc_data[us_cnt * us_size], - &pst_master->uc_data[us_cnt * us_size], us_size); - } - } -} -#endif diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GsnsYFst_l.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GsnsYFst_l.cpp deleted file mode 100755 index 1fc1b92..0000000 --- a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GsnsYFst_l.cpp +++ /dev/null @@ -1,128 +0,0 @@ -/* - * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @file - * VehicleSens_Did_GsnsYFst_l.cpp - * @brief - * Vehicle sensor data master(POSHAL_DID_GSNS_Y_FST) - */ - -#include <vehicle_service/positioning_base_library.h> -#include "VehicleSens_DataMaster.h" - -/*************************************************/ -/* Global variable */ -/*************************************************/ -static VEHICLESENS_DATA_MASTER_FST g_st_gsnsy_fst_l; // NOLINT(readability/nolint) - -/** - * @brief - * Vehicle sensor GSNS_Y initialization function - * - * GSNS_Y data master initialization processing - */ -void VehicleSensInitGsnsYFstl(void) { - memset(&g_st_gsnsy_fst_l, 0x00, sizeof(VEHICLESENS_DATA_MASTER_FST)); - g_st_gsnsy_fst_l.ul_did = POSHAL_DID_GSNS_Y_FST; - g_st_gsnsy_fst_l.us_size = VEHICLE_DSIZE_GSNS_Y_EXT_INIT; - g_st_gsnsy_fst_l.uc_rcvflag = VEHICLE_RCVFLAG_OFF; - g_st_gsnsy_fst_l.partition_flg = 0; -} - -/** - * @brief - * Vehicle sensor GSNS_Y SET function - * - * Update the GSNS_Y data master - * - * @param[in] *pst_data : Pointer to the message data received by the direct line - * - * @return VEHICLESENS_EQ No data change<br> - * VEHICLESENS_NEQ Data change - */ -u_int8 VehicleSensSetGsnsYFstG(const LSDRV_LSDATA_FST_GSENSOR_Y *pst_data) { - static u_int8 uc_ret = VEHICLESENS_EQ; - VEHICLESENS_DATA_MASTER_FST *pst_master; - - u_int8 partition_max; /* Total number of partitions */ - u_int8 partition_num; /* Data number */ - - pst_master = &g_st_gsnsy_fst_l; - - partition_max = pst_data->uc_partition_max; - partition_num = pst_data->uc_partition_num; - - if (partition_max == 1) { - /* Compare data master and received data */ - uc_ret = VehicleSensmemcmp(pst_master->uc_data, pst_data->uc_data, pst_data->uc_size); - - /* Received data is set in the data master. */ - pst_master->ul_did = pst_data->ul_did; - pst_master->us_size = pst_data->uc_size; - pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON; - pst_master->partition_flg = 0; - memset(pst_master->uc_data, 0x00, sizeof(pst_master->uc_data)); - memcpy(pst_master->uc_data, pst_data->uc_data, pst_data->uc_size); - } else if (partition_max == 2) { - if (partition_num == 1) { - /* Compare data master and received data */ - uc_ret = VehicleSensmemcmp(pst_master->uc_data, pst_data->uc_data, pst_data->uc_size); - - /* Received data is set in the data master. */ - pst_master->ul_did = pst_data->ul_did; - pst_master->us_size = static_cast<u_int16>(pst_master->us_size + pst_data->uc_size); - pst_master->partition_flg = 1; - memcpy(pst_master->uc_data, pst_data->uc_data, pst_data->uc_size); - } else if (partition_num == 2) { - /* Compare data master and received data */ - if (uc_ret == VEHICLESENS_EQ) { - uc_ret = VehicleSensmemcmp(&pst_master->uc_data[VEHICLE_DSIZE_GSNSY_FST], - pst_data->uc_data, pst_data->uc_size); - } - - /* Received data is set in the data master. */ - pst_master->ul_did = pst_data->ul_did; - pst_master->us_size = static_cast<u_int16>(pst_master->us_size + pst_data->uc_size); - pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON; - pst_master->partition_flg = 1; - memcpy(&pst_master->uc_data[VEHICLE_DSIZE_GSNSY_FST], pst_data->uc_data, pst_data->uc_size); - } else {} - } else {} - - return(uc_ret); -} - -/** - * @brief - * Vehicle sensor GSNS_Y GET function - * - * Provide the GSNS_Y data master - * - * @param[in] Pointer to the data master acquisition destination - */ -void VehicleSensGetGsnsYFstl(VEHICLESENS_DATA_MASTER_FST *pst_data) { - const VEHICLESENS_DATA_MASTER_FST *pst_master; - - pst_master = &g_st_gsnsy_fst_l; - - /* Store the data master in the specified destination. */ - pst_data->ul_did = pst_master->ul_did; - pst_data->us_size = pst_master->us_size; - pst_data->uc_rcvflag = pst_master->uc_rcvflag; - pst_data->partition_flg = pst_master->partition_flg; - memcpy(pst_data->uc_data, pst_master->uc_data, pst_master->us_size); -} diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GsnsY_l.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GsnsY_l.cpp deleted file mode 100755 index 1bf2e30..0000000 --- a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GsnsY_l.cpp +++ /dev/null @@ -1,99 +0,0 @@ -/* - * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/******************************************************************************* - * File name :VehicleSens_Did_GsnsY_l.cpp - * System name :_CWORD107_ - * Subsystem name :Vehicle sensor process - * Program name :Vehicle sensor data master(POSHAL_DID_GSNS_Y) - * Module configuration :VehicleSensInitGsnsYl() Vehicle sensor GSNS_Y initialization function - * :VehicleSensSetGsnsYlG() Vehicle sensor GSNS_Y SET function - * :VehicleSensGetGsnsYl() Vehicle sensor GSNS_Y GET function - ******************************************************************************/ - -#include <vehicle_service/positioning_base_library.h> -#include "VehicleSens_DataMaster.h" - -/*************************************************/ -/* Global variable */ -/*************************************************/ -static VEHICLESENS_DATA_MASTER gstGsnsY_l; // NOLINT(readability/nolint) - -/******************************************************************************* -* MODULE : VehicleSensInitGsnsYl -* ABSTRACT : Vehicle sensor GSNS_Y initialization function -* FUNCTION : GSNS_Y data master initialization processing -* ARGUMENT : void -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensInitGsnsYl(void) { - memset(&gstGsnsY_l, 0x00, sizeof(VEHICLESENS_DATA_MASTER)); - gstGsnsY_l.ul_did = POSHAL_DID_GSNS_Y; - gstGsnsY_l.us_size = VEHICLE_DSIZE_GSNS_Y; - gstGsnsY_l.uc_rcvflag = VEHICLE_RCVFLAG_OFF; -} - -/** - * @brief - * Vehicle sensor GSNS_Y SET function - * - * Update the GSNS_Y data master - * - * @param[in] *pst_data : Pointer to the message data received by the direct line - * - * @return VEHICLESENS_EQ No data change<br> - * VEHICLESENS_NEQ Data change - * - */ -u_int8 VehicleSensSetGsnsYlG(const LSDRV_LSDATA_G *pst_data) { - u_int8 uc_ret; - VEHICLESENS_DATA_MASTER *pst_master; - - pst_master = &gstGsnsY_l; - - /* Compare data master and received data */ - uc_ret = VehicleSensmemcmp(pst_master->uc_data, pst_data->uc_data, pst_data->uc_size); - - /* Received data is set in the data master. */ - pst_master->ul_did = pst_data->ul_did; - pst_master->us_size = pst_data->uc_size; - pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON; - (void)memcpy(reinterpret_cast<void *>(pst_master->uc_data), - (const void *)(pst_data->uc_data), (size_t)(pst_data->uc_size)); - - return(uc_ret); -} - -/******************************************************************************* -* MODULE : VehicleSensGetGsnsYl -* ABSTRACT : Vehicle sensor GSNS_Y GET function -* FUNCTION : Provide the GSNS_Y data master -* ARGUMENT : *pst_data : Pointer to the data master acquisition destination -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensGetGsnsYl(VEHICLESENS_DATA_MASTER *pst_data) { - const VEHICLESENS_DATA_MASTER *pst_master; - - pst_master = &gstGsnsY_l; - - /* Store the data master in the specified destination. */ - pst_data->ul_did = pst_master->ul_did; - pst_data->us_size = pst_master->us_size; - pst_data->uc_rcvflag = pst_master->uc_rcvflag; - memcpy(pst_data->uc_data, pst_master->uc_data, pst_master->us_size); /* Ignore->MISRA-C++:2008 Rule 5-0-5 */ -} diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GsnsZ.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GsnsZ.cpp deleted file mode 100755 index ec865c3..0000000 --- a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GsnsZ.cpp +++ /dev/null @@ -1,116 +0,0 @@ -/* - * @copyright Copyright (c) 2020 TOYOTA MOTOR CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/******************************************************************************* - * File name :VehicleSens_Did_GsnsY.cpp - * Subsystem name :Vehicle sensor process - * Program name :Vehicle sensor data master(VEHICLE_DID_GSNS_Z) - * Module configuration :VehicleSensGetGsnsZ() Vehicle sensor GSNS_Z GET function - ******************************************************************************/ - -#include "VehicleSens_DataMaster.h" - -/*************************************************/ -/* Global variable */ -/*************************************************/ - -/******************************************************************************* -* MODULE : VehicleSensGetGsnsZ -* ABSTRACT : Vehicle sensor GSNS_Z GET function -* FUNCTION : Provide the GSNS_Z data master -* ARGUMENT : *pst_data : Pointer to the data master acquisition destination -* uc_get_method : Acquisition method(Direct Line or CAN) -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensGetGsnsZ(VEHICLESENS_DATA_MASTER *pst_data, u_int8 uc_get_method) { - switch (uc_get_method) { // LCOV_EXCL_BR_LINE 6:VEHICLESENS_GETMETHOD_CAN cannot to pass in - case VEHICLESENS_GETMETHOD_CAN: - { - /* When acquiring from CAN data */ - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - break; // LCOV_EXCL_LINE 8: dead code - } - case VEHICLESENS_GETMETHOD_LINE: - { - /* To acquire from LineSensor */ - VehicleSensGetGsnsZl(pst_data); - break; - } - default: - break; - } -} - -#if CONFIG_SENSOR_EXT_VALID /* Initial Sensor Support */ -/******************************************************************************* -* MODULE : VehicleSensGetGsnsZExt -* ABSTRACT : Vehicle sensor GSNS_Z GET function -* FUNCTION : Provide the GSNS_Z data master -* ARGUMENT : *pst_data : Pointer to the data master acquisition destination -* uc_get_method : Acquisition method(Direct Line or CAN) -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensGetGsnsZExt(VEHICLESENS_DATA_MASTER_EXT *pst_data, u_int8 uc_get_method) { - switch (uc_get_method) { // LCOV_EXCL_BR_LINE 6:VEHICLESENS_GETMETHOD_CAN cannot to pass in - case VEHICLESENS_GETMETHOD_CAN: - { - /* When acquiring from CAN data */ - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - break; // LCOV_EXCL_LINE 8: dead code - } - case VEHICLESENS_GETMETHOD_LINE: - { - /* To acquire from LineSensor */ - VehicleSensGetGsnsZExtl(pst_data); - break; - } - default: - break; - } -} -#endif - -/** - * @brief - * Vehicle sensor GSNS_Z GET function - * - * Provide the GSNS_Z data master - * - * @param[in] *pst_data: Pointer to the data master acquisition destination - * @param[in] uc_get_method: Acquisition method(Direct Line or CAN) - */ -void VehicleSensGetGsnsZFst(VEHICLESENS_DATA_MASTER_FST *pst_data, u_int8 uc_get_method) { - switch (uc_get_method) { // LCOV_EXCL_BR_LINE 6:VEHICLESENS_GETMETHOD_CAN cannot to pass in - case VEHICLESENS_GETMETHOD_CAN: - { - /* When acquiring from CAN data */ - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - break; // LCOV_EXCL_LINE 8: dead code - } - - case VEHICLESENS_GETMETHOD_LINE: - { - /* To acquire from LineSensor */ - VehicleSensGetGsnsZFstl(pst_data); - break; - } - - default: - break; - } -} diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GsnsZExt_l.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GsnsZExt_l.cpp deleted file mode 100755 index 9dc1e39..0000000 --- a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GsnsZExt_l.cpp +++ /dev/null @@ -1,142 +0,0 @@ -/* - * @copyright Copyright (c) 2019-2020 TOYOTA MOTOR CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/******************************************************************************* - * File name :VehicleSens_Did_GsnsZExt_l.cpp - * Subsystem name :Vehicle sensor process - * Program name :Vehicle sensor data master(POSHAL_DID_GSNS_Z) - * Module configuration :VehicleSensInitGsnsZExtl() Vehicle sensor GSNS_Z initialization function - * :VehicleSensSetGsnsZExtlG() Vehicle sensor GSNS_Z SET function - * :VehicleSensGetGsnsZExtl() Vehicle sensor GSNS_Z GET function - ******************************************************************************/ - -#include "VehicleSens_DataMaster.h" - -#if CONFIG_SENSOR_EXT_VALID /* Initial Sensor Support */ -/*************************************************/ -/* Global variable */ -/*************************************************/ -static VEHICLESENS_DATA_MASTER_EXT gstGsnsZExt_l; // NOLINT(readability/nolint) - -/******************************************************************************* -* MODULE : VehicleSensInitGsnsZExtl -* ABSTRACT : Vehicle sensor GSNS_Z initialization function -* FUNCTION : GSNS_Z data master initialization processing -* ARGUMENT : void -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensInitGsnsZExtl(void) { - memset(&gstGsnsZExt_l, 0x00, sizeof(VEHICLESENS_DATA_MASTER_EXT)); - gstGsnsZExt_l.ul_did = POSHAL_DID_GSNS_Z; - gstGsnsZExt_l.us_size = VEHICLE_DSIZE_GSNS_Z_EXT_INIT; - gstGsnsZExt_l.uc_rcvflag = VEHICLE_RCVFLAG_OFF; -} - -/** - * @brief - * Vehicle sensor GSNS_Z SET function - * - * Update the GSNS_Z data master - * - * @param[in] *pst_data : Pointer to the message data received by the direct line - */ -void VehicleSensSetGsnsZExtlG(const LSDRV_LSDATA_G *pst_data) { - VEHICLESENS_DATA_MASTER_EXT *pst_master; - u_int16 us_start = 0; - u_int16 us_size = 0; - u_int16 us_cnt = 0; - - pst_master = &gstGsnsZExt_l; - us_size = static_cast<u_int16>(sizeof(u_int16) * 10); /* Size of one data item: 2byte * 10 data items */ - - /* Store the latest one in the internal data structure */ - us_start = gstPkgTempExt.start_point[GsnsZ]; /* Location to store one received message */ - /* Stored in data master(Order of reception)*/ - if (us_start >= VEHICLE_DKEEP_MAX) { - /* Store the latest one at position 0 */ - us_start = VEHICLE_DATA_POS_00; - /* If you are discarding old data,,Set a flag */ - gstPkgTempExt.data_break = VEHICLE_SNS_BREAK; - } - pst_master->ul_did = pst_data->ul_did; - pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON; - for (us_cnt = 0; us_cnt < us_size; us_cnt++) { - pst_master->uc_data[us_start * us_size + us_cnt] = (u_int8)(pst_data->uc_data[us_cnt]); - } - - /* Update next storage start position and latest data storage position */ - us_start++; - gstPkgTempExt.start_point[GsnsZ] = us_start; - - /* Update data master size */ - if (gstPkgTempExt.data_break == VEHICLE_SNS_BREAK) { - /* Make the size of all extended data masters */ - pst_master->us_size = VEHICLE_DSIZE_GSNS_Z_EXT; - } else { - /* Add the size of one received data item */ - pst_master->us_size = static_cast<u_int16>(pst_master->us_size + us_size); - } -} - -/******************************************************************************* -* MODULE : VehicleSensGetGsnsZExtl -* ABSTRACT : Vehicle sensor GSNS_Z GET function -* FUNCTION : Provide the GSNS_Z data master -* ARGUMENT : *pst_data : Pointer to the data master acquisition destination -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensGetGsnsZExtl(VEHICLESENS_DATA_MASTER_EXT *pst_data) { - const VEHICLESENS_DATA_MASTER_EXT *pst_master; - uint16_t us_size = 0; - uint16_t us_data_cnt = 0; // Number of data contained - uint16_t us_loop_cnt = 0; // 64 over index - - /* Store the data master in the specified destination. */ - pst_master = &gstGsnsZExt_l; - pst_data->ul_did = pst_master->ul_did; - pst_data->us_size = pst_master->us_size; - pst_data->uc_rcvflag = pst_master->uc_rcvflag; - - us_size = static_cast<u_int16>(sizeof(u_int16) * 10); /* Size of one data item: 2byte * 10 data items */ - - /* Checking whether the number of stored entries is looped */ - if (gstPkgTempExt.data_break == VEHICLE_SNS_BREAK) { - us_data_cnt = VEHICLE_DKEEP_MAX; - } else { - us_data_cnt = gstPkgTempExt.start_point[GsnsZ]; - } - - /* Acquire data from the oldest data master */ - for (uint16_t us_cnt = 0; us_cnt < us_data_cnt; us_cnt++) { - if (gstPkgTempExt.data_break == VEHICLE_SNS_BREAK) { - /* Get information before loop */ - if (gstPkgTempExt.start_point[GsnsZ] + us_cnt < VEHICLE_DKEEP_MAX) { - memcpy(&pst_data->uc_data[us_cnt * us_size], - &pst_master->uc_data[(gstPkgTempExt.start_point[GsnsZ] + us_cnt) * us_size], us_size); - } else { - memcpy(&pst_data->uc_data[us_cnt * us_size], - &pst_master->uc_data[us_loop_cnt * us_size], us_size); - us_loop_cnt++; - } - } else { - memcpy(&pst_data->uc_data[us_cnt * us_size], - &pst_master->uc_data[us_cnt * us_size], us_size); - } - } -} -#endif diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GsnsZFst_l.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GsnsZFst_l.cpp deleted file mode 100755 index a69bb87..0000000 --- a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GsnsZFst_l.cpp +++ /dev/null @@ -1,127 +0,0 @@ -/* - * @copyright Copyright (c) 2019-2020 TOYOTA MOTOR CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @file - * VehicleSens_Did_GsnsZFst_l.cpp - * @brief - * Vehicle sensor data master(POSHAL_DID_GSNS_Z_FST) - */ - -#include "VehicleSens_DataMaster.h" - -/*************************************************/ -/* Global variable */ -/*************************************************/ -static VEHICLESENS_DATA_MASTER_FST g_st_gsnsz_fst_l; // NOLINT(readability/nolint) - -/** - * @brief - * Vehicle sensor GSNS_Z initialization function - * - * GSNS_Z data master initialization processing - */ -void VehicleSensInitGsnsZFstl(void) { - memset(&g_st_gsnsz_fst_l, 0x00, sizeof(VEHICLESENS_DATA_MASTER_FST)); - g_st_gsnsz_fst_l.ul_did = POSHAL_DID_GSNS_Z_FST; - g_st_gsnsz_fst_l.us_size = VEHICLE_DSIZE_GSNS_Z_EXT_INIT; - g_st_gsnsz_fst_l.uc_rcvflag = VEHICLE_RCVFLAG_OFF; - g_st_gsnsz_fst_l.partition_flg = 0; -} - -/** - * @brief - * Vehicle sensor GSNS_Z SET function - * - * Update the GSNS_Z data master - * - * @param[in] *pst_data : Pointer to the message data received by the direct line - * - * @return VEHICLESENS_EQ No data change<br> - * VEHICLESENS_NEQ Data change - */ -u_int8 VehicleSensSetGsnsZFstG(const LSDRV_LSDATA_FST_GSENSOR_Z *pst_data) { - static u_int8 uc_ret = VEHICLESENS_EQ; - VEHICLESENS_DATA_MASTER_FST *pst_master; - - u_int8 partition_max; /* Total number of partitions */ - u_int8 partition_num; /* Data number */ - - pst_master = &g_st_gsnsz_fst_l; - - partition_max = pst_data->uc_partition_max; - partition_num = pst_data->uc_partition_num; - - if (partition_max == 1) { - /* Compare data master and received data */ - uc_ret = VehicleSensmemcmp(pst_master->uc_data, pst_data->uc_data, pst_data->uc_size); - - /* Received data is set in the data master. */ - pst_master->ul_did = pst_data->ul_did; - pst_master->us_size = pst_data->uc_size; - pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON; - pst_master->partition_flg = 0; - memset(pst_master->uc_data, 0x00, sizeof(pst_master->uc_data)); - memcpy(pst_master->uc_data, pst_data->uc_data, pst_data->uc_size); - } else if (partition_max == 2) { - if (partition_num == 1) { - /* Compare data master and received data */ - uc_ret = VehicleSensmemcmp(pst_master->uc_data, pst_data->uc_data, pst_data->uc_size); - - /* Received data is set in the data master. */ - pst_master->ul_did = pst_data->ul_did; - pst_master->us_size = static_cast<u_int16>(pst_master->us_size + pst_data->uc_size); - pst_master->partition_flg = 1; - memcpy(pst_master->uc_data, pst_data->uc_data, pst_data->uc_size); - } else if (partition_num == 2) { - /* Compare data master and received data */ - if (uc_ret == VEHICLESENS_EQ) { - uc_ret = VehicleSensmemcmp(&pst_master->uc_data[VEHICLE_DSIZE_GSNSZ_FST], - pst_data->uc_data, pst_data->uc_size); - } - - /* Received data is set in the data master. */ - pst_master->ul_did = pst_data->ul_did; - pst_master->us_size = static_cast<u_int16>(pst_master->us_size + pst_data->uc_size); - pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON; - pst_master->partition_flg = 1; - memcpy(&pst_master->uc_data[VEHICLE_DSIZE_GSNSZ_FST], pst_data->uc_data, pst_data->uc_size); - } else {} - } else {} - - return(uc_ret); -} - -/** - * @brief - * Vehicle sensor GSNS_Z GET function - * - * Provide the GSNS_Z data master - * - * @param[in] Pointer to the data master acquisition destination - */ -void VehicleSensGetGsnsZFstl(VEHICLESENS_DATA_MASTER_FST *pst_data) { - const VEHICLESENS_DATA_MASTER_FST *pst_master; - - pst_master = &g_st_gsnsz_fst_l; - - /* Store the data master in the specified destination. */ - pst_data->ul_did = pst_master->ul_did; - pst_data->us_size = pst_master->us_size; - pst_data->uc_rcvflag = pst_master->uc_rcvflag; - pst_data->partition_flg = pst_master->partition_flg; - memcpy(pst_data->uc_data, pst_master->uc_data, pst_master->us_size); -} diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GsnsZ_l.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GsnsZ_l.cpp deleted file mode 100755 index 8614535..0000000 --- a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GsnsZ_l.cpp +++ /dev/null @@ -1,97 +0,0 @@ -/* - * @copyright Copyright (c) 2019-2020 TOYOTA MOTOR CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/******************************************************************************* - * File name :VehicleSens_Did_GsnsZ_l.cpp - * Subsystem name :Vehicle sensor process - * Program name :Vehicle sensor data master(POSHAL_DID_GSNS_Z) - * Module configuration :VehicleSensInitGsnsZl() Vehicle sensor GSNS_Z initialization function - * :VehicleSensSetGsnsZlG() Vehicle sensor GSNS_Z SET function - * :VehicleSensGetGsnsZl() Vehicle sensor GSNS_Z GET function - ******************************************************************************/ - -#include "VehicleSens_DataMaster.h" - -/*************************************************/ -/* Global variable */ -/*************************************************/ -static VEHICLESENS_DATA_MASTER gstGsnsZ_l; // NOLINT(readability/nolint) - -/******************************************************************************* -* MODULE : VehicleSensInitGsnsZl -* ABSTRACT : Vehicle sensor GSNS_Z initialization function -* FUNCTION : GSNS_Z data master initialization processing -* ARGUMENT : void -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensInitGsnsZl(void) { - memset(&gstGsnsZ_l, 0x00, sizeof(VEHICLESENS_DATA_MASTER)); - gstGsnsZ_l.ul_did = POSHAL_DID_GSNS_Z; - gstGsnsZ_l.us_size = VEHICLE_DSIZE_GSNS_Z; - gstGsnsZ_l.uc_rcvflag = VEHICLE_RCVFLAG_OFF; -} - -/** - * @brief - * Vehicle sensor GSNS_Z SET function - * - * Update the GSNS_Z data master - * - * @param[in] *pst_data : Pointer to the message data received by the direct line - * - * @return VEHICLESENS_EQ No data change<br> - * VEHICLESENS_NEQ Data change - * - */ -u_int8 VehicleSensSetGsnsZlG(const LSDRV_LSDATA_G *pst_data) { - u_int8 uc_ret; - VEHICLESENS_DATA_MASTER *pst_master; - - pst_master = &gstGsnsZ_l; - - /* Compare data master and received data */ - uc_ret = VehicleSensmemcmp(pst_master->uc_data, pst_data->uc_data, pst_data->uc_size); - - /* Received data is set in the data master. */ - pst_master->ul_did = pst_data->ul_did; - pst_master->us_size = pst_data->uc_size; - pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON; - (void)memcpy(reinterpret_cast<void *>(pst_master->uc_data), - (const void *)(pst_data->uc_data), (size_t)(pst_data->uc_size)); - - return(uc_ret); -} - -/******************************************************************************* -* MODULE : VehicleSensGetGsnsZl -* ABSTRACT : Vehicle sensor GSNS_Z GET function -* FUNCTION : Provide the GSNS_Z data master -* ARGUMENT : *pst_data : Pointer to the data master acquisition destination -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensGetGsnsZl(VEHICLESENS_DATA_MASTER *pst_data) { - const VEHICLESENS_DATA_MASTER *pst_master; - - pst_master = &gstGsnsZ_l; - - /* Store the data master in the specified destination. */ - pst_data->ul_did = pst_master->ul_did; - pst_data->us_size = pst_master->us_size; - pst_data->uc_rcvflag = pst_master->uc_rcvflag; - memcpy(pst_data->uc_data, pst_master->uc_data, pst_master->us_size); -} diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GyroConnectStatus.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GyroConnectStatus.cpp deleted file mode 100755 index d6fee30..0000000 --- a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GyroConnectStatus.cpp +++ /dev/null @@ -1,110 +0,0 @@ -/* - * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/******************************************************************************* - * File name :VehicleSens_Did_GyroConnectStatus.cpp - * System name :PastModel002 - * Subsystem name :Vehicle sensor process - * Program name :Vehicle sensor data master(VEHICLE_DID_GYRO_CONNECT_STATUS) - * Module configuration :VehicleSensInitGyroConnectStatus() Vehicle Sensor GYRO CONNECT STATUS Initialization Functions - * :VehicleSensSetGyroConnectStatus() Vehicle Sensor GYRO CONNECT STATUS SET Functions - * :VehicleSensGetGyroConnectStatus() Vehicle Sensor GYRO CONNECT STATUS GET Functions - ******************************************************************************/ - -#include <vehicle_service/positioning_base_library.h> -#include "VehicleSens_DataMaster.h" - -/*************************************************/ -/* Global variable */ -/*************************************************/ -static VEHICLESENS_DATA_MASTER_GYRO_CONNECT_STATUS gstGyroConnectStatus; // NOLINT(readability/nolint) - -/******************************************************************************* -* MODULE : VehicleSensInitGyroConnectStatus -* ABSTRACT : Vehicle sensor GYRO_CONNECT_STATUS initialization function -* FUNCTION : GYRO_CONNECT_STATUS data master initialization processing -* ARGUMENT : void -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensInitGyroConnectStatus(void) { - (void)memset(reinterpret_cast<void *>(&(gstGyroConnectStatus)), static_cast<int>(0x00), - sizeof(VEHICLESENS_DATA_MASTER_GYRO_CONNECT_STATUS)); - gstGyroConnectStatus.ul_did = VEHICLE_DID_GYRO_CONNECT_STATUS; - gstGyroConnectStatus.us_size = VEHICLE_DSIZE_GYRO_CONNECT_STATUS; - gstGyroConnectStatus.uc_data = VEHICLE_DINIT_GYRO_CONNECT_STATUS; -} - -/******************************************************************************* -* MODULE : VehicleSensSetGyroConnectStatus -* ABSTRACT : Vehicle sensor GYRO_CONNECT_STATUS SET function -* FUNCTION : Update the GYRO_CONNECT_STATUS data master -* ARGUMENT : *pst_data : Pointer to received message data -* NOTE : -* RETURN : VEHICLESENS_EQ : No data change -* VEHICLESENS_NEQ : Data change -******************************************************************************/ -u_int8 VehicleSensSetGyroConnectStatus(const LSDRV_MSG_LSDATA_DAT_GYRO_CONNECT_STATUS *pst_data) { // LCOV_EXCL_START 8: dead code. // NOLINT(whitespace/line_length) - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - u_int8 uc_ret = VEHICLESENS_EQ; - VEHICLESENS_DATA_MASTER_GYRO_CONNECT_STATUS *pst_master; - - if (pst_data == NULL) { - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "pst_data == NULL\r\n"); - } else { - pst_master = &gstGyroConnectStatus; - - /* Compare data master and received data */ - uc_ret = VehicleSensmemcmp(reinterpret_cast<void *>(&(pst_master->uc_data)), - (const void *)(&(pst_data->uc_data)), (size_t)(pst_data->uc_size)); - - /* Received data is set in the data master. */ - pst_master->ul_did = pst_data->ul_did; - pst_master->us_size = (u_int16)pst_data->uc_size; - pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON; - (void)memcpy(reinterpret_cast<void *>(&(pst_master->uc_data)), - (const void *)(&(pst_data->uc_data)), sizeof(pst_master->uc_data)); - } - - return(uc_ret); -} - -/******************************************************************************* -* MODULE : VehicleSensGetGyroConnectStatus -* ABSTRACT : Vehicle Sensor GYRO TROUBLE GET Functions -* FUNCTION : Provide a GYRO TROUBLE data master -* ARGUMENT : *pst_data : Pointer to the data master acquisition destination -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensGetGyroConnectStatus(VEHICLESENS_DATA_MASTER_GYRO_CONNECT_STATUS *pst_data) { - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - const VEHICLESENS_DATA_MASTER_GYRO_CONNECT_STATUS *pst_master; - - if (pst_data == NULL) { - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "pst_data == NULL\r\n"); - } else { - pst_master = &gstGyroConnectStatus; - - /* Store the data master in the specified destination. */ - pst_data->ul_did = pst_master->ul_did; - pst_data->us_size = pst_master->us_size; - pst_data->uc_rcvflag = pst_master->uc_rcvflag; - (void)memcpy(reinterpret_cast<void *>(&(pst_data->uc_data)), - (const void *)(&(pst_master->uc_data)), sizeof(pst_data->uc_data)); - } -} -// LCOV_EXCL_STOP diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GyroExt_l.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GyroExt_l.cpp deleted file mode 100755 index 0470c9f..0000000 --- a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GyroExt_l.cpp +++ /dev/null @@ -1,257 +0,0 @@ -/* - * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/******************************************************************************* - * File name :VehicleSens_Did_GyroExt_l.cpp - * System name :Polaris - * Subsystem name :Vehicle sensor process - * Program name :Vehicle sensor data master(POSHAL_DID_GYRO_EXT) - * Module configuration :VehicleSensInitGyroExtl() Vehicle Sensor GYRO (Initial Delivery) Initialization Functions - * :VehicleSensSetGyroExtlG() Vehicle Sensor GYRO (Initial Delivery) Set Functions - * :VehicleSensGetGyroExtl() Vehicle Sensor GYRO (Initial Delivery) Get Functions - ******************************************************************************/ - -#include <vehicle_service/positioning_base_library.h> -#include "VehicleSens_DataMaster.h" - -/* Ignore->MISRA-C++:2008 Rule 2-7-2 */ -#if CONFIG_SENSOR_EXT_VALID /* Initial Sensor Support */ -/*************************************************/ -/* Global variable */ -/*************************************************/ -static VEHICLESENS_DATA_MASTER_EXT gstGyroExt_l; // NOLINT(readability/nolint) -static VEHICLESENS_DATA_MASTER gstGyroRev_l; // NOLINT(readability/nolint) - -/******************************************************************************* -* MODULE : VehicleSensInitGyroRevl -* ABSTRACT : Vehicle Sensor GYRO Initialization Functions(Extensions data) -* FUNCTION : GYRO data master initialization process -* ARGUMENT : void -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensInitGyroRevl(void) { - u_int16 *pus; - - memset(&gstGyroRev_l, 0x00, sizeof(VEHICLESENS_DATA_MASTER)); - /* POSHAL_DID_GYRO initialized by POSHAL_DID_GYRO_X because POSHAL_DID_GYRO is internally replaced by POSHAL_DID_GYRO_EXT */ - gstGyroRev_l.ul_did = POSHAL_DID_GYRO_X; - gstGyroRev_l.us_size = VEHICLE_DSIZE_GYRO; - - pus = reinterpret_cast<u_int16 *>(gstGyroRev_l.uc_data); - pus[0] = VEHICLE_DINIT_GYRO; /* Ignore->MISRA-C++:2008 Rule 5-0-15 */ - pus[1] = VEHICLE_DINIT_GYRO; /* Ignore->MISRA-C++:2008 Rule 5-0-15 */ - pus[2] = VEHICLE_DINIT_GYRO; /* Ignore->MISRA-C++:2008 Rule 5-0-15 */ -} - -/******************************************************************************* -* MODULE : VehicleSensInitGyroExtl -* ABSTRACT : Vehicle Sensor GYRO Initialization Functions(Initial delivery) -* FUNCTION : GYRO data master initialization process -* ARGUMENT : void -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensInitGyroExtl(void) { - u_int16 *pus; - - memset(&gstGyroExt_l, 0x00, sizeof(VEHICLESENS_DATA_MASTER_EXT)); - /* POSHAL_DID_GYRO initialized by POSHAL_DID_GYRO_X because POSHAL_DID_GYRO is internally replaced by POSHAL_DID_GYRO_EXT */ - gstGyroExt_l.ul_did = POSHAL_DID_GYRO_X; - gstGyroExt_l.us_size = VEHICLE_DSIZE_GYRO_EXT_INIT; - - pus = reinterpret_cast<u_int16 *>(gstGyroExt_l.uc_data); - memset(reinterpret_cast<void*>(pus), VEHICLE_DINIT_GYRO, VEHICLE_DSIZE_GYRO_EXT); -} - -/******************************************************************************* -* MODULE : VehicleSensSetGyroRevl -* ABSTRACT : Vehicle Sensor GYRO SET Functions -* FUNCTION : Update the GYRO data master -* ARGUMENT : *pst_data : Pointer to the message data received by the direct line -* NOTE : -* RETURN : VEHICLESENS_EQ : No data change -* VEHICLESENS_NEQ : Data change -******************************************************************************/ -u_int8 VehicleSensSetGyroRevl(const LSDRV_LSDATA *pst_data) { // LCOV_EXCL_START 8 : dead code - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - u_int8 uc_ret; - VEHICLESENS_DATA_MASTER *pst_master; - - pst_master = &gstGyroRev_l; - - /* Compare data master and received data */ - uc_ret = VehicleSensmemcmp(pst_master->uc_data, - pst_data->uc_data, pst_data->uc_size); /* Ignore->MISRA-C++:2008 Rule 5-0-5 */ - - /* Received data is set in the data master. */ - pst_master->ul_did = POSHAL_DID_GYRO_X; - pst_master->us_size = pst_data->uc_size; /* Ignore->MISRA-C++:2008 Rule 5-0-5 */ - pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON; - pst_master->uc_snscnt = pst_data->uc_sns_cnt; - memset(pst_master->uc_data, 0x00, sizeof(pst_master->uc_data)); - memcpy(pst_master->uc_data, pst_data->uc_data, pst_data->uc_size); /* Ignore->MISRA-C++:2008 Rule 5-0-5 */ - - return(uc_ret); -} -// LCOV_EXCL_STOP - -/******************************************************************************* -* MODULE : VehicleSensSetGyroRevlG -* ABSTRACT : Vehicle Sensor GYRO SET Functions -* FUNCTION : Update the GYRO data master -* ARGUMENT : *pst_data : Pointer to the message data received by the direct line -* NOTE : -* RETURN : VEHICLESENS_EQ : No data change -* VEHICLESENS_NEQ : Data change -******************************************************************************/ -u_int8 VehicleSensSetGyroRevlG(const LSDRV_LSDATA_G *pst_data) { - u_int8 uc_ret; - VEHICLESENS_DATA_MASTER *pst_master; - - pst_master = &gstGyroRev_l; - - /* Compare data master and received data */ - /* Ignore->MISRA-C++:2008 Rule 5-0-5 */ - uc_ret = VehicleSensmemcmp(pst_master->uc_data, pst_data->uc_data, pst_data->uc_size); - - /* Received data is set in the data master. */ - pst_master->ul_did = POSHAL_DID_GYRO_X; - pst_master->us_size = pst_data->uc_size; /* Ignore->MISRA-C++:2008 Rule 5-0-5 */ - pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON; - pst_master->uc_snscnt = pst_data->uc_sns_cnt; - memcpy(pst_master->uc_data, pst_data->uc_data, pst_data->uc_size); /* Ignore->MISRA-C++:2008 Rule 5-0-5 */ - - return(uc_ret); -} - -/******************************************************************************* -* MODULE : VehicleSensSetGyroExtlG -* ABSTRACT : Vehicle Sensor GYRO SET Functions(Initial delivery) -* FUNCTION : Update the GYRO data master -* ARGUMENT : *pst_data : Pointer to the message data received by the direct line -* NOTE : -* RETURN : VEHICLESENS_EQ : No data change -* VEHICLESENS_NEQ : Data change -******************************************************************************/ -void VehicleSensSetGyroExtlG(const LSDRV_LSDATA_G *pst_data) { - VEHICLESENS_DATA_MASTER_EXT *pst_master; - u_int16 us_start = 0; - u_int16 us_size = 0; - u_int16 us_cnt = 0; - - pst_master = &gstGyroExt_l; - us_size = static_cast<u_int16>(sizeof(u_int16) * 10); /* Size of one data item: 2byte * 10 data items */ - - /* Retrieve the location where the received one is stored */ - us_start = gstPkgTempExt.start_point[GyroExt]; - - /* Stored in data master(Order of reception)*/ - if (us_start >= VEHICLE_DKEEP_MAX) { - /* Store the latest one at position 0 */ - us_start = VEHICLE_DATA_POS_00; - /* If you are discarding old data,,Set a flag */ - gstPkgTempExt.data_break = VEHICLE_SNS_BREAK; - } - pst_master->ul_did = POSHAL_DID_GYRO_X; - pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON; - for (us_cnt = 0; us_cnt < us_size; us_cnt++) { - pst_master->uc_data[us_start * us_size + us_cnt] = (u_int8)(pst_data->uc_data[us_cnt]); - } - - /* Update next storage start position and latest data storage position */ - us_start++; - gstPkgTempExt.start_point[GyroExt] = us_start; - - /* Update data master size */ - if (gstPkgTempExt.data_break == VEHICLE_SNS_BREAK) { - /* Make the size of all extended data masters */ - pst_master->us_size = VEHICLE_DSIZE_GYRO_EXT; - } else { - /* Add the size of one received data item */ - pst_master->us_size = static_cast<u_int16>(pst_master->us_size + us_size); - } -} - -/******************************************************************************* -* MODULE : VehicleSensGetGyroExtl -* ABSTRACT : Vehicle Sensor GYRO GET Functions(Initial delivery) -* FUNCTION : Provide a GYRO data master -* ARGUMENT : *pst_data : Pointer to the data master acquisition destination -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensGetGyroExtl(VEHICLESENS_DATA_MASTER_EXT *pst_data) { - const VEHICLESENS_DATA_MASTER_EXT *pst_master; - uint16_t us_size = 0; - uint16_t us_data_cnt = 0; // Number of data contained - uint16_t us_loop_cnt = 0; // 64 over index - - /* Store the data master in the specified destination. */ - pst_master = &gstGyroExt_l; - pst_data->ul_did = pst_master->ul_did; - pst_data->us_size = pst_master->us_size; - pst_data->uc_rcvflag = pst_master->uc_rcvflag; - - us_size = static_cast<u_int16>(sizeof(u_int16) * 10); /* Size of one data item: 2byte * 10 data items */ - - /* Checking whether the number of stored entries is looped */ - if (gstPkgTempExt.data_break == VEHICLE_SNS_BREAK) { - us_data_cnt = VEHICLE_DKEEP_MAX; - } else { - us_data_cnt = gstPkgTempExt.start_point[GyroExt]; - } - - /* Acquire data from the oldest data master */ - for (uint16_t us_cnt = 0; us_cnt < us_data_cnt; us_cnt++) { - if (gstPkgTempExt.data_break == VEHICLE_SNS_BREAK) { - /* Get information before loop */ - if (gstPkgTempExt.start_point[GyroExt] + us_cnt < VEHICLE_DKEEP_MAX) { - memcpy(&pst_data->uc_data[us_cnt * us_size], - &pst_master->uc_data[(gstPkgTempExt.start_point[GyroExt] + us_cnt) * us_size], us_size); - } else { - memcpy(&pst_data->uc_data[us_cnt * us_size], - &pst_master->uc_data[us_loop_cnt * us_size], us_size); - us_loop_cnt++; - } - } else { - memcpy(&pst_data->uc_data[us_cnt * us_size], - &pst_master->uc_data[us_cnt * us_size], us_size); - } - } -} - -/******************************************************************************* -* MODULE : VehicleSensGetGyroRevl -* ABSTRACT : Vehicle Sensor GYRO GET Functions(Initial delivery) -* FUNCTION : Provide a GYRO data master -* ARGUMENT : *pst_data : Pointer to the data master acquisition destination -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensGetGyroRevl(VEHICLESENS_DATA_MASTER *pst_data) { - const VEHICLESENS_DATA_MASTER *pst_master; - - pst_master = &gstGyroRev_l; - - /* Store the data master in the specified destination. */ - pst_data->ul_did = pst_master->ul_did; - pst_data->us_size = pst_master->us_size; - pst_data->uc_rcvflag = pst_master->uc_rcvflag; - pst_data->uc_snscnt = pst_master->uc_snscnt; - memcpy(pst_data->uc_data, pst_master->uc_data, pst_master->us_size); /* Ignore->MISRA-C++:2008 Rule 5-0-5 */ -} -#endif diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GyroTemp.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GyroTemp.cpp deleted file mode 100755 index d6debe6..0000000 --- a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GyroTemp.cpp +++ /dev/null @@ -1,114 +0,0 @@ -/* - * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @file - * VehicleSens_Did_GyroTemp.cpp - * @brief - * Vehicle sensor data master(VEHICLE_DID_GYRO_TEMP_) - */ - -#include <vehicle_service/positioning_base_library.h> -#include "VehicleSens_DataMaster.h" - -/*************************************************/ -/* Global variable */ -/*************************************************/ - -/** - * @brief - * Vehicle Sensor Gyro Temperature GET Function - * - * Provide a gyro temperature data master - * - * @param[in] *pst_data: Pointer to the data master acquisition destination - * @param[in] uc_get_method: Acquisition method(Direct Line or CAN) - */ -void VehicleSensGetGyroTemp(VEHICLESENS_DATA_MASTER *pst_data, u_int8 uc_get_method) { - switch (uc_get_method) { // LCOV_EXCL_BR_LINE 6:VEHICLESENS_GETMETHOD_CAN cannot to pass in - case VEHICLESENS_GETMETHOD_CAN: - { - /* When acquiring from CAN data */ - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - break; // LCOV_EXCL_LINE 8: dead code - } - case VEHICLESENS_GETMETHOD_LINE: - { - /* To acquire from LineSensor */ - VehicleSensGetGyroTempl(pst_data); - break; - } - default: - break; - } -} - -/** - * @brief - * Vehicle Sensor Gyro Temperature (Initial Delivery) GET Function - * - * Provide a gyro temperature data master - * - * @param[in] *pst_data: Pointer to the data master acquisition destination - * @param[in] uc_get_method: Acquisition method(Direct Line or CAN) - */ -void VehicleSensGetGyroTempExt(VEHICLESENS_DATA_MASTER_EXT *pst_data, u_int8 uc_get_method) { - switch (uc_get_method) { // LCOV_EXCL_BR_LINE 6:VEHICLESENS_GETMETHOD_CAN cannot to pass in - case VEHICLESENS_GETMETHOD_CAN: - { - /* When acquiring from CAN data */ - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - break; // LCOV_EXCL_LINE 8: dead code - } - case VEHICLESENS_GETMETHOD_LINE: - { - /* To acquire from LineSensor */ - VehicleSensGetGyroTempExtl(pst_data); - break; - } - default: - break; - } -} - -/** - * @brief - * Vehicle sensor gyro temperature (initial sensor) GET function - * - * Provide a gyro temperature data master - * - * @param[in] *pst_data: Pointer to the data master acquisition destination - * @param[in] uc_get_method: Acquisition method(Direct Line or CAN) - */ -void VehicleSensGetGyroTempFst(VEHICLESENS_DATA_MASTER_FST *pst_data, u_int8 uc_get_method) { - switch (uc_get_method) { // LCOV_EXCL_BR_LINE 6:VEHICLESENS_GETMETHOD_CAN cannot to pass in - case VEHICLESENS_GETMETHOD_CAN: - { - /* When acquiring from CAN data */ - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - break; // LCOV_EXCL_LINE 8: dead code - } - case VEHICLESENS_GETMETHOD_LINE: - { - /* To acquire from LineSensor */ - VehicleSensGetGyroTempFstl(pst_data); - break; - } - default: - break; - } -} - diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GyroTempExt_l.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GyroTempExt_l.cpp deleted file mode 100755 index aee750d..0000000 --- a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GyroTempExt_l.cpp +++ /dev/null @@ -1,140 +0,0 @@ -/* - * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @file - * VehicleSens_Did_GyroTempExt_l.cpp - * @brief - * Vehicle sensor data master(POSHAL_DID_GYRO_TEMP) - */ - -#include <vehicle_service/positioning_base_library.h> -#include "VehicleSens_DataMaster.h" - -/*************************************************/ -/* Global variable */ -/*************************************************/ -static VEHICLESENS_DATA_MASTER_EXT g_stgyro_temp_ext_l; // NOLINT(readability/nolint) - -/** - * @brief - * Vehicle sensor gyro temperature initialization function - * - * Gyro Temperature Data Master Initialization Processing - */ -void VehicleSensInitGyroTempExtl(void) { - (void)memset(reinterpret_cast<void *>(&g_stgyro_temp_ext_l), 0, sizeof(VEHICLESENS_DATA_MASTER_EXT)); - g_stgyro_temp_ext_l.ul_did = POSHAL_DID_GYRO_TEMP; - g_stgyro_temp_ext_l.us_size = VEHICLE_DSIZE_GYRO_TEMP_EXT_INIT; - g_stgyro_temp_ext_l.uc_rcvflag = VEHICLE_RCVFLAG_OFF; -} - -/** - * @brief - * Vehicle Sensor Gyro Temperature SET Function - * - * Update the gyro temperature data master - * - * @param[in] *pst_data : Pointer to the message data received by the direct line - * - * @return VEHICLESENS_EQ No data change<br> - * VEHICLESENS_NEQ Data change - */ -void VehicleSensSetGyroTempExtlG(const LSDRV_LSDATA_G *pst_data) { - VEHICLESENS_DATA_MASTER_EXT *pst_master; - u_int16 us_start = 0; - u_int16 us_size = 0; - u_int16 us_cnt = 0; - - pst_master = &g_stgyro_temp_ext_l; - us_size = sizeof(u_int16); /* Size of one data item: 2byte */ - - /* Store the latest one in the internal data structure */ - us_start = gstPkgTempExt.start_point[GyroTemp]; /* Location to store one received message */ - /* Stored in data master(Order of reception)*/ - if (us_start == VEHICLE_DKEEP_MAX) { - /* Store the latest one at position 0 */ - us_start = VEHICLE_DATA_POS_00; - /* If you are discarding old data,,Set a flag */ - gstPkgTempExt.data_break = VEHICLE_SNS_BREAK; - } - pst_master->ul_did = pst_data->ul_did; - pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON; - for (us_cnt = 0; us_cnt < us_size; us_cnt++) { - pst_master->uc_data[us_start * us_size + us_cnt] = (u_int8)(pst_data->uc_data[us_cnt]); - } - - /* Update next storage start position and latest data storage position. */ - us_start++; - gstPkgTempExt.start_point[GyroTemp] = us_start; - - /* Update data master size */ - if (gstPkgTempExt.data_break == VEHICLE_SNS_BREAK) { - /* Make the size of all extended data masters */ - pst_master->us_size = VEHICLE_DSIZE_GYRO_TEMP_EXT; - } else { - /* Add the size of one received data item */ - pst_master->us_size = static_cast<u_int16>(pst_master->us_size + us_size); - } -} - -/** - * @brief - * Vehicle Sensor Gyro Temperature GET Function - * - * Provide a gyro temperature data master - * - * @param[in] Pointer to the data master acquisition destination - */ -void VehicleSensGetGyroTempExtl(VEHICLESENS_DATA_MASTER_EXT *pst_data) { - const VEHICLESENS_DATA_MASTER_EXT *pst_master; - uint16_t us_size = 0; - uint16_t us_data_cnt = 0; // Number of data contained - uint16_t us_loop_cnt = 0; // 64 over index - - /* Store the data master in the specified destination. */ - pst_master = &g_stgyro_temp_ext_l; - pst_data->ul_did = pst_master->ul_did; - pst_data->us_size = pst_master->us_size; - pst_data->uc_rcvflag = pst_master->uc_rcvflag; - - us_size = sizeof(u_int16); /* Size of one data item: 2byte */ - - /* Checking whether the number of stored entries is looped */ - if (gstPkgTempExt.data_break == VEHICLE_SNS_BREAK) { - us_data_cnt = VEHICLE_DKEEP_MAX; - } else { - us_data_cnt = gstPkgTempExt.start_point[GyroTemp]; - } - - /* Acquire data from the oldest data master */ - for (uint16_t us_cnt = 0; us_cnt < us_data_cnt; us_cnt++) { - if (gstPkgTempExt.data_break == VEHICLE_SNS_BREAK) { - /* Get information before loop */ - if (gstPkgTempExt.start_point[GyroTemp] + us_cnt < VEHICLE_DKEEP_MAX) { - memcpy(&pst_data->uc_data[us_cnt * us_size], - &pst_master->uc_data[(gstPkgTempExt.start_point[GyroTemp] + us_cnt) * us_size], us_size); - } else { - memcpy(&pst_data->uc_data[us_cnt * us_size], - &pst_master->uc_data[us_loop_cnt * us_size], us_size); - us_loop_cnt++; - } - } else { - memcpy(&pst_data->uc_data[us_cnt * us_size], - &pst_master->uc_data[us_cnt * us_size], us_size); - } - } -} diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GyroTempFst_l.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GyroTempFst_l.cpp deleted file mode 100755 index 3c2906d..0000000 --- a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GyroTempFst_l.cpp +++ /dev/null @@ -1,128 +0,0 @@ -/* - * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @file - * VehicleSens_Did_GyroTempFst_l.cpp - * @brief - * Vehicle sensor data master(POSHAL_DID_GYRO_TEMP_FST) - */ - -#include <vehicle_service/positioning_base_library.h> -#include "VehicleSens_DataMaster.h" - -/*************************************************/ -/* Global variable */ -/*************************************************/ -static VEHICLESENS_DATA_MASTER_FST g_st_gyro_tempfst_l; // NOLINT(readability/nolint) - -/** - * @brief - * Vehicle sensor gyro temperature initialization function - * - * Gyro Temperature Data Master Initialization Processing - */ -void VehicleSensInitGyroTempFstl(void) { - memset(&g_st_gyro_tempfst_l, 0x00, sizeof(VEHICLESENS_DATA_MASTER_FST)); - g_st_gyro_tempfst_l.ul_did = POSHAL_DID_GYRO_TEMP_FST; - g_st_gyro_tempfst_l.us_size = VEHICLE_DSIZE_GYRO_TEMP_EXT_INIT; - g_st_gyro_tempfst_l.uc_rcvflag = VEHICLE_RCVFLAG_OFF; - g_st_gyro_tempfst_l.partition_flg = 0; -} - -/** - * @brief - * Vehicle Sensor Gyro Temperature SET Function - * - * Update the gyro temperature data master - * - * @param[in] *pst_data : Pointer to the message data received by the direct line - * - * @return VEHICLESENS_EQ No data change<br> - * VEHICLESENS_NEQ Data change - */ -u_int8 VehicleSensSetGyroTempFstG(const LSDRV_LSDATA_FST_GYRO_TEMP *pst_data) { - static u_int8 uc_ret = VEHICLESENS_EQ; - VEHICLESENS_DATA_MASTER_FST *pst_master; - - u_int8 partition_max; /* Total number of partitions */ - u_int8 partition_num; /* Data number */ - - pst_master = &g_st_gyro_tempfst_l; - - partition_max = pst_data->uc_partition_max; - partition_num = pst_data->uc_partition_num; - - if (partition_max == 1) { - /* Compare data master and received data */ - uc_ret = VehicleSensmemcmp(pst_master->uc_data, pst_data->uc_data, pst_data->uc_size); - - /* Received data is set in the data master. */ - pst_master->ul_did = pst_data->ul_did; - pst_master->us_size = pst_data->uc_size; - pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON; - pst_master->partition_flg = 0; - memset(pst_master->uc_data, 0x00, sizeof(pst_master->uc_data)); - memcpy(pst_master->uc_data, pst_data->uc_data, pst_data->uc_size); - } else if (partition_max == 2) { - if (partition_num == 1) { - /* Compare data master and received data */ - uc_ret = VehicleSensmemcmp(pst_master->uc_data, pst_data->uc_data, pst_data->uc_size); - - /* Received data is set in the data master. */ - pst_master->ul_did = pst_data->ul_did; - pst_master->us_size = static_cast<u_int16>(pst_master->us_size + pst_data->uc_size); - pst_master->partition_flg = 1; - memcpy(pst_master->uc_data, pst_data->uc_data, pst_data->uc_size); - } else if (partition_num == 2) { - /* Compare data master and received data */ - if (uc_ret == VEHICLESENS_EQ) { - uc_ret = VehicleSensmemcmp(&pst_master->uc_data[VEHICLE_DSIZE_GYROTEMP_FST], - pst_data->uc_data, pst_data->uc_size); - } - - /* Received data is set in the data master. */ - pst_master->ul_did = pst_data->ul_did; - pst_master->us_size = static_cast<u_int16>(pst_master->us_size + pst_data->uc_size); - pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON; - pst_master->partition_flg = 1; - memcpy(&pst_master->uc_data[VEHICLE_DSIZE_GYROTEMP_FST], pst_data->uc_data, pst_data->uc_size); - } else {} - } else {} - - return(uc_ret); -} - -/** - * @brief - * Vehicle Sensor Gyro Temperature GET Function - * - * Provide a gyro temperature data master - * - * @param[in] Pointer to the data master acquisition destination - */ -void VehicleSensGetGyroTempFstl(VEHICLESENS_DATA_MASTER_FST *pst_data) { - const VEHICLESENS_DATA_MASTER_FST *pst_master; - - pst_master = &g_st_gyro_tempfst_l; - - /* Store the data master in the specified destination. */ - pst_data->ul_did = pst_master->ul_did; - pst_data->us_size = pst_master->us_size; - pst_data->uc_rcvflag = pst_master->uc_rcvflag; - pst_data->partition_flg = pst_master->partition_flg; - memcpy(pst_data->uc_data, pst_master->uc_data, pst_master->us_size); -} diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GyroTemp_l.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GyroTemp_l.cpp deleted file mode 100755 index 002cf02..0000000 --- a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GyroTemp_l.cpp +++ /dev/null @@ -1,95 +0,0 @@ -/* - * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @file - * VehicleSens_Did_GyroTemp_l.cpp - * @brief - * Vehicle sensor data master(POSHAL_DID_GYRO_TEMP) - */ - -#include <vehicle_service/positioning_base_library.h> -#include "VehicleSens_DataMaster.h" - -/*************************************************/ -/* Global variable */ -/*************************************************/ -static VEHICLESENS_DATA_MASTER gstGyroTemp_l; // NOLINT(readability/nolint) - -/** - * @brief - * Vehicle sensor gyro temperature initialization function - * - * Gyro Temperature Data Master Initialization Processing - */ -void VehicleSensInitGyroTempl(void) { - (void)memset(reinterpret_cast<void *>(&gstGyroTemp_l), 0, sizeof(VEHICLESENS_DATA_MASTER)); - gstGyroTemp_l.ul_did = POSHAL_DID_GYRO_TEMP; - gstGyroTemp_l.us_size = VEHICLE_DSIZE_GYRO_TEMP; - gstGyroTemp_l.uc_rcvflag = VEHICLE_RCVFLAG_OFF; -} - -/** - * @brief - * Vehicle Sensor Gyro Temperature SET Function - * - * Update the gyro temperature data master - * - * @param[in] *pst_data : Pointer to the message data received by the direct line - * - * @return VEHICLESENS_EQ No data change<br> - * VEHICLESENS_NEQ Data change - */ -u_int8 VehicleSensSetGyroTemplG(const LSDRV_LSDATA_G *pst_data) { - u_int8 uc_ret; - VEHICLESENS_DATA_MASTER *pst_master; - - pst_master = &gstGyroTemp_l; - - /* Compare data master and received data */ - uc_ret = VehicleSensmemcmp(pst_master->uc_data, pst_data->uc_data, pst_data->uc_size); - - /* Received data is set in the data master. */ - pst_master->ul_did = pst_data->ul_did; - pst_master->us_size = pst_data->uc_size; - pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON; - (void)memcpy(reinterpret_cast<void *>(pst_master->uc_data), - (const void *)(pst_data->uc_data), (size_t)(pst_data->uc_size)); - - return(uc_ret); -} - -/** - * @brief - * Vehicle Sensor Gyro Temperature GET Function - * - * Provide a gyro temperature data master - * - * @param[in] Pointer to the data master acquisition destination - */ -void VehicleSensGetGyroTempl(VEHICLESENS_DATA_MASTER *pst_data) { - const VEHICLESENS_DATA_MASTER *pst_master; - - pst_master = &gstGyroTemp_l; - - /* Store the data master in the specified destination. */ - pst_data->ul_did = pst_master->ul_did; - pst_data->us_size = pst_master->us_size; - pst_data->uc_rcvflag = pst_master->uc_rcvflag; - pst_data->uc_snscnt = pst_master->uc_snscnt; - (void)memcpy(reinterpret_cast<void *>(pst_data->uc_data), - (const void *)(pst_master->uc_data), (size_t)(pst_master->us_size)); -} diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GyroTrouble.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GyroTrouble.cpp deleted file mode 100755 index e588c39..0000000 --- a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GyroTrouble.cpp +++ /dev/null @@ -1,121 +0,0 @@ -/* - * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/******************************************************************************* - * File name :VehicleSens_Did_GyroTrouble.cpp - * System name :PastModel002 - * Subsystem name :Vehicle sensor process - * Program name :Vehicle sensor data master(VEHICLE_DID_GYRO_TROUBLE) - * Module configuration :VehicleSensInitGyroTrouble() Vehicle Sensor GYRO TROUBLE Initialization Functions - * :VehicleSensSetGyroTrouble() Vehicle Sensor GYRO TROUBLE SET Functions - * :VehicleSensGetGyroTrouble() Vehicle Sensor GYRO TROUBLE GET Functions - ******************************************************************************/ - -#include <vehicle_service/positioning_base_library.h> -#include "VehicleSens_DataMaster.h" - -#define VEHICLE_SENS_DID_GYRO_TROUBLE_DEBUG_FACTORY 0 - -/*************************************************/ -/* Global variable */ -/*************************************************/ -static VEHICLESENS_DATA_MASTER_GYRO_TROUBLE gstGyroTrouble; // NOLINT(readability/nolint) - -/******************************************************************************* -* MODULE : VehicleSensInitGyroTrouble -* ABSTRACT : Vehicle sensor GYRO_TROUBLE initialization function -* FUNCTION : GYRO_TROUBLE data master initialization processing -* ARGUMENT : void -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensInitGyroTrouble(void) { - (void)memset(reinterpret_cast<void *>(&(gstGyroTrouble)), - static_cast<int>(0x00), sizeof(VEHICLESENS_DATA_MASTER_GYRO_TROUBLE)); - gstGyroTrouble.ul_did = VEHICLE_DID_GYRO_TROUBLE; - gstGyroTrouble.us_size = VEHICLE_DSIZE_GYRO_TROUBLE; - gstGyroTrouble.uc_data = VEHICLE_DINIT_GYRO_TROUBLE; -} - -/******************************************************************************* -* MODULE : VehicleSensSetGyroTrouble -* ABSTRACT : Vehicle Sensor GYRO_TROUBLE SET Function -* FUNCTION : Update the GYRO_TROUBLE data master -* ARGUMENT : *pst_data : Pointer to received message data -* NOTE : -* RETURN : VEHICLESENS_EQ : No data change -* VEHICLESENS_NEQ : Data change -******************************************************************************/ -u_int8 VehicleSensSetGyroTrouble(const LSDRV_MSG_LSDATA_DAT_GYRO_TROUBLE *pst_data) { // LCOV_EXCL_START 8: dead code. - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - u_int8 uc_ret = VEHICLESENS_EQ; - VEHICLESENS_DATA_MASTER_GYRO_TROUBLE *pst_master; - - if (pst_data == NULL) { - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "pst_data == NULL\r\n"); - } else { - pst_master = &gstGyroTrouble; - - /* Compare data master and received data */ - uc_ret = VehicleSensmemcmp(&(pst_master->uc_data), &(pst_data->uc_data), pst_data->uc_size); - - /* Received data is set in the data master. */ - pst_master->ul_did = pst_data->ul_did; - pst_master->us_size = (u_int16)pst_data->uc_size; - pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON; - pst_master->uc_data = pst_data->uc_data; - (void)memcpy(reinterpret_cast<void *>(&(pst_master->uc_data)), - (const void *)(&(pst_data->uc_data)), sizeof(pst_master->uc_data)); - } - -#if VEHICLE_SENS_DID_GYRO_TROUBLE_DEBUG_FACTORY - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "#[DIAG] pst_data->ul_did == 0x%x", pst_data->ul_did); - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "#[DIAG] gstGyroTrouble.ul_did == 0x%x\r\n", gstGyroTrouble.ul_did); - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "#[DIAG] (u_int8)pst_data->ucSize == 0x%x", (u_int8)pst_data->uc_size); - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "#[DIAG] gstGyroTrouble.us_size == 0x%x\r\n", gstGyroTrouble.us_size); - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "#[DIAG] pst_data->uc_data == 0x%x", pst_data->uc_data); - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "#[DIAG] gstGyroTrouble.uc_data == 0x%x\r\n", gstGyroTrouble.uc_data); -#endif - - return(uc_ret); -} - -/******************************************************************************* -* MODULE : VehicleSensGetGyroTrouble -* ABSTRACT : Vehicle Sensor GYRO TROUBLE GET Functions -* FUNCTION : Provide a GYRO TROUBLE data master -* ARGUMENT : *pst_data : Pointer to the data master acquisition destination -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensGetGyroTrouble(VEHICLESENS_DATA_MASTER_GYRO_TROUBLE *pst_data) { - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - const VEHICLESENS_DATA_MASTER_GYRO_TROUBLE *pst_master; - - if (pst_data == NULL) { - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "pst_data == NULL\r\n"); - } else { - pst_master = &gstGyroTrouble; - - /* Store the data master in the specified destination. */ - pst_data->ul_did = pst_master->ul_did; - pst_data->us_size = pst_master->us_size; - pst_data->uc_rcvflag = pst_master->uc_rcvflag; - (void)memcpy(reinterpret_cast<void *>(&(pst_data->uc_data)), - (const void *)(&(pst_master->uc_data)), sizeof(pst_data->uc_data)); - } -} -// LCOV_EXCL_STOP diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GyroX.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GyroX.cpp deleted file mode 100755 index 3cda53a..0000000 --- a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GyroX.cpp +++ /dev/null @@ -1,145 +0,0 @@ -/* - * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/******************************************************************************* - * File name :VehicleSens_Did_GyroX.cpp - * System name :_CWORD107_ - * Subsystem name :Vehicle sensor process - * Program name :Vehicle sensor data master(VEHICLE_DID_GYRO_X) - * Module configuration :VehicleSensGetGyroX() Vehicle Sensor GYRO GET Functions - ******************************************************************************/ - -#include <vehicle_service/positioning_base_library.h> -#include "VehicleSens_DataMaster.h" - -/*************************************************/ -/* Global variable */ -/*************************************************/ - -/******************************************************************************* -* MODULE : VehicleSensGetGyroX -* ABSTRACT : Vehicle Sensor GYRO_X GET Functions -* FUNCTION : Provide a GYRO data master -* ARGUMENT : *pst_data : Pointer to the data master acquisition destination -* uc_get_method : Acquisition method(Direct Line or CAN) -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensGetGyroX(VEHICLESENS_DATA_MASTER *pst_data, u_int8 uc_get_method) { - switch (uc_get_method) { // LCOV_EXCL_BR_LINE 6:VEHICLESENS_GETMETHOD_CAN cannot to pass in - case VEHICLESENS_GETMETHOD_CAN: - { - /* When acquiring from CAN data */ - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - break; // LCOV_EXCL_LINE 8: dead code - } - case VEHICLESENS_GETMETHOD_LINE: - { - /* To acquire from LineSensor */ - VehicleSensGetGyroXl(pst_data); - break; - } - default: - break; - } -} - -#if CONFIG_SENSOR_EXT_VALID /* Initial Sensor Support */ -/******************************************************************************* -* MODULE : VehicleSensGetGyroRev -* ABSTRACT : Vehicle Sensor GYRO GET Functions -* FUNCTION : Provide a GYRO data master -* ARGUMENT : *pst_data : Pointer to the data master acquisition destination -* uc_get_method : Acquisition method(Direct Line or CAN) -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensGetGyroRev(VEHICLESENS_DATA_MASTER *pst_data, u_int8 uc_get_method) { - switch (uc_get_method) { // LCOV_EXCL_BR_LINE 6:VEHICLESENS_GETMETHOD_CAN cannot to pass in - case VEHICLESENS_GETMETHOD_CAN: - { - /* When acquiring from CAN data */ - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - break; // LCOV_EXCL_LINE 8: dead code - } - case VEHICLESENS_GETMETHOD_LINE: - { - /* To acquire from LineSensor */ - VehicleSensGetGyroRevl(pst_data); - break; - } - default: - break; - } -} - -/******************************************************************************* -* MODULE : VehicleSensGetGyroExt -* ABSTRACT : Vehicle Sensor GYRO GET Functions -* FUNCTION : Provide a GYRO data master -* ARGUMENT : *pst_data : Pointer to the data master acquisition destination -* uc_get_method : Acquisition method(Direct Line or CAN) -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensGetGyroExt(VEHICLESENS_DATA_MASTER_EXT *pst_data, u_int8 uc_get_method) { - switch (uc_get_method) { // LCOV_EXCL_BR_LINE 6:VEHICLESENS_GETMETHOD_CAN cannot to pass in - case VEHICLESENS_GETMETHOD_CAN: - { - /* When acquiring from CAN data */ - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - break; // LCOV_EXCL_LINE 8: dead code - } - case VEHICLESENS_GETMETHOD_LINE: - { - /* To acquire from LineSensor */ - VehicleSensGetGyroExtl(pst_data); - break; - } - default: /* Ignore->MISRA-C++:2008 Rule 6-3-1, 6-4-1 */ - break; - } -} - -/******************************************************************************* -* MODULE : VehicleSensGetGyroXFst -* ABSTRACT : Vehicle Sensor GYRO_X GET Functions -* FUNCTION : Provide a GYRO data master -* ARGUMENT : *pst_data : Pointer to the data master acquisition destination -* uc_get_method : Acquisition method(Direct Line or CAN) -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensGetGyroXFst(VEHICLESENS_DATA_MASTER_FST *pst_data, u_int8 uc_get_method) { - switch (uc_get_method) { // LCOV_EXCL_BR_LINE 6:VEHICLESENS_GETMETHOD_CAN cannot to pass in - case VEHICLESENS_GETMETHOD_CAN: - { - /* When acquiring from CAN data */ - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - break; // LCOV_EXCL_LINE 8: dead code - } - case VEHICLESENS_GETMETHOD_LINE: - { - /* To acquire from LineSensor */ - VehicleSensGetGyroXFstl(pst_data); - break; - } - default: - break; - } -} -#endif - diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GyroXFst_l.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GyroXFst_l.cpp deleted file mode 100755 index e9997ac..0000000 --- a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GyroXFst_l.cpp +++ /dev/null @@ -1,176 +0,0 @@ -/* - * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/******************************************************************************* - * File name :VehicleSens_Did_GyroXFst_l.cpp - * System name :Polaris - * Subsystem name :Vehicle sensor process - * Program name :Vehicle sensor data master(POSHAL_DID_GYRO_X_FST) - * Module configuration :VehicleSensInitGyroXFstl() Vehicle sensor GYRO (initial sensor) initialization functions - * :VehicleSensSetGyroXFstl() Vehicle sensor GYRO (initial sensor) SET-function - * :VehicleSensSetGyroXFstG() Vehicle sensor GYRO (initial sensor) SET-function - * :VehicleSensGetGyroXFstl() Vehicle sensor GYRO (initial sensor) GET-function - ******************************************************************************/ - -#include <vehicle_service/positioning_base_library.h> -#include "VehicleSens_DataMaster.h" - -#if CONFIG_SENSOR_EXT_VALID /* Initial Sensor Support */ -/*************************************************/ -/* Global variable */ -/*************************************************/ -static VEHICLESENS_DATA_MASTER_FST gstGyroXFst_l; // NOLINT(readability/nolint) - -/******************************************************************************* -* MODULE : VehicleSensInitGyroXFstl -* ABSTRACT : Vehicle Sensor GYRO_X Initialization Functions -* FUNCTION : GYRO data master initialization process -* ARGUMENT : void -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensInitGyroXFstl(void) { - u_int16 *pus; - - memset(&gstGyroXFst_l, 0x00, sizeof(VEHICLESENS_DATA_MASTER_FST)); - gstGyroXFst_l.ul_did = POSHAL_DID_GYRO_X_FST; - gstGyroXFst_l.us_size = 0; - gstGyroXFst_l.partition_flg = 0; - - pus = reinterpret_cast<u_int16 *>(gstGyroXFst_l.uc_data); - memset(reinterpret_cast<void*>(pus), VEHICLE_DINIT_GYRO_X, VEHICLE_DSIZE_GYRO_X_FST); -} - -/******************************************************************************* -* MODULE : VehicleSensSetGyroXFstl -* ABSTRACT : Vehicle Sensor GYRO_X SET Functions -* FUNCTION : Update the GYRO data master -* ARGUMENT : *pst_data : Pointer to the message data received by the direct line -* NOTE : -* RETURN : VEHICLESENS_EQ : No data change -* VEHICLESENS_NEQ : Data change -******************************************************************************/ -u_int8 VehicleSensSetGyroXFstl(const LSDRV_LSDATA_FST *pst_data) { // LCOV_EXCL_START 8: dead code. - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - u_int8 uc_ret; - VEHICLESENS_DATA_MASTER_FST *pst_master; - - pst_master = &gstGyroXFst_l; - - /* Compare data master and received data */ - uc_ret = VehicleSensmemcmp(pst_master->uc_data, - pst_data->uc_data, pst_data->uc_size); /* Ignore->MISRA-C++:2008 Rule 5-0-5 */ - - /* Received data is set in the data master. */ - pst_master->ul_did = pst_data->ul_did; - pst_master->us_size = pst_data->uc_size; - pst_master->partition_flg = 0; - pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON; - memset(pst_master->uc_data, 0x00, sizeof(pst_master->uc_data)); - memcpy(pst_master->uc_data, pst_data->uc_data, pst_data->uc_size); /* Ignore->MISRA-C++:2008 Rule 5-0-5 */ - - return(uc_ret); -} -// LCOV_EXCL_STOP - -/******************************************************************************* -* MODULE : VehicleSensSetGyroXFstG -* ABSTRACT : Vehicle Sensor GYRO SET Functions -* FUNCTION : Update the GYRO data master -* ARGUMENT : *pst_data : Pointer to the message data received by the direct line -* NOTE : -* RETURN : VEHICLESENS_EQ : No data change -* VEHICLESENS_NEQ : Data change -******************************************************************************/ -u_int8 VehicleSensSetGyroXFstG(const LSDRV_LSDATA_FST_GYRO_X *pst_data) { - static u_int8 uc_ret = VEHICLESENS_EQ; - VEHICLESENS_DATA_MASTER_FST *pst_master; - - u_int8 partition_max; /* Total number of partitions */ - u_int8 partition_num; /* Data number */ - - partition_max = pst_data->uc_partition_max; - partition_num = pst_data->uc_partition_num; - - pst_master = &gstGyroXFst_l; - - if (partition_max == 1) { /* Ignore->MISRA-C++:2008 Rule 5-0-5 */ - /* Compare data master and received data */ - uc_ret = VehicleSensmemcmp(pst_master->uc_data, - pst_data->uc_data, pst_data->uc_size); /* Ignore->MISRA-C++:2008 Rule 5-0-5 */ - - /* Received data is set in the data master. */ - pst_master->ul_did = pst_data->ul_did; - pst_master->us_size = pst_data->uc_size; - pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON; - pst_master->partition_flg = 0; - memset(pst_master->uc_data, 0x00, sizeof(pst_master->uc_data)); - memcpy(pst_master->uc_data, pst_data->uc_data, pst_data->uc_size); /* Ignore->MISRA-C++:2008 Rule 5-0-5 */ - } else if (partition_max == 2) { /* Ignore->MISRA-C++:2008 Rule 5-0-5 */ - if (partition_num == 1) { /* Ignore->MISRA-C++:2008 Rule 5-0-5 */ - /* Compare data master and received data */ - /* Ignore->MISRA-C++:2008 Rule 5-0-5 */ - uc_ret = VehicleSensmemcmp(pst_master->uc_data, pst_data->uc_data, pst_data->uc_size); - - /* Received data is set in the data master. */ - pst_master->ul_did = pst_data->ul_did; - /* Ignore->MISRA-C++:2008 Rule 5-0-5 */ - pst_master->us_size = static_cast<u_int16>(pst_master->us_size + pst_data->uc_size); - pst_master->partition_flg = 1; - memcpy(pst_master->uc_data, pst_data->uc_data, pst_data->uc_size); /* Ignore->MISRA-C++:2008 Rule 5-0-5 */ - } else if (partition_num == 2) { /* Ignore->MISRA-C++:2008 Rule 5-0-5 */ - /* Compare data master and received data */ - if (uc_ret == VEHICLESENS_EQ) { - uc_ret = VehicleSensmemcmp(&pst_master->uc_data[VEHICLE_DSIZE_GYRO_X_FST], - pst_data->uc_data, pst_data->uc_size); /* Ignore->MISRA-C++:2008 Rule 5-0-5 */ - } - - /* Received data is set in the data master. */ - pst_master->ul_did = pst_data->ul_did; - /* Ignore->MISRA-C++:2008 Rule 5-0-5 */ - pst_master->us_size = static_cast<u_int16>(pst_master->us_size + pst_data->uc_size); - pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON; - pst_master->partition_flg = 1; - /* Ignore->MISRA-C++:2008 Rule 5-0-5 */ - memcpy(&pst_master->uc_data[VEHICLE_DSIZE_GYRO_X_FST], pst_data->uc_data, pst_data->uc_size); - } else {} - } else {} - - return(uc_ret); -} - -/******************************************************************************* -* MODULE : VehicleSensGetGyroXFstl -* ABSTRACT : Vehicle Sensor GYRO GET Functions -* FUNCTION : Provide a GYRO data master -* ARGUMENT : *pst_data : Pointer to the data master acquisition destination -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensGetGyroXFstl(VEHICLESENS_DATA_MASTER_FST *pst_data) { - const VEHICLESENS_DATA_MASTER_FST *pst_master; - - pst_master = &gstGyroXFst_l; - - /* Store the data master in the specified destination. */ - pst_data->ul_did = pst_master->ul_did; - pst_data->us_size = pst_master->us_size; - pst_data->uc_rcvflag = pst_master->uc_rcvflag; - pst_data->partition_flg = pst_master->partition_flg; - memcpy(pst_data->uc_data, pst_master->uc_data, pst_master->us_size); /* Ignore->MISRA-C++:2008 Rule 5-0-5 */ -} - -#endif diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GyroX_l.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GyroX_l.cpp deleted file mode 100755 index af90e25..0000000 --- a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GyroX_l.cpp +++ /dev/null @@ -1,128 +0,0 @@ -/* - * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/******************************************************************************* - * File name :VehicleSens_Did_GyroX_l.cpp - * System name :_CWORD107_ - * Subsystem name :Vehicle sensor process - * Program name :Vehicle sensor data master(POSHAL_DID_GYRO_X) - * Module configuration :VehicleSensInitGyroXl() Vehicle Sensor GYRO Initialization Functions - * :VehicleSensSetGyroXl() Vehicle Sensor GYRO SET Functions - * :VehicleSensGetGyroXl() Vehicle Sensor GYRO GET Functions - ******************************************************************************/ - -#include <vehicle_service/positioning_base_library.h> -#include "VehicleSens_DataMaster.h" - -/*************************************************/ -/* Global variable */ -/*************************************************/ -static VEHICLESENS_DATA_MASTER gstGyroX_l; // NOLINT(readability/nolint) - -/******************************************************************************* -* MODULE : VehicleSensInitGyroXl -* ABSTRACT : Vehicle Sensor GYRO_X Initialization Functions -* FUNCTION : GYRO data master initialization process -* ARGUMENT : void -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensInitGyroXl(void) { - memset(&gstGyroX_l, 0x00, sizeof(VEHICLESENS_DATA_MASTER)); - gstGyroX_l.ul_did = POSHAL_DID_GYRO_X; - gstGyroX_l.us_size = VEHICLE_DSIZE_GYRO_X; - gstGyroX_l.uc_rcvflag = VEHICLE_RCVFLAG_OFF; -} - -/******************************************************************************* -* MODULE : VehicleSensSetGyroXl -* ABSTRACT : Vehicle Sensor GYRO_X SET Functions -* FUNCTION : Update the GYRO data master -* ARGUMENT : *pst_data : Pointer to the message data received by the direct line -* NOTE : -* RETURN : VEHICLESENS_EQ : No data change -* VEHICLESENS_NEQ : Data change -******************************************************************************/ -u_int8 VehicleSensSetGyroXl(const LSDRV_LSDATA *pst_data) { - u_int8 uc_ret; - VEHICLESENS_DATA_MASTER *pst_master; - - pst_master = &gstGyroX_l; - - /* Compare data master and received data */ - uc_ret = VehicleSensmemcmp(pst_master->uc_data, pst_data->uc_data, pst_data->uc_size); - - /* Received data is set in the data master. */ - pst_master->ul_did = pst_data->ul_did; - pst_master->us_size = pst_data->uc_size; - pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON; - pst_master->uc_snscnt = pst_data->uc_sns_cnt; - (void)memcpy(reinterpret_cast<void *>(pst_master->uc_data), - (const void *)(pst_data->uc_data), (size_t)pst_data->uc_size); - - return(uc_ret); -} - -/******************************************************************************* -* MODULE : VehicleSensSetGyroXlG -* ABSTRACT : Vehicle Sensor GYRO_X SET Functions -* FUNCTION : Update the GYRO data master -* ARGUMENT : *pst_data : Pointer to the message data received by the direct line -* NOTE : -* RETURN : VEHICLESENS_EQ : No data change -* VEHICLESENS_NEQ : Data change -******************************************************************************/ -u_int8 VehicleSensSetGyroXlG(const LSDRV_LSDATA_G *pst_data) { - u_int8 uc_ret; - VEHICLESENS_DATA_MASTER *pst_master; - - pst_master = &gstGyroX_l; - - /* Compare data master and received data */ - uc_ret = VehicleSensmemcmp(pst_master->uc_data, pst_data->uc_data, pst_data->uc_size); - - /* Received data is set in the data master. */ - pst_master->ul_did = pst_data->ul_did; - pst_master->us_size = pst_data->uc_size; - pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON; - pst_master->uc_snscnt = pst_data->uc_sns_cnt; - (void)memcpy(reinterpret_cast<void *>(pst_master->uc_data), - (const void *)(pst_data->uc_data), (size_t)(pst_data->uc_size)); - - return(uc_ret); -} - -/******************************************************************************* -* MODULE : VehicleSensGetGyroXl -* ABSTRACT : Vehicle Sensor GYRO_X GET Functions -* FUNCTION : Provide a GYRO data master -* ARGUMENT : *pst_data : Pointer to the data master acquisition destination -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensGetGyroXl(VEHICLESENS_DATA_MASTER *pst_data) { - const VEHICLESENS_DATA_MASTER *pst_master; - - pst_master = &gstGyroX_l; - - /* Store the data master in the specified destination. */ - pst_data->ul_did = pst_master->ul_did; - pst_data->us_size = pst_master->us_size; - pst_data->uc_rcvflag = pst_master->uc_rcvflag; - pst_data->uc_snscnt = pst_master->uc_snscnt; - (void)memcpy(reinterpret_cast<void *>(pst_data->uc_data), - (const void *)(pst_master->uc_data), (size_t)(pst_master->us_size)); -} diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GyroY.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GyroY.cpp deleted file mode 100755 index b7d0e5a..0000000 --- a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GyroY.cpp +++ /dev/null @@ -1,113 +0,0 @@ -/* - * @copyright Copyright (c) 2019-2020 TOYOTA MOTOR CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/******************************************************************************* - * File name :VehicleSens_Did_GyroY.cpp - * Subsystem name :Vehicle sensor process - * Program name :Vehicle sensor data master(VEHICLE_DID_GYRO_Y) - * Module configuration :VehicleSensGetGyroY() Vehicle Sensor GYRO GET Functions - ******************************************************************************/ - -#include "VehicleSens_DataMaster.h" - -/*************************************************/ -/* Global variable */ -/*************************************************/ - -/******************************************************************************* -* MODULE : VehicleSensGetGyroY -* ABSTRACT : Vehicle Sensor GYRO_Y GET Functions -* FUNCTION : Provide a GYRO data master -* ARGUMENT : *pst_data : Pointer to the data master acquisition destination -* uc_get_method : Acquisition method(Direct Line or CAN) -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensGetGyroY(VEHICLESENS_DATA_MASTER *pst_data, u_int8 uc_get_method) { - switch (uc_get_method) { // LCOV_EXCL_BR_LINE 6:VEHICLESENS_GETMETHOD_CAN cannot to pass in - case VEHICLESENS_GETMETHOD_CAN: - { - /* When acquiring from CAN data */ - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - break; // LCOV_EXCL_LINE 8: dead code - } - case VEHICLESENS_GETMETHOD_LINE: - { - /* To acquire from LineSensor */ - VehicleSensGetGyroYl(pst_data); - break; - } - default: - break; - } -} - -#if CONFIG_SENSOR_EXT_VALID /* Initial Sensor Support */ -/******************************************************************************* -* MODULE : VehicleSensGetGyroYExt -* ABSTRACT : Vehicle Sensor GYRO_Y GET Functions -* FUNCTION : Provide a GYRO data master -* ARGUMENT : *pst_data : Pointer to the data master acquisition destination -* uc_get_method : Acquisition method(Direct Line or CAN) -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensGetGyroYExt(VEHICLESENS_DATA_MASTER_EXT *pst_data, u_int8 uc_get_method) { - switch (uc_get_method) { - case VEHICLESENS_GETMETHOD_CAN: - { - /* When acquiring from CAN data */ - break; - } - case VEHICLESENS_GETMETHOD_LINE: - { - /* To acquire from LineSensor */ - VehicleSensGetGyroYExtl(pst_data); - break; - } - default: - break; - } -} - -/******************************************************************************* -* MODULE : VehicleSensGetGyroYFst -* ABSTRACT : Vehicle Sensor GYRO_Y GET Functions -* FUNCTION : Provide a GYRO data master -* ARGUMENT : *pst_data : Pointer to the data master acquisition destination -* uc_get_method : Acquisition method(Direct Line or CAN) -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensGetGyroYFst(VEHICLESENS_DATA_MASTER_FST *pst_data, u_int8 uc_get_method) { - switch (uc_get_method) { // LCOV_EXCL_BR_LINE 6:VEHICLESENS_GETMETHOD_CAN cannot to pass in - case VEHICLESENS_GETMETHOD_CAN: - { - /* When acquiring from CAN data */ - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - break; // LCOV_EXCL_LINE 8: dead code - } - case VEHICLESENS_GETMETHOD_LINE: - { - /* To acquire from LineSensor */ - VehicleSensGetGyroYFstl(pst_data); - break; - } - default: - break; - } -} -#endif diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GyroYExt_l.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GyroYExt_l.cpp deleted file mode 100755 index 898dafb..0000000 --- a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GyroYExt_l.cpp +++ /dev/null @@ -1,148 +0,0 @@ -/* - * @copyright Copyright (c) 2019-2020 TOYOTA MOTOR CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/******************************************************************************* - * File name :VehicleSens_Did_GyroYExt_l.cpp - * Subsystem name :Vehicle sensor process - * Program name :Vehicle sensor data master(POSHAL_DID_GYRO_EXT) - * Module configuration :VehicleSensInitGyroYExtl() Vehicle Sensor GYRO (Initial Delivery) Initialization Functions - * :VehicleSensSetGyroYExtlG() Vehicle Sensor GYRO (Initial Delivery) Set Functions - * :VehicleSensGetGyroYExtl() Vehicle Sensor GYRO (Initial Delivery) Get Functions - ******************************************************************************/ - -#include "VehicleSens_DataMaster.h" - -#if CONFIG_SENSOR_EXT_VALID /* Initial Sensor Support */ -/*************************************************/ -/* Global variable */ -/*************************************************/ -static VEHICLESENS_DATA_MASTER_EXT gstGyroYExt_l; // NOLINT(readability/nolint) - -/******************************************************************************* -* MODULE : VehicleSensInitGyroYExtl -* ABSTRACT : Vehicle Sensor GYRO_Y Initialization Functions(Initial delivery) -* FUNCTION : GYRO data master initialization process -* ARGUMENT : void -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensInitGyroYExtl(void) { - u_int16 *pus; - - memset(&gstGyroYExt_l, 0x00, sizeof(VEHICLESENS_DATA_MASTER_EXT)); - gstGyroYExt_l.ul_did = POSHAL_DID_GYRO_Y; - gstGyroYExt_l.us_size = VEHICLE_DSIZE_GYRO_EXT_INIT; - - pus = reinterpret_cast<u_int16 *>(gstGyroYExt_l.uc_data); - memset(reinterpret_cast<void*>(pus), VEHICLE_DINIT_GYRO, VEHICLE_DSIZE_GYRO_EXT); -} - -/******************************************************************************* -* MODULE : VehicleSensSetGyroYExtlG -* ABSTRACT : Vehicle Sensor GYRO_Y SET Functions(Initial delivery) -* FUNCTION : Update the GYRO data master -* ARGUMENT : *pst_data : Pointer to the message data received by the direct line -* NOTE : -* RETURN : VEHICLESENS_EQ : No data change -* VEHICLESENS_NEQ : Data change -******************************************************************************/ -void VehicleSensSetGyroYExtlG(const LSDRV_LSDATA_G *pst_data) { - VEHICLESENS_DATA_MASTER_EXT *pst_master; - u_int16 us_start = 0; - u_int16 us_size = 0; - u_int16 us_cnt = 0; - - pst_master = &gstGyroYExt_l; - us_size = static_cast<u_int16>(sizeof(u_int16) * 10); /* Size of one data item: 2byte * 10 data items */ - - /* Retrieve the location where the received one is stored */ - us_start = gstPkgTempExt.start_point[GyroY]; - - /* Stored in data master(Order of reception)*/ - if (us_start >= VEHICLE_DKEEP_MAX) { - /* Store the latest one at position 0 */ - us_start = VEHICLE_DATA_POS_00; - /* If you are discarding old data,,Set a flag */ - gstPkgTempExt.data_break = VEHICLE_SNS_BREAK; - } - pst_master->ul_did = pst_data->ul_did; - pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON; - for (us_cnt = 0; us_cnt < us_size; us_cnt++) { - pst_master->uc_data[us_start * us_size + us_cnt] = (u_int8)(pst_data->uc_data[us_cnt]); - } - - /* Update next storage start position and latest data storage position */ - us_start++; - gstPkgTempExt.start_point[GyroY] = us_start; - - /* Update data master size */ - if (gstPkgTempExt.data_break == VEHICLE_SNS_BREAK) { - /* Make the size of all extended data masters */ - pst_master->us_size = VEHICLE_DSIZE_GYRO_EXT; - } else { - /* Add the size of one received data item */ - pst_master->us_size = static_cast<u_int16>(pst_master->us_size + us_size); - } -} - -/******************************************************************************* -* MODULE : VehicleSensGetGyroYExtl -* ABSTRACT : Vehicle Sensor GYRO_Y GET Functions(Initial delivery) -* FUNCTION : Provide a GYRO data master -* ARGUMENT : *pst_data : Pointer to the data master acquisition destination -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensGetGyroYExtl(VEHICLESENS_DATA_MASTER_EXT *pst_data) { - const VEHICLESENS_DATA_MASTER_EXT *pst_master; - uint16_t us_size = 0; - uint16_t us_data_cnt = 0; // Number of data contained - uint16_t us_loop_cnt = 0; // 64 over index - - /* Store the data master in the specified destination. */ - pst_master = &gstGyroYExt_l; - pst_data->ul_did = pst_master->ul_did; - pst_data->us_size = pst_master->us_size; - pst_data->uc_rcvflag = pst_master->uc_rcvflag; - - us_size = static_cast<u_int16>(sizeof(u_int16) * 10); /* Size of one data item: 2byte * 10 data items */ - - /* Checking whether the number of stored entries is looped */ - if (gstPkgTempExt.data_break == VEHICLE_SNS_BREAK) { - us_data_cnt = VEHICLE_DKEEP_MAX; - } else { - us_data_cnt = gstPkgTempExt.start_point[GyroY]; - } - - /* Acquire data from the oldest data master */ - for (uint16_t us_cnt = 0; us_cnt < us_data_cnt; us_cnt++) { - if (gstPkgTempExt.data_break == VEHICLE_SNS_BREAK) { - /* Get information before loop */ - if (gstPkgTempExt.start_point[GyroY] + us_cnt < VEHICLE_DKEEP_MAX) { - memcpy(&pst_data->uc_data[us_cnt * us_size], - &pst_master->uc_data[(gstPkgTempExt.start_point[GyroY] + us_cnt) * us_size], us_size); - } else { - memcpy(&pst_data->uc_data[us_cnt * us_size], - &pst_master->uc_data[us_loop_cnt * us_size], us_size); - us_loop_cnt++; - } - } else { - memcpy(&pst_data->uc_data[us_cnt * us_size], - &pst_master->uc_data[us_cnt * us_size], us_size); - } - } -} -#endif // CONFIG_SENSOR_EXT_VALID diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GyroYFst_l.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GyroYFst_l.cpp deleted file mode 100755 index 164cf4d..0000000 --- a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GyroYFst_l.cpp +++ /dev/null @@ -1,169 +0,0 @@ -/* - * @copyright Copyright (c) 2019-2020 TOYOTA MOTOR CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/******************************************************************************* - * File name :VehicleSens_Did_GyroYFst_l.cpp - * Subsystem name :Vehicle sensor process - * Program name :Vehicle sensor data master(POSHAL_DID_GYRO_Y_FST) - * Module configuration :VehicleSensInitGyroYFstl() Vehicle sensor GYRO (initial sensor) initialization functions - * :VehicleSensSetGyroYFstl() Vehicle sensor GYRO (initial sensor) SET-function - * :VehicleSensSetGyroYFstG() Vehicle sensor GYRO (initial sensor) SET-function - * :VehicleSensGetGyroYFstl() Vehicle sensor GYRO (initial sensor) GET-function - ******************************************************************************/ - -#include "VehicleSens_DataMaster.h" - -#if CONFIG_SENSOR_EXT_VALID /* Initial Sensor Support */ -/*************************************************/ -/* Global variable */ -/*************************************************/ -static VEHICLESENS_DATA_MASTER_FST gstGyroYFst_l; // NOLINT(readability/nolint) - -/******************************************************************************* -* MODULE : VehicleSensInitGyroYFstl -* ABSTRACT : Vehicle Sensor GYRO_Y Initialization Functions -* FUNCTION : GYRO data master initialization process -* ARGUMENT : void -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensInitGyroYFstl(void) { - u_int16 *pus; - - memset(&gstGyroYFst_l, 0x00, sizeof(VEHICLESENS_DATA_MASTER_FST)); - gstGyroYFst_l.ul_did = POSHAL_DID_GYRO_Y_FST; - gstGyroYFst_l.us_size = 0; - gstGyroYFst_l.partition_flg = 0; - - pus = reinterpret_cast<u_int16 *>(gstGyroYFst_l.uc_data); - memset(reinterpret_cast<void*>(pus), VEHICLE_DINIT_GYRO_Y, VEHICLE_DSIZE_GYRO_Y_FST); -} - -/******************************************************************************* -* MODULE : VehicleSensSetGyroYFstl -* ABSTRACT : Vehicle Sensor GYRO_Y SET Functions -* FUNCTION : Update the GYRO data master -* ARGUMENT : *pst_data : Pointer to the message data received by the direct line -* NOTE : -* RETURN : VEHICLESENS_EQ : No data change -* VEHICLESENS_NEQ : Data change -******************************************************************************/ -u_int8 VehicleSensSetGyroYFstl(const LSDRV_LSDATA_FST *pst_data) { // LCOV_EXCL_START 8: dead code. - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - u_int8 uc_ret; - VEHICLESENS_DATA_MASTER_FST *pst_master; - - pst_master = &gstGyroYFst_l; - - /* Compare data master and received data */ - uc_ret = VehicleSensmemcmp(pst_master->uc_data, - pst_data->uc_data, pst_data->uc_size); - - /* Received data is set in the data master. */ - pst_master->ul_did = pst_data->ul_did; - pst_master->us_size = pst_data->uc_size; - pst_master->partition_flg = 0; - pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON; - memset(pst_master->uc_data, 0x00, sizeof(pst_master->uc_data)); - memcpy(pst_master->uc_data, pst_data->uc_data, pst_data->uc_size); - - return(uc_ret); -} -// LCOV_EXCL_STOP - -/******************************************************************************* -* MODULE : VehicleSensSetGyroYFstG -* ABSTRACT : Vehicle Sensor GYRO_Y SET Functions -* FUNCTION : Update the GYRO data master -* ARGUMENT : *pst_data : Pointer to the message data received by the direct line -* NOTE : -* RETURN : VEHICLESENS_EQ : No data change -* VEHICLESENS_NEQ : Data change -******************************************************************************/ -u_int8 VehicleSensSetGyroYFstG(const LSDRV_LSDATA_FST_GYRO_Y *pst_data) { - static u_int8 uc_ret = VEHICLESENS_EQ; - VEHICLESENS_DATA_MASTER_FST *pst_master; - - u_int8 partition_max; /* Total number of partitions */ - u_int8 partition_num; /* Data number */ - - partition_max = pst_data->uc_partition_max; - partition_num = pst_data->uc_partition_num; - - pst_master = &gstGyroYFst_l; - - if (partition_max == 1) { - /* Compare data master and received data */ - uc_ret = VehicleSensmemcmp(pst_master->uc_data, - pst_data->uc_data, pst_data->uc_size); - - /* Received data is set in the data master. */ - pst_master->ul_did = pst_data->ul_did; - pst_master->us_size = pst_data->uc_size; - pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON; - pst_master->partition_flg = 0; - memset(pst_master->uc_data, 0x00, sizeof(pst_master->uc_data)); - memcpy(pst_master->uc_data, pst_data->uc_data, pst_data->uc_size); - } else if (partition_max == 2) { - if (partition_num == 1) { - /* Compare data master and received data */ - uc_ret = VehicleSensmemcmp(pst_master->uc_data, pst_data->uc_data, pst_data->uc_size); - - /* Received data is set in the data master. */ - pst_master->ul_did = pst_data->ul_did; - pst_master->us_size = static_cast<u_int16>(pst_master->us_size + pst_data->uc_size); - pst_master->partition_flg = 1; - memcpy(pst_master->uc_data, pst_data->uc_data, pst_data->uc_size); - } else if (partition_num == 2) { - /* Compare data master and received data */ - if (uc_ret == VEHICLESENS_EQ) { - uc_ret = VehicleSensmemcmp(&pst_master->uc_data[VEHICLE_DSIZE_GYRO_Y_FST], - pst_data->uc_data, pst_data->uc_size); - } - - /* Received data is set in the data master. */ - pst_master->ul_did = pst_data->ul_did; - pst_master->us_size = static_cast<u_int16>(pst_master->us_size + pst_data->uc_size); - pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON; - pst_master->partition_flg = 1; - memcpy(&pst_master->uc_data[VEHICLE_DSIZE_GYRO_Y_FST], pst_data->uc_data, pst_data->uc_size); - } else {} - } else {} - - return(uc_ret); -} - -/******************************************************************************* -* MODULE : VehicleSensGetGyroYFstl -* ABSTRACT : Vehicle Sensor GYRO_Y GET Functions -* FUNCTION : Provide a GYRO data master -* ARGUMENT : *pst_data : Pointer to the data master acquisition destination -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensGetGyroYFstl(VEHICLESENS_DATA_MASTER_FST *pst_data) { - const VEHICLESENS_DATA_MASTER_FST *pst_master; - - pst_master = &gstGyroYFst_l; - - /* Store the data master in the specified destination. */ - pst_data->ul_did = pst_master->ul_did; - pst_data->us_size = pst_master->us_size; - pst_data->uc_rcvflag = pst_master->uc_rcvflag; - pst_data->partition_flg = pst_master->partition_flg; - memcpy(pst_data->uc_data, pst_master->uc_data, pst_master->us_size); -} -#endif diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GyroY_l.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GyroY_l.cpp deleted file mode 100755 index 9799b29..0000000 --- a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GyroY_l.cpp +++ /dev/null @@ -1,126 +0,0 @@ -/* - * @copyright Copyright (c) 2019-2020 TOYOTA MOTOR CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/******************************************************************************* - * File name :VehicleSens_Did_GyroY_l.cpp - * Subsystem name :Vehicle sensor process - * Program name :Vehicle sensor data master(POSHAL_DID_GYRO_Y) - * Module configuration :VehicleSensInitGyroYl() Vehicle Sensor GYRO Initialization Functions - * :VehicleSensSetGyroYl() Vehicle Sensor GYRO SET Functions - * :VehicleSensGetGyroYl() Vehicle Sensor GYRO GET Functions - ******************************************************************************/ - -#include "VehicleSens_DataMaster.h" - -/*************************************************/ -/* Global variable */ -/*************************************************/ -static VEHICLESENS_DATA_MASTER gstGyroY_l; // NOLINT(readability/nolint) - -/******************************************************************************* -* MODULE : VehicleSensInitGyroYl -* ABSTRACT : Vehicle Sensor GYRO_Y Initialization Functions -* FUNCTION : GYRO data master initialization process -* ARGUMENT : void -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensInitGyroYl(void) { - memset(&gstGyroY_l, 0x00, sizeof(VEHICLESENS_DATA_MASTER)); - gstGyroY_l.ul_did = POSHAL_DID_GYRO_Y; - gstGyroY_l.us_size = VEHICLE_DSIZE_GYRO_Y; - gstGyroY_l.uc_rcvflag = VEHICLE_RCVFLAG_OFF; -} - -/******************************************************************************* -* MODULE : VehicleSensSetGyroYl -* ABSTRACT : Vehicle Sensor GYRO_Y SET Functions -* FUNCTION : Update the GYRO data master -* ARGUMENT : *pst_data : Pointer to the message data received by the direct line -* NOTE : -* RETURN : VEHICLESENS_EQ : No data change -* VEHICLESENS_NEQ : Data change -******************************************************************************/ -u_int8 VehicleSensSetGyroYl(const LSDRV_LSDATA *pst_data) { - u_int8 uc_ret; - VEHICLESENS_DATA_MASTER *pst_master; - - pst_master = &gstGyroY_l; - - /* Compare data master and received data */ - uc_ret = VehicleSensmemcmp(pst_master->uc_data, pst_data->uc_data, pst_data->uc_size); - - /* Received data is set in the data master. */ - pst_master->ul_did = pst_data->ul_did; - pst_master->us_size = pst_data->uc_size; - pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON; - pst_master->uc_snscnt = pst_data->uc_sns_cnt; - (void)memcpy(reinterpret_cast<void *>(pst_master->uc_data), - (const void *)(pst_data->uc_data), (size_t)pst_data->uc_size); - - return(uc_ret); -} - -/******************************************************************************* -* MODULE : VehicleSensSetGyroYlG -* ABSTRACT : Vehicle Sensor GYRO_Y SET Functions -* FUNCTION : Update the GYRO data master -* ARGUMENT : *pst_data : Pointer to the message data received by the direct line -* NOTE : -* RETURN : VEHICLESENS_EQ : No data change -* VEHICLESENS_NEQ : Data change -******************************************************************************/ -u_int8 VehicleSensSetGyroYlG(const LSDRV_LSDATA_G *pst_data) { - u_int8 uc_ret; - VEHICLESENS_DATA_MASTER *pst_master; - - pst_master = &gstGyroY_l; - - /* Compare data master and received data */ - uc_ret = VehicleSensmemcmp(pst_master->uc_data, pst_data->uc_data, pst_data->uc_size); - - /* Received data is set in the data master. */ - pst_master->ul_did = pst_data->ul_did; - pst_master->us_size = pst_data->uc_size; - pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON; - pst_master->uc_snscnt = pst_data->uc_sns_cnt; - (void)memcpy(reinterpret_cast<void *>(pst_master->uc_data), - (const void *)(pst_data->uc_data), (size_t)(pst_data->uc_size)); - - return(uc_ret); -} - -/******************************************************************************* -* MODULE : VehicleSensGetGyroYl -* ABSTRACT : Vehicle Sensor GYRO_Y GET Functions -* FUNCTION : Provide a GYRO data master -* ARGUMENT : *pst_data : Pointer to the data master acquisition destination -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensGetGyroYl(VEHICLESENS_DATA_MASTER *pst_data) { - const VEHICLESENS_DATA_MASTER *pst_master; - - pst_master = &gstGyroY_l; - - /* Store the data master in the specified destination. */ - pst_data->ul_did = pst_master->ul_did; - pst_data->us_size = pst_master->us_size; - pst_data->uc_rcvflag = pst_master->uc_rcvflag; - pst_data->uc_snscnt = pst_master->uc_snscnt; - (void)memcpy(reinterpret_cast<void *>(pst_data->uc_data), - (const void *)(pst_master->uc_data), (size_t)(pst_master->us_size)); -} diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GyroZ.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GyroZ.cpp deleted file mode 100755 index 1b84af7..0000000 --- a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GyroZ.cpp +++ /dev/null @@ -1,113 +0,0 @@ -/* - * @copyright Copyright (c) 2019-2020 TOYOTA MOTOR CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/******************************************************************************* - * File name :VehicleSens_Did_GyroZ.cpp - * Subsystem name :Vehicle sensor process - * Program name :Vehicle sensor data master(VEHICLE_DID_GYRO_Z) - * Module configuration :VehicleSensGetGyroZ() Vehicle Sensor GYRO GET Functions - ******************************************************************************/ - -#include "VehicleSens_DataMaster.h" - -/*************************************************/ -/* Global variable */ -/*************************************************/ - -/******************************************************************************* -* MODULE : VehicleSensGetGyroZ -* ABSTRACT : Vehicle Sensor GYRO_Z GET Functions -* FUNCTION : Provide a GYRO data master -* ARGUMENT : *pst_data : Pointer to the data master acquisition destination -* uc_get_method : Acquisition method(Direct Line or CAN) -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensGetGyroZ(VEHICLESENS_DATA_MASTER *pst_data, u_int8 uc_get_method) { - switch (uc_get_method) { // LCOV_EXCL_BR_LINE 6:VEHICLESENS_GETMETHOD_CAN cannot to pass in - case VEHICLESENS_GETMETHOD_CAN: - { - /* When acquiring from CAN data */ - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - break; // LCOV_EXCL_LINE 8: dead code - } - case VEHICLESENS_GETMETHOD_LINE: - { - /* To acquire from LineSensor */ - VehicleSensGetGyroZl(pst_data); - break; - } - default: - break; - } -} - -#if CONFIG_SENSOR_EXT_VALID /* Initial Sensor Support */ -/******************************************************************************* -* MODULE : VehicleSensGetGyroZExt -* ABSTRACT : Vehicle Sensor GYRO_Z GET Functions -* FUNCTION : Provide a GYRO data master -* ARGUMENT : *pst_data : Pointer to the data master acquisition destination -* uc_get_method : Acquisition method(Direct Line or CAN) -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensGetGyroZExt(VEHICLESENS_DATA_MASTER_EXT *pst_data, u_int8 uc_get_method) { - switch (uc_get_method) { - case VEHICLESENS_GETMETHOD_CAN: - { - /* When acquiring from CAN data */ - break; - } - case VEHICLESENS_GETMETHOD_LINE: - { - /* To acquire from LineSensor */ - VehicleSensGetGyroZExtl(pst_data); - break; - } - default: - break; - } -} - -/******************************************************************************* -* MODULE : VehicleSensGetGyroZFst -* ABSTRACT : Vehicle Sensor GYRO_Z GET Functions -* FUNCTION : Provide a GYRO data master -* ARGUMENT : *pst_data : Pointer to the data master acquisition destination -* uc_get_method : Acquisition method(Direct Line or CAN) -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensGetGyroZFst(VEHICLESENS_DATA_MASTER_FST *pst_data, u_int8 uc_get_method) { - switch (uc_get_method) { // LCOV_EXCL_BR_LINE 6:VEHICLESENS_GETMETHOD_CAN cannot to pass in - case VEHICLESENS_GETMETHOD_CAN: - { - /* When acquiring from CAN data */ - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - break; // LCOV_EXCL_LINE 8: dead code - } - case VEHICLESENS_GETMETHOD_LINE: - { - /* To acquire from LineSensor */ - VehicleSensGetGyroZFstl(pst_data); - break; - } - default: - break; - } -} -#endif diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GyroZExt_l.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GyroZExt_l.cpp deleted file mode 100755 index 9ef9996..0000000 --- a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GyroZExt_l.cpp +++ /dev/null @@ -1,148 +0,0 @@ -/* - * @copyright Copyright (c) 2019-2020 TOYOTA MOTOR CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/******************************************************************************* - * File name :VehicleSens_Did_GyroZExt_l.cpp - * Subsystem name :Vehicle sensor process - * Program name :Vehicle sensor data master(POSHAL_DID_GYRO_EXT) - * Module configuration :VehicleSensInitGyroxiZYExtl() Vehicle Sensor GYRO (Initial Delivery) Initialization Functions - * :VehicleSensSetGyroZExtlG() Vehicle Sensor GYRO (Initial Delivery) Set Functions - * :VehicleSensGetGyroZExtl() Vehicle Sensor GYRO (Initial Delivery) Get Functions - ******************************************************************************/ - -#include "VehicleSens_DataMaster.h" - -#if CONFIG_SENSOR_EXT_VALID /* Initial Sensor Support */ -/*************************************************/ -/* Global variable */ -/*************************************************/ -static VEHICLESENS_DATA_MASTER_EXT gstGyroZExt_l; // NOLINT(readability/nolint) - -/******************************************************************************* -* MODULE : VehicleSensInitGyroZExtl -* ABSTRACT : Vehicle Sensor GYRO_Z Initialization Functions(Initial delivery) -* FUNCTION : GYRO data master initialization process -* ARGUMENT : void -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensInitGyroZExtl(void) { - u_int16 *pus; - - memset(&gstGyroZExt_l, 0x00, sizeof(VEHICLESENS_DATA_MASTER_EXT)); - gstGyroZExt_l.ul_did = POSHAL_DID_GYRO_Z; - gstGyroZExt_l.us_size = VEHICLE_DSIZE_GYRO_EXT_INIT; - - pus = reinterpret_cast<u_int16 *>(gstGyroZExt_l.uc_data); - memset(reinterpret_cast<void*>(pus), VEHICLE_DINIT_GYRO, VEHICLE_DSIZE_GYRO_EXT); -} - -/******************************************************************************* -* MODULE : VehicleSensSetGyroZExtlG -* ABSTRACT : Vehicle Sensor GYRO_Z SET Functions(Initial delivery) -* FUNCTION : Update the GYRO data master -* ARGUMENT : *pst_data : Pointer to the message data received by the direct line -* NOTE : -* RETURN : VEHICLESENS_EQ : No data change -* VEHICLESENS_NEQ : Data change -******************************************************************************/ -void VehicleSensSetGyroZExtlG(const LSDRV_LSDATA_G *pst_data) { - VEHICLESENS_DATA_MASTER_EXT *pst_master; - u_int16 us_start = 0; - u_int16 us_size = 0; - u_int16 us_cnt = 0; - - pst_master = &gstGyroZExt_l; - us_size = static_cast<u_int16>(sizeof(u_int16) * 10); /* Size of one data item: 2byte * 10 data items */ - - /* Retrieve the location where the received one is stored */ - us_start = gstPkgTempExt.start_point[GyroZ]; - - /* Stored in data master(Order of reception)*/ - if (us_start >= VEHICLE_DKEEP_MAX) { - /* Store the latest one at position 0 */ - us_start = VEHICLE_DATA_POS_00; - /* If you are discarding old data,,Set a flag */ - gstPkgTempExt.data_break = VEHICLE_SNS_BREAK; - } - pst_master->ul_did = pst_data->ul_did; - pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON; - for (us_cnt = 0; us_cnt < us_size; us_cnt++) { - pst_master->uc_data[us_start * us_size + us_cnt] = (u_int8)(pst_data->uc_data[us_cnt]); - } - - /* Update next storage start position and latest data storage position */ - us_start++; - gstPkgTempExt.start_point[GyroZ] = us_start; - - /* Update data master size */ - if (gstPkgTempExt.data_break == VEHICLE_SNS_BREAK) { - /* Make the size of all extended data masters */ - pst_master->us_size = VEHICLE_DSIZE_GYRO_EXT; - } else { - /* Add the size of one received data item */ - pst_master->us_size = static_cast<u_int16>(pst_master->us_size + us_size); - } -} - -/******************************************************************************* -* MODULE : VehicleSensGetGyroZExtl -* ABSTRACT : Vehicle Sensor GYRO_Z GET Functions(Initial delivery) -* FUNCTION : Provide a GYRO data master -* ARGUMENT : *pst_data : Pointer to the data master acquisition destination -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensGetGyroZExtl(VEHICLESENS_DATA_MASTER_EXT *pst_data) { - const VEHICLESENS_DATA_MASTER_EXT *pst_master; - uint16_t us_size = 0; - uint16_t us_data_cnt = 0; // Number of data contained - uint16_t us_loop_cnt = 0; // 64 over index - - /* Store the data master in the specified destination. */ - pst_master = &gstGyroZExt_l; - pst_data->ul_did = pst_master->ul_did; - pst_data->us_size = pst_master->us_size; - pst_data->uc_rcvflag = pst_master->uc_rcvflag; - - us_size = static_cast<u_int16>(sizeof(u_int16) * 10); /* Size of one data item: 2byte * 10 data items */ - - /* Checking whether the number of stored entries is looped */ - if (gstPkgTempExt.data_break == VEHICLE_SNS_BREAK) { - us_data_cnt = VEHICLE_DKEEP_MAX; - } else { - us_data_cnt = gstPkgTempExt.start_point[GyroZ]; - } - - /* Acquire data from the oldest data master */ - for (uint16_t us_cnt = 0; us_cnt < us_data_cnt; us_cnt++) { - if (gstPkgTempExt.data_break == VEHICLE_SNS_BREAK) { - /* Get information before loop */ - if (gstPkgTempExt.start_point[GyroZ] + us_cnt < VEHICLE_DKEEP_MAX) { - memcpy(&pst_data->uc_data[us_cnt * us_size], - &pst_master->uc_data[(gstPkgTempExt.start_point[GyroZ] + us_cnt) * us_size], us_size); - } else { - memcpy(&pst_data->uc_data[us_cnt * us_size], - &pst_master->uc_data[us_loop_cnt * us_size], us_size); - us_loop_cnt++; - } - } else { - memcpy(&pst_data->uc_data[us_cnt * us_size], - &pst_master->uc_data[us_cnt * us_size], us_size); - } - } -} -#endif // CONFIG_SENSOR_EXT_VALID diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GyroZFst_l.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GyroZFst_l.cpp deleted file mode 100755 index 587f565..0000000 --- a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GyroZFst_l.cpp +++ /dev/null @@ -1,169 +0,0 @@ -/* - * @copyright Copyright (c) 2019-2020 TOYOTA MOTOR CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/******************************************************************************* - * File name :VehicleSens_Did_GyroZFst_l.cpp - * Subsystem name :Vehicle sensor process - * Program name :Vehicle sensor data master(POSHAL_DID_GYRO_Z_FST) - * Module configuration :VehicleSensInitGyroZFstl() Vehicle sensor GYRO (initial sensor) initialization functions - * :VehicleSensSetGyroZFstl() Vehicle sensor GYRO (initial sensor) SET-function - * :VehicleSensSetGyroZFstG() Vehicle sensor GYRO (initial sensor) SET-function - * :VehicleSensGetGyroZFstl() Vehicle sensor GYRO (initial sensor) GET-function - ******************************************************************************/ - -#include "VehicleSens_DataMaster.h" - -#if CONFIG_SENSOR_EXT_VALID /* Initial Sensor Support */ -/*************************************************/ -/* Global variable */ -/*************************************************/ -static VEHICLESENS_DATA_MASTER_FST gstGyroZFst_l; // NOLINT(readability/nolint) - -/******************************************************************************* -* MODULE : VehicleSensInitGyroZFstl -* ABSTRACT : Vehicle Sensor GYRO_Z Initialization Functions -* FUNCTION : GYRO data master initialization process -* ARGUMENT : void -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensInitGyroZFstl(void) { - u_int16 *pus; - - memset(&gstGyroZFst_l, 0x00, sizeof(VEHICLESENS_DATA_MASTER_FST)); - gstGyroZFst_l.ul_did = POSHAL_DID_GYRO_Z_FST; - gstGyroZFst_l.us_size = 0; - gstGyroZFst_l.partition_flg = 0; - - pus = reinterpret_cast<u_int16 *>(gstGyroZFst_l.uc_data); - memset(reinterpret_cast<void*>(pus), VEHICLE_DINIT_GYRO_Z, VEHICLE_DSIZE_GYRO_Z_FST); -} - -/******************************************************************************* -* MODULE : VehicleSensSetGyroZFstl -* ABSTRACT : Vehicle Sensor GYRO_Z SET Functions -* FUNCTION : Update the GYRO data master -* ARGUMENT : *pst_data : Pointer to the message data received by the direct line -* NOTE : -* RETURN : VEHICLESENS_EQ : No data change -* VEHICLESENS_NEQ : Data change -******************************************************************************/ -u_int8 VehicleSensSetGyroZFstl(const LSDRV_LSDATA_FST *pst_data) { // LCOV_EXCL_START 8: dead code. - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - u_int8 uc_ret; - VEHICLESENS_DATA_MASTER_FST *pst_master; - - pst_master = &gstGyroZFst_l; - - /* Compare data master and received data */ - uc_ret = VehicleSensmemcmp(pst_master->uc_data, - pst_data->uc_data, pst_data->uc_size); - - /* Received data is set in the data master. */ - pst_master->ul_did = pst_data->ul_did; - pst_master->us_size = pst_data->uc_size; - pst_master->partition_flg = 0; - pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON; - memset(pst_master->uc_data, 0x00, sizeof(pst_master->uc_data)); - memcpy(pst_master->uc_data, pst_data->uc_data, pst_data->uc_size); - - return(uc_ret); -} -// LCOV_EXCL_STOP - -/******************************************************************************* -* MODULE : VehicleSensSetGyroZFstG -* ABSTRACT : Vehicle Sensor GYRO_Z SET Functions -* FUNCTION : Update the GYRO data master -* ARGUMENT : *pst_data : Pointer to the message data received by the direct line -* NOTE : -* RETURN : VEHICLESENS_EQ : No data change -* VEHICLESENS_NEQ : Data change -******************************************************************************/ -u_int8 VehicleSensSetGyroZFstG(const LSDRV_LSDATA_FST_GYRO_Z *pst_data) { - static u_int8 uc_ret = VEHICLESENS_EQ; - VEHICLESENS_DATA_MASTER_FST *pst_master; - - u_int8 partition_max; /* Total number of partitions */ - u_int8 partition_num; /* Data number */ - - partition_max = pst_data->uc_partition_max; - partition_num = pst_data->uc_partition_num; - - pst_master = &gstGyroZFst_l; - - if (partition_max == 1) { - /* Compare data master and received data */ - uc_ret = VehicleSensmemcmp(pst_master->uc_data, - pst_data->uc_data, pst_data->uc_size); - - /* Received data is set in the data master. */ - pst_master->ul_did = pst_data->ul_did; - pst_master->us_size = pst_data->uc_size; - pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON; - pst_master->partition_flg = 0; - memset(pst_master->uc_data, 0x00, sizeof(pst_master->uc_data)); - memcpy(pst_master->uc_data, pst_data->uc_data, pst_data->uc_size); - } else if (partition_max == 2) { - if (partition_num == 1) { - /* Compare data master and received data */ - uc_ret = VehicleSensmemcmp(pst_master->uc_data, pst_data->uc_data, pst_data->uc_size); - - /* Received data is set in the data master. */ - pst_master->ul_did = pst_data->ul_did; - pst_master->us_size = static_cast<u_int16>(pst_master->us_size + pst_data->uc_size); - pst_master->partition_flg = 1; - memcpy(pst_master->uc_data, pst_data->uc_data, pst_data->uc_size); - } else if (partition_num == 2) { - /* Compare data master and received data */ - if (uc_ret == VEHICLESENS_EQ) { - uc_ret = VehicleSensmemcmp(&pst_master->uc_data[VEHICLE_DSIZE_GYRO_Z_FST], - pst_data->uc_data, pst_data->uc_size); - } - - /* Received data is set in the data master. */ - pst_master->ul_did = pst_data->ul_did; - pst_master->us_size = static_cast<u_int16>(pst_master->us_size + pst_data->uc_size); - pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON; - pst_master->partition_flg = 1; - memcpy(&pst_master->uc_data[VEHICLE_DSIZE_GYRO_Z_FST], pst_data->uc_data, pst_data->uc_size); - } else {} - } else {} - - return(uc_ret); -} - -/******************************************************************************* -* MODULE : VehicleSensGetGyroZFstl -* ABSTRACT : Vehicle Sensor GYRO_Z GET Functions -* FUNCTION : Provide a GYRO data master -* ARGUMENT : *pst_data : Pointer to the data master acquisition destination -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensGetGyroZFstl(VEHICLESENS_DATA_MASTER_FST *pst_data) { - const VEHICLESENS_DATA_MASTER_FST *pst_master; - - pst_master = &gstGyroZFst_l; - - /* Store the data master in the specified destination. */ - pst_data->ul_did = pst_master->ul_did; - pst_data->us_size = pst_master->us_size; - pst_data->uc_rcvflag = pst_master->uc_rcvflag; - pst_data->partition_flg = pst_master->partition_flg; - memcpy(pst_data->uc_data, pst_master->uc_data, pst_master->us_size); -} -#endif diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GyroZ_l.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GyroZ_l.cpp deleted file mode 100755 index 8296dab..0000000 --- a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_GyroZ_l.cpp +++ /dev/null @@ -1,126 +0,0 @@ -/* - * @copyright Copyright (c) 2019-2020 TOYOTA MOTOR CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/******************************************************************************* - * File name :VehicleSens_Did_GyroZ_l.cpp - * Subsystem name :Vehicle sensor process - * Program name :Vehicle sensor data master(POSHAL_DID_GYRO_Z) - * Module configuration :VehicleSensInitGyroZl() Vehicle Sensor GYRO Initialization Functions - * :VehicleSensSetGyroZl() Vehicle Sensor GYRO SET Functions - * :VehicleSensGetGyroZl() Vehicle Sensor GYRO GET Functions - ******************************************************************************/ - -#include "VehicleSens_DataMaster.h" - -/*************************************************/ -/* Global variable */ -/*************************************************/ -static VEHICLESENS_DATA_MASTER gstGyroZ_l; // NOLINT(readability/nolint) - -/******************************************************************************* -* MODULE : VehicleSensInitGyroZl -* ABSTRACT : Vehicle Sensor GYRO_Z Initialization Functions -* FUNCTION : GYRO data master initialization process -* ARGUMENT : void -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensInitGyroZl(void) { - memset(&gstGyroZ_l, 0x00, sizeof(VEHICLESENS_DATA_MASTER)); - gstGyroZ_l.ul_did = POSHAL_DID_GYRO_Z; - gstGyroZ_l.us_size = VEHICLE_DSIZE_GYRO_Z; - gstGyroZ_l.uc_rcvflag = VEHICLE_RCVFLAG_OFF; -} - -/******************************************************************************* -* MODULE : VehicleSensSetGyroZl -* ABSTRACT : Vehicle Sensor GYRO_Z SET Functions -* FUNCTION : Update the GYRO data master -* ARGUMENT : *pst_data : Pointer to the message data received by the direct line -* NOTE : -* RETURN : VEHICLESENS_EQ : No data change -* VEHICLESENS_NEQ : Data change -******************************************************************************/ -u_int8 VehicleSensSetGyroZl(const LSDRV_LSDATA *pst_data) { - u_int8 uc_ret; - VEHICLESENS_DATA_MASTER *pst_master; - - pst_master = &gstGyroZ_l; - - /* Compare data master and received data */ - uc_ret = VehicleSensmemcmp(pst_master->uc_data, pst_data->uc_data, pst_data->uc_size); - - /* Received data is set in the data master. */ - pst_master->ul_did = pst_data->ul_did; - pst_master->us_size = pst_data->uc_size; - pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON; - pst_master->uc_snscnt = pst_data->uc_sns_cnt; - (void)memcpy(reinterpret_cast<void *>(pst_master->uc_data), - (const void *)(pst_data->uc_data), (size_t)pst_data->uc_size); - - return(uc_ret); -} - -/******************************************************************************* -* MODULE : VehicleSensSetGyroZlG -* ABSTRACT : Vehicle Sensor GYRO_Z SET Functions -* FUNCTION : Update the GYRO data master -* ARGUMENT : *pst_data : Pointer to the message data received by the direct line -* NOTE : -* RETURN : VEHICLESENS_EQ : No data change -* VEHICLESENS_NEQ : Data change -******************************************************************************/ -u_int8 VehicleSensSetGyroZlG(const LSDRV_LSDATA_G *pst_data) { - u_int8 uc_ret; - VEHICLESENS_DATA_MASTER *pst_master; - - pst_master = &gstGyroZ_l; - - /* Compare data master and received data */ - uc_ret = VehicleSensmemcmp(pst_master->uc_data, pst_data->uc_data, pst_data->uc_size); - - /* Received data is set in the data master. */ - pst_master->ul_did = pst_data->ul_did; - pst_master->us_size = pst_data->uc_size; - pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON; - pst_master->uc_snscnt = pst_data->uc_sns_cnt; - (void)memcpy(reinterpret_cast<void *>(pst_master->uc_data), - (const void *)(pst_data->uc_data), (size_t)(pst_data->uc_size)); - - return(uc_ret); -} - -/******************************************************************************* -* MODULE : VehicleSensGetGyroZl -* ABSTRACT : Vehicle Sensor GYRO_Z GET Functions -* FUNCTION : Provide a GYRO data master -* ARGUMENT : *pst_data : Pointer to the data master acquisition destination -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensGetGyroZl(VEHICLESENS_DATA_MASTER *pst_data) { - const VEHICLESENS_DATA_MASTER *pst_master; - - pst_master = &gstGyroZ_l; - - /* Store the data master in the specified destination. */ - pst_data->ul_did = pst_master->ul_did; - pst_data->us_size = pst_master->us_size; - pst_data->uc_rcvflag = pst_master->uc_rcvflag; - pst_data->uc_snscnt = pst_master->uc_snscnt; - (void)memcpy(reinterpret_cast<void *>(pst_data->uc_data), - (const void *)(pst_master->uc_data), (size_t)(pst_master->us_size)); -} diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_LocationAltitude.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_LocationAltitude.cpp deleted file mode 100755 index 167fa0a..0000000 --- a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_LocationAltitude.cpp +++ /dev/null @@ -1,55 +0,0 @@ -/* - * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/**************************************************************************** -@file VehicleSens_Did_LocationAltitude.cpp -@detail Altitude information data master management -******************************************************************************/ -#include <vehicle_service/positioning_base_library.h> -#include "VehicleSens_DataMaster.h" - -/************************************************* - * Global variable * - *************************************************/ - -/**************************************************************************** -@brief VehicleSensGetLocationAltitude<BR> - Altitude Information Data Master GET Processing -@outline Provide an altitude information data master -@param[in] u_int8 uc_get_method : Acquisition method(GPS or Navi) -@param[out] VEHICLESENS_DATA_MASTER *pst_data : Pointer to the data master acquisition destination -@return none -@retval none -*******************************************************************************/ -void VehicleSensGetLocationAltitude(VEHICLESENS_DATA_MASTER *pst_data, u_int8 uc_get_method) { - switch (uc_get_method) { // LCOV_EXCL_BR_LINE 6:no other parameter pass in - case VEHICLESENS_GETMETHOD_GPS: - { - /** To acquire from GPS */ - VehicleSensGetLocationAltitudeG(pst_data); - break; - } - case VEHICLESENS_GETMETHOD_NAVI: - { - /** To acquire from NAVI */ - VehicleSensGetLocationAltitudeN(pst_data); - break; - } - default: /* Ignore->MISRA-C++:2008 Rule 6-3-1, 6-4-1 */ - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - break; // LCOV_EXCL_LINE 8: dead code - } -} diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_LocationAltitude_g.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_LocationAltitude_g.cpp deleted file mode 100755 index cae429c..0000000 --- a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_LocationAltitude_g.cpp +++ /dev/null @@ -1,105 +0,0 @@ -/* - * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/**************************************************************************** -@file VehicleSens_Did_LocationAltitude_g.cpp -@detail Altitude information data master management(NMEA information) -******************************************************************************/ -#include <vehicle_service/positioning_base_library.h> -#include "VehicleSens_DataMaster.h" -#include "CommonDefine.h" - -/************************************************* - * Global variable * - *************************************************/ -static VEHICLESENS_DATA_MASTER gstLocationAltitude_g; // NOLINT(readability/nolint) - -/**************************************************************************** -@brief VehicleSensInitLocationAltitudeG<BR> - Altitude information data master initialization processing(NMEA information) -@outline Initialize the altitude information data master -@param[in] none -@param[out] none -@return none -@retval none -*******************************************************************************/ -void VehicleSensInitLocationAltitudeG(void) { - SENSORLOCATION_ALTITUDEINFO_DAT st_altitude; - - memset(&gstLocationAltitude_g, 0x00, sizeof(VEHICLESENS_DATA_MASTER)); - - /** Data ID setting */ - gstLocationAltitude_g.ul_did = VEHICLE_DID_LOCATION_ALTITUDE; - /** Data size setting */ - gstLocationAltitude_g.us_size = sizeof(SENSORLOCATION_ALTITUDEINFO_DAT); - /** Data content setting */ - memset(&st_altitude, 0x00, sizeof(st_altitude)); - st_altitude.getMethod = SENSOR_GET_METHOD_GPS; - st_altitude.SyncCnt = 0x00; - st_altitude.isEnable = SENSORLOCATION_STATUS_DISABLE; - memcpy(&gstLocationAltitude_g.uc_data[0], &st_altitude, sizeof(st_altitude)); -} - -/**************************************************************************** -@brief VehicleSensSetLocationAltitudeG<BR> - Altitude information data master SET processing(NMEA information) -@outline Update the altitude information data master -@param[in] u_int8 ucSensCnt : Sensor counter value -@param[in] u_int8* pucDGGA : Double precision GGAInformation(_CWORD82_ NMEA) -@param[out] none -@return u_int8 -@retval VEHICLESENS_EQ : No data change -@retval VEHICLESENS_NEQ : Data change -*******************************************************************************/ -u_int8 VehicleSensSetLocationAltitudeG(const SENSORLOCATION_ALTITUDEINFO_DAT *pst_altitude) { - u_int8 uc_ret; - VEHICLESENS_DATA_MASTER *pst_master; - - pst_master = &gstLocationAltitude_g; - - /** With the contents of the current data master,Compare received data */ - uc_ret = VehicleSensmemcmp(pst_master->uc_data, pst_altitude, sizeof(SENSORLOCATION_ALTITUDEINFO_DAT)); - - /** Received data is set in the data master. */ - pst_master->ul_did = VEHICLE_DID_LOCATION_ALTITUDE; - pst_master->us_size = sizeof(SENSORLOCATION_ALTITUDEINFO_DAT); - pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON; - memset(pst_master->uc_data, 0x00, sizeof(pst_master->uc_data)); - memcpy(pst_master->uc_data, pst_altitude, sizeof(SENSORLOCATION_ALTITUDEINFO_DAT)); - - return(uc_ret); -} - -/**************************************************************************** -@brief VehicleSensGetLocationAltitudeG<BR> - Altitude Information Data Master GET Processing(NMEA information) -@outline Provide an altitude information data master -@param[in] none -@param[out] VEHICLESENS_DATA_MASTER *pst_data : Pointer to the data master acquisition destination -@return none -@retval none -*******************************************************************************/ -void VehicleSensGetLocationAltitudeG(VEHICLESENS_DATA_MASTER *pst_data) { - const VEHICLESENS_DATA_MASTER *pst_master; - - pst_master = &gstLocationAltitude_g; - - /* Store the data master in the specified destination. */ - pst_data->ul_did = pst_master->ul_did; - pst_data->us_size = pst_master->us_size; - pst_data->uc_rcvflag = pst_master->uc_rcvflag; - memcpy(pst_data->uc_data, pst_master->uc_data, pst_master->us_size); /* Ignore->MISRA-C++:2008 Rule 5-0-5 */ -} diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_LocationAltitude_n.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_LocationAltitude_n.cpp deleted file mode 100755 index 1d6064f..0000000 --- a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_LocationAltitude_n.cpp +++ /dev/null @@ -1,121 +0,0 @@ -/* - * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @file - * VehicleSens_Did_LocationAltitude_n.cpp - * @brief - */ -/*---------------------------------------------------------------------------------* - * Include Files * - *---------------------------------------------------------------------------------*/ -#include <vehicle_service/positioning_base_library.h> -#include "VehicleSens_DataMaster.h" -#include "SensorLocation_API.h" -#include "CommonDefine.h" - -/*---------------------------------------------------------------------------------* - * Global Value * - *---------------------------------------------------------------------------------*/ -static VEHICLESENS_DATA_MASTER gstLocationAltitude_n; // NOLINT(readability/nolint) - -/** - * @brief - * Altitude information data master initialization processing(NAVI information) - * - * Initialize the altitude information data master - * - * @param[in] none - * @param[out] none - * @return none - * @retval none - */ -void VehicleSensInitLocationAltitudeN(void) { - SENSORLOCATION_ALTITUDEINFO_DAT st_altitude; - - memset(&gstLocationAltitude_n, 0x00, sizeof(VEHICLESENS_DATA_MASTER)); - - /** Data ID setting */ - gstLocationAltitude_n.ul_did = VEHICLE_DID_LOCATION_ALTITUDE_NAVI; - - /** Data size setting */ - gstLocationAltitude_n.us_size = sizeof(SENSORLOCATION_ALTITUDEINFO_DAT); - - /** Data content setting */ - memset(&st_altitude, 0x00, sizeof(st_altitude)); - st_altitude.getMethod = SENSOR_GET_METHOD_NAVI; - st_altitude.SyncCnt = 0x00; - st_altitude.isEnable = SENSORLOCATION_STATUS_DISABLE; - st_altitude.Altitude = 0x00; - memcpy(&gstLocationAltitude_n.uc_data[0], &st_altitude, sizeof(st_altitude)); - - return; -} - -/** - * @brief - * Altitude information data master SET processing(NAVI information) - * - * Update the altitude information data master - * - * @param[in] VEHICLESENS_DATA_MASTER *pst_data : Pointer to the data master acquisition destination - * @param[out] none - * @return u_int8 - * @retval VEHICLESENS_EQ : No data change - * @retval VEHICLESENS_NEQ : Data change - */ -u_int8 VehicleSensSetLocationAltitudeN(const SENSORLOCATION_ALTITUDEINFO_DAT *pst_altitude) { - u_int8 uc_ret; - VEHICLESENS_DATA_MASTER *pst_master; - - pst_master = &gstLocationAltitude_n; - - /** With the contents of the current data master,Compare received data */ - uc_ret = VehicleSensmemcmp(pst_master->uc_data, pst_altitude, sizeof(SENSORLOCATION_ALTITUDEINFO_DAT)); - - /** Received data is set in the data master. */ - pst_master->ul_did = VEHICLE_DID_LOCATION_ALTITUDE_NAVI; - pst_master->us_size = sizeof(SENSORLOCATION_ALTITUDEINFO_DAT); - pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON; - memcpy(pst_master->uc_data, pst_altitude, sizeof(SENSORLOCATION_ALTITUDEINFO_DAT)); - - return(uc_ret); -} - -/** - * @brief - * Altitude Information Data Master GET Processing(NAVI information) - * - * Provide an altitude information data master - * - * @param[in] none - * @param[out] VEHICLESENS_DATA_MASTER *pst_data : Pointer to the data master acquisition destination - * @return none - * @retval none - */ -void VehicleSensGetLocationAltitudeN(VEHICLESENS_DATA_MASTER *pst_data) { - const VEHICLESENS_DATA_MASTER *pst_master; - - pst_master = &gstLocationAltitude_n; - - /** Store the data master in the specified destination. */ - pst_data->ul_did = pst_master->ul_did; - pst_data->us_size = pst_master->us_size; - pst_data->uc_rcvflag = pst_master->uc_rcvflag; - memcpy(pst_data->uc_data, pst_master->uc_data, pst_master->us_size); - - return; -} diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_LocationInfoNmea.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_LocationInfoNmea.cpp deleted file mode 100755 index 496e5ac..0000000 --- a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_LocationInfoNmea.cpp +++ /dev/null @@ -1,50 +0,0 @@ -/* - * @copyright Copyright (c) 2018-2020 TOYOTA MOTOR CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/**************************************************************************//** -@file VehicleSens_Did_LocationInfoNmea.cpp -@detail Location Information (NMEA) Management of information data master -******************************************************************************/ -#include <vehicle_service/positioning_base_library.h> -#include "VehicleSens_DataMaster.h" - -/************************************************* - * Global variable * - *************************************************/ - -/**************************************************************************//** -@brief VehicleSens_GetLocationInfoNmea<BR> - Location Information (NMEA) Information Data Master GET Processing -@outline Location Information (NMEA) Provide an information data master -@param[in] u_int8 ucGetMethod : Acquisition method(GPS or Navi) -@param[out] VEHICLESENS_DATA_MASTER_GPS_FORMAT *pstData : Pointer to the data master acquisition destination -@return none -@retval none -*******************************************************************************/ -void VehicleSens_GetLocationInfoNmea(VEHICLESENS_DATA_MASTER_GPS_FORMAT *pstData, u_int8 ucGetMethod) -{ - switch(ucGetMethod) - { - case VEHICLESENS_GETMETHOD_NAVI: - { - VehicleSens_GetLocationInfoNmea_n(pstData); - break; - } - - default: - break; - } -} diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_LocationInfoNmea_n.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_LocationInfoNmea_n.cpp deleted file mode 100755 index 048e522..0000000 --- a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_LocationInfoNmea_n.cpp +++ /dev/null @@ -1,118 +0,0 @@ -/* - * @copyright Copyright (c) 2018-2020 TOYOTA MOTOR CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @file - * VehicleSens_Did_LocationInfoNmea_n.cpp - * @brief - */ -/*---------------------------------------------------------------------------------* - * Include Files * - *---------------------------------------------------------------------------------*/ -#include <vehicle_service/positioning_base_library.h> -#include "VehicleSens_DataMaster.h" -#include "SensorLocation_API.h" - -/*---------------------------------------------------------------------------------* - * Global Value * - *---------------------------------------------------------------------------------*/ -static VEHICLESENS_DATA_MASTER_GPS_FORMAT gstLocationInfoNmea_n; - -/** - * @brief - * Location Information (NMEA) Initialization of information data master(NAVI information) - * - * Location Information (NMEA) Initialize the information data master - * - * @param[in] none - * @param[out] none - * @return none - */ -void VehicleSens_InitLocationInfoNmea_n(void) -{ - POS_LOCATIONINFO_NMEA stLocInfoNmea; - - _pb_memset(&gstLocationInfoNmea_n, 0x00, sizeof(VEHICLESENS_DATA_MASTER_GPS_FORMAT)); - - /* Set Data ID */ - gstLocationInfoNmea_n.ul_did = VEHICLE_DID_LOCATIONINFO_NMEA_NAVI; - - /* Set Data Size */ - gstLocationInfoNmea_n.us_size = sizeof(POS_LOCATIONINFO_NMEA); - - /** Set Data itself */ - _pb_memset(&stLocInfoNmea, 0x00, sizeof(stLocInfoNmea)); - _pb_memcpy(&gstLocationInfoNmea_n.uc_data[0], &stLocInfoNmea, sizeof(stLocInfoNmea)); - - return; -} - -/** - * @brief - * Location Information (NMEA) Information data master SET process(NAVI information) - * - * Location Information (NMEA) Update the information data master - * - * @param[in] VEHICLESENS_DATA_MASTER_GPS_FORMAT *pstData : Pointer to the data master acquisition destination - * @param[out] none - * @return u_int8 - * @retval VEHICLESENS_EQ : No data change - * @retval VEHICLESENS_NEQ : Data change - */ -u_int8 VehicleSens_SetLocationInfoNmea_n( const POS_LOCATIONINFO_NMEA *pstLocInfoNmea ) -{ - u_int8 ucRet; - VEHICLESENS_DATA_MASTER_GPS_FORMAT *pstMaster; - - pstMaster = &gstLocationInfoNmea_n; - - /* Compare Received Data with Master Data */ - ucRet = VehicleSensmemcmp( pstMaster->uc_data, pstLocInfoNmea, sizeof(POS_LOCATIONINFO_NMEA) ); - - /* Set Received Data as Master Data */ - pstMaster->ul_did = VEHICLE_DID_LOCATIONINFO_NMEA_NAVI; - pstMaster->us_size = sizeof(POS_LOCATIONINFO_NMEA); - pstMaster->uc_rcvflag = VEHICLE_RCVFLAG_ON; - _pb_memcpy(pstMaster->uc_data, pstLocInfoNmea, sizeof(POS_LOCATIONINFO_NMEA)); - - return ucRet; -} - -/** - * @brief - * Location Information (NMEA) Information Data Master GET Processing(NAVI information) - * - * Location Information (NMEA) Provide an information data master - * - * @param[in] none - * @param[out] VEHICLESENS_DATA_MASTER_GPS_FORMAT *pstData : Pointer to the data master acquisition destination - * @return none - * @retval none - */ -void VehicleSens_GetLocationInfoNmea_n(VEHICLESENS_DATA_MASTER_GPS_FORMAT *pstData) -{ - const VEHICLESENS_DATA_MASTER_GPS_FORMAT *pstMaster; - - pstMaster = &gstLocationInfoNmea_n; - - /* Set Master Data to Indicated Region */ - pstData->ul_did = pstMaster->ul_did; - pstData->us_size = pstMaster->us_size; - pstData->uc_rcvflag = pstMaster->uc_rcvflag; - _pb_memcpy(pstData->uc_data, pstMaster->uc_data, pstMaster->us_size); - - return; -} diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_LocationLonLat.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_LocationLonLat.cpp deleted file mode 100755 index 1ae1b59..0000000 --- a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_LocationLonLat.cpp +++ /dev/null @@ -1,56 +0,0 @@ -/* - * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/**************************************************************************** -@file VehicleSens_Did_LocationLonLat.cpp -@detail Latitude and longitudeManagement of information data master -******************************************************************************/ -#include <vehicle_service/positioning_base_library.h> -#include "VehicleSens_DataMaster.h" - -/************************************************* - * Global variable * - *************************************************/ - -/**************************************************************************** -@brief VehicleSensGetLocationLonLat<BR> - Latitude and longitudeInformation Data Master GET Processing -@outline Latitude and longitudeProvide an information data master -@param[in] u_int8 uc_get_method : Acquisition method(GPS or Navi) -@param[out] VEHICLESENS_DATA_MASTER *pst_data : Pointer to the data master acquisition destination -@return none -@retval none -*******************************************************************************/ -void VehicleSensGetLocationLonLat(VEHICLESENS_DATA_MASTER *pst_data, u_int8 uc_get_method) { - switch (uc_get_method) { // LCOV_EXCL_BR_LINE 6:other parameters cannot pass in - case VEHICLESENS_GETMETHOD_GPS: - { - /** To acquire from GPS */ - VehicleSensGetLocationLonLatG(pst_data); - break; - } - case VEHICLESENS_GETMETHOD_NAVI: - { - /** To acquire from NAVI */ - VehicleSensGetLocationLonLatnUnitCnv(pst_data); - break; - } - - default: /* Ignore->MISRA-C++:2008 Rule 6-3-1, 6-4-1 */ - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - break; // LCOV_EXCL_LINE 8: dead code - } -} diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_LocationLonLat_g.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_LocationLonLat_g.cpp deleted file mode 100755 index 07075c0..0000000 --- a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_LocationLonLat_g.cpp +++ /dev/null @@ -1,104 +0,0 @@ -/* - * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/**************************************************************************** -@file VehicleSens_Did_LocationLonLat_g.cpp -@detail Latitude and longitudeManagement of information data master(NMEA information) -******************************************************************************/ -#include <vehicle_service/positioning_base_library.h> -#include "VehicleSens_DataMaster.h" -#include "CommonDefine.h" - -/************************************************* - * Global variable * - *************************************************/ -static VEHICLESENS_DATA_MASTER gstLocationLonLat_g; // NOLINT(readability/nolint) - -/**************************************************************************** -@brief VehicleSensInitLocationLonLatG<BR> - Latitude and longitudeInitialization of information data master(NMEA information) -@outline Latitude and longitudeInitialize the information data master -@param[in] none -@param[out] none -@return none -@retval none -*******************************************************************************/ -void VehicleSensInitLocationLonLatG(void) { - SENSORLOCATION_LONLATINFO_DAT st_lonlat; - - memset(&gstLocationLonLat_g, 0x00, sizeof(VEHICLESENS_DATA_MASTER)); - - /** Data ID setting */ - gstLocationLonLat_g.ul_did = VEHICLE_DID_LOCATION_LONLAT; - /** Data size setting */ - gstLocationLonLat_g.us_size = sizeof(SENSORLOCATION_LONLATINFO_DAT); - /** Data content setting */ - memset(&st_lonlat, 0x00, sizeof(st_lonlat)); - st_lonlat.getMethod = SENSOR_GET_METHOD_GPS; - st_lonlat.SyncCnt = 0x00; - st_lonlat.isEnable = SENSORLOCATION_STATUS_DISABLE; - memcpy(&gstLocationLonLat_g.uc_data[0], &st_lonlat, sizeof(st_lonlat)); -} - -/**************************************************************************** -@brief VehicleSensSetLocationLonLatG<BR> - Latitude and longitudeInformation data master SET process(NMEA information) -@outline Latitude and longitudeUpdate the information data master -@param[in] SENSORLOCATION_LONLATINFO_DAT * pst_lonlat : Latitude and longitude information -@param[out] none -@return u_int8 -@retval VEHICLESENS_EQ : No data change -@retval VEHICLESENS_NEQ : Data change -*******************************************************************************/ -u_int8 VehicleSensSetLocationLonLatG(const SENSORLOCATION_LONLATINFO_DAT *pst_lonlat) { - u_int8 uc_ret; - VEHICLESENS_DATA_MASTER *pst_master; - - pst_master = &gstLocationLonLat_g; - - /** With the contents of the current data master,Compare received data */ - uc_ret = VehicleSensmemcmp(pst_master->uc_data, pst_lonlat, sizeof(SENSORLOCATION_LONLATINFO_DAT)); - - /** Received data is set in the data master. */ - pst_master->ul_did = VEHICLE_DID_LOCATION_LONLAT; - pst_master->us_size = sizeof(SENSORLOCATION_LONLATINFO_DAT); - pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON; - memset(pst_master->uc_data, 0x00, sizeof(pst_master->uc_data)); - memcpy(pst_master->uc_data, pst_lonlat, sizeof(SENSORLOCATION_LONLATINFO_DAT)); - - return(uc_ret); -} - -/**************************************************************************** -@brief VehicleSensGetLocationLonLatG<BR> - Latitude and longitudeInformation Data Master GET Processing(NMEA information) -@outline Latitude and longitudeProvide an information data master -@param[in] none -@param[out] VEHICLESENS_DATA_MASTER *pst_data : Pointer to the data master acquisition destination -@return none -@retval none -*******************************************************************************/ -void VehicleSensGetLocationLonLatG(VEHICLESENS_DATA_MASTER *pst_data) { - const VEHICLESENS_DATA_MASTER *pst_master; - - pst_master = &gstLocationLonLat_g; - - /* Store the data master in the specified destination. */ - pst_data->ul_did = pst_master->ul_did; - pst_data->us_size = pst_master->us_size; - pst_data->uc_rcvflag = pst_master->uc_rcvflag; - memcpy(pst_data->uc_data, pst_master->uc_data, pst_master->us_size); /* Ignore->MISRA-C++:2008 Rule 5-0-5 */ -} diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_LocationLonLat_n.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_LocationLonLat_n.cpp deleted file mode 100755 index dcaecff..0000000 --- a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_LocationLonLat_n.cpp +++ /dev/null @@ -1,163 +0,0 @@ -/* - * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @file - * VehicleSens_Did_LocationLonLat_n.cpp - * @brief - */ -/*---------------------------------------------------------------------------------* - * Include Files * - *---------------------------------------------------------------------------------*/ -#include <vehicle_service/positioning_base_library.h> -#include "VehicleSens_DataMaster.h" -#include "SensorLocation_API.h" -#include "CommonDefine.h" - -/*---------------------------------------------------------------------------------* - * Global Value * - *---------------------------------------------------------------------------------*/ -static VEHICLESENS_DATA_MASTER gstLocationLonLat_n; // NOLINT(readability/nolint) - -/** - * @brief - * Latitude and longitudeInitialization of information data master(NAVI information) - * - * Latitude and longitudeInitialize the information data master - * - * @param[in] none - * @param[out] none - * @return none - * @retval none - */ -void VehicleSensInitLocationLonLatN(void) { - SENSORLOCATION_LONLATINFO_DAT st_lonlat; - - memset(&gstLocationLonLat_n, 0x00, sizeof(VEHICLESENS_DATA_MASTER)); - - /** Data ID setting */ - gstLocationLonLat_n.ul_did = VEHICLE_DID_LOCATION_LONLAT_NAVI; - - /** Data size setting */ - gstLocationLonLat_n.us_size = sizeof(SENSORLOCATION_LONLATINFO_DAT); - - /** Data content setting */ - memset(&st_lonlat, 0x00, sizeof(st_lonlat)); - st_lonlat.getMethod = SENSOR_GET_METHOD_NAVI; - st_lonlat.SyncCnt = 0x00; - st_lonlat.isEnable = SENSORLOCATION_STATUS_DISABLE; - st_lonlat.posSts = 0x00; - st_lonlat.posAcc = 0x00; - st_lonlat.Longitude = 0x00; - st_lonlat.Latitude = 0x00; - memcpy(&gstLocationLonLat_n.uc_data[0], &st_lonlat, sizeof(st_lonlat)); - - return; -} - -/** - * @brief - * Latitude and longitudeInformation data master SET process(NAVI information) - * - * Latitude and longitudeUpdate the information data master - * - * @param[in] VEHICLESENS_DATA_MASTER *pst_data : Pointer to the data master acquisition destination - * @param[out] none - * @return u_int8 - * @retval VEHICLESENS_EQ : No data change - * @retval VEHICLESENS_NEQ : Data change - */ -u_int8 VehicleSensSetLocationLonLatN(const SENSORLOCATION_LONLATINFO_DAT *pst_lonlat) { - u_int8 uc_ret; - VEHICLESENS_DATA_MASTER *pst_master; - - pst_master = &gstLocationLonLat_n; - - /** With the contents of the current data master,Compare received data */ - uc_ret = VehicleSensmemcmp(pst_master->uc_data, pst_lonlat, sizeof(SENSORLOCATION_LONLATINFO_DAT)); - - /** Received data is set in the data master. */ - pst_master->ul_did = VEHICLE_DID_LOCATION_LONLAT_NAVI; - pst_master->us_size = sizeof(SENSORLOCATION_LONLATINFO_DAT); - pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON; - memcpy(pst_master->uc_data, pst_lonlat, sizeof(SENSORLOCATION_LONLATINFO_DAT)); - - return(uc_ret); -} - -/** - * @brief - * Latitude and longitudeInformation Data Master GET Processing(NAVI information) - * - * Latitude and longitudeProvide an information data master - * - * @param[in] none - * @param[out] VEHICLESENS_DATA_MASTER *pst_data : Pointer to the data master acquisition destination - * @return none - * @retval none - */ -void VehicleSensGetLocationLonLatN(VEHICLESENS_DATA_MASTER *pst_data) { - const VEHICLESENS_DATA_MASTER *pst_master; - - pst_master = &gstLocationLonLat_n; - - /** Store the data master in the specified destination. */ - pst_data->ul_did = pst_master->ul_did; - pst_data->us_size = pst_master->us_size; - pst_data->uc_rcvflag = pst_master->uc_rcvflag; - memcpy(pst_data->uc_data, pst_master->uc_data, pst_master->us_size); - - return; -} - -/** - * @brief - * Latitude and longitudeInformation Data Master GET Processing(NAVI information) - * - * Latitude and longitudeProvide an information data master(Unit:10^-7th degree) - * - * @param[out] VEHICLESENS_DATA_MASTER *pst_data : Pointer to the data master acquisition destination - */ -void VehicleSensGetLocationLonLatnUnitCnv(VEHICLESENS_DATA_MASTER *pst_data) { - const VEHICLESENS_DATA_MASTER *pst_master; - SENSORLOCATION_LONLATINFO_DAT st_lonlat; - int32_t l_lon; - int32_t l_lat; - int64_t ll_tmp; - - pst_master = &gstLocationLonLat_n; - - /* Perform unit conversion[1/128Second] -> [10^-7 degree] */ - memcpy(&st_lonlat, pst_master->uc_data, sizeof(st_lonlat)); - - /* Longitude */ - l_lon = st_lonlat.Longitude; - ll_tmp = (int64_t)l_lon * 10000000; - st_lonlat.Longitude = (int32_t)(ll_tmp / (128 * 60 * 60)); - - /* Latitude */ - l_lat = st_lonlat.Latitude; - ll_tmp = (int64_t)l_lat * 10000000; - st_lonlat.Latitude = (int32_t)(ll_tmp / (128 * 60 * 60)); - - /** Store the data master in the specified destination. */ - pst_data->ul_did = pst_master->ul_did; - pst_data->us_size = pst_master->us_size; - pst_data->uc_rcvflag = pst_master->uc_rcvflag; - memcpy(pst_data->uc_data, &st_lonlat, sizeof(st_lonlat)); - - return; -} diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_MainGpsInterruptSignal.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_MainGpsInterruptSignal.cpp deleted file mode 100755 index 7066324..0000000 --- a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_MainGpsInterruptSignal.cpp +++ /dev/null @@ -1,132 +0,0 @@ -/* - * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/******************************************************************************* - * File name :VehicleSens_Did_MainGpsInterruptSignal.cpp - * System name :PastModel002 - * Subsystem name :GPS process - * Program name :MAIN GPS interrupt data master(VEHICLE_DID_MAIN_GPS_INTERRUPT_SIGNAL) - * Module configuration :VehicleSensInitMainGpsInterruptSignal() Vehicle sensor MAIN_GPS_INTERRUPT_SIGNAL initialization function - * :VehicleSensSetMainGpsInterruptSignal() Vehicle sensor MAIN_GPS_INTERRUPT_SIGNAL SET function - * :VehicleSensGetMainGpsInterruptSignal() Vehicle sensor MAIN_GPS_INTERRUPT_SIGNAL GET function - ******************************************************************************/ - -#include <vehicle_service/positioning_base_library.h> -#include "VehicleSens_DataMaster.h" - -#define VEHICLE_SENS_DID_MAIN_GPS_INTERRUPT_SIGNAL_DEBUG_FACTORY 0 - -/*************************************************/ -/* Global variable */ -/*************************************************/ -static VEHICLESENS_DATA_MASTER_GPS_INTERRUPT_SIGNAL gstMainGpsInterruptSignal; // NOLINT(readability/nolint) - -/******************************************************************************* -* MODULE : VehicleSensInitMainGpsInterruptSignal -* ABSTRACT : Vehicle sensor MAIN_GPS_INTERRUPT_SIGNAL initialization function -* FUNCTION : MAIN_GPS_INTERRUPT_SIGNAL data master initialization processing -* ARGUMENT : None -* NOTE : -* RETURN : None -******************************************************************************/ -void VehicleSensInitMainGpsInterruptSignal(void) { - (void)memset(reinterpret_cast<void *>(&(gstMainGpsInterruptSignal)), - static_cast<int>(0x00), sizeof(VEHICLESENS_DATA_MASTER_GPS_INTERRUPT_SIGNAL)); - gstMainGpsInterruptSignal.ul_did = VEHICLE_DID_MAIN_GPS_INTERRUPT_SIGNAL; - gstMainGpsInterruptSignal.us_size = VEHICLE_DSIZE_MAIN_GPS_INTERRUPT_SIGNAL; - gstMainGpsInterruptSignal.uc_data = VEHICLE_DINIT_MAIN_GPS_INTERRUPT_SIGNAL; - -#if VEHICLE_SENS_DID_MAIN_GPS_INTERRUPT_SIGNAL_DEBUG_FACTORY - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, - "#[FACTORY] gstMainGpsInterruptSignal.uc_data.uc_data == 0x%x\r\n", gstMainGpsInterruptSignal.uc_data); -#endif -} - -/******************************************************************************* -* MODULE : VehicleSensSetMainGpsInterruptSignal -* ABSTRACT : Vehicle sensor MAIN_GPS_INTERRUPT_SIGNALE SET function -* FUNCTION : Update the Main_GPS_INTERRUPT_SIGNAL data master -* ARGUMENT : *pst_data : Pointer to received message data -* NOTE : -* RETURN : VEHICLESENS_EQ : No data change -* VEHICLESENS_NEQ : Data change -******************************************************************************/ -u_int8 VehicleSensSetMainGpsInterruptSignal(const SENSOR_MSG_GPSDATA_DAT *pst_data) { // LCOV_EXCL_START 8: dead code. - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - u_int8 uc_ret = VEHICLESENS_EQ; - VEHICLESENS_DATA_MASTER_GPS_INTERRUPT_SIGNAL *pst_master; - - if (pst_data == NULL) { - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "pst_data == NULL\r\n"); - } else { - pst_master = &gstMainGpsInterruptSignal; - - /* Compare data master and received data */ - uc_ret = VehicleSensmemcmp(reinterpret_cast<void *>(&(pst_master->uc_data)), - (const void *)(&(pst_data->uc_data)), (size_t)(pst_data->us_size)); - - /* Received data is set in the data master. */ - pst_master->ul_did = pst_data->ul_did; - pst_master->us_size = pst_data->us_size; - pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON; - (void)memcpy(reinterpret_cast<void *>(&(pst_master->uc_data)), - (const void *)(&(pst_data->uc_data)), sizeof(pst_master->uc_data)); - -#if VEHICLE_SENS_DID_MAIN_GPS_INTERRUPT_SIGNAL_DEBUG_FACTORY - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, - "#[FACTORY] pst_data->ul_did == 0x%x", pst_data->ul_did); - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, - "#[FACTORY] gstMainGpsInterruptSignal.ul_did == 0x%x\r\n", gstMainGpsInterruptSignal.ul_did); - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, - "#[FACTORY] (u_int8)pst_data->us_size == 0x%x", (u_int8)pst_data->us_size); - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, - "#[FACTORY] gstMainGpsInterruptSignal.us_size == 0x%x\r\n", gstMainGpsInterruptSignal.us_size); - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, - "#[FACTORY] pst_data->uc_data == 0x%x", pst_data->uc_data[0]); - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, - "#[FACTORY] gstMainGpsInterruptSignal.uc_data == 0x%x\r\n", gstMainGpsInterruptSignal.uc_data); -#endif - } - - return(uc_ret); -} - -/******************************************************************************* -* MODULE : VehicleSensGetMainGpsInterruptSignal -* ABSTRACT : Vehicle sensor MAIN_GPS_INTERRUPT_SIGNAL GET function -* FUNCTION : Provide the MAIN_GPS_INTERRUPT_SIGNAL data master -* ARGUMENT : *pst_data : Pointer to the data master acquisition destination -* NOTE : -* RETURN : None -******************************************************************************/ -void VehicleSensGetMainGpsInterruptSignal(VEHICLESENS_DATA_MASTER_GPS_INTERRUPT_SIGNAL *pst_data) { - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - const VEHICLESENS_DATA_MASTER_GPS_INTERRUPT_SIGNAL *pst_master; - - if (pst_data == NULL) { - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "pst_data == NULL\r\n"); - } else { - pst_master = &gstMainGpsInterruptSignal; - - /* Store the data master in the specified destination. */ - pst_data->ul_did = pst_master->ul_did; - pst_data->us_size = pst_master->us_size; - pst_data->uc_rcvflag = pst_master->uc_rcvflag; - (void)memcpy(reinterpret_cast<void *>(&(pst_data->uc_data)), - (const void *)(&(pst_master->uc_data)), sizeof(pst_data->uc_data)); - } -} -// LCOV_EXCL_STOP diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_Mon_Hw_g.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_Mon_Hw_g.cpp deleted file mode 100755 index 1859f76..0000000 --- a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_Mon_Hw_g.cpp +++ /dev/null @@ -1,104 +0,0 @@ -/* - * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/*************************************************************************** -@file VehicleSens_Did_Mon_Hw_g.cpp -@detail Master vehicle sensor data(VEHICLE_DID_GPS_UBLOX_MON_HW) -*****************************************************************************/ - -#include <vehicle_service/positioning_base_library.h> -#include "VehicleSens_DataMaster.h" - -/*************************************************/ -/* Global variable */ -/*************************************************/ -static VEHICLESENS_DATA_MASTER_GPS_UBLOX_FORMAT gstMonHw_g; // NOLINT(readability/nolint) - -/*************************************************************************** -@brief MON-HW vehicle sensor initialization function -@outline MON-HW initialization process data master -@type Completion return type -@param[in] none -@threshold none -@return void -@retval none -@trace -*****************************************************************************/ -void VehicleSensInitMonHwG(void) { - memset(&gstMonHw_g, 0x00, sizeof(VEHICLESENS_DATA_MASTER_GPS_UBLOX_FORMAT)); - gstMonHw_g.ul_did = VEHICLE_DID_GPS_UBLOX_MON_HW; - gstMonHw_g.us_size = VEHICLE_DSIZE_GPS_UBLOX_MON_HW + VEHICLE_DSIZE_GPS_UBLOX_HEADER_SIZE; - gstMonHw_g.uc_data[0] = VEHICLE_DINIT_GPS_UBLOX_MON_HW; -} - -/*************************************************************************** -@brief MON-HW SET vehicle sensor function -@outline To update the master data MON-HW. -@type Completion return type -@param[in] SENSOR_MSG_GPSDATA_DAT *pst_data : The pointer to GPS incoming message data -@threshold none -@return u_int8 -@retval VEHICLESENS_EQ : No data changes -@retval VEHICLESENS_NEQ : With data changes -@trace -*****************************************************************************/ -u_int8 VehicleSensSetMonHwG(const SENSOR_MSG_GPSDATA_DAT *pst_data) { // LCOV_EXCL_START 8: dead code - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - u_int8 uc_ret; - VEHICLESENS_DATA_MASTER_GPS_UBLOX_FORMAT *pst_master; - - pst_master = &gstMonHw_g; - - /** Compare data master and received data */ - uc_ret = VehicleSensmemcmp(pst_master->uc_data, pst_data->uc_data, pst_data->us_size); - - /** Received data is set in the data master. */ - pst_master->ul_did = pst_data->ul_did; - pst_master->us_size = pst_data->us_size; - pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON; - pst_master->uc_sensor_cnt = pst_data->uc_sns_cnt; - pst_master->uc_gpscnt_flag = pst_data->uc_gps_cnt_flag; - - memcpy(pst_master->uc_data, pst_data->uc_data, pst_data->us_size); - - return(uc_ret); -} - -/*************************************************************************** -@brief Vehicle sensor function MON-HW GET -@outline Master Data provides the MON-HW -@type Completion return type -@param[in] SENSOR_MSG_GPSDATA_DAT *pst_data : Where to get a pointer to the data master -@threshold none -@return void -@retval none -@trace -*****************************************************************************/ -void VehicleSensGetMonHwG(SENSOR_MSG_GPSDATA_DAT *pst_data) { - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - const VEHICLESENS_DATA_MASTER_GPS_UBLOX_FORMAT *pst_master; - - pst_master = &gstMonHw_g; - - /** Store the data master in the specified destination. */ - pst_data->ul_did = pst_master->ul_did; - pst_data->us_size = pst_master->us_size; - pst_data->uc_rcv_flag = pst_master->uc_rcvflag; - pst_data->uc_sns_cnt = pst_master->uc_sensor_cnt; - pst_data->uc_gps_cnt_flag = pst_master->uc_gpscnt_flag; - memcpy(pst_data->uc_data, pst_master->uc_data, pst_master->us_size); -} -// LCOV_EXCL_STOP diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_MotionHeading.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_MotionHeading.cpp deleted file mode 100755 index 67a218e..0000000 --- a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_MotionHeading.cpp +++ /dev/null @@ -1,55 +0,0 @@ -/* - * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/**************************************************************************** -@file VehicleSens_Did_MotionHeading.cpp -@detail Orientation Information Data Master Management -******************************************************************************/ -#include <vehicle_service/positioning_base_library.h> -#include "VehicleSens_DataMaster.h" - -/************************************************* - * Global variable * - *************************************************/ - -/**************************************************************************** -@brief VehicleSensGetMotionHeading<BR> - Compass Data Master GET Processing -@outline Provide an orientation information data master -@param[in] u_int8 uc_get_method : Acquisition method(GPS or Navi) -@param[out] VEHICLESENS_DATA_MASTER *pst_data : Pointer to the data master acquisition destination -@return none -@retval none -*******************************************************************************/ -void VehicleSensGetMotionHeading(VEHICLESENS_DATA_MASTER *pst_data, u_int8 uc_get_method) { - switch (uc_get_method) { // LCOV_EXCL_BR_LINE 6:other parameters cannot pass in - case VEHICLESENS_GETMETHOD_GPS: - { - /** To acquire from GPS */ - VehicleSensGetMotionHeadingG(pst_data); - break; - } - case VEHICLESENS_GETMETHOD_NAVI: - { - /** To acquire from NAVI */ - VehicleSensGetMotionHeadingnCnvData(pst_data); - break; - } - default: /* Ignore->MISRA-C++:2008 Rule 6-3-1, 6-4-1 */ - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - break; // LCOV_EXCL_LINE 8: dead code - } -} diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_MotionHeading_g.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_MotionHeading_g.cpp deleted file mode 100755 index 751b199..0000000 --- a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_MotionHeading_g.cpp +++ /dev/null @@ -1,105 +0,0 @@ -/* - * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/**************************************************************************** -@file VehicleSens_Did_MotionHeading_g.cpp -@detail Orientation Information Data Master Management(NMEA information) -******************************************************************************/ -#include <vehicle_service/positioning_base_library.h> -#include "VehicleSens_DataMaster.h" -#include "CommonDefine.h" - -/************************************************* - * Global variable * - *************************************************/ -static VEHICLESENS_DATA_MASTER gstMotionHeading_g; // NOLINT(readability/nolint) - -/**************************************************************************** -@brief VehicleSensInitMotionHeadingG<BR> - Orientation information data master initialization process(NMEA information) -@outline Initialize the orientation information data master -@param[in] none -@param[out] none -@return none -@retval none -*******************************************************************************/ -void VehicleSensInitMotionHeadingG(void) { - SENSORMOTION_HEADINGINFO_DAT st_heading; - - memset(&gstMotionHeading_g, 0x00, sizeof(VEHICLESENS_DATA_MASTER)); - - /** Data ID setting */ - gstMotionHeading_g.ul_did = VEHICLE_DID_MOTION_HEADING; - /** Data size setting */ - gstMotionHeading_g.us_size = sizeof(SENSORMOTION_HEADINGINFO_DAT); - /** Data content setting */ - memset(&st_heading, 0x00, sizeof(st_heading)); - st_heading.getMethod = SENSOR_GET_METHOD_GPS; - st_heading.SyncCnt = 0x00; - st_heading.isEnable = SENSORMOTION_STATUS_DISABLE; - memcpy(&gstMotionHeading_g.uc_data[0], &st_heading, sizeof(st_heading)); -} - -/**************************************************************************** -@brief VehicleSensSetMotionHeadingG<BR> - Compass Data Master SET Processing(NMEA information) -@outline Update the orientation information data master -@param[in] SENSORMOTION_HEADINGINFO_DAT* pst_heading : Bearing information -@param[out] none -@return u_int8 -@retval VEHICLESENS_EQ : No data change -@retval VEHICLESENS_NEQ : Data change -*******************************************************************************/ -u_int8 VehicleSensSetMotionHeadingG(const SENSORMOTION_HEADINGINFO_DAT *pst_heading) { - u_int8 uc_ret; - VEHICLESENS_DATA_MASTER *pst_master; - - pst_master = &gstMotionHeading_g; - - /** With the contents of the current data master,Compare received data */ - uc_ret = VehicleSensmemcmp(pst_master->uc_data, pst_heading, - sizeof(SENSORMOTION_HEADINGINFO_DAT)); - - /** Received data is set in the data master. */ - pst_master->ul_did = VEHICLE_DID_MOTION_HEADING; - pst_master->us_size = sizeof(SENSORMOTION_HEADINGINFO_DAT); - pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON; - memset(pst_master->uc_data, 0x00, sizeof(pst_master->uc_data)); - memcpy(pst_master->uc_data, pst_heading, sizeof(SENSORMOTION_HEADINGINFO_DAT)); - - return(uc_ret); -} - -/**************************************************************************** -@brief VehicleSensGetMotionHeadingG<BR> - Compass Data Master GET Processing(NMEA information) -@outline Provide an orientation information data master -@param[in] none -@param[out] VEHICLESENS_DATA_MASTER *pst_data : Pointer to the data master acquisition destination -@return none -@retval none -*******************************************************************************/ -void VehicleSensGetMotionHeadingG(VEHICLESENS_DATA_MASTER *pst_data) { - const VEHICLESENS_DATA_MASTER *pst_master; - - pst_master = &gstMotionHeading_g; - - /* Store the data master in the specified destination. */ - pst_data->ul_did = pst_master->ul_did; - pst_data->us_size = pst_master->us_size; - pst_data->uc_rcvflag = pst_master->uc_rcvflag; - memcpy(pst_data->uc_data, pst_master->uc_data, pst_master->us_size); /* Ignore->MISRA-C++:2008 Rule 5-0-5 */ -} diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_MotionHeading_n.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_MotionHeading_n.cpp deleted file mode 100755 index 4475b24..0000000 --- a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_MotionHeading_n.cpp +++ /dev/null @@ -1,162 +0,0 @@ -/* - * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @file - * VehicleSens_Did_MotionHeading_n.cpp - * @brief - */ -/*---------------------------------------------------------------------------------* - * Include Files * - *---------------------------------------------------------------------------------*/ -#include <vehicle_service/positioning_base_library.h> -#include "VehicleSens_DataMaster.h" -#include "SensorMotion_API.h" -#include "CommonDefine.h" - -/*---------------------------------------------------------------------------------* - * Global Value * - *---------------------------------------------------------------------------------*/ -static VEHICLESENS_DATA_MASTER gstMotionHeading_n; // NOLINT(readability/nolint) - -/** - * @brief - * Orientation information data master initialization process(NAVI information) - * - * Initialize the orientation information data master - * - * @param[in] none - * @param[out] none - * @return none - * @retval none - */ -void VehicleSensInitMotionHeadingN(void) { - SENSORMOTION_HEADINGINFO_DAT st_heading; - - memset(&gstMotionHeading_n, 0x00, sizeof(VEHICLESENS_DATA_MASTER)); - - /** Data ID setting */ - gstMotionHeading_n.ul_did = VEHICLE_DID_MOTION_HEADING_NAVI; - - /** Data size setting */ - gstMotionHeading_n.us_size = sizeof(SENSORMOTION_HEADINGINFO_DAT); - - /** Data content setting */ - memset(&st_heading, 0x00, sizeof(st_heading)); - st_heading.getMethod = SENSOR_GET_METHOD_NAVI; - st_heading.SyncCnt = 0x00; - st_heading.isEnable = SENSORMOTION_STATUS_DISABLE; - st_heading.posSts = 0x00; - st_heading.Heading = 0x00; - memcpy(&gstMotionHeading_n.uc_data[0], &st_heading, sizeof(st_heading)); - - return; -} - -/** - * @brief - * Compass Data Master SET Processing(NAVI information) - * - * Update the orientation information data master - * - * @param[in] VEHICLESENS_DATA_MASTER *pst_heading : Pointer to the data master acquisition destination - * @param[out] none - * @return u_int8 - * @retval VEHICLESENS_EQ : No data change - * @retval VEHICLESENS_NEQ : Data change - */ -u_int8 VehicleSensSetMotionHeadingN(const SENSORMOTION_HEADINGINFO_DAT *pst_heading) { - u_int8 uc_ret; - VEHICLESENS_DATA_MASTER *pst_master; - - pst_master = &gstMotionHeading_n; - - /** With the contents of the current data master,Compare received data */ - uc_ret = VehicleSensmemcmp(pst_master->uc_data, pst_heading, sizeof(SENSORMOTION_HEADINGINFO_DAT)); - - /** Received data is set in the data master. */ - pst_master->ul_did = VEHICLE_DID_MOTION_HEADING_NAVI; - pst_master->us_size = sizeof(SENSORMOTION_HEADINGINFO_DAT); - pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON; - memcpy(pst_master->uc_data, pst_heading, sizeof(SENSORMOTION_HEADINGINFO_DAT)); - - return(uc_ret); -} - -/** - * @brief - * Compass Data Master GET Processing(NAVI information) - * - * Provide an orientation information data master - * - * @param[in] none - * @param[out] VEHICLESENS_DATA_MASTER *pst_data : Pointer to the data master acquisition destination - * @return none - * @retval none - */ -void VehicleSensGetMotionHeadingN(VEHICLESENS_DATA_MASTER *pst_data) { // LCOV_EXCL_START 8: dead code. - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - const VEHICLESENS_DATA_MASTER *pst_master; - - pst_master = &gstMotionHeading_n; - - /** Store the data master in the specified destination. */ - pst_data->ul_did = pst_master->ul_did; - pst_data->us_size = pst_master->us_size; - pst_data->uc_rcvflag = pst_master->uc_rcvflag; - memcpy(pst_data->uc_data, pst_master->uc_data, pst_master->us_size); - - return; -} -// LCOV_EXCL_STOP - -/** - * @brief - * Compass Data Master GET Processing(NAVI information) - * - * Providing orientation information data master with orientation and unit conversion - * - * @param[in] none - * @param[out] VEHICLESENS_DATA_MASTER *pst_data : Pointer to the data master acquisition destination - * @return none - * @retval none - */ -void VehicleSensGetMotionHeadingnCnvData(VEHICLESENS_DATA_MASTER *pst_data) { - const VEHICLESENS_DATA_MASTER *pst_master; - SENSORMOTION_HEADINGINFO_DAT st_heading; - int16 i_heading; - - pst_master = &gstMotionHeading_n; - - /* Perform the orientation conversion[-179 to +180] -> [0 to 359] */ - memcpy(&st_heading, pst_master->uc_data, sizeof(st_heading)); - i_heading = static_cast<int16>(st_heading.Heading); - if (i_heading > 0) { - i_heading = static_cast<int16>(360 - i_heading); - } else { - i_heading = static_cast<int16>(i_heading * -1); - } - /* Perform unit conversion[Once] -> [0.01 degree] */ - st_heading.Heading = (u_int16)(i_heading * 100); - - /** Store the data master in the specified destination. */ - pst_data->ul_did = pst_master->ul_did; - pst_data->us_size = pst_master->us_size; - pst_data->uc_rcvflag = pst_master->uc_rcvflag; - memcpy(pst_data->uc_data, &st_heading, sizeof(st_heading)); - - return; -} diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_MotionSpeed.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_MotionSpeed.cpp deleted file mode 100755 index 0f7abe3..0000000 --- a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_MotionSpeed.cpp +++ /dev/null @@ -1,57 +0,0 @@ -/* - * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @file - * VehicleSens_Did_MotionSpeed.cpp - * @brief - */ - -/*---------------------------------------------------------------------------------* - * Include Files * - *---------------------------------------------------------------------------------*/ -#include <vehicle_service/positioning_base_library.h> -#include "VehicleSens_DataMaster.h" - -/*---------------------------------------------------------------------------------* - * Function * - *---------------------------------------------------------------------------------*/ -/** - * @brief - * Speed information data master GET processing - * - * @param[out] *pst_data - VEHICLESENS_DATA_MASTER Pointer to the data master acquisition destination - * @param[in] uc_get_method - u_int8 acquisition method - */ -void VehicleSensGetMotionSpeed(VEHICLESENS_DATA_MASTER *pst_data, u_int8 uc_get_method) { - switch (uc_get_method) { // LCOV_EXCL_BR_LINE 6:other parameters cannot pass in - case VEHICLESENS_GETMETHOD_INTERNAL: - { - /** When acquiring internal calculation data */ - VehicleSensGetMotionSpeedI(pst_data); - } - break; - case VEHICLESENS_GETMETHOD_NAVI: - { - /** To acquire NAVI data */ - VehicleSensGetMotionSpeedN(pst_data); - break; - } - default: - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - break; // LCOV_EXCL_LINE 8: dead code - } -} diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_MotionSpeed_g.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_MotionSpeed_g.cpp deleted file mode 100755 index 9b8ae6c..0000000 --- a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_MotionSpeed_g.cpp +++ /dev/null @@ -1,107 +0,0 @@ -/* - * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @file - * VehicleSens_Did_MotionSpeed_g.cpp - * @brief - * Vehicle Speed Information Data Master Management(NMEA information) - */ - -/*---------------------------------------------------------------------------------* - * Include Files * - *---------------------------------------------------------------------------------*/ -#include <vehicle_service/positioning_base_library.h> -#include "VehicleSens_DataMaster.h" -#include "CommonDefine.h" - -/*---------------------------------------------------------------------------------* - * Grobal Value * - *---------------------------------------------------------------------------------*/ -static VEHICLESENS_DATA_MASTER gstMotionSpeed_g; // NOLINT(readability/nolint) - -/*---------------------------------------------------------------------------------* - * Function * - *---------------------------------------------------------------------------------*/ -/** - * @brief - * Speed information data master initialization process(NMEA information) - */ -void VehicleSensInitMotionSpeedG(void) { - SENSORMOTION_SPEEDINFO_DAT st_speed; - - memset(&gstMotionSpeed_g, 0x00, sizeof(VEHICLESENS_DATA_MASTER)); - - /** Data ID setting */ - gstMotionSpeed_g.ul_did = VEHICLE_DID_MOTION_SPEED; - /** Data size setting */ - gstMotionSpeed_g.us_size = sizeof(SENSORMOTION_SPEEDINFO_DAT); - /** Data content setting */ - memset(&st_speed, 0x00, sizeof(st_speed)); - st_speed.getMethod = SENSOR_GET_METHOD_GPS; - st_speed.SyncCnt = 0x00; - st_speed.isEnable = SENSORMOTION_STATUS_DISABLE; - memcpy(&gstMotionSpeed_g.uc_data[0], &st_speed, sizeof(st_speed)); -} - -/** - * @brief - * Rate information data master SET process(NMEA information) - * - * @param[in] *pst_speed - SENSORMOTION_SPEEDINFO_DAT Pointer to vehicle speed information - * - * @return VEHICLESENS_EQ : No data change<br> - * VEHICLESENS_NEQ : Data change - */ -u_int8 VehicleSensSetMotionSpeedG(const SENSORMOTION_SPEEDINFO_DAT *pst_speed) { // LCOV_EXCL_START 8: dead code. - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - u_int8 uc_ret; - VEHICLESENS_DATA_MASTER *pst_master; - - pst_master = &gstMotionSpeed_g; - - /** With the contents of the current data master,Compare received data */ - uc_ret = VehicleSensmemcmp(pst_master->uc_data, pst_speed, sizeof(SENSORMOTION_SPEEDINFO_DAT)); - - /** Received data is set in the data master. */ - pst_master->ul_did = VEHICLE_DID_MOTION_SPEED; - pst_master->us_size = sizeof(SENSORMOTION_SPEEDINFO_DAT); - pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON; - memset(pst_master->uc_data, 0x00, sizeof(pst_master->uc_data)); - memcpy(pst_master->uc_data, pst_speed, sizeof(SENSORMOTION_SPEEDINFO_DAT)); - - return(uc_ret); -} - -/** - * @brief - * Speed information data master GET processing(NMEA information) - * - * @param[out] *pst_speed - VEHICLESENS_DATA_MASTER Pointer to the data master acquisition destination - */ -void VehicleSensGetMotionSpeedG(VEHICLESENS_DATA_MASTER *pst_data) { - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - const VEHICLESENS_DATA_MASTER *pst_master; - - pst_master = &gstMotionSpeed_g; - - /* Store the data master in the specified destination. */ - pst_data->ul_did = pst_master->ul_did; - pst_data->us_size = pst_master->us_size; - pst_data->uc_rcvflag = pst_master->uc_rcvflag; - memcpy(pst_data->uc_data, pst_master->uc_data, pst_master->us_size); -} -// LCOV_EXCL_STOP diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_MotionSpeed_i.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_MotionSpeed_i.cpp deleted file mode 100755 index 7f01e2f..0000000 --- a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_MotionSpeed_i.cpp +++ /dev/null @@ -1,103 +0,0 @@ -/* - * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @file - * VehicleSens_Did_MotionSpeed_i.cpp - * @brief - * Vehicle Speed Information Data Master Management(Internal calculation information) - */ - -/*---------------------------------------------------------------------------------* - * Include Files * - *---------------------------------------------------------------------------------*/ -#include <vehicle_service/positioning_base_library.h> -#include "VehicleSens_DataMaster.h" -#include "CommonDefine.h" - -/*---------------------------------------------------------------------------------* - * Grobal Value * - *---------------------------------------------------------------------------------*/ -static VEHICLESENS_DATA_MASTER gstMotionSpeed_i; // NOLINT(readability/nolint) - -/*---------------------------------------------------------------------------------* - * Function * - *---------------------------------------------------------------------------------*/ -/** - * @brief - * Speed information data master initialization process(Internal calculation information) - */ -void VehicleSensInitMotionSpeedI(void) { - SENSORMOTION_SPEEDINFO_DAT st_speed; - - memset(&gstMotionSpeed_i, 0x00, sizeof(VEHICLESENS_DATA_MASTER)); - - /** Data ID setting */ - gstMotionSpeed_i.ul_did = VEHICLE_DID_MOTION_SPEED_INTERNAL; - /** Data size setting */ - gstMotionSpeed_i.us_size = sizeof(SENSORMOTION_SPEEDINFO_DAT); - /** Data content setting */ - memset(&st_speed, 0x00, sizeof(st_speed)); - st_speed.getMethod = SENSOR_GET_METHOD_POS; - st_speed.SyncCnt = 0x00; - st_speed.isEnable = SENSORMOTION_STATUS_DISABLE; - memcpy(&gstMotionSpeed_i.uc_data[0], &st_speed, sizeof(st_speed)); -} - -/** - * @brief - * Rate information data master SET process(Internal calculation information) - * - * @param[in] *pst_speed - SENSORMOTION_SPEEDINFO_DAT Pointer to vehicle speed information - * - * @return VEHICLESENS_EQ : No data change<br> - * VEHICLESENS_NEQ : Data change - */ -u_int8 VehicleSensSetMotionSpeedI(const SENSORMOTION_SPEEDINFO_DAT *pst_speed) { - u_int8 uc_ret; - VEHICLESENS_DATA_MASTER *pst_master; - - pst_master = &gstMotionSpeed_i; - - /** With the contents of the current data master,Compare received data */ - uc_ret = VehicleSensmemcmp(pst_master->uc_data, pst_speed, sizeof(SENSORMOTION_SPEEDINFO_DAT)); - - /** Received data is set in the data master. */ - pst_master->ul_did = VEHICLE_DID_MOTION_SPEED_INTERNAL; - pst_master->us_size = sizeof(SENSORMOTION_SPEEDINFO_DAT); - pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON; - memcpy(pst_master->uc_data, pst_speed, sizeof(SENSORMOTION_SPEEDINFO_DAT)); - - return(uc_ret); -} - -/** - * @brief - * Speed information data master GET processing(Internal calculation information) - * - * @param[out] *pst_speed - VEHICLESENS_DATA_MASTER Pointer to the data master acquisition destination - */ -void VehicleSensGetMotionSpeedI(VEHICLESENS_DATA_MASTER *pst_data) { - const VEHICLESENS_DATA_MASTER *pst_master; - - pst_master = &gstMotionSpeed_i; - - /* Store the data master in the specified destination. */ - pst_data->ul_did = pst_master->ul_did; - pst_data->us_size = pst_master->us_size; - pst_data->uc_rcvflag = pst_master->uc_rcvflag; - memcpy(pst_data->uc_data, pst_master->uc_data, pst_master->us_size); -} diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_MotionSpeed_n.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_MotionSpeed_n.cpp deleted file mode 100755 index 9c8f5bc..0000000 --- a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_MotionSpeed_n.cpp +++ /dev/null @@ -1,103 +0,0 @@ -/* - * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @file - * VehicleSens_Did_MotionSpeed_n.cpp - * @brief - * Vehicle Speed Information Data Master Management(Navi information) - */ - -/*---------------------------------------------------------------------------------* - * Include Files * - *---------------------------------------------------------------------------------*/ -#include <vehicle_service/positioning_base_library.h> -#include "VehicleSens_DataMaster.h" -#include "CommonDefine.h" - -/*---------------------------------------------------------------------------------* - * Grobal Value * - *---------------------------------------------------------------------------------*/ -static VEHICLESENS_DATA_MASTER gstMotionSpeed_n; // NOLINT(readability/nolint) - -/*---------------------------------------------------------------------------------* - * Function * - *---------------------------------------------------------------------------------*/ -/** - * @brief - * Speed information data master initialization process(Navi information) - */ -void VehicleSensInitMotionSpeedN(void) { - SENSORMOTION_SPEEDINFO_DAT st_speed; - - memset(&gstMotionSpeed_n, 0x00, sizeof(VEHICLESENS_DATA_MASTER)); - - /** Data ID setting */ - gstMotionSpeed_n.ul_did = VEHICLE_DID_MOTION_SPEED_NAVI; - /** Data size setting */ - gstMotionSpeed_n.us_size = sizeof(SENSORMOTION_SPEEDINFO_DAT); - /** Data content setting */ - memset(&st_speed, 0x00, sizeof(st_speed)); - st_speed.getMethod = SENSOR_GET_METHOD_NAVI; - st_speed.SyncCnt = 0x00; - st_speed.isEnable = SENSORMOTION_STATUS_DISABLE; - memcpy(&gstMotionSpeed_n.uc_data[0], &st_speed, sizeof(st_speed)); -} - -/** - * @brief - * Rate information data master SET process(Navi information) - * - * @param[in] *pst_speed - SENSORMOTION_SPEEDINFO_DAT Pointer to vehicle speed information - * - * @return VEHICLESENS_EQ : No data change<br> - * VEHICLESENS_NEQ : Data change - */ -u_int8 VehicleSensSetMotionSpeedN(const SENSORMOTION_SPEEDINFO_DAT *pst_speed) { - u_int8 uc_ret; - VEHICLESENS_DATA_MASTER *pst_master; - - pst_master = &gstMotionSpeed_n; - - /** With the contents of the current data master,Compare received data */ - uc_ret = VehicleSensmemcmp(pst_master->uc_data, pst_speed, sizeof(SENSORMOTION_SPEEDINFO_DAT)); - - /** Received data is set in the data master. */ - pst_master->ul_did = VEHICLE_DID_MOTION_SPEED_NAVI; - pst_master->us_size = sizeof(SENSORMOTION_SPEEDINFO_DAT); - pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON; - memcpy(pst_master->uc_data, pst_speed, sizeof(SENSORMOTION_SPEEDINFO_DAT)); - - return(uc_ret); -} - -/** - * @brief - * Speed information data master GET processing(Navi information) - * - * @param[out] *pst_speed - VEHICLESENS_DATA_MASTER Pointer to the data master acquisition destination - */ -void VehicleSensGetMotionSpeedN(VEHICLESENS_DATA_MASTER *pst_data) { - const VEHICLESENS_DATA_MASTER *pst_master; - - pst_master = &gstMotionSpeed_n; - - /* Store the data master in the specified destination. */ - pst_data->ul_did = pst_master->ul_did; - pst_data->us_size = pst_master->us_size; - pst_data->uc_rcvflag = pst_master->uc_rcvflag; - memcpy(pst_data->uc_data, pst_master->uc_data, pst_master->us_size); -} diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_Nav_Clock_g.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_Nav_Clock_g.cpp deleted file mode 100755 index a9bc0c9..0000000 --- a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_Nav_Clock_g.cpp +++ /dev/null @@ -1,104 +0,0 @@ -/* - * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/*************************************************************************** -@file VehicleSens_Did_Nav_Clock_g.cpp -@detail Master vehicle sensor data(VEHICLE_DID_GPS_UBLOX_NAV_CLOCK) -*****************************************************************************/ - -#include <vehicle_service/positioning_base_library.h> -#include "VehicleSens_DataMaster.h" - -/*************************************************/ -/* Global variable */ -/*************************************************/ -static VEHICLESENS_DATA_MASTER_GPS_UBLOX_FORMAT gstNavClock_g; // NOLINT(readability/nolint) - -/*************************************************************************** -@brief NAV-CLOCK vehicle sensor initialization function -@outline NAV-CLOCK initialization process data master -@type Completion return type -@param[in] none -@threshold none -@return void -@retval none -@trace -*****************************************************************************/ -void VehicleSensInitNavClockG(void) { - memset(&gstNavClock_g, 0x00, sizeof(VEHICLESENS_DATA_MASTER_GPS_UBLOX_FORMAT)); - gstNavClock_g.ul_did = VEHICLE_DID_GPS_UBLOX_NAV_CLOCK; - gstNavClock_g.us_size = VEHICLE_DSIZE_GPS_UBLOX_NAV_CLOCK + VEHICLE_DSIZE_GPS_UBLOX_HEADER_SIZE; - gstNavClock_g.uc_data[0] = VEHICLE_DINIT_GPS_UBLOX_NAV_CLOCK; -} - -/*************************************************************************** -@brief NAV-CLOCK SET vehicle sensor function -@outline To update the master data NAV-CLOCK. -@type Completion return type -@param[in] SENSOR_MSG_GPSDATA_DAT *pst_data : The pointer to GPS incoming message data -@threshold none -@return u_int8 -@retval VEHICLESENS_EQ : No data changes -@retval VEHICLESENS_NEQ : With data changes -@trace -*****************************************************************************/ -u_int8 VehicleSensSetNavClockG(const SENSOR_MSG_GPSDATA_DAT *pst_data) { // LCOV_EXCL_START 8: dead code - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - u_int8 uc_ret; - VEHICLESENS_DATA_MASTER_GPS_UBLOX_FORMAT *pst_master; - - pst_master = &gstNavClock_g; - - /** Compare data master and received data */ - uc_ret = VehicleSensmemcmp(pst_master->uc_data, pst_data->uc_data, pst_data->us_size); - - /** Received data is set in the data master. */ - pst_master->ul_did = pst_data->ul_did; - pst_master->us_size = pst_data->us_size; - pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON; - pst_master->uc_sensor_cnt = pst_data->uc_sns_cnt; - pst_master->uc_gpscnt_flag = pst_data->uc_gps_cnt_flag; - - memcpy(pst_master->uc_data, pst_data->uc_data, pst_data->us_size); - - return(uc_ret); -} - -/*************************************************************************** -@brief Vehicle sensor function NAV-CLOCK GET -@outline Master Data provides the NAV-CLOCK -@type Completion return type -@param[in] SENSOR_MSG_GPSDATA_DAT *pst_data : Where to get a pointer to the data master -@threshold none -@return void -@retval none -@trace -*****************************************************************************/ -void VehicleSensGetNavClockG(SENSOR_MSG_GPSDATA_DAT *pst_data) { - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - const VEHICLESENS_DATA_MASTER_GPS_UBLOX_FORMAT *pst_master; - - pst_master = &gstNavClock_g; - - /** Store the data master in the specified destination. */ - pst_data->ul_did = pst_master->ul_did; - pst_data->us_size = pst_master->us_size; - pst_data->uc_rcv_flag = pst_master->uc_rcvflag; - pst_data->uc_sns_cnt = pst_master->uc_sensor_cnt; - pst_data->uc_gps_cnt_flag = pst_master->uc_gpscnt_flag; - memcpy(pst_data->uc_data, pst_master->uc_data, pst_master->us_size); -} -// LCOV_EXCL_STOP diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_Nav_Dop_g.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_Nav_Dop_g.cpp deleted file mode 100755 index 211e940..0000000 --- a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_Nav_Dop_g.cpp +++ /dev/null @@ -1,104 +0,0 @@ -/* - * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/*************************************************************************** -@file VehicleSens_Did_Nav_Dop_g.cpp -@detail Master vehicle sensor data(VEHICLE_DID_GPS_UBLOX_NAV_DOP) -*****************************************************************************/ - -#include <vehicle_service/positioning_base_library.h> -#include "VehicleSens_DataMaster.h" - -/*************************************************/ -/* Global variable */ -/*************************************************/ -static VEHICLESENS_DATA_MASTER_GPS_UBLOX_FORMAT gstNavDop_g; // NOLINT(readability/nolint) - -/*************************************************************************** -@brief NAV-DOP vehicle sensor initialization function -@outline NAV-DOP initialization process data master -@type Completion return type -@param[in] none -@threshold none -@return void -@retval none -@trace -*****************************************************************************/ -void VehicleSensInitNavDopG(void) { - memset(&gstNavDop_g, 0x00, sizeof(VEHICLESENS_DATA_MASTER_GPS_UBLOX_FORMAT)); - gstNavDop_g.ul_did = VEHICLE_DID_GPS_UBLOX_NAV_DOP; - gstNavDop_g.us_size = VEHICLE_DSIZE_GPS_UBLOX_NAV_DOP + VEHICLE_DSIZE_GPS_UBLOX_HEADER_SIZE; - gstNavDop_g.uc_data[0] = VEHICLE_DINIT_GPS_UBLOX_NAV_DOP; -} - -/*************************************************************************** -@brief NAV-DOP SET vehicle sensor function -@outline To update the master data NAV-DOP. -@type Completion return type -@param[in] SENSOR_MSG_GPSDATA_DAT *pst_data : The pointer to GPS incoming message data -@threshold none -@return u_int8 -@retval VEHICLESENS_EQ : No data changes -@retval VEHICLESENS_NEQ : With data changes -@trace -*****************************************************************************/ -u_int8 VehicleSensSetNavDopG(const SENSOR_MSG_GPSDATA_DAT *pst_data) { // LCOV_EXCL_START 8: dead code - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - u_int8 uc_ret; - VEHICLESENS_DATA_MASTER_GPS_UBLOX_FORMAT *pst_master; - - pst_master = &gstNavDop_g; - - /** Compare data master and received data */ - uc_ret = VehicleSensmemcmp(pst_master->uc_data, pst_data->uc_data, pst_data->us_size); - - /** Received data is set in the data master. */ - pst_master->ul_did = pst_data->ul_did; - pst_master->us_size = pst_data->us_size; - pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON; - pst_master->uc_sensor_cnt = pst_data->uc_sns_cnt; - pst_master->uc_gpscnt_flag = pst_data->uc_gps_cnt_flag; - - memcpy(pst_master->uc_data, pst_data->uc_data, pst_data->us_size); - - return(uc_ret); -} - -/*************************************************************************** -@brief Vehicle sensor function NAV-DOP GET -@outline Master Data provides the NAV-DOP -@type Completion return type -@param[in] SENSOR_MSG_GPSDATA_DAT *pst_data : Where to get a pointer to the data master -@threshold none -@return void -@retval none -@trace -*****************************************************************************/ -void VehicleSensGetNavDopG(SENSOR_MSG_GPSDATA_DAT *pst_data) { - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - const VEHICLESENS_DATA_MASTER_GPS_UBLOX_FORMAT *pst_master; - - pst_master = &gstNavDop_g; - - /** Store the data master in the specified destination. */ - pst_data->ul_did = pst_master->ul_did; - pst_data->us_size = pst_master->us_size; - pst_data->uc_rcv_flag = pst_master->uc_rcvflag; - pst_data->uc_sns_cnt = pst_master->uc_sensor_cnt; - pst_data->uc_gps_cnt_flag = pst_master->uc_gpscnt_flag; - memcpy(pst_data->uc_data, pst_master->uc_data, pst_master->us_size); -} -// LCOV_EXCL_STOP diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_Nav_Posllh_g.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_Nav_Posllh_g.cpp deleted file mode 100755 index 17ebc04..0000000 --- a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_Nav_Posllh_g.cpp +++ /dev/null @@ -1,104 +0,0 @@ -/* - * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/*************************************************************************** -@file VehicleSens_Did_Nav_Posllh_g.cpp -@detail Master vehicle sensor data(VEHICLE_DID_GPS_UBLOX_NAV_POSLLH) -*****************************************************************************/ - -#include <vehicle_service/positioning_base_library.h> -#include "VehicleSens_DataMaster.h" - -/*************************************************/ -/* Global variable */ -/*************************************************/ -static VEHICLESENS_DATA_MASTER_GPS_UBLOX_FORMAT gstNavPosllh_g; // NOLINT(readability/nolint) - -/*************************************************************************** -@brief NAV-POSLLH vehicle sensor initialization function -@outline NAV-POSLLH initialization process data master -@type Completion return type -@param[in] none -@threshold none -@return void -@retval none -@trace -*****************************************************************************/ -void VehicleSensInitNavPosllhG(void) { - memset(&gstNavPosllh_g, 0x00, sizeof(VEHICLESENS_DATA_MASTER_GPS_UBLOX_FORMAT)); - gstNavPosllh_g.ul_did = VEHICLE_DID_GPS_UBLOX_NAV_POSLLH; - gstNavPosllh_g.us_size = VEHICLE_DSIZE_GPS_UBLOX_NAV_POSLLH + VEHICLE_DSIZE_GPS_UBLOX_HEADER_SIZE; - gstNavPosllh_g.uc_data[0] = VEHICLE_DINIT_GPS_UBLOX_NAV_POSLLH; -} - -/*************************************************************************** -@brief NAV-POSLLH SET vehicle sensor function -@outline To update the master data NAV-POSLLH. -@type Completion return type -@param[in] SENSOR_MSG_GPSDATA_DAT *pst_data : The pointer to GPS incoming message data -@threshold none -@return u_int8 -@retval VEHICLESENS_EQ : No data changes -@retval VEHICLESENS_NEQ : With data changes -@trace -*****************************************************************************/ -u_int8 VehicleSensSetNavPosllhG(const SENSOR_MSG_GPSDATA_DAT *pst_data) { // LCOV_EXCL_START 8: dead code - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - u_int8 uc_ret; - VEHICLESENS_DATA_MASTER_GPS_UBLOX_FORMAT *pst_master; - - pst_master = &gstNavPosllh_g; - - /** Compare data master and received data */ - uc_ret = VehicleSensmemcmp(pst_master->uc_data, pst_data->uc_data, pst_data->us_size); - - /** Received data is set in the data master. */ - pst_master->ul_did = pst_data->ul_did; - pst_master->us_size = pst_data->us_size; - pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON; - pst_master->uc_sensor_cnt = pst_data->uc_sns_cnt; - pst_master->uc_gpscnt_flag = pst_data->uc_gps_cnt_flag; - - memcpy(pst_master->uc_data, pst_data->uc_data, pst_data->us_size); - - return(uc_ret); -} - -/*************************************************************************** -@brief Vehicle sensor function NAV-POSLLH GET -@outline Master Data provides the NAV-POSLLH -@type Completion return type -@param[in] SENSOR_MSG_GPSDATA_DAT *pst_data : Where to get a pointer to the data master -@threshold none -@return void -@retval none -@trace -*****************************************************************************/ -void VehicleSensGetNavPosllhG(SENSOR_MSG_GPSDATA_DAT *pst_data) { - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - const VEHICLESENS_DATA_MASTER_GPS_UBLOX_FORMAT *pst_master; - - pst_master = &gstNavPosllh_g; - - /** Store the data master in the specified destination. */ - pst_data->ul_did = pst_master->ul_did; - pst_data->us_size = pst_master->us_size; - pst_data->uc_rcv_flag = pst_master->uc_rcvflag; - pst_data->uc_sns_cnt = pst_master->uc_sensor_cnt; - pst_data->uc_gps_cnt_flag = pst_master->uc_gpscnt_flag; - memcpy(pst_data->uc_data, pst_master->uc_data, pst_master->us_size); -} -// LCOV_EXCL_STOP diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_Nav_Status_g.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_Nav_Status_g.cpp deleted file mode 100755 index f03d48f..0000000 --- a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_Nav_Status_g.cpp +++ /dev/null @@ -1,104 +0,0 @@ -/* - * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/*************************************************************************** -@file VehicleSens_Did_Nav_Status_g.cpp -@detail Master vehicle sensor data(VEHICLE_DID_GPS_UBLOX_NAV_STATUS) -*****************************************************************************/ - -#include <vehicle_service/positioning_base_library.h> -#include "VehicleSens_DataMaster.h" - -/*************************************************/ -/* Global variable */ -/*************************************************/ -static VEHICLESENS_DATA_MASTER_GPS_UBLOX_FORMAT gstNavStatus_g; // NOLINT(readability/nolint) - -/*************************************************************************** -@brief NAV-STATUS vehicle sensor initialization function -@outline NAV-STATUS initialization process data master -@type Completion return type -@param[in] none -@threshold none -@return void -@retval none -@trace -*****************************************************************************/ -void VehicleSensInitNavStatusG(void) { - memset(&gstNavStatus_g, 0x00, sizeof(VEHICLESENS_DATA_MASTER_GPS_UBLOX_FORMAT)); - gstNavStatus_g.ul_did = VEHICLE_DID_GPS_UBLOX_NAV_STATUS; - gstNavStatus_g.us_size = VEHICLE_DSIZE_GPS_UBLOX_NAV_STATUS + VEHICLE_DSIZE_GPS_UBLOX_HEADER_SIZE; - gstNavStatus_g.uc_data[0] = VEHICLE_DINIT_GPS_UBLOX_NAV_STATUS; -} - -/*************************************************************************** -@brief NAV-STATUS SET vehicle sensor function -@outline To update the master data NAV-STATUS. -@type Completion return type -@param[in] SENSOR_MSG_GPSDATA_DAT *pst_data : The pointer to GPS incoming message data -@threshold none -@return u_int8 -@retval VEHICLESENS_EQ : No data changes -@retval VEHICLESENS_NEQ : With data changes -@trace -*****************************************************************************/ -u_int8 VehicleSensSetNavStatusG(const SENSOR_MSG_GPSDATA_DAT *pst_data) { // LCOV_EXCL_START 8: dead code - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - u_int8 uc_ret; - VEHICLESENS_DATA_MASTER_GPS_UBLOX_FORMAT *pst_master; - - pst_master = &gstNavStatus_g; - - /** Compare data master and received data */ - uc_ret = VehicleSensmemcmp(pst_master->uc_data, pst_data->uc_data, pst_data->us_size); - - /** Received data is set in the data master. */ - pst_master->ul_did = pst_data->ul_did; - pst_master->us_size = pst_data->us_size; - pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON; - pst_master->uc_sensor_cnt = pst_data->uc_sns_cnt; - pst_master->uc_gpscnt_flag = pst_data->uc_gps_cnt_flag; - - memcpy(pst_master->uc_data, pst_data->uc_data, pst_data->us_size); - - return(uc_ret); -} - -/*************************************************************************** -@brief Vehicle sensor function NAV-STATUS GET -@outline Master Data provides the NAV-STATUS -@type Completion return type -@param[in] SENSOR_MSG_GPSDATA_DAT *pst_data : Where to get a pointer to the data master -@threshold none -@return void -@retval none -@trace -*****************************************************************************/ -void VehicleSensGetNavStatusG(SENSOR_MSG_GPSDATA_DAT *pst_data) { - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - const VEHICLESENS_DATA_MASTER_GPS_UBLOX_FORMAT *pst_master; - - pst_master = &gstNavStatus_g; - - /** Store the data master in the specified destination. */ - pst_data->ul_did = pst_master->ul_did; - pst_data->us_size = pst_master->us_size; - pst_data->uc_rcv_flag = pst_master->uc_rcvflag; - pst_data->uc_sns_cnt = pst_master->uc_sensor_cnt; - pst_data->uc_gps_cnt_flag = pst_master->uc_gpscnt_flag; - memcpy(pst_data->uc_data, pst_master->uc_data, pst_master->us_size); -} -// LCOV_EXCL_STOP diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_Nav_SvInfo_g.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_Nav_SvInfo_g.cpp deleted file mode 100755 index 7211ce8..0000000 --- a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_Nav_SvInfo_g.cpp +++ /dev/null @@ -1,108 +0,0 @@ -/* - * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/*************************************************************************** -@file VehicleSens_Did_Nav_SvInfo_g.cpp -@detail Master vehicle sensor data(VEHICLE_DID_GPS_UBLOX_NAV_SVINFO) -*****************************************************************************/ - -#include <vehicle_service/positioning_base_library.h> -#include "VehicleSens_DataMaster.h" - -/*************************************************/ -/* Global variable */ -/*************************************************/ -static VEHICLESENS_DATA_MASTER_GPS_UBLOX_FORMAT gstNavSvInfo_g; // NOLINT(readability/nolint) - -/*************************************************************************** -@brief NAV-SVINFO vehicle sensor initialization function -@outline NAV-SVINFO initialization process data master -@type Completion return type -@param[in] none -@threshold none -@return void -@retval none -@trace -*****************************************************************************/ -void VehicleSensInitNavSvInfoG(void) { - memset(&gstNavSvInfo_g, 0x00, sizeof(VEHICLESENS_DATA_MASTER_GPS_UBLOX_FORMAT)); - gstNavSvInfo_g.ul_did = VEHICLE_DID_GPS_UBLOX_NAV_SVINFO; - /* Initially, the maximum storage size is set.(Common header size(8) + NAV-SVINFO fixed-data-size(8) + - *(Maximum number of channels(16) + Size of single channel data(12))) */ - gstNavSvInfo_g.us_size = (VEHICLE_DSIZE_GPS_UBLOX_HEADER_SIZE + VEHICLE_DSIZE_GPS_UBLOX_NAV_SVINFO) + - (VEHICLE_DSIZE_GPS_UBLOX_NAV_SVINFO_CH_MAX * \ - VEHICLE_DSIZE_GPS_UBLOX_NAV_SVINFO_ALONE_MAX); - gstNavSvInfo_g.uc_data[0] = VEHICLE_DINIT_GPS_UBLOX_NAV_SVINFO; -} - -/*************************************************************************** -@brief NAV-SVINFO SET vehicle sensor function -@outline To update the master data NAV-SVINFO. -@type Completion return type -@param[in] SENSOR_MSG_GPSDATA_DAT *pst_data : The pointer to GPS incoming message data -@threshold none -@return u_int8 -@retval VEHICLESENS_EQ : No data changes -@retval VEHICLESENS_NEQ : With data changes -@trace -*****************************************************************************/ -u_int8 VehicleSensSetNavSvInfoG(const SENSOR_MSG_GPSDATA_DAT *pst_data) { // LCOV_EXCL_START 8: dead code - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - u_int8 uc_ret; - VEHICLESENS_DATA_MASTER_GPS_UBLOX_FORMAT *pst_master; - - pst_master = &gstNavSvInfo_g; - - /** Compare data master and received data */ - uc_ret = VehicleSensmemcmp(pst_master->uc_data, pst_data->uc_data, pst_data->us_size); - - /** Received data is set in the data master. */ - pst_master->ul_did = pst_data->ul_did; - pst_master->us_size = pst_data->us_size; - pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON; - pst_master->uc_sensor_cnt = pst_data->uc_sns_cnt; - pst_master->uc_gpscnt_flag = pst_data->uc_gps_cnt_flag; - - memcpy(pst_master->uc_data, pst_data->uc_data, pst_data->us_size); - - return(uc_ret); -} - -/*************************************************************************** -@brief Vehicle sensor function NAV-SVINFO GET -@outline Master Data provides the NAV-SVINFO -@type Completion return type -@param[in] SENSOR_MSG_GPSDATA_DAT *pst_data : Where to get a pointer to the data master -@threshold none -@return void -@retval none -@trace -*****************************************************************************/ -void VehicleSensGetNavSvInfoG(SENSOR_MSG_GPSDATA_DAT *pst_data) { - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - const VEHICLESENS_DATA_MASTER_GPS_UBLOX_FORMAT *pst_master; - - pst_master = &gstNavSvInfo_g; - - /** Store the data master in the specified destination. */ - pst_data->ul_did = pst_master->ul_did; - pst_data->us_size = pst_master->us_size; - pst_data->uc_rcv_flag = pst_master->uc_rcvflag; - pst_data->uc_sns_cnt = pst_master->uc_sensor_cnt; - pst_data->uc_gps_cnt_flag = pst_master->uc_gpscnt_flag; - memcpy(pst_data->uc_data, pst_master->uc_data, pst_master->us_size); -} -// LCOV_EXCL_STOP diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_Nav_TimeGps_g.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_Nav_TimeGps_g.cpp deleted file mode 100755 index 1d959cd..0000000 --- a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_Nav_TimeGps_g.cpp +++ /dev/null @@ -1,104 +0,0 @@ -/* - * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/*************************************************************************** -@file VehicleSens_Did_Nav_TimeGps_g.cpp -@detail Master vehicle sensor data(VEHICLE_DID_GPS_UBLOX_NAV_TIMEGPS) -*****************************************************************************/ - -#include <vehicle_service/positioning_base_library.h> -#include "VehicleSens_DataMaster.h" - -/*************************************************/ -/* Global variable */ -/*************************************************/ -static VEHICLESENS_DATA_MASTER_GPS_UBLOX_FORMAT gstNavTimeGps_g; // NOLINT(readability/nolint) - -/*************************************************************************** -@brief NAV-TIMEGPS vehicle sensor initialization function -@outline NAV-TIMEGPS initialization process data master -@type Completion return type -@param[in] none -@threshold none -@return void -@retval none -@trace -*****************************************************************************/ -void VehicleSensInitNavTimeGpsG(void) { - memset(&gstNavTimeGps_g, 0x00, sizeof(VEHICLESENS_DATA_MASTER_GPS_UBLOX_FORMAT)); - gstNavTimeGps_g.ul_did = VEHICLE_DID_GPS_UBLOX_NAV_TIMEGPS; - gstNavTimeGps_g.us_size = VEHICLE_DSIZE_GPS_UBLOX_NAV_TIMEGPS + VEHICLE_DSIZE_GPS_UBLOX_HEADER_SIZE; - gstNavTimeGps_g.uc_data[0] = VEHICLE_DINIT_GPS_UBLOX_NAV_TIMEGPS; -} - -/*************************************************************************** -@brief NAV-TIMEGPS SET vehicle sensor function -@outline To update the master data NAV-TIMEGPS. -@type Completion return type -@param[in] SENSOR_MSG_GPSDATA_DAT *pst_data : The pointer to GPS incoming message data -@threshold none -@return u_int8 -@retval VEHICLESENS_EQ : No data changes -@retval VEHICLESENS_NEQ : With data changes -@trace -*****************************************************************************/ -u_int8 VehicleSensSetNavTimeGpsG(const SENSOR_MSG_GPSDATA_DAT *pst_data) { // LCOV_EXCL_START 8: dead code - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - u_int8 uc_ret; - VEHICLESENS_DATA_MASTER_GPS_UBLOX_FORMAT *pst_master; - - pst_master = &gstNavTimeGps_g; - - /** Compare data master and received data */ - uc_ret = VehicleSensmemcmp(pst_master->uc_data, pst_data->uc_data, pst_data->us_size); - - /** Received data is set in the data master. */ - pst_master->ul_did = pst_data->ul_did; - pst_master->us_size = pst_data->us_size; - pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON; - pst_master->uc_sensor_cnt = pst_data->uc_sns_cnt; - pst_master->uc_gpscnt_flag = pst_data->uc_gps_cnt_flag; - - memcpy(pst_master->uc_data, pst_data->uc_data, pst_data->us_size); - - return(uc_ret); -} - -/*************************************************************************** -@brief Vehicle sensor function NAV-TIMEGPS GET -@outline Master Data provides the NAV-TIMEGPS -@type Completion return type -@param[in] SENSOR_MSG_GPSDATA_DAT *pst_data : Where to get a pointer to the data master -@threshold none -@return void -@retval none -@trace -*****************************************************************************/ -void VehicleSensGetNavTimeGpsG(SENSOR_MSG_GPSDATA_DAT *pst_data) { - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - const VEHICLESENS_DATA_MASTER_GPS_UBLOX_FORMAT *pst_master; - - pst_master = &gstNavTimeGps_g; - - /** Store the data master in the specified destination. */ - pst_data->ul_did = pst_master->ul_did; - pst_data->us_size = pst_master->us_size; - pst_data->uc_rcv_flag = pst_master->uc_rcvflag; - pst_data->uc_sns_cnt = pst_master->uc_sensor_cnt; - pst_data->uc_gps_cnt_flag = pst_master->uc_gpscnt_flag; - memcpy(pst_data->uc_data, pst_master->uc_data, pst_master->us_size); -} -// LCOV_EXCL_STOP diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_Nav_TimeUtc_g.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_Nav_TimeUtc_g.cpp deleted file mode 100755 index 8368257..0000000 --- a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_Nav_TimeUtc_g.cpp +++ /dev/null @@ -1,104 +0,0 @@ -/* - * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/*************************************************************************** -@file VehicleSens_Did_Nav_TimeUtc_g.cpp -@detail Master vehicle sensor data(VEHICLE_DID_GPS_UBLOX_NAV_TIMEUTC) -*****************************************************************************/ - -#include <vehicle_service/positioning_base_library.h> -#include "VehicleSens_DataMaster.h" - -/*************************************************/ -/* Global variable */ -/*************************************************/ -static VEHICLESENS_DATA_MASTER_GPS_UBLOX_FORMAT gstNavTimeUtc_g; // NOLINT(readability/nolint) - -/*************************************************************************** -@brief NAV-TIMEUTC vehicle sensor initialization function -@outline NAV-TIMEUTC initialization process data master -@type Completion return type -@param[in] none -@threshold none -@return void -@retval none -@trace -*****************************************************************************/ -void VehicleSensInitNavTimeUtcG(void) { - memset(&gstNavTimeUtc_g, 0x00, sizeof(VEHICLESENS_DATA_MASTER_GPS_UBLOX_FORMAT)); - gstNavTimeUtc_g.ul_did = VEHICLE_DID_GPS_UBLOX_NAV_TIMEUTC; - gstNavTimeUtc_g.us_size = VEHICLE_DSIZE_GPS_UBLOX_NAV_TIMEUTC + VEHICLE_DSIZE_GPS_UBLOX_HEADER_SIZE; - gstNavTimeUtc_g.uc_data[0] = VEHICLE_DINIT_GPS_UBLOX_NAV_TIMEUTC; -} - -/*************************************************************************** -@brief NAV-TIMEUTC SET vehicle sensor function -@outline To update the master data NAV-TIMEUTC. -@type Completion return type -@param[in] SENSOR_MSG_GPSDATA_DAT *pst_data : The pointer to GPS incoming message data -@threshold none -@return u_int8 -@retval VEHICLESENS_EQ : No data changes -@retval VEHICLESENS_NEQ : With data changes -@trace -*****************************************************************************/ -u_int8 VehicleSensSetNavTimeUtcG(const SENSOR_MSG_GPSDATA_DAT *pst_data) { // LCOV_EXCL_START 8: dead code - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - u_int8 uc_ret; - VEHICLESENS_DATA_MASTER_GPS_UBLOX_FORMAT *pst_master; - - pst_master = &gstNavTimeUtc_g; - - /** Compare data master and received data */ - uc_ret = VehicleSensmemcmp(pst_master->uc_data, pst_data->uc_data, pst_data->us_size); - - /** Received data is set in the data master. */ - pst_master->ul_did = pst_data->ul_did; - pst_master->us_size = pst_data->us_size; - pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON; - pst_master->uc_sensor_cnt = pst_data->uc_sns_cnt; - pst_master->uc_gpscnt_flag = pst_data->uc_gps_cnt_flag; - - memcpy(pst_master->uc_data, pst_data->uc_data, pst_data->us_size); - - return(uc_ret); -} - -/*************************************************************************** -@brief Vehicle sensor function NAV-TIMEUTC GET -@outline Master Data provides the NAV-TIMEUTC -@type Completion return type -@param[in] SENSOR_MSG_GPSDATA_DAT *pst_data : Where to get a pointer to the data master -@threshold none -@return void -@retval none -@trace -*****************************************************************************/ -void VehicleSensGetNavTimeUtcG(SENSOR_MSG_GPSDATA_DAT *pst_data) { - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - const VEHICLESENS_DATA_MASTER_GPS_UBLOX_FORMAT *pst_master; - - pst_master = &gstNavTimeUtc_g; - - /** Store the data master in the specified destination. */ - pst_data->ul_did = pst_master->ul_did; - pst_data->us_size = pst_master->us_size; - pst_data->uc_rcv_flag = pst_master->uc_rcvflag; - pst_data->uc_sns_cnt = pst_master->uc_sensor_cnt; - pst_data->uc_gps_cnt_flag = pst_master->uc_gpscnt_flag; - memcpy(pst_data->uc_data, pst_master->uc_data, pst_master->us_size); -} -// LCOV_EXCL_STOP diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_Nav_Velned_g.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_Nav_Velned_g.cpp deleted file mode 100755 index ad757aa..0000000 --- a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_Nav_Velned_g.cpp +++ /dev/null @@ -1,104 +0,0 @@ -/* - * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/*************************************************************************** -@file VehicleSens_Did_Nav_Velned_g.cpp -@detail Master vehicle sensor data(VEHICLE_DID_GPS_UBLOX_NAV_VELNED) -*****************************************************************************/ - -#include <vehicle_service/positioning_base_library.h> -#include "VehicleSens_DataMaster.h" - -/*************************************************/ -/* Global variable */ -/*************************************************/ -static VEHICLESENS_DATA_MASTER_GPS_UBLOX_FORMAT gstNavVelned_g; // NOLINT(readability/nolint) - -/*************************************************************************** -@brief NAV-VELNED vehicle sensor initialization function -@outline NAV-VELNED initialization process data master -@type Completion return type -@param[in] none -@threshold none -@return void -@retval none -@trace -*****************************************************************************/ -void VehicleSensInitNavVelnedG(void) { - memset(&gstNavVelned_g, 0x00, sizeof(VEHICLESENS_DATA_MASTER_GPS_UBLOX_FORMAT)); - gstNavVelned_g.ul_did = VEHICLE_DID_GPS_UBLOX_NAV_VELNED; - gstNavVelned_g.us_size = VEHICLE_DSIZE_GPS_UBLOX_NAV_VELNED + VEHICLE_DSIZE_GPS_UBLOX_HEADER_SIZE; - gstNavVelned_g.uc_data[0] = VEHICLE_DINIT_GPS_UBLOX_NAV_VELNED; -} - -/*************************************************************************** -@brief NAV-VELNED SET vehicle sensor function -@outline To update the master data NAV-VELNED. -@type Completion return type -@param[in] SENSOR_MSG_GPSDATA_DAT *pst_data : A pointer to the received data message or the direct line -@threshold none -@return u_int8 -@retval VEHICLESENS_EQ : No data changes -@retval VEHICLESENS_NEQ : With data changes -@trace -*****************************************************************************/ -u_int8 VehicleSensSetNavVelnedG(const SENSOR_MSG_GPSDATA_DAT *pst_data) { // LCOV_EXCL_START 8: dead code - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - u_int8 uc_ret; - VEHICLESENS_DATA_MASTER_GPS_UBLOX_FORMAT *pst_master; - - pst_master = &gstNavVelned_g; - - /** Compare data master and received data */ - uc_ret = VehicleSensmemcmp(pst_master->uc_data, pst_data->uc_data, pst_data->us_size); - - /** Received data is set in the data master. */ - pst_master->ul_did = pst_data->ul_did; - pst_master->us_size = pst_data->us_size; - pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON; - pst_master->uc_sensor_cnt = pst_data->uc_sns_cnt; - pst_master->uc_gpscnt_flag = pst_data->uc_gps_cnt_flag; - - memcpy(pst_master->uc_data, pst_data->uc_data, pst_data->us_size); - - return(uc_ret); -} - -/*************************************************************************** -@brief Vehicle sensor function NAV-VELNED GET -@outline Master Data provides the NAV-VELNED -@type Completion return type -@param[in] SENSOR_MSG_GPSDATA_DAT *pst_data : Where to get a pointer to the data master -@threshold none -@return void -@retval none -@trace -*****************************************************************************/ -void VehicleSensGetNavVelnedG(SENSOR_MSG_GPSDATA_DAT *pst_data) { - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - const VEHICLESENS_DATA_MASTER_GPS_UBLOX_FORMAT *pst_master; - - pst_master = &gstNavVelned_g; - - /** Store the data master in the specified destination. */ - pst_data->ul_did = pst_master->ul_did; - pst_data->us_size = pst_master->us_size; - pst_data->uc_rcv_flag = pst_master->uc_rcvflag; - pst_data->uc_sns_cnt = pst_master->uc_sensor_cnt; - pst_data->uc_gps_cnt_flag = pst_master->uc_gpscnt_flag; - memcpy(pst_data->uc_data, pst_master->uc_data, pst_master->us_size); -} -// LCOV_EXCL_STOP diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_NaviinfoDiagGPS_g.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_NaviinfoDiagGPS_g.cpp deleted file mode 100755 index 7335ce1..0000000 --- a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_NaviinfoDiagGPS_g.cpp +++ /dev/null @@ -1,94 +0,0 @@ -/* - * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/**************************************************************************** -@file VehicleSens_Did_NaviinfoDiagGPS_g.cpp -@detail Management of GPS Information Master for Diag -******************************************************************************/ -#include <vehicle_service/positioning_base_library.h> -#include "VehicleSens_DataMaster.h" - -/************************************************* - * Global variable * - *************************************************/ -static VEHICLESENS_DATA_MASTER_GPS_FORMAT gstNaviinfoDiagGPS_g; // NOLINT(readability/nolint) - -/**************************************************************************** -@brief VehicleSensInitNaviinfoDiagGPSg<BR> - Initialization of GPS Data Master for Diag -@outline Initializing GPS Data Master for Diag -@param[in] none -@param[out] none -@return none -@retval none -*******************************************************************************/ -void VehicleSensInitNaviinfoDiagGPSg(void) { - memset(&gstNaviinfoDiagGPS_g, 0x00, sizeof(VEHICLESENS_DATA_MASTER_GPS_FORMAT)); - - /** Data ID setting */ - gstNaviinfoDiagGPS_g.ul_did = VEHICLE_DID_NAVIINFO_DIAG_GPS; - /** Data size setting */ - gstNaviinfoDiagGPS_g.us_size = sizeof(NAVIINFO_DIAG_GPS); -} - -/**************************************************************************** -@brief VehicleSensSetNaviinfoDiagGPSg<BR> - GPS Information Master SET Processing for Diag -@outline Update the GPS Data Master for Diag -@param[in] NAVIINFO_DIAG_GPS* pst_diag_data : GPS information for Diag -@param[out] none -@return u_int8 -@retval VEHICLESENS_EQ : No data change -@retval VEHICLESENS_NEQ : Data change -*******************************************************************************/ -u_int8 VehicleSensSetNaviinfoDiagGPSg(const NAVIINFO_DIAG_GPS *pst_diag_data) { - u_int8 uc_ret; - VEHICLESENS_DATA_MASTER_GPS_FORMAT *pst_master; - - pst_master = &gstNaviinfoDiagGPS_g; - - /** With the contents of the current data master,Compare received data */ - uc_ret = VehicleSensmemcmp(pst_master->uc_data, pst_diag_data, sizeof(NAVIINFO_DIAG_GPS)); - - /** Received data is set in the data master. */ - pst_master->ul_did = VEHICLE_DID_NAVIINFO_DIAG_GPS; - pst_master->us_size = sizeof(NAVIINFO_DIAG_GPS); - pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON; - memcpy(pst_master->uc_data, pst_diag_data, sizeof(NAVIINFO_DIAG_GPS)); - - return(uc_ret); -} - -/**************************************************************************** -@brief VehicleSensGetNaviinfoDiagGPSg<BR> - GPS Information Master GET Processing for Diag -@outline Provide a master GPS information for Diag -@param[in] none -@param[out] SENSOR_MSG_GPSDATA_DAT *pst_data : Pointer to the data master acquisition destination -@return none -@retval none -*******************************************************************************/ -void VehicleSensGetNaviinfoDiagGPSg(SENSOR_MSG_GPSDATA_DAT *pst_data) { - const VEHICLESENS_DATA_MASTER_GPS_FORMAT *pst_master; - - pst_master = reinterpret_cast<VEHICLESENS_DATA_MASTER_GPS_FORMAT*>(&gstNaviinfoDiagGPS_g); - - /* Store the data master in the specified destination. */ - pst_data->ul_did = pst_master->ul_did; - pst_data->us_size = pst_master->us_size; - pst_data->uc_rcv_flag = pst_master->uc_rcvflag; - memcpy(pst_data->uc_data, pst_master->uc_data, pst_master->us_size); /* Ignore->MISRA-C++:2008 Rule 5-0-5 */ -} diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_PulseTime.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_PulseTime.cpp deleted file mode 100755 index cb80e6f..0000000 --- a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_PulseTime.cpp +++ /dev/null @@ -1,115 +0,0 @@ -/* - * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @file - * VehicleSens_Did_PulseTime.cpp - * @brief - * Vehicle sensor data master(VEHICLE_DID_PULSE_TIME) - */ - -#include <vehicle_service/positioning_base_library.h> -#include "VehicleSens_DataMaster.h" - -/*************************************************/ -/* Global variable */ -/*************************************************/ - -/** - * @brief - * Vehicle sensor pulse time GET function - * - * Provide interpulse time data master - * - * @param[in] *pst_data: Pointer to the data master acquisition destination - * @param[in] uc_get_method: Acquisition method(Direct Line or CAN) - */ -void VehicleSensGetPulseTime(VEHICLESENS_DATA_MASTER *pst_data, u_int8 uc_get_method) { - switch (uc_get_method) { // LCOV_EXCL_BR_LINE 6:VEHICLESENS_GETMETHOD_CAN cannot to pass in - case VEHICLESENS_GETMETHOD_CAN: - { - /* When acquiring from CAN data */ - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - break; // LCOV_EXCL_LINE 8: dead code - } - case VEHICLESENS_GETMETHOD_LINE: - { - /* To acquire from LineSensor */ - VehicleSensGetPulseTimel(pst_data); - break; - } - default: - break; - } -} - -/** - * @brief - * Vehicle sensor inter-pulse time (initial delivery) GET function - * - * Provide interpulse time data master - * - * @param[in] *pst_data: Pointer to the data master acquisition destination - * @param[in] uc_get_method: Acquisition method(Direct Line or CAN) - */ -void VehicleSensGetPulseTimeExt(VEHICLESENS_DATA_MASTER_EXT *pst_data, u_int8 uc_get_method) { - switch (uc_get_method) { // LCOV_EXCL_BR_LINE 6:VEHICLESENS_GETMETHOD_CAN cannot to pass in - case VEHICLESENS_GETMETHOD_CAN: - { - /* When acquiring from CAN data */ - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - break; // LCOV_EXCL_LINE 8: dead code - } - - case VEHICLESENS_GETMETHOD_LINE: - { - /* To acquire from LineSensor */ - VehicleSensGetPulseTimeExtl(pst_data); - break; - } - default: - break; - } -} - -/** - * @brief - * Vehicle sensor pulse time (initial sensor) GET function - * - * Provide interpulse time data master - * - * @param[in] *pst_data: Pointer to the data master acquisition destination - * @param[in] uc_get_method: Acquisition method(Direct Line or CAN) - */ - -void VehicleSensGetPulseTimeFst(VEHICLESENS_DATA_MASTER_FST *pst_data, u_int8 uc_get_method) { // LCOV_EXCL_START 8: dead code // NOLINT(whitespace/line_length) - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - switch (uc_get_method) { - case VEHICLESENS_GETMETHOD_CAN: - { - /* When acquiring from CAN data */ - break; - } - case VEHICLESENS_GETMETHOD_LINE: - { - /* To acquire from LineSensor */ - break; - } - default: - break; - } -} -// LCOV_EXCL_STOP diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_PulseTimeExt_l.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_PulseTimeExt_l.cpp deleted file mode 100755 index 04e66b5..0000000 --- a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_PulseTimeExt_l.cpp +++ /dev/null @@ -1,143 +0,0 @@ -/* - * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @file - * VehicleSens_Did_PulseTimeExt_l.cpp - * @brief - * Vehicle sensor data master(POSHAL_DID_PULSE_TIME) - */ - -#include <vehicle_service/positioning_base_library.h> -#include "VehicleSens_DataMaster.h" - -/*---------------------------------------------------------------------------------* - * Global Value * - *---------------------------------------------------------------------------------*/ -static VEHICLESENS_DATA_MASTER_EXT g_st_pulsetime_ext_l; // NOLINT(readability/nolint) - -/** - * @brief - * Vehicle sensor inter-pulse time initialization function - * - * Inter-pulse time data master initialization processing - */ -void VehicleSensInitPulseTimeExtl(void) { - (void)memset(reinterpret_cast<void *>(&g_st_pulsetime_ext_l), 0, sizeof(VEHICLESENS_DATA_MASTER_EXT)); - g_st_pulsetime_ext_l.ul_did = POSHAL_DID_PULSE_TIME; - g_st_pulsetime_ext_l.us_size = VEHICLE_DSIZE_PULSE_TIME_EXT_INIT; - g_st_pulsetime_ext_l.uc_rcvflag = VEHICLE_RCVFLAG_OFF; -} - -/** - * @brief - * Vehicle sensor pulse time SET function - * - * Update the interpulse time data master - * - * @param[in] *pst_data : Pointer to the message data received by the direct line - * - * @return VEHICLESENS_EQ No data change<br> - * VEHICLESENS_NEQ Data change - */ -void VehicleSensSetPulseTimeExtlG(const LSDRV_LSDATA_G *pst_data) { - VEHICLESENS_DATA_MASTER_EXT *pst_master; - u_int16 us_size = 0; - u_int16 us_start = 0; - u_int16 us_cnt = 0; - - pst_master = &g_st_pulsetime_ext_l; - /* 4byte * (Number of data items + 32 data items) */ - us_size = static_cast<u_int16>(sizeof(u_int32) * (1 + VEHICLE_SNS_INFO_PULSE_NUM)); - - /* Retrieve the location where the received one is stored */ - us_start = gstPkgTempExt.start_point[PulseTime]; - - /* Stored in data master(Order of reception)*/ - if (us_start >= VEHICLE_DKEEP_MAX) { - /* Store the latest one at position 0 */ - us_start = VEHICLE_DATA_POS_00; - /* If you are discarding old data,,Set a flag */ - gstPkgTempExt.data_break = VEHICLE_SNS_BREAK; - } - pst_master->ul_did = pst_data->ul_did; - pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON; - for (us_cnt = 0; us_cnt < us_size; us_cnt++) { - pst_master->uc_data[us_start * us_size + us_cnt] = (u_int8)(pst_data->uc_data[us_cnt]); - } - - /* Update next storage start position and latest data storage position */ - us_start++; - gstPkgTempExt.start_point[PulseTime] = us_start; - - /* Update data master size */ - if (gstPkgTempExt.data_break == VEHICLE_SNS_BREAK) { - /* Make the size of all extended data masters */ - pst_master->us_size = VEHICLE_DSIZE_PULSE_TIME_EXT; - } else { - /* Add the size of one received data item */ - pst_master->us_size = static_cast<u_int16>(pst_master->us_size + us_size); - } -} - -/** - * @brief - * Vehicle sensor pulse time GET function - * - * Provide interpulse time data master - * - * @param[in] Pointer to the data master acquisition destination - */ -void VehicleSensGetPulseTimeExtl(VEHICLESENS_DATA_MASTER_EXT *pst_data) { - const VEHICLESENS_DATA_MASTER_EXT *pst_master; - u_int16 us_size = 0; - uint16_t us_data_cnt = 0; // Number of data contained - uint16_t us_loop_cnt = 0; // 64 over index - - /* Store the data master in the specified destination. */ - pst_master = &g_st_pulsetime_ext_l; - pst_data->ul_did = pst_master->ul_did; - pst_data->us_size = pst_master->us_size; - pst_data->uc_rcvflag = pst_master->uc_rcvflag; - - /* Size of one data item: 4byte * (Number of data items + 32 data items) */ - us_size = static_cast<u_int16>(sizeof(u_int32) * (1 + VEHICLE_SNS_INFO_PULSE_NUM)); - - /* Checking whether the number of stored entries is looped */ - if (gstPkgTempExt.data_break == VEHICLE_SNS_BREAK) { - us_data_cnt = VEHICLE_DKEEP_MAX; - } else { - us_data_cnt = gstPkgTempExt.start_point[PulseTime]; - } - - /* Acquire data from the oldest data master */ - for (uint16_t us_cnt = 0; us_cnt < us_data_cnt; us_cnt++) { - if (gstPkgTempExt.data_break == VEHICLE_SNS_BREAK) { - /* Get information before loop */ - if (gstPkgTempExt.start_point[PulseTime] + us_cnt < VEHICLE_DKEEP_MAX) { - memcpy(&pst_data->uc_data[us_cnt * us_size], - &pst_master->uc_data[(gstPkgTempExt.start_point[PulseTime] + us_cnt) * us_size], us_size); - } else { - memcpy(&pst_data->uc_data[us_cnt * us_size], - &pst_master->uc_data[us_loop_cnt * us_size], us_size); - us_loop_cnt++; - } - } else { - memcpy(&pst_data->uc_data[us_cnt * us_size], - &pst_master->uc_data[us_cnt * us_size], us_size); - } - } -} diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_PulseTime_l.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_PulseTime_l.cpp deleted file mode 100755 index 527bb72..0000000 --- a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_PulseTime_l.cpp +++ /dev/null @@ -1,93 +0,0 @@ -/* - * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @file - * VehicleSens_Did_PulseTime_l.cpp - * @brief - * Vehicle sensor data master(POSHAL_DID_PULSE_TIME) - */ - -#include <vehicle_service/positioning_base_library.h> -#include "VehicleSens_DataMaster.h" - -/*************************************************/ -/* Global variable */ -/*************************************************/ -static VEHICLESENS_DATA_MASTER gstPulseTime_l; // NOLINT(readability/nolint) - -/** - * @brief - * Vehicle sensor inter-pulse time initialization function - * - * Inter-pulse time data master initialization processing - */ -void VehicleSensInitPulseTimel(void) { - memset(&gstPulseTime_l, 0x00, sizeof(VEHICLESENS_DATA_MASTER)); - gstPulseTime_l.ul_did = POSHAL_DID_PULSE_TIME; - gstPulseTime_l.us_size = VEHICLE_DSIZE_PULSE_TIME; - gstPulseTime_l.uc_rcvflag = VEHICLE_RCVFLAG_OFF; -} - -/** - * @brief - * Vehicle sensor inter-pulse time initialization function - * - * Update the interpulse time data master - * - * @param[in] *pst_data : Pointer to the message data received by the direct line - * - * @return VEHICLESENS_EQ No data change<br> - * VEHICLESENS_NEQ Data change - */ -u_int8 VehicleSensSetPulseTimelG(const LSDRV_LSDATA_G *pst_data) { - u_int8 uc_ret; - VEHICLESENS_DATA_MASTER *pst_master; - - pst_master = &gstPulseTime_l; - - /* Compare data master and received data */ - uc_ret = VehicleSensmemcmp(pst_master->uc_data, pst_data->uc_data, pst_data->uc_size); - - /* Received data is set in the data master. */ - pst_master->ul_did = pst_data->ul_did; - pst_master->us_size = pst_data->uc_size; - pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON; - (void)memcpy(reinterpret_cast<void *>(pst_master->uc_data), - (const void *)(pst_data->uc_data), (size_t)(pst_data->uc_size)); - - return(uc_ret); -} - -/** - * @brief - * Vehicle sensor pulse time GET function - * - * Provide interpulse time data master - * - * @param[in] Pointer to the data master acquisition destination - */ -void VehicleSensGetPulseTimel(VEHICLESENS_DATA_MASTER *pst_data) { - const VEHICLESENS_DATA_MASTER *pst_master; - - pst_master = &gstPulseTime_l; - - /* Store the data master in the specified destination. */ - pst_data->ul_did = pst_master->ul_did; - pst_data->us_size = pst_master->us_size; - pst_data->uc_rcvflag = pst_master->uc_rcvflag; - memcpy(pst_data->uc_data, pst_master->uc_data, pst_master->us_size); -} diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_Rev.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_Rev.cpp deleted file mode 100755 index 08c5ec7..0000000 --- a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_Rev.cpp +++ /dev/null @@ -1,118 +0,0 @@ -/* - * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/******************************************************************************* - * File name :VehicleSens_Did_Rev.cpp - * System name :_CWORD107_ - * Subsystem name :Vehicle sensor process - * Program name :Vehicle sensor data master(VEHICLE_DID_REV) - * Module configuration :VehicleSensGetRev() Vehicle Sensor REV GET Functions - ******************************************************************************/ - -#include <vehicle_service/positioning_base_library.h> -#include "VehicleSens_DataMaster.h" - -/*************************************************/ -/* Global variable */ -/*************************************************/ - -/******************************************************************************* -* MODULE : VehicleSensGetRev -* ABSTRACT : Vehicle Sensor REV GET Functions -* FUNCTION : Provide a REV data master -* ARGUMENT : *pst_data : Pointer to the data master acquisition destination -* uc_get_method : Acquisition method(Direct Line or CAN) -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensGetRev(VEHICLESENS_DATA_MASTER *pst_data, u_int8 uc_get_method) { - switch (uc_get_method) { // LCOV_EXCL_BR_LINE 6:VEHICLESENS_GETMETHOD_CAN cannot to pass in - case VEHICLESENS_GETMETHOD_CAN: - { - /* When acquiring from CAN data */ - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - break; // LCOV_EXCL_LINE 8: dead code - } - case VEHICLESENS_GETMETHOD_LINE: - { - /* To acquire from LineSensor */ - VehicleSensGetRevl(pst_data); - break; - } - default: - break; - } -} - -#if CONFIG_SENSOR_EXT_VALID /* Initial Sensor Support */ -/******************************************************************************* -* MODULE : VehicleSensGetRevFst -* ABSTRACT : Vehicle sensor GET function -* FUNCTION : Provide a data master -* ARGUMENT : *pst_data : Pointer to the data master acquisition destination -* uc_get_method : Acquisition method(Direct Line or CAN) -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensGetRevFst(VEHICLESENS_DATA_MASTER_FST *pst_data, u_int8 uc_get_method) { - switch (uc_get_method) { // LCOV_EXCL_BR_LINE 6:VEHICLESENS_GETMETHOD_CAN cannot to pass in - case VEHICLESENS_GETMETHOD_CAN: - { - /* When acquiring from CAN data */ - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - break; // LCOV_EXCL_LINE 8: dead code - } - case VEHICLESENS_GETMETHOD_LINE: - { - /* To acquire from LineSensor */ - VehicleSensGetRevFstl(pst_data); - break; - } - default: - break; - } -} -#endif - -/** - * @brief - * Vehicle Sensor REV GET Functions - * - * Provide a REV data master - * - * @param[in] *pst_data: Pointer to the data master acquisition destination - * @param[in] uc_get_method: Acquisition method(Direct Line or CAN) - * - * @return none - */ -void VehicleSensGetRevExt(VEHICLESENS_DATA_MASTER_EXT *pst_data, u_int8 uc_get_method) { - switch (uc_get_method) { // LCOV_EXCL_BR_LINE 6:VEHICLESENS_GETMETHOD_CAN cannot to pass in - case VEHICLESENS_GETMETHOD_CAN: - { - /* When acquiring from CAN data */ - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - break; // LCOV_EXCL_LINE 8: dead code - } - case VEHICLESENS_GETMETHOD_LINE: - { - /* To acquire from LineSensor */ - VehicleSensGetRevExtl(pst_data); - break; - } - default: /* Ignore->MISRA-C++:2008 Rule 6-3-1, 6-4-1 */ - break; - } -} diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_RevExt_l.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_RevExt_l.cpp deleted file mode 100755 index 0f4e5e6..0000000 --- a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_RevExt_l.cpp +++ /dev/null @@ -1,134 +0,0 @@ -/* - * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @file - * VehicleSens_Did_RevExt_l.cpp - * @brief - * Vehicle sensor data master(POSHAL_DID_REV) - */ - -#include <vehicle_service/positioning_base_library.h> -#include "VehicleSens_DataMaster.h" - -/*************************************************/ -/* Global variable */ -/*************************************************/ -static VEHICLESENS_DATA_MASTER_EXT g_st_revext_l; // NOLINT(readability/nolint) - -/** - * @brief - * Vehicle Sensor REV Initialization Functions - * - * REV data master initialization processing - * - * @param[in] none - */ -void VehicleSensInitRevExtl(void) { - u_int16 *pus; - - memset(&g_st_revext_l, 0x00, sizeof(VEHICLESENS_DATA_MASTER_EXT)); - g_st_revext_l.ul_did = POSHAL_DID_REV; - g_st_revext_l.us_size = VEHICLE_DSIZE_REV_EXT_INIT; - g_st_revext_l.uc_rcvflag = VEHICLE_RCVFLAG_OFF; - pus = reinterpret_cast<u_int16 *>(g_st_revext_l.uc_data); - memset(reinterpret_cast<void*>(pus), VEHICLE_DINIT_SNS_COUNTER, VEHICLE_DSIZE_REV_EXT); -} - -/** - * @brief - * Vehicle Sensor REV SET Functions - * - * Update the REV data master - * - * @param[in] *pst_data : Pointer to the message data received by the direct line - */ -void VehicleSensSetRevExtlG(const LSDRV_LSDATA_G *pst_data) { - VEHICLESENS_DATA_MASTER_EXT *pst_master; - u_int16 us_start = 0; - - pst_master = &g_st_revext_l; - - /* Retrieve the location where the received one is stored */ - us_start = gstPkgTempExt.start_point[Rev]; - - /* Stored in data master(Order of reception)*/ - if (us_start >= VEHICLE_DKEEP_MAX) { - /* Store the latest one at position 0 */ - us_start = VEHICLE_DATA_POS_00; - /* If you are discarding old data,,Set a flag */ - gstPkgTempExt.data_break = VEHICLE_SNS_BREAK; - } - pst_master->ul_did = pst_data->ul_did; - pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON; - pst_master->uc_data[us_start] = pst_data->uc_data[0]; - - /* Update next storage start position and latest data storage position */ - us_start++; - gstPkgTempExt.start_point[Rev] = us_start; - - /* Update data master size */ - if (gstPkgTempExt.data_break == VEHICLE_SNS_BREAK) { - /* Make the size of all extended data masters */ - pst_master->us_size = VEHICLE_DSIZE_REV_EXT; - } else { - /* Add the size of one received data item */ - pst_master->us_size = static_cast<u_int16>(pst_master->us_size + sizeof(u_int8)); - } -} - -/** - * @brief - * Vehicle Sensor REV GET Functions - * - * Provide a REV data master - * - * @param[in] *pst_data : Pointer to the data master acquisition destination - */ -void VehicleSensGetRevExtl(VEHICLESENS_DATA_MASTER_EXT *pst_data) { - const VEHICLESENS_DATA_MASTER_EXT *pst_master; - uint16_t us_data_cnt = 0; // Number of data contained - uint16_t us_loop_cnt = 0; // 64 over index - - /* Store the data master in the specified destination. */ - pst_master = &g_st_revext_l; - pst_data->ul_did = pst_master->ul_did; - pst_data->us_size = pst_master->us_size; - pst_data->uc_rcvflag = pst_master->uc_rcvflag; - - /* Checking whether the number of stored entries is looped */ - if (gstPkgTempExt.data_break == VEHICLE_SNS_BREAK) { - us_data_cnt = VEHICLE_DKEEP_MAX; - } else { - us_data_cnt = gstPkgTempExt.start_point[Rev]; - } - - /* Acquire data from the newest data master */ - for (uint16_t us_cnt = 0; us_cnt < us_data_cnt; us_cnt++) { - if (gstPkgTempExt.data_break == VEHICLE_SNS_BREAK) { - /* Get information before loop */ - if (gstPkgTempExt.start_point[Rev] + us_cnt < VEHICLE_DKEEP_MAX) { - pst_data->uc_data[us_cnt] = pst_master->uc_data[(gstPkgTempExt.start_point[Rev] + us_cnt)]; - } else { - pst_data->uc_data[us_cnt] = pst_master->uc_data[us_loop_cnt]; - us_loop_cnt++; - } - } else { - pst_data->uc_data[us_cnt] = pst_master->uc_data[us_cnt]; - } - } -} - diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_RevFst_l.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_RevFst_l.cpp deleted file mode 100755 index 49d4654..0000000 --- a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_RevFst_l.cpp +++ /dev/null @@ -1,171 +0,0 @@ -/* - * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/******************************************************************************* - * File name :VehicleSens_Did_RevFst_l.cpp - * System name :PastModel002 - * Subsystem name :Vehicle sensor process - * Program name :Vehicle sensor data master(POSHAL_DID_REV_FST) - * Module configuration :VehicleSensInitRevFstl() Vehicle Sensor REV Initialization Functions - * :VehicleSensSetRevFstl() Vehicle Sensor REV SET Functions - * :VehicleSensSetRevFstG() Vehicle Sensor REV SET Functions - * :VehicleSensGetRevFstl() Vehicle Sensor REV GET Functions - ******************************************************************************/ - -#include <vehicle_service/positioning_base_library.h> -#include "VehicleSens_DataMaster.h" - -#if CONFIG_SENSOR_EXT_VALID /* Initial Sensor Support */ -/*************************************************/ -/* Global variable */ -/*************************************************/ -static VEHICLESENS_DATA_MASTER_FST gstRevFst_l; // NOLINT(readability/nolint) - -/******************************************************************************* -* MODULE : VehicleSensInitRevFstl -* ABSTRACT : Vehicle Sensor REV Initialization Functions -* FUNCTION : REV data master initialization processing -* ARGUMENT : void -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensInitRevFstl(void) { - (void)memset(reinterpret_cast<void *>(&gstRevFst_l), 0, sizeof (VEHICLESENS_DATA_MASTER_FST)); - gstRevFst_l.ul_did = POSHAL_DID_REV_FST; - gstRevFst_l.us_size = 0U; - gstRevFst_l.uc_rcvflag = 0U; - gstRevFst_l.partition_flg = 0; -} - -/******************************************************************************* -* MODULE : VehicleSensSetRevFstl -* ABSTRACT : Vehicle Sensor REV SET Functions -* FUNCTION : Update the REV data master -* ARGUMENT : *pst_data : Pointer to the message data received by the direct line -* NOTE : -* RETURN : VEHICLESENS_EQ : No data change -* VEHICLESENS_NEQ : Data change -******************************************************************************/ -u_int8 VehicleSensSetRevFstl(const LSDRV_LSDATA_FST *pst_data) { // LCOV_EXCL_START 8 : dead code - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - u_int8 uc_ret; - VEHICLESENS_DATA_MASTER_FST *pst_master; - - pst_master = &gstRevFst_l; - - /* Compare data master and received data */ - uc_ret = VehicleSensmemcmp(pst_master->uc_data, pst_data->uc_data, pst_data->uc_size); - - /* Received data is set in the data master. */ - pst_master->ul_did = pst_data->ul_did; - pst_master->us_size = pst_data->uc_size; - pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON; - (void)memcpy(reinterpret_cast<void *>(pst_master->uc_data), - (const void *)(pst_data->uc_data), (size_t)(pst_data->uc_size)); - - return(uc_ret); -} -// LCOV_EXCL_STOP - -/******************************************************************************* -* MODULE : VehicleSensSetRevFstG -* ABSTRACT : Vehicle Sensor REV SET Functions -* FUNCTION : Update the REV data master -* ARGUMENT : *pst_data : Pointer to the message data received by the direct line -* NOTE : -* RETURN : VEHICLESENS_EQ : No data change -* VEHICLESENS_NEQ : Data change -******************************************************************************/ -u_int8 VehicleSensSetRevFstG(const LSDRV_LSDATA_FST_REV *pst_data) { - static u_int8 uc_ret = VEHICLESENS_EQ; - VEHICLESENS_DATA_MASTER_FST *pst_master; - - pst_master = &gstRevFst_l; - - u_int8 partition_max; /* Total number of partitions */ - u_int8 partition_num; /* Data number */ - - partition_max = pst_data->uc_partition_max; - partition_num = pst_data->uc_partition_num; - - if (partition_max == 1) { /* Ignore->MISRA-C++:2008 Rule 5-0-5 */ - /* Compare data master and received data */ - uc_ret = VehicleSensmemcmp(pst_master->uc_data, - pst_data->uc_data, pst_data->uc_size); /* Ignore->MISRA-C++:2008 Rule 5-0-5 */ - - /* Received data is set in the data master. */ - pst_master->ul_did = pst_data->ul_did; - pst_master->us_size = pst_data->uc_size; - pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON; - pst_master->partition_flg = 0; - memset(pst_master->uc_data, 0x00, sizeof(pst_master->uc_data)); - memcpy(pst_master->uc_data, pst_data->uc_data, pst_data->uc_size); /* Ignore->MISRA-C++:2008 Rule 5-0-5 */ - } else if (partition_max == 2) { /* Ignore->MISRA-C++:2008 Rule 5-0-5 */ - if (partition_num == 1) { /* Ignore->MISRA-C++:2008 Rule 5-0-5 */ - /* Compare data master and received data */ - /* Ignore->MISRA-C++:2008 Rule 5-0-5 */ - uc_ret = VehicleSensmemcmp(pst_master->uc_data, pst_data->uc_data, pst_data->uc_size); - - /* Received data is set in the data master. */ - pst_master->ul_did = pst_data->ul_did; - /* Ignore->MISRA-C++:2008 Rule 5-0-5 */ - pst_master->us_size = static_cast<u_int16>(pst_master->us_size + pst_data->uc_size); - pst_master->partition_flg = 1; - memcpy(pst_master->uc_data, pst_data->uc_data, pst_data->uc_size); /* Ignore->MISRA-C++:2008 Rule 5-0-5 */ - } else if (partition_num == 2) { /* Ignore->MISRA-C++:2008 Rule 5-0-5 */ - /* Compare data master and received data */ - if (uc_ret == VEHICLESENS_EQ) { - uc_ret = VehicleSensmemcmp(&pst_master->uc_data[VEHICLE_DSIZE_REV_FST], - pst_data->uc_data, pst_data->uc_size); /* Ignore->MISRA-C++:2008 Rule 5-0-5 */ - } - - /* Received data is set in the data master. */ - pst_master->ul_did = pst_data->ul_did; - /* Ignore->MISRA-C++:2008 Rule 5-0-5 */ - pst_master->us_size = static_cast<u_int16>(pst_master->us_size + pst_data->uc_size); - pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON; - pst_master->partition_flg = 1; - memcpy(&pst_master->uc_data[VEHICLE_DSIZE_REV_FST], - pst_data->uc_data, pst_data->uc_size); /* Ignore->MISRA-C++:2008 Rule 5-0-5 */ - } else {} - } else {} - - return(uc_ret); -} - -/******************************************************************************* -* MODULE : VehicleSensGetRevFstl -* ABSTRACT : Vehicle Sensor REV GET Functions -* FUNCTION : Provide a REV data master -* ARGUMENT : *pst_data : Pointer to the data master acquisition destination -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensGetRevFstl(VEHICLESENS_DATA_MASTER_FST *pst_data) { - const VEHICLESENS_DATA_MASTER_FST *pst_master; - - pst_master = &gstRevFst_l; - - /* Store the data master in the specified destination. */ - pst_data->ul_did = pst_master->ul_did; - pst_data->us_size = pst_master->us_size; - pst_data->uc_rcvflag = pst_master->uc_rcvflag; - pst_data->partition_flg = pst_master->partition_flg; - (void)memcpy(reinterpret_cast<void *>(pst_data->uc_data), - (const void *)(pst_master->uc_data), (size_t)(pst_master->us_size)); -} - -#endif diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_Rev_l.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_Rev_l.cpp deleted file mode 100755 index 8a8178a..0000000 --- a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_Rev_l.cpp +++ /dev/null @@ -1,157 +0,0 @@ -/* - * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/******************************************************************************* - * File name :VehicleSens_Did_Rev_l.cpp - * System name :_CWORD107_ - * Subsystem name :Vehicle sensor process - * Program name :Vehicle sensor data master(VEHICLE_DID_REV) - * Module configuration :VehicleSensInitRevl() Vehicle Sensor REV Initialization Functions - * :VehicleSensSetRevl() Vehicle Sensor REV SET Functions - * :VehicleSensGetRevl() Vehicle Sensor REV GET Functions - * :VehicleSensGetRevline() Vehicle Sensor REV GET Functions(_LINE) - ******************************************************************************/ - -#include <vehicle_service/positioning_base_library.h> -#include "VehicleSens_DataMaster.h" - -/*************************************************/ -/* Global variable */ -/*************************************************/ -static VEHICLESENS_DATA_MASTER gstRev_l; // NOLINT(readability/nolint) - -/******************************************************************************* -* MODULE : VehicleSensInitRevl -* ABSTRACT : Vehicle Sensor REV Initialization Functions -* FUNCTION : REV data master initialization processing -* ARGUMENT : void -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensInitRevl(void) { - memset(&gstRev_l, 0x00, sizeof(VEHICLESENS_DATA_MASTER)); - gstRev_l.ul_did = VEHICLE_DID_REV; - gstRev_l.us_size = VEHICLE_DSIZE_REV; - gstRev_l.uc_rcvflag = VEHICLE_RCVFLAG_OFF; -} - -/******************************************************************************* -* MODULE : VehicleSensSetRevl -* ABSTRACT : Vehicle Sensor REV SET Functions -* FUNCTION : Update the REV data master -* ARGUMENT : *pst_data : Pointer to the message data received by the direct line -* NOTE : -* RETURN : VEHICLESENS_EQ : No data change -* VEHICLESENS_NEQ : Data change -******************************************************************************/ -u_int8 VehicleSensSetRevl(const LSDRV_LSDATA *pst_data) { - u_int8 uc_ret; - VEHICLESENS_DATA_MASTER *pst_master; - - pst_master = &gstRev_l; - - /* Compare data master and received data */ - uc_ret = VehicleSensmemcmp(pst_master->uc_data, pst_data->uc_data, pst_data->uc_size); - - /* Received data is set in the data master. */ - pst_master->ul_did = pst_data->ul_did; - pst_master->us_size = pst_data->uc_size; - pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON; - pst_master->uc_snscnt = pst_data->uc_sns_cnt; - (void)memcpy(reinterpret_cast<void *>(pst_master->uc_data), - (const void *)(pst_data->uc_data), (size_t)(pst_data->uc_size)); - - return(uc_ret); -} - -/** - * @brief - * Vehicle Sensor REV SET Functions - * - * Update the REV data master - * - * @param[in] *pst_data : Pointer to the message data received by the direct line - * - * @return VEHICLESENS_EQ : No data change -* VEHICLESENS_NEQ : Data change - */ -u_int8 VehicleSensSetRevlG(const LSDRV_LSDATA_G *pst_data) { - u_int8 uc_ret; - VEHICLESENS_DATA_MASTER *pst_master; - - pst_master = &gstRev_l; - - /* Compare data master and received data */ - uc_ret = VehicleSensmemcmp(pst_master->uc_data, pst_data->uc_data, pst_data->uc_size); - - /* Received data is set in the data master. */ - pst_master->ul_did = pst_data->ul_did; - pst_master->us_size = pst_data->uc_size; - pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON; - pst_master->uc_snscnt = pst_data->uc_sns_cnt; - (void)memcpy(reinterpret_cast<void *>(pst_master->uc_data), - (const void *)(pst_data->uc_data), (size_t)(pst_data->uc_size)); - - return(uc_ret); -} - -/******************************************************************************* -* MODULE : VehicleSensGetRevl -* ABSTRACT : Vehicle Sensor REV GET Functions -* FUNCTION : Provide a REV data master -* ARGUMENT : *pst_data : Pointer to the data master acquisition destination -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensGetRevl(VEHICLESENS_DATA_MASTER *pst_data) { - const VEHICLESENS_DATA_MASTER *pst_master; - - pst_master = &gstRev_l; - - /* Store the data master in the specified destination. */ - pst_data->ul_did = pst_master->ul_did; - pst_data->us_size = pst_master->us_size; - pst_data->uc_rcvflag = pst_master->uc_rcvflag; - pst_data->uc_snscnt = pst_master->uc_snscnt; - (void)memcpy(reinterpret_cast<void *>(pst_data->uc_data), - (const void *)(pst_master->uc_data), (size_t)(pst_master->us_size)); -} - -/******************************************************************************* -* MODULE : VehicleSensGetRevline -* ABSTRACT : Vehicle Sensor REV GET Functions(For direct lines) -* FUNCTION : Provide a REV data master(For direct lines) -* ARGUMENT : *pst_data : Pointer to the data master acquisition destination -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensGetRevline(VEHICLESENS_DATA_MASTER *pst_data) { // LCOV_EXCL_START 8 : dead code - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - const VEHICLESENS_DATA_MASTER *pst_master; - - pst_master = &gstRev_l; - - /* Store the data master in the specified destination. */ - pst_data->ul_did = VEHICLE_DID_REV_LINE; - pst_data->us_size = pst_master->us_size; - pst_data->uc_rcvflag = pst_master->uc_rcvflag; - pst_data->uc_snscnt = pst_master->uc_snscnt; - (void)memcpy(reinterpret_cast<void *>(pst_data->uc_data), - (const void *)(pst_master->uc_data), (size_t)(pst_master->us_size)); -} -// LCOV_EXCL_STOP - - diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_SettingTime.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_SettingTime.cpp deleted file mode 100755 index b8db26c..0000000 --- a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_SettingTime.cpp +++ /dev/null @@ -1,58 +0,0 @@ -/* - * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @file - * VehicleSens_Did_SettingTime.cpp - * @brief - */ -/*---------------------------------------------------------------------------------* - * Include Files * - *---------------------------------------------------------------------------------*/ -#include <vehicle_service/positioning_base_library.h> -#include "VehicleSens_DataMaster.h" - -/*---------------------------------------------------------------------------------* - * Global Value * - *---------------------------------------------------------------------------------*/ - -/** - * @brief - * GPS setting time information data master GET process - * - * Provide the GPS setting time information data master - * - * @param[in] u_int8 uc_get_method : Acquisition method(NAVI) - * @param[out] VEHICLESENS_DATA_MASTER *pst_data : Pointer to the data master acquisition destination - * - * @return none - * @retval none - */ -void VehicleSensGetSettingTime(VEHICLESENS_DATA_MASTER *pst_data, u_int8 uc_get_method) { - switch (uc_get_method) { // LCOV_EXCL_BR_LINE 6:other parameters cannot pass in - case VEHICLESENS_GETMETHOD_OTHER: - { - /** Acquiring from Clock */ - VehicleSensGetSettingTimeclock(pst_data); - break; - } - default: /* Ignore->MISRA-C++:2008 Rule 6-3-1, 6-4-1 */ - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - break; // LCOV_EXCL_LINE 8: dead code - } - - return; -} diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_SettingTime_clock.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_SettingTime_clock.cpp deleted file mode 100755 index a415a84..0000000 --- a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_SettingTime_clock.cpp +++ /dev/null @@ -1,116 +0,0 @@ -/* - * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @file - * VehicleSens_Did_SettingTime_clock.cpp - * @brief - */ -/*---------------------------------------------------------------------------------* - * Include Files * - *---------------------------------------------------------------------------------*/ -#include <vehicle_service/positioning_base_library.h> -#include "VehicleSens_DataMaster.h" - -/*---------------------------------------------------------------------------------* - * Global Value * - *---------------------------------------------------------------------------------*/ -static VEHICLESENS_DATA_MASTER gstSettingTime_clock; // NOLINT(readability/nolint) - -/** - * @brief - * GPS setting time information data master initialization process(NAVI information) - * - * Initialize the GPS setting time information data master - * - * @param[in] none - * @param[out] none - * @return none - * @retval none - */ -void VehicleSensInitSettingTimeclock(void) { - POS_DATETIME st_time; - - memset(&gstSettingTime_clock, 0x00, sizeof(VEHICLESENS_DATA_MASTER)); - - /** Data ID setting */ - gstSettingTime_clock.ul_did = VEHICLE_DID_SETTINGTIME; - - /** Data size setting */ - gstSettingTime_clock.us_size = sizeof(POS_DATETIME); - - /** Data content setting */ - memset(&st_time, 0x00, sizeof(st_time)); - memcpy(&gstSettingTime_clock.uc_data[0], &st_time, sizeof(st_time)); - - return; -} - -/** - * @brief - * GPS setting time information data master SET process(NAVI information) - * - * Update the GPS setting time information data master - * - * @param[in] VEHICLESENS_DATA_MASTER *pst_data : Pointer to the data master acquisition destination - * @param[out] none - * @return u_int8 - * @retval VEHICLESENS_EQ : No data change - * @retval VEHICLESENS_NEQ : Data change - */ -u_int8 VehicleSensSetSettingTimeclock(const POS_DATETIME *pst_rcv_time) { - u_int8 uc_ret; - VEHICLESENS_DATA_MASTER *pst_master; - - pst_master = &gstSettingTime_clock; - - /** Compare the data master and generated data */ - uc_ret = VehicleSensmemcmp(pst_master->uc_data, pst_rcv_time, sizeof(POS_DATETIME)); - - /** Received data is set in the data master. */ - pst_master->ul_did = VEHICLE_DID_SETTINGTIME; - pst_master->us_size = sizeof(POS_DATETIME); - pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON; - memcpy(pst_master->uc_data, pst_rcv_time, sizeof(POS_DATETIME)); - - return(uc_ret); -} - -/** - * @brief - * GPS setting time information data master GET process(NAVI information) - * - * Provide the GPS setting time information data master - * - * @param[in] none - * @param[out] VEHICLESENS_DATA_MASTER *pst_data : Pointer to the data master acquisition destination - * @return none - * @retval none - */ -void VehicleSensGetSettingTimeclock(VEHICLESENS_DATA_MASTER *pst_data) { - const VEHICLESENS_DATA_MASTER *pst_master; - - pst_master = &gstSettingTime_clock; - - /** Store the data master in the specified destination. */ - pst_data->ul_did = pst_master->ul_did; - pst_data->us_size = pst_master->us_size; - pst_data->uc_rcvflag = pst_master->uc_rcvflag; - memcpy(pst_data->uc_data, pst_master->uc_data, pst_master->us_size); /* Ignore->MISRA-C++:2008 Rule 5-0-5 */ - - return; -} - diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_SnsCounter.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_SnsCounter.cpp deleted file mode 100755 index 6456125..0000000 --- a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_SnsCounter.cpp +++ /dev/null @@ -1,90 +0,0 @@ -/* - * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/******************************************************************************* - * File name :VehicleSens_Did_SnsCounter.cpp - * System name :_CWORD107_ - * Subsystem name :Vehicle sensor process - * Program name :Vehicle sensor data master(VEHICLE_DID_SNS_COUNTER) - * Module configuration :VehicleSensGetSnsCounter() Vehicle sensor SNS_COUNTER GET function - ******************************************************************************/ - -#include <vehicle_service/positioning_base_library.h> -#include "VehicleSens_DataMaster.h" - -/*************************************************/ -/* Global variable */ -/*************************************************/ - -/******************************************************************************* -* MODULE : VehicleSensGetSnsCounter -* ABSTRACT : Vehicle sensor SNS_COUNTER GET function -* FUNCTION : Provide the SNS_COUNTER data master -* ARGUMENT : *pst_data : Pointer to the data master acquisition destination -* uc_get_method : Acquisition method(Direct Line or CAN) -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensGetSnsCounter(VEHICLESENS_DATA_MASTER *pst_data, u_int8 uc_get_method) { - switch (uc_get_method) { // LCOV_EXCL_BR_LINE 6:VEHICLESENS_GETMETHOD_CAN cannot to pass in - case VEHICLESENS_GETMETHOD_CAN: - { - /* When acquiring from CAN data */ - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - break; // LCOV_EXCL_LINE 8: dead code - } - case VEHICLESENS_GETMETHOD_LINE: - { - /* To acquire from LineSensor */ - VehicleSensGetSnsCounterl(pst_data); - break; - } - default: - break; - } -} - -#if CONFIG_SENSOR_EXT_VALID /* Initial Sensor Support */ -/******************************************************************************* -* MODULE : VehicleSensGetSnsCounterExt -* ABSTRACT : Vehicle sensor SNS_COUNTER GET function -* FUNCTION : Provide the SNS_COUNTER data master -* ARGUMENT : *pst_data : Pointer to the data master acquisition destination -* uc_get_method : Acquisition method(Direct Line or CAN) -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensGetSnsCounterExt(VEHICLESENS_DATA_MASTER_EXT *pst_data, u_int8 uc_get_method) { - switch (uc_get_method) { // LCOV_EXCL_BR_LINE 6:VEHICLESENS_GETMETHOD_CAN cannot to pass in - case VEHICLESENS_GETMETHOD_CAN: - { - /* When acquiring from CAN data */ - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - break; // LCOV_EXCL_LINE 8: dead code - } - case VEHICLESENS_GETMETHOD_LINE: - { - /* To acquire from LineSensor */ - VehicleSensGetSnsCounterExtl(pst_data); - break; - } - default: /* Ignore->MISRA-C++:2008 Rule 6-3-1, 6-4-1 */ - break; - } -} -#endif -/* Ignore->MISRA-C++:2008 Rule 2-7-2 */ - diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_SnsCounterExt_l.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_SnsCounterExt_l.cpp deleted file mode 100755 index 61b7a42..0000000 --- a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_SnsCounterExt_l.cpp +++ /dev/null @@ -1,155 +0,0 @@ -/* - * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/******************************************************************************* - * File name :VehicleSens_Did_SnsCounterExt_l.cpp - * System name :_CWORD107_ - * Subsystem name :Vehicle sensor process - * Program name :Vehicle sensor data master(POSHAL_DID_SNS_COUNTER) - * Module configuration :VehicleSensInitSnsCounterl() Vehicle sensor SNS_COUNTER initialization function - * :VehicleSensSetSnsCounterl() Vehicle sensor SNS_COUNTER SET function - * :VehicleSensGetSnsCounterl() Vehicle sensor SNS_COUNTER GET function - ******************************************************************************/ - -#include <vehicle_service/positioning_base_library.h> -#include "VehicleSens_DataMaster.h" - -/* Ignore->MISRA-C++:2008 Rule 2-7-2 */ -#if CONFIG_SENSOR_EXT_VALID /* Initial Sensor Response */ -/*************************************************/ -/* Global variable */ -/*************************************************/ -static VEHICLESENS_DATA_MASTER_EXT gstSnsCounterExt_l; // NOLINT(readability/nolint) - -/******************************************************************************* -* MODULE : VehicleSensInitSnsCounterExtl -* ABSTRACT : Vehicle sensor SNS_COUNTER initialization function -* FUNCTION : SNS_COUNTER data master initialization processing -* ARGUMENT : void -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensInitSnsCounterExtl(void) { - u_int16 *pus; - - memset(&gstSnsCounterExt_l, 0x00, sizeof(VEHICLESENS_DATA_MASTER_EXT)); - gstSnsCounterExt_l.ul_did = POSHAL_DID_SNS_COUNTER; - gstSnsCounterExt_l.us_size = VEHICLE_DSIZE_SNS_COUNTER_EXT_INIT; - pus = reinterpret_cast<u_int16 *>(gstSnsCounterExt_l.uc_data); - memset(reinterpret_cast<void*>(pus), VEHICLE_DINIT_SNS_COUNTER, VEHICLE_DSIZE_SNS_COUNTER_EXT); - - /* Initializing Initial Delivery Internal Information */ - memset(&gstPkgTempExt, 0x00, sizeof(VEHICLESENS_PKG_DELIVERY_TEMP_EXT)); -} - -/******************************************************************************* -* MODULE : VehicleSensSetSnsCounterExtl -* ABSTRACT : Vehicle sensor SNS_COUNTER SET function -* FUNCTION : Update the SNS_COUNTER data master -* ARGUMENT : *pst_data : Pointer to the message data received by the direct line -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensSetSnsCounterExtl(const LSDRV_LSDATA *pst_data) { // LCOV_EXCL_START 8: dead code - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - return; -} -// LCOV_EXCL_STOP - -/******************************************************************************* -* MODULE : VehicleSensSetSnsCounterExtlG -* ABSTRACT : Vehicle sensor SNS_COUNTER SET function -* FUNCTION : Update the SNS_COUNTER data master -* ARGUMENT : *pst_data : Pointer to the message data received by the direct line -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensSetSnsCounterExtlG(const LSDRV_LSDATA_G *pst_data) { - VEHICLESENS_DATA_MASTER_EXT *pst_master; - u_int16 us_start = 0; - - pst_master = &gstSnsCounterExt_l; - - /* Retrieve the location where the received one is stored */ - us_start = gstPkgTempExt.start_point[SNSCounter]; - - /* Stored in data master(Order of reception)*/ - if (us_start >= VEHICLE_DKEEP_MAX) { - /* Store the latest one at position 0 */ - us_start = VEHICLE_DATA_POS_00; - /* If you are discarding old data,,Set a flag */ - gstPkgTempExt.data_break = VEHICLE_SNS_BREAK; - } - pst_master->ul_did = pst_data->ul_did; - pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON; - pst_master->uc_data[us_start] = pst_data->uc_data[0]; - - /* Update next storage start position and latest data storage position */ - us_start++; - gstPkgTempExt.start_point[SNSCounter] = us_start; - - /* Update data master size */ - if (gstPkgTempExt.data_break == VEHICLE_SNS_BREAK) { - /* Make the size of all extended data masters */ - pst_master->us_size = VEHICLE_DSIZE_SNS_COUNTER_EXT; - } else { - /* Add the size of one received data item */ - pst_master->us_size = static_cast<u_int16>(pst_master->us_size + sizeof(u_int8)); - } -} - -/******************************************************************************* -* MODULE : VehicleSensGetSnsCounterExtl -* ABSTRACT : Vehicle sensor SNS_COUNTER GET function -* FUNCTION : Provide the SNS_COUNTER data master -* ARGUMENT : *pst_data : Pointer to the data master acquisition destination -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensGetSnsCounterExtl(VEHICLESENS_DATA_MASTER_EXT *pst_data) { - const VEHICLESENS_DATA_MASTER_EXT *pst_master; - uint16_t us_data_cnt = 0; // Number of data contained - uint16_t us_loop_cnt = 0; // 64 over index - - /* Store the data master in the specified destination. */ - pst_master = &gstSnsCounterExt_l; - pst_data->ul_did = pst_master->ul_did; - pst_data->us_size = pst_master->us_size; - pst_data->uc_rcvflag = pst_master->uc_rcvflag; - - /* Checking whether the number of stored entries is looped */ - if (gstPkgTempExt.data_break == VEHICLE_SNS_BREAK) { - us_data_cnt = VEHICLE_DKEEP_MAX; - } else { - us_data_cnt = gstPkgTempExt.start_point[SNSCounter]; - } - - /* Acquire data from the newest data master */ - for (uint16_t us_cnt = 0; us_cnt < us_data_cnt; us_cnt++) { - if (gstPkgTempExt.data_break == VEHICLE_SNS_BREAK) { - /* Get information before loop */ - if (gstPkgTempExt.start_point[SNSCounter] + us_cnt < VEHICLE_DKEEP_MAX) { - pst_data->uc_data[us_cnt] = pst_master->uc_data[(gstPkgTempExt.start_point[SNSCounter] + us_cnt)]; - } else { - pst_data->uc_data[us_cnt] = pst_master->uc_data[us_loop_cnt]; - us_loop_cnt++; - } - } else { - pst_data->uc_data[us_cnt] = pst_master->uc_data[us_cnt]; - } - } -} -#endif diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_SnsCounter_l.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_SnsCounter_l.cpp deleted file mode 100755 index b81b4b3..0000000 --- a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_SnsCounter_l.cpp +++ /dev/null @@ -1,124 +0,0 @@ -/* - * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/******************************************************************************* - * File name :VehicleSens_Did_SnsCounter_l.cpp - * System name :_CWORD107_ - * Subsystem name :Vehicle sensor process - * Program name :Vehicle sensor data master(POSHAL_DID_SNS_COUNTER) - * Module configuration :VehicleSensInitSnsCounterl() Vehicle sensor SNS_COUNTER initialization function - * :VehicleSensSetSnsCounterl() Vehicle sensor SNS_COUNTER SET function - * :VehicleSensGetSnsCounterl() Vehicle sensor SNS_COUNTER GET function - ******************************************************************************/ - -#include <vehicle_service/positioning_base_library.h> -#include "VehicleSens_DataMaster.h" - -/*************************************************/ -/* Global variable */ -/*************************************************/ -static VEHICLESENS_DATA_MASTER gstSnsCounter_l; // NOLINT(readability/nolint) - -/******************************************************************************* -* MODULE : VehicleSensInitSnsCounterl -* ABSTRACT : Vehicle sensor SNS_COUNTER initialization function -* FUNCTION : SNS_COUNTER data master initialization processing -* ARGUMENT : void -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensInitSnsCounterl(void) { - memset(&gstSnsCounter_l, 0x00, sizeof(VEHICLESENS_DATA_MASTER)); - gstSnsCounter_l.ul_did = POSHAL_DID_SNS_COUNTER; - gstSnsCounter_l.us_size = VEHICLE_DSIZE_SNS_COUNTER; - gstSnsCounter_l.uc_data[0] = VEHICLE_DINIT_SNS_COUNTER; -} - -/******************************************************************************* -* MODULE : VehicleSensSetSnsCounterl -* ABSTRACT : Vehicle sensor SNS_COUNTER SET function -* FUNCTION : Update the SNS_COUNTER data master -* ARGUMENT : *pst_data : Pointer to the message data received by the direct line -* NOTE : -* RETURN : VEHICLESENS_EQ : No data change -* VEHICLESENS_NEQ : Data change -******************************************************************************/ -u_int8 VehicleSensSetSnsCounterl(const LSDRV_LSDATA *pst_data) { // LCOV_EXCL_START 8: dead code - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - u_int8 uc_ret; - VEHICLESENS_DATA_MASTER *pst_master; - - pst_master = &gstSnsCounter_l; - - /* Compare data master and received data */ - uc_ret = VehicleSensmemcmp(pst_master->uc_data, pst_data->uc_data, pst_data->uc_size); - - /* Received data is set in the data master. */ - pst_master->ul_did = pst_data->ul_did; - pst_master->us_size = pst_data->uc_size; - pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON; - memcpy(pst_master->uc_data, pst_data->uc_data, pst_data->uc_size); - - return(uc_ret); -} -// LCOV_EXCL_STOP - -/******************************************************************************* -* MODULE : VehicleSensSetSnsCounterlG -* ABSTRACT : Vehicle sensor SNS_COUNTER SET function -* FUNCTION : Update the SNS_COUNTER data master -* ARGUMENT : *pst_data : Pointer to the message data received by the direct line -* NOTE : -* RETURN : VEHICLESENS_EQ : No data change -* VEHICLESENS_NEQ : Data change -******************************************************************************/ -u_int8 VehicleSensSetSnsCounterlG(const LSDRV_LSDATA_G *pst_data) { - u_int8 uc_ret; - VEHICLESENS_DATA_MASTER *pst_master; - - pst_master = &gstSnsCounter_l; - - /* Compare data master and received data */ - uc_ret = VehicleSensmemcmp(pst_master->uc_data, pst_data->uc_data, pst_data->uc_size); - - /* Received data is set in the data master. */ - pst_master->ul_did = pst_data->ul_did; - pst_master->us_size = pst_data->uc_size; - pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON; - memcpy(pst_master->uc_data, pst_data->uc_data, pst_data->uc_size); - - return(uc_ret); -} - -/******************************************************************************* -* MODULE : VehicleSensGetSnsCounterl -* ABSTRACT : Vehicle sensor SNS_COUNTER GET function -* FUNCTION : Provide the SNS_COUNTER data master -* ARGUMENT : *pst_data : Pointer to the data master acquisition destination -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensGetSnsCounterl(VEHICLESENS_DATA_MASTER *pst_data) { - const VEHICLESENS_DATA_MASTER *pst_master; - - pst_master = &gstSnsCounter_l; - - /* Store the data master in the specified destination. */ - pst_data->ul_did = pst_master->ul_did; - pst_data->us_size = pst_master->us_size; - pst_data->uc_rcvflag = pst_master->uc_rcvflag; - memcpy(pst_data->uc_data, pst_master->uc_data, pst_master->us_size); -} diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_SpeedKmph.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_SpeedKmph.cpp deleted file mode 100755 index 4705774..0000000 --- a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_SpeedKmph.cpp +++ /dev/null @@ -1,57 +0,0 @@ -/* - * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/******************************************************************************* - * File name :VehicleSens_Did_SpeedKmph.cpp - * System name :_CWORD107_ - * Subsystem name :Vehicle sensor process - * Program name :Vehicle sensor data master(POSHAL_DID_SPEED_KMPH) - * Module configuration :VehicleSensGetSpeedKmph() Vehicle Sensor SPEED_KMPH GET Function - ******************************************************************************/ - -#include <vehicle_service/positioning_base_library.h> -#include "VehicleSens_DataMaster.h" - -/*************************************************/ -/* Global variable */ -/*************************************************/ - -/******************************************************************************* -* MODULE : VehicleSensGetSpeedKmph -* ABSTRACT : Vehicle Sensor SPEED_KMPH GET Function -* FUNCTION : Provide the SPEED_KMPH data master -* ARGUMENT : *pst_data : Pointer to the data master acquisition destination -* uc_get_method : Acquisition method(DIRECT or CAN or NAVI) -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensGetSpeedKmph(VEHICLESENS_DATA_MASTER *pst_data, u_int8 uc_get_method) { - switch (uc_get_method) { - case VEHICLESENS_GETMETHOD_CAN: - { - /* When acquiring from CAN data */ - break; - } - case VEHICLESENS_GETMETHOD_LINE: - { - /* To acquire from LineSensor */ - VehicleSensGetSpeedKmphl(pst_data); - break; - } - default: /* Ignore->MISRA-C++:2008 Rule 6-3-1, 6-4-1 */ - break; - } -} diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_SpeedKmph_l.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_SpeedKmph_l.cpp deleted file mode 100755 index abbb27a..0000000 --- a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_SpeedKmph_l.cpp +++ /dev/null @@ -1,156 +0,0 @@ -/* - * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/******************************************************************************* - * File name :VehicleSens_Did_SpeedKmph_l.cpp - * System name :_CWORD107_ - * Subsystem name :Vehicle sensor process - * Program name :Vehicle sensor data master(POSHAL_DID_SPEED_KMPH) - * Module configuration :VehicleSensInitSpeedKmphl() Vehicle sensor SPEED_KMPH initialization function - * :VehicleSensSetSpeedKmphl() Vehicle sensor SPEED_KMPH SET function - * :VehicleSensGetSpeedKmphl() Vehicle Sensor SPEED_KMPH GET Function - ******************************************************************************/ - -#include <vehicle_service/positioning_base_library.h> -#include "VehicleSens_DataMaster.h" - -/*************************************************/ -/* Global variable */ -/*************************************************/ -static VEHICLESENS_DATA_MASTER gstSpeedKmph_l; // NOLINT(readability/nolint) - -/******************************************************************************* -* MODULE : VehicleSensInitSpeedKmphl -* ABSTRACT : Vehicle sensor SPEED_KMPH initialization function -* FUNCTION : SPEED_KMPH data master initialization processing -* ARGUMENT : void -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensInitSpeedKmphl(void) { - u_int16 *pus; - - memset(&gstSpeedKmph_l, 0x00, sizeof(VEHICLESENS_DATA_MASTER)); - gstSpeedKmph_l.ul_did = POSHAL_DID_SPEED_KMPH; - gstSpeedKmph_l.us_size = VEHICLE_DSIZE_SPEED_KMPH; - - pus = reinterpret_cast<u_int16 *>(gstSpeedKmph_l.uc_data); - *pus = VEHICLE_DINIT_SPEED_KMPH; -} - -/******************************************************************************* -* MODULE : VehicleSensSetSpeedKmphl -* ABSTRACT : Vehicle sensor SPEED_KMPH SET function -* FUNCTION : Update the SPEED_KMPH data master -* ARGUMENT : *pst_data : Pointer to the message data received by the direct line -* NOTE : -* RETURN : VEHICLESENS_EQ : No data change -* VEHICLESENS_NEQ : Data change -******************************************************************************/ -u_int8 VehicleSensSetSpeedKmphl(const LSDRV_LSDATA *pst_data) { // LCOV_EXCL_START 8: dead code. - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - u_int8 uc_ret; - VEHICLESENS_DATA_MASTER *pst_master; - - pst_master = &gstSpeedKmph_l; - - /* Compare data master and received data */ - uc_ret = VehicleSensmemcmp(pst_master->uc_data, - pst_data->uc_data, pst_data->uc_size); /* Ignore->MISRA-C++:2008 Rule 5-0-5 */ - - /* Received data is set in the data master. */ - pst_master->ul_did = pst_data->ul_did; - pst_master->us_size = pst_data->uc_size; /* Ignore->MISRA-C++:2008 Rule 5-0-5 */ - pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON; - memset(pst_master->uc_data, 0x00, sizeof(pst_master->uc_data)); - memcpy(pst_master->uc_data, pst_data->uc_data, pst_data->uc_size); /* Ignore->MISRA-C++:2008 Rule 5-0-5 */ - - return(uc_ret); -} -// LCOV_EXCL_STOP - -/******************************************************************************* -* MODULE : VehicleSensSetSpeedKmphlG -* ABSTRACT : Vehicle sensor SPEED_KMPH SET function -* FUNCTION : Update the SPEED_KMPH data master -* ARGUMENT : *pst_data : Pointer to the message data received by the direct line -* NOTE : -* RETURN : VEHICLESENS_EQ : No data change -* VEHICLESENS_NEQ : Data change -******************************************************************************/ -u_int8 VehicleSensSetSpeedKmphlG(const LSDRV_LSDATA_G *pst_data) { - u_int8 uc_ret; - VEHICLESENS_DATA_MASTER *pst_master; - - static u_int16 pre_speed[2] = {0, 0}; - u_int16 cur_speed = 0; - memcpy(&cur_speed, &pst_data->uc_data[0], sizeof(u_int16)); - - BOOL under2 = TRUE; - BOOL eq_speed = TRUE; - - pst_master = &gstSpeedKmph_l; - - /* Transition of 0->1km/h and 1->0km/h requires 3 consecutive matches. Compliance with driving regulations */ - under2 = ((pre_speed[1] < 2) && (pre_speed[0] < 2) && (cur_speed < 2)); - eq_speed = ((pre_speed[1] == pre_speed[0]) && (pre_speed[0] == cur_speed)); - - if ((under2 == TRUE) && (eq_speed != TRUE) && (pst_master->uc_rcvflag == VEHICLE_RCVFLAG_ON)) { - uc_ret = VEHICLESENS_EQ; /* Return without data change */ - - /* Received data is set in the data master. */ - pst_master->ul_did = pst_data->ul_did; - pst_master->us_size = pst_data->uc_size; /* Ignore->MISRA-C++:2008 Rule 5-0-5 */ - pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON; - - } else { - /* Compare data master and received data */ - uc_ret = VehicleSensmemcmp(pst_master->uc_data, - pst_data->uc_data, pst_data->uc_size); /* Ignore->MISRA-C++:2008 Rule 5-0-5 */ - - /* Received data is set in the data master. */ - pst_master->ul_did = pst_data->ul_did; - pst_master->us_size = pst_data->uc_size; /* Ignore->MISRA-C++:2008 Rule 5-0-5 */ - pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON; - memcpy(pst_master->uc_data, pst_data->uc_data, pst_data->uc_size); /* Ignore->MISRA-C++:2008 Rule 5-0-5 */ - } - - /* For the next comparison,Update Speed */ - pre_speed[1] = pre_speed[0]; - pre_speed[0] = cur_speed; - - return(uc_ret); -} - -/******************************************************************************* -* MODULE : VehicleSensGetSpeedKmphl -* ABSTRACT : Vehicle Sensor SPEED_KMPH GET Function -* FUNCTION : Provide the SPEED_KMPH data master -* ARGUMENT : *pst_data : Pointer to the data master acquisition destination -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensGetSpeedKmphl(VEHICLESENS_DATA_MASTER *pst_data) { - const VEHICLESENS_DATA_MASTER *pst_master; - - pst_master = &gstSpeedKmph_l; - - /* Store the data master in the specified destination. */ - pst_data->ul_did = pst_master->ul_did; - pst_data->us_size = pst_master->us_size; - pst_data->uc_rcvflag = pst_master->uc_rcvflag; - memcpy(pst_data->uc_data, pst_master->uc_data, pst_master->us_size); /* Ignore->MISRA-C++:2008 Rule 5-0-5 */ -} diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_SpeedPulse.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_SpeedPulse.cpp deleted file mode 100755 index 3f4ec8a..0000000 --- a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_SpeedPulse.cpp +++ /dev/null @@ -1,117 +0,0 @@ -/* - * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/******************************************************************************* - * File name :VehicleSens_Did_SpeedPulse.cpp - * System name :_CWORD107_ - * Subsystem name :Vehicle sensor process - * Program name :Vehicle sensor data master(VEHICLE_DID_) - * Module configuration :VehicleSensGetSpeedPulse() Vehicle sensor GET function - ******************************************************************************/ - -#include <vehicle_service/positioning_base_library.h> -#include "VehicleSens_DataMaster.h" - -/*************************************************/ -/* Global variable */ -/*************************************************/ - -/******************************************************************************* -* MODULE : VehicleSensGetSpeedPulse -* ABSTRACT : Vehicle sensor GET function -* FUNCTION : Provide a data master -* ARGUMENT : *pst_data : Pointer to the data master acquisition destination -* uc_get_method : Acquisition method(Direct Line or CAN) -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensGetSpeedPulse(VEHICLESENS_DATA_MASTER *pst_data, u_int8 uc_get_method) { - switch (uc_get_method) { // LCOV_EXCL_BR_LINE 6:VEHICLESENS_GETMETHOD_CAN cannot to pass in - case VEHICLESENS_GETMETHOD_CAN: - { - /* When acquiring from CAN data */ - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - break; // LCOV_EXCL_LINE 8: dead code - } - case VEHICLESENS_GETMETHOD_LINE: - { - /* To acquire from LineSensor */ - VehicleSensGetSpeedPulsel(pst_data); - break; - } - default: - break; - } -} - -#if CONFIG_SENSOR_EXT_VALID /* Initial Sensor Support */ -/******************************************************************************* -* MODULE : VehicleSensGetSpeedPulseExt -* ABSTRACT : Vehicle sensor GET function -* FUNCTION : Provide a data master -* ARGUMENT : *pst_data : Pointer to the data master acquisition destination -* uc_get_method : Acquisition method(Direct Line or CAN) -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensGetSpeedPulseExt(VEHICLESENS_DATA_MASTER_EXT *pst_data, u_int8 uc_get_method) { - switch (uc_get_method) { // LCOV_EXCL_BR_LINE 6:VEHICLESENS_GETMETHOD_CAN cannot to pass in - case VEHICLESENS_GETMETHOD_CAN: - { - /* When acquiring from CAN data */ - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - break; // LCOV_EXCL_LINE 8: dead code - } - case VEHICLESENS_GETMETHOD_LINE: - { - /* To acquire from LineSensor */ - VehicleSensGetSpeedPulseExtl(pst_data); - break; - } - default: /* Ignore->MISRA-C++:2008 Rule 6-3-1, 6-4-1 */ - break; - } -} - -/******************************************************************************* -* MODULE : VehicleSensGetSpeedPulseFst -* ABSTRACT : Vehicle sensor GET function -* FUNCTION : Provide a data master -* ARGUMENT : *pst_data : Pointer to the data master acquisition destination -* uc_get_method : Acquisition method(Direct Line or CAN) -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensGetSpeedPulseFst(VEHICLESENS_DATA_MASTER_FST *pst_data, u_int8 uc_get_method) { - switch (uc_get_method) { // LCOV_EXCL_BR_LINE 6:VEHICLESENS_GETMETHOD_CAN cannot to pass in - case VEHICLESENS_GETMETHOD_CAN: - { - /* When acquiring from CAN data */ - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - break; // LCOV_EXCL_LINE 8: dead code - } - case VEHICLESENS_GETMETHOD_LINE: - { - /* To acquire from LineSensor */ - VehicleSensGetSpeedPulseFstl(pst_data); - break; - } - default: - break; - } -} -#endif - diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_SpeedPulseExt_l.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_SpeedPulseExt_l.cpp deleted file mode 100755 index 86c8f49..0000000 --- a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_SpeedPulseExt_l.cpp +++ /dev/null @@ -1,150 +0,0 @@ -/* - * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/******************************************************************************* - * File name :VehicleSens_Did_SpeedPulseExt_l.cpp - * System name :_CWORD107_ - * Subsystem name :Vehicle sensor process - * Program name :Vehicle sensor data master(POSHAL_DID_SPEED_PULSE) - * Module configuration :VehicleSensInitSpeedPulseExtl() Vehicle sensor SPEED_PULSE initialization function - * :VehicleSensSetSpeedPulseExtlG() Vehicle Sensor SPEED_PULSE SET Function - * :VehicleSensGetSpeedPulseExtl() Vehicle Sensor SPEED_PULSE GET Function - ******************************************************************************/ - -#include <vehicle_service/positioning_base_library.h> -#include "VehicleSens_DataMaster.h" - -/* Ignore->MISRA-C++:2008 Rule 2-7-2 */ -#if CONFIG_SENSOR_EXT_VALID /* Initial Sensor Support */ -/*************************************************/ -/* Global variable */ -/*************************************************/ -static VEHICLESENS_DATA_MASTER_EXT gstSpeedPulseExt_l; // NOLINT(readability/nolint) - -/******************************************************************************* -* MODULE : VehicleSensInitSpeedPulseExtl -* ABSTRACT : Vehicle sensor SPEED_PULSE initialization function -* FUNCTION : SPEED_PULSE data master initialization processing -* ARGUMENT : void -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensInitSpeedPulseExtl(void) { - u_int16 *pus; - - memset(&gstSpeedPulseExt_l, 0x00, sizeof(VEHICLESENS_DATA_MASTER_EXT)); - gstSpeedPulseExt_l.ul_did = POSHAL_DID_SPEED_PULSE; - gstSpeedPulseExt_l.us_size = VEHICLE_DSIZE_SPEED_PULSE_EXT_INIT; - - pus = reinterpret_cast<u_int16 *>(gstSpeedPulseExt_l.uc_data); - memset(reinterpret_cast<void*>(pus), VEHICLE_DINIT_SPEED_PULSE, VEHICLE_DSIZE_SPEED_PULSE_EXT); -} - -/******************************************************************************* -* MODULE : VehicleSensSetSpeedPulseExtlG -* ABSTRACT : Vehicle Sensor SPEED_PULSE SET Function -* FUNCTION : Update the SPEED_PULSE data master -* ARGUMENT : *pst_data : Pointer to the message data received by the direct line -* NOTE : -* RETURN : VEHICLESENS_EQ : No data change -* VEHICLESENS_NEQ : Data change -******************************************************************************/ -void VehicleSensSetSpeedPulseExtlG(const LSDRV_LSDATA_G *pst_data) { - VEHICLESENS_DATA_MASTER_EXT *pst_master; - u_int16 us_start = 0; - u_int16 us_size = 0; - u_int16 us_cnt = 0; - - pst_master = &gstSpeedPulseExt_l; - us_size = static_cast<u_int16>(sizeof(u_int16) * 10); /* Size of one data item: 2byte * 10 data items */ - - /* Retrieve the location where the received one is stored */ - us_start = gstPkgTempExt.start_point[SpeedPulse]; - - /* Stored in data master(Order of reception)*/ - if (us_start >= VEHICLE_DKEEP_MAX) { - /* Store the latest one at position 0 */ - us_start = VEHICLE_DATA_POS_00; - /* If you are discarding old data,,Set a flag */ - gstPkgTempExt.data_break = VEHICLE_SNS_BREAK; - } - pst_master->ul_did = pst_data->ul_did; - pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON; - for (us_cnt = 0; us_cnt < us_size; us_cnt++) { - pst_master->uc_data[us_start * us_size + us_cnt] = (u_int8)(pst_data->uc_data[us_cnt]); - } - - /* Update next storage start position and latest data storage position */ - us_start++; - gstPkgTempExt.start_point[SpeedPulse] = us_start; - /* Update data master size */ - if (gstPkgTempExt.data_break == VEHICLE_SNS_BREAK) { - /* Make the size of all extended data masters */ - pst_master->us_size = VEHICLE_DSIZE_SPEED_PULSE_EXT; - } else { - /* Add the size of one received data item */ - pst_master->us_size = static_cast<u_int16>(pst_master->us_size + us_size); - } -} - -/******************************************************************************* -* MODULE : VehicleSensGetSpeedPulseExtl -* ABSTRACT : Vehicle Sensor SPEED_PULSE GET Function -* FUNCTION : Provide the SPEED_PULSE data master -* ARGUMENT : *pst_data : Pointer to the data master acquisition destination -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensGetSpeedPulseExtl(VEHICLESENS_DATA_MASTER_EXT *pst_data) { - const VEHICLESENS_DATA_MASTER_EXT *pst_master; - uint16_t us_size = 0; - uint16_t us_data_cnt = 0; // Number of data contained - uint16_t us_loop_cnt = 0; // 64 over index - - /* Store the data master in the specified destination. */ - pst_master = &gstSpeedPulseExt_l; - pst_data->ul_did = pst_master->ul_did; - pst_data->us_size = pst_master->us_size; - pst_data->uc_rcvflag = pst_master->uc_rcvflag; - - us_size = static_cast<u_int16>(sizeof(u_int16) * 10); /* Size of one data item: 2byte * 10 data items */ - - /* Checking whether the number of stored entries is looped */ - if (gstPkgTempExt.data_break == VEHICLE_SNS_BREAK) { - us_data_cnt = VEHICLE_DKEEP_MAX; - } else { - us_data_cnt = gstPkgTempExt.start_point[SpeedPulse]; - } - - /* Acquire data from the newest data master */ - for (uint16_t us_cnt = 0; us_cnt < us_data_cnt; us_cnt++) { - if (gstPkgTempExt.data_break == VEHICLE_SNS_BREAK) { - /* Get information before loop */ - if (gstPkgTempExt.start_point[SpeedPulse] + us_cnt < VEHICLE_DKEEP_MAX) { - memcpy(&pst_data->uc_data[us_cnt * us_size], - &pst_master->uc_data[(gstPkgTempExt.start_point[SpeedPulse] + us_cnt) * us_size], us_size); - } else { - memcpy(&pst_data->uc_data[us_cnt * us_size], - &pst_master->uc_data[us_loop_cnt * us_size], us_size); - us_loop_cnt++; - } - } else { - memcpy(&pst_data->uc_data[us_cnt * us_size], - &pst_master->uc_data[us_cnt * us_size], us_size); - } - } -} -#endif diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_SpeedPulseFlag.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_SpeedPulseFlag.cpp deleted file mode 100755 index f6ab8df..0000000 --- a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_SpeedPulseFlag.cpp +++ /dev/null @@ -1,133 +0,0 @@ -/* - * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/*************************************************************************** -@file VehicleSens_Did_Nav_Clock_g.cpp -@detail Master vehicle sensor data(POSHAL_DID_SPEED_PULSE_FLAG) -*****************************************************************************/ - -#include <vehicle_service/positioning_base_library.h> -#include "VehicleSens_DataMaster.h" - -/*************************************************/ -/* Global variable */ -/*************************************************/ -static VEHICLESENS_DATA_MASTER gstSpeedPulseFlag; // NOLINT(readability/nolint) - -/*************************************************************************** -@brief VehicleSensInitSpeedPulseFlag -@outline SPEED_PULSE_FLAG initialization process data master -@type Completion return type -@param[in] none -@threshold none -@return void -@retval none -@trace -*****************************************************************************/ -void VehicleSensInitSpeedPulseFlag(void) { - (void)memset(reinterpret_cast<void *>(&gstSpeedPulseFlag), 0, sizeof(VEHICLESENS_DATA_MASTER)); - gstSpeedPulseFlag.ul_did = POSHAL_DID_SPEED_PULSE_FLAG; - gstSpeedPulseFlag.us_size = VEHICLE_DSIZE_SPEED_PULSE_FLAG; - gstSpeedPulseFlag.uc_rcvflag = VEHICLE_RCVFLAG_OFF; -} - -/*************************************************************************** -@brief NAV-CLOCK SET vehicle sensor function -@outline To update the master data NAV-CLOCK. -@type Completion return type -@param[in] SENSOR_MSG_GPSDATA_DAT *pst_data : The pointer to GPS incoming message data -@threshold none -@return u_int8 -@retval VEHICLESENS_EQ : No data changes -@retval VEHICLESENS_NEQ : With data changes -@trace -*****************************************************************************/ -u_int8 VehicleSensSetSpeedPulseFlag(const LSDRV_LSDATA_G *pst_data) { // LCOV_EXCL_START 8: dead code - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - u_int8 uc_ret; - VEHICLESENS_DATA_MASTER *pst_master; - - pst_master = &gstSpeedPulseFlag; - - /** Compare data master and received data */ - uc_ret = VehicleSensmemcmp(pst_master->uc_data, pst_data->uc_data, pst_data->uc_size); - - /** Received data is set in the data master. */ - pst_master->ul_did = pst_data->ul_did; - pst_master->us_size = pst_data->uc_size; - pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON; - pst_master->uc_snscnt = pst_data->uc_sns_cnt; - (void)memcpy(reinterpret_cast<void *>(pst_master->uc_data), - (const void *)(pst_data->uc_data), (size_t)(pst_data->uc_size)); - - return(uc_ret); -} - -/*************************************************************************** -@brief Vehicle sensor function NAV-CLOCK GET -@outline Master Data provides the NAV-CLOCK -@type Completion return type -@param[in] SENSOR_MSG_GPSDATA_DAT *pst_data : Where to get a pointer to the data master -@threshold none -@return void -@retval none -@trace -*****************************************************************************/ -void VehicleSensGetSpeedPulseFlag(VEHICLESENS_DATA_MASTER *pst_data) { - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - const VEHICLESENS_DATA_MASTER *pst_master; - - pst_master = &gstSpeedPulseFlag; - - /** Store the data master in the specified destination. */ - pst_data->ul_did = pst_master->ul_did; - pst_data->us_size = pst_master->us_size; - pst_data->uc_rcvflag = pst_master->uc_rcvflag; - pst_data->uc_snscnt = pst_master->uc_snscnt; - (void)memcpy(reinterpret_cast<void *>(pst_data->uc_data), - (const void *)(pst_master->uc_data), (size_t)(pst_master->us_size)); -} - -#if CONFIG_SENSOR_EXT_VALID /* Initial Sensor Support */ -/******************************************************************************* -* MODULE : VehicleSensGetSpeedPulseFlagFst -* ABSTRACT : Vehicle sensor GET function -* FUNCTION : Provide a data master -* ARGUMENT : *pst_data : Pointer to the data master acquisition destination -* uc_get_method : Acquisition method(Direct Line or CAN) -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensGetSpeedPulseFlagFst(VEHICLESENS_DATA_MASTER_FST *pst_data, u_int8 uc_get_method) { - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - switch (uc_get_method) { - case VEHICLESENS_GETMETHOD_CAN: - { - /* When acquiring from CAN data */ - break; - } - case VEHICLESENS_GETMETHOD_LINE: - { - /* To acquire from LineSensor */ - VehicleSensGetSpeedPulseFlagFstl(pst_data); - break; - } - default: - break; - } -} -#endif -// LCOV_EXCL_STOP diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_SpeedPulseFlagFst_l.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_SpeedPulseFlagFst_l.cpp deleted file mode 100755 index 051c6bb..0000000 --- a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_SpeedPulseFlagFst_l.cpp +++ /dev/null @@ -1,91 +0,0 @@ -/* - * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/******************************************************************************* - * File name :VehicleSens_Did_SpeedPulseFlagFst_l.cpp - * System name :PastModel002 - * Subsystem name :Vehicle sensor process - * Program name :Vehicle sensor data master(POSHAL_DID_SPEED_PULSE_FLAG_FST) - * Module configuration :VehicleSensInitSpeedPulseFlagFstl() Vehicle sensor SPEED_PULSE_FLAG initialization function - * :VehicleSensSetSpeedPulseFlagFstl() Vehicle Sensor SPEED_PULSE_FLAG SET Function - * :VehicleSensSetSpeedPulseFlagFstG() Vehicle Sensor SPEED_PULSE_FLAG SET Function - * :VehicleSensGetSpeedPulseFlagFstl() Vehicle Sensor SPEED_PULSE_FLAG GET Function - ******************************************************************************/ - -#include <vehicle_service/positioning_base_library.h> -#include "VehicleSens_DataMaster.h" - -/* #Polaris_003 START */ -#if CONFIG_SENSOR_EXT_VALID /* Initial Sensor Response */ -/*************************************************/ -/* Global variable */ -/*************************************************/ - -/******************************************************************************* -* MODULE : VehicleSensInitSpeedPulseFlagFstl -* ABSTRACT : Vehicle sensor SPEED_PULSE_FLAG initialization function -* FUNCTION : SPEED_PULSE_FLAG data master initialization processing -* ARGUMENT : void -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensInitSpeedPulseFlagFstl(void) { - return; -} - -/******************************************************************************* -* MODULE : VehicleSensSetSpeedPulseFlagFstl -* ABSTRACT : Vehicle Sensor SPEED_PULSE_FLAG SET Function -* FUNCTION : Update the SPEED_PULSE_FLAG data master -* ARGUMENT : *pst_data : Pointer to the message data received by the direct line -* NOTE : -* RETURN : VEHICLESENS_EQ : No data change -* VEHICLESENS_NEQ : Data change -******************************************************************************/ -u_int8 VehicleSensSetSpeedPulseFlagFstl(const LSDRV_LSDATA_FST *pst_data) { // LCOV_EXCL_START 8: dead code - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - return(VEHICLESENS_EQ); -} -// LCOV_EXCL_STOP - -/******************************************************************************* -* MODULE : VehicleSensSetSpeedPulseFlagFstG -* ABSTRACT : Vehicle Sensor SPEED_PULSE_FLAG SET Function -* FUNCTION : Update the SPEED_PULSE_FLAG data master -* ARGUMENT : *pst_data : Pointer to the message data received by the direct line -* NOTE : -* RETURN : VEHICLESENS_EQ : No data change -* VEHICLESENS_NEQ : Data change -******************************************************************************/ -u_int8 VehicleSensSetSpeedPulseFlagFstG(const LSDRV_LSDATA_FST_SPEED_PULSE_FLAG *pst_data) { - return VEHICLESENS_EQ; -} - -/******************************************************************************* -* MODULE : VehicleSensGetSpeedPulseFlagFstl -* ABSTRACT : Vehicle Sensor SPEED_PULSE_FLAG GET Function -* FUNCTION : Provide the SPEED_PULSE_FLAG data master -* ARGUMENT : *pst_data : Pointer to the data master acquisition destination -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensGetSpeedPulseFlagFstl(VEHICLESENS_DATA_MASTER_FST *pst_data) { // LCOV_EXCL_START 8: dead code - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - return; -} - -#endif -// LCOV_EXCL_STOP diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_SpeedPulseFst_l.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_SpeedPulseFst_l.cpp deleted file mode 100755 index 26952b3..0000000 --- a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_SpeedPulseFst_l.cpp +++ /dev/null @@ -1,172 +0,0 @@ -/* - * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/******************************************************************************* - * File name :VehicleSens_Did_SpeedPulseFst_l.cpp - * System name :_CWORD107_ - * Subsystem name :Vehicle sensor process - * Program name :Vehicle sensor data master(POSHAL_DID_SPEED_PULSE_FST) - * Module configuration :VehicleSensInitSpeedPulseFstl() Vehicle sensor SPEED_PULSE initialization function - * :VehicleSensSetSpeedPulseFstl() Vehicle Sensor SPEED_PULSE SET Function - * :VehicleSensSetSpeedPulseFstG() Vehicle Sensor SPEED_PULSE SET Function - * :VehicleSensGetSpeedPulseFstl() Vehicle Sensor SPEED_PULSE GET Function - ******************************************************************************/ - -#include <vehicle_service/positioning_base_library.h> -#include "VehicleSens_DataMaster.h" - -#if CONFIG_SENSOR_EXT_VALID /* Initial Sensor Support */ -/*************************************************/ -/* Global variable */ -/*************************************************/ -static VEHICLESENS_DATA_MASTER_FST gstSpeedPulseFst_l; // NOLINT(readability/nolint) - -/******************************************************************************* -* MODULE : VehicleSensInitSpeedPulseFstl -* ABSTRACT : Vehicle sensor SPEED_PULSE initialization function -* FUNCTION : SPEED_PULSE data master initialization processing -* ARGUMENT : void -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensInitSpeedPulseFstl(void) { - u_int16 *pus; - - memset(&gstSpeedPulseFst_l, 0x00, sizeof(VEHICLESENS_DATA_MASTER_FST)); - gstSpeedPulseFst_l.ul_did = POSHAL_DID_SPEED_PULSE_FST; - gstSpeedPulseFst_l.us_size = 0; - gstSpeedPulseFst_l.partition_flg = 0; - pus = reinterpret_cast<u_int16 *>(gstSpeedPulseFst_l.uc_data); - memset(reinterpret_cast<void*>(pus), VEHICLE_DINIT_SPEED_PULSE, VEHICLE_DSIZE_SPEED_PULSE_FST); -} - -/******************************************************************************* -* MODULE : VehicleSensSetSpeedPulseFstl -* ABSTRACT : Vehicle Sensor SPEED_PULSE SET Function -* FUNCTION : Update the SPEED_PULSE data master -* ARGUMENT : *pst_data : Pointer to the message data received by the direct line -* NOTE : -* RETURN : VEHICLESENS_EQ : No data change -* VEHICLESENS_NEQ : Data change -******************************************************************************/ -u_int8 VehicleSensSetSpeedPulseFstl(const LSDRV_LSDATA_FST *pst_data) { - u_int8 uc_ret; - VEHICLESENS_DATA_MASTER_FST *pst_master; - - pst_master = &gstSpeedPulseFst_l; - - /* Compare data master and received data */ - /* Ignore->MISRA-C++:2008 Rule 5-0-5 */ - uc_ret = VehicleSensmemcmp(pst_master->uc_data, pst_data->uc_data, pst_data->uc_size); - - /* Received data is set in the data master. */ - pst_master->ul_did = pst_data->ul_did; - pst_master->us_size = pst_data->uc_size; - pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON; - memset(pst_master->uc_data, 0x00, sizeof(pst_master->uc_data)); - memcpy(pst_master->uc_data, pst_data->uc_data, pst_data->uc_size); /* Ignore->MISRA-C++:2008 Rule 5-0-5 */ - - return(uc_ret); -} - -/******************************************************************************* -* MODULE : VehicleSensSetSpeedPulseFstG -* ABSTRACT : Vehicle Sensor SPEED_PULSE SET Function -* FUNCTION : Update the SPEED_PULSE data master -* ARGUMENT : *pst_data : Pointer to the message data received by the direct line -* NOTE : -* RETURN : VEHICLESENS_EQ : No data change -* VEHICLESENS_NEQ : Data change -******************************************************************************/ -u_int8 VehicleSensSetSpeedPulseFstG(const LSDRV_LSDATA_FST_SPEED *pst_data) { - static u_int8 uc_ret = VEHICLESENS_EQ; - VEHICLESENS_DATA_MASTER_FST *pst_master; - - u_int8 partition_max; /* Total number of partitions */ - u_int8 partition_num; /* Data number */ - - pst_master = &gstSpeedPulseFst_l; - - partition_max = pst_data->uc_partition_max; - partition_num = pst_data->uc_partition_num; - - if (partition_max == 1) { /* Ignore->MISRA-C++:2008 Rule 5-0-5 */ - /* Compare data master and received data */ - /* Ignore->MISRA-C++:2008 Rule 5-0-5 */ - uc_ret = VehicleSensmemcmp(pst_master->uc_data, pst_data->uc_data, pst_data->uc_size); - - /* Received data is set in the data master. */ - pst_master->ul_did = pst_data->ul_did; - pst_master->us_size = pst_data->uc_size; - pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON; - pst_master->partition_flg = 0; - memset(pst_master->uc_data, 0x00, sizeof(pst_master->uc_data)); - memcpy(pst_master->uc_data, pst_data->uc_data, pst_data->uc_size); /* Ignore->MISRA-C++:2008 Rule 5-0-5 */ - } else if (partition_max == 2) { /* Ignore->MISRA-C++:2008 Rule 5-0-5 */ - if (partition_num == 1) { /* Ignore->MISRA-C++:2008 Rule 5-0-5 */ - /* Compare data master and received data */ - /* Ignore->MISRA-C++:2008 Rule 5-0-5 */ - uc_ret = VehicleSensmemcmp(pst_master->uc_data, pst_data->uc_data, pst_data->uc_size); - - /* Received data is set in the data master. */ - pst_master->ul_did = pst_data->ul_did; - /* Ignore->MISRA-C++:2008 Rule 5-0-5 */ - pst_master->us_size = static_cast<u_int16>(pst_master->us_size + pst_data->uc_size); - pst_master->partition_flg = 1; - memcpy(pst_master->uc_data, pst_data->uc_data, pst_data->uc_size); /* Ignore->MISRA-C++:2008 Rule 5-0-5 */ - } else if (partition_num == 2) { /* Ignore->MISRA-C++:2008 Rule 5-0-5 */ - /* Compare data master and received data */ - if (uc_ret == VEHICLESENS_EQ) { - uc_ret = VehicleSensmemcmp(&pst_master->uc_data[VEHICLE_DSIZE_SPEED_PULSE_FST], - pst_data->uc_data, pst_data->uc_size); /* Ignore->MISRA-C++:2008 Rule 5-0-5 */ - } - - /* Received data is set in the data master. */ - pst_master->ul_did = pst_data->ul_did; - /* Ignore->MISRA-C++:2008 Rule 5-0-5 */ - pst_master->us_size = static_cast<u_int16>(pst_master->us_size + pst_data->uc_size); - pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON; - pst_master->partition_flg = 1; - memcpy(&pst_master->uc_data[VEHICLE_DSIZE_SPEED_PULSE_FST], - pst_data->uc_data, pst_data->uc_size); /* Ignore->MISRA-C++:2008 Rule 5-0-5 */ - } else {} - } else {} - - return(uc_ret); -} - -/******************************************************************************* -* MODULE : VehicleSensGetSpeedPulseFstl -* ABSTRACT : Vehicle Sensor SPEED_PULSE GET Function -* FUNCTION : Provide the SPEED_PULSE data master -* ARGUMENT : *pst_data : Pointer to the data master acquisition destination -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensGetSpeedPulseFstl(VEHICLESENS_DATA_MASTER_FST *pst_data) { - const VEHICLESENS_DATA_MASTER_FST *pst_master; - - pst_master = &gstSpeedPulseFst_l; - - /* Store the data master in the specified destination. */ - pst_data->ul_did = pst_master->ul_did; - pst_data->us_size = pst_master->us_size; - pst_data->uc_rcvflag = pst_master->uc_rcvflag; - pst_data->partition_flg = pst_master->partition_flg; - memcpy(pst_data->uc_data, pst_master->uc_data, pst_master->us_size); /* Ignore->MISRA-C++:2008 Rule 5-0-5 */ -} - -#endif diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_SpeedPulse_l.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_SpeedPulse_l.cpp deleted file mode 100755 index a3ebc01..0000000 --- a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_SpeedPulse_l.cpp +++ /dev/null @@ -1,128 +0,0 @@ -/* - * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/******************************************************************************* - * File name :VehicleSens_Did_SpeedPulse_l.cpp - * System name :_CWORD107_ - * Subsystem name :Vehicle sensor process - * Program name :Vehicle sensor data master(POSHAL_DID_SPEED_PULSE) - * Module configuration :VehicleSensInitSpeedPulsel() Vehicle sensor SPEED_PULSE initialization function - * :VehicleSensSetSpeedPulsel() Vehicle Sensor SPEED_PULSE SET Function - * :VehicleSensGetSpeedPulsel() Vehicle Sensor SPEED_PULSE GET Function - ******************************************************************************/ - -#include <vehicle_service/positioning_base_library.h> -#include "VehicleSens_DataMaster.h" - -/*************************************************/ -/* Global variable */ -/*************************************************/ -static VEHICLESENS_DATA_MASTER gstSpeedPulse_l; // NOLINT(readability/nolint) - -/******************************************************************************* -* MODULE : VehicleSensInitSpeedPulsel -* ABSTRACT : Vehicle sensor SPEED_PULSE initialization function -* FUNCTION : SPEED_PULSE data master initialization processing -* ARGUMENT : void -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensInitSpeedPulsel(void) { - (void)memset(reinterpret_cast<void *>(&gstSpeedPulse_l), 0, sizeof(VEHICLESENS_DATA_MASTER)); - gstSpeedPulse_l.ul_did = POSHAL_DID_SPEED_PULSE; - gstSpeedPulse_l.us_size = VEHICLE_DSIZE_SPEED_PULSE; - gstSpeedPulse_l.uc_rcvflag = VEHICLE_RCVFLAG_OFF; -} - -/******************************************************************************* -* MODULE : VehicleSensSetSpeedPulsel -* ABSTRACT : Vehicle Sensor SPEED_PULSE SET Function -* FUNCTION : Update the SPEED_PULSE data master -* ARGUMENT : *pst_data : Pointer to the message data received by the direct line -* NOTE : -* RETURN : VEHICLESENS_EQ : No data change -* VEHICLESENS_NEQ : Data change -******************************************************************************/ -u_int8 VehicleSensSetSpeedPulsel(const LSDRV_LSDATA *pst_data) { - u_int8 uc_ret; - VEHICLESENS_DATA_MASTER *pst_master; - - pst_master = &gstSpeedPulse_l; - - /* Compare data master and received data */ - uc_ret = VehicleSensmemcmp(pst_master->uc_data, pst_data->uc_data, pst_data->uc_size); - - /* Received data is set in the data master. */ - pst_master->ul_did = pst_data->ul_did; - pst_master->us_size = pst_data->uc_size; - pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON; - pst_master->uc_snscnt = pst_data->uc_sns_cnt; - (void)memcpy(reinterpret_cast<void *>(pst_master->uc_data), - (const void *)(pst_data->uc_data), (size_t)(pst_data->uc_size)); - - return(uc_ret); -} - -/******************************************************************************* -* MODULE : VehicleSensSetSpeedPulselG -* ABSTRACT : Vehicle Sensor SPEED_PULSE SET Function -* FUNCTION : Update the SPEED_PULSE data master -* ARGUMENT : *pst_data : Pointer to the message data received by the direct line -* NOTE : -* RETURN : VEHICLESENS_EQ : No data change -* VEHICLESENS_NEQ : Data change -******************************************************************************/ -u_int8 VehicleSensSetSpeedPulselG(const LSDRV_LSDATA_G *pst_data) { - u_int8 uc_ret; - VEHICLESENS_DATA_MASTER *pst_master; - - pst_master = &gstSpeedPulse_l; - - /* Compare data master and received data */ - uc_ret = VehicleSensmemcmp(pst_master->uc_data, pst_data->uc_data, pst_data->uc_size); - - /* Received data is set in the data master. */ - pst_master->ul_did = pst_data->ul_did; - pst_master->us_size = pst_data->uc_size; - pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON; - pst_master->uc_snscnt = pst_data->uc_sns_cnt; - (void)memcpy(reinterpret_cast<void *>(pst_master->uc_data), - (const void *)(pst_data->uc_data), (size_t)(pst_data->uc_size)); - - return(uc_ret); -} - -/******************************************************************************* -* MODULE : VehicleSensGetSpeedPulsel -* ABSTRACT : Vehicle Sensor SPEED_PULSE GET Function -* FUNCTION : Provide the SPEED_PULSE data master -* ARGUMENT : *pst_data : Pointer to the data master acquisition destination -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensGetSpeedPulsel(VEHICLESENS_DATA_MASTER *pst_data) { - const VEHICLESENS_DATA_MASTER *pst_master; - - pst_master = &gstSpeedPulse_l; - - /* Store the data master in the specified destination. */ - pst_data->ul_did = pst_master->ul_did; - pst_data->us_size = pst_master->us_size; - pst_data->uc_rcvflag = pst_master->uc_rcvflag; - pst_data->uc_snscnt = pst_master->uc_snscnt; - (void)memcpy(reinterpret_cast<void *>(pst_data->uc_data), - (const void *)(pst_master->uc_data), (size_t)(pst_master->us_size)); -} diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_SysGpsInterruptSignal.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_SysGpsInterruptSignal.cpp deleted file mode 100755 index e1400f2..0000000 --- a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_SysGpsInterruptSignal.cpp +++ /dev/null @@ -1,132 +0,0 @@ -/* - * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/******************************************************************************* - * File name :VehicleSens_Did_SysGpsInterruptSignal.cpp - * System name :PastModel002 - * Subsystem name :Vehicle sensor process - * Program name :Vehicle sensor data master(VEHICLE_DID_SYS_GPS_INTERRUPT_SIGNAL) - * Module configuration :VehicleSensInitSysGpsInterruptSignal() Vehicle sensor Sys_GPS_INTERRUPT_SIGNAL initialization function - * :VehicleSensSetSysGpsInterruptSignal() Vehicle Sensor Sys_GPS_INTERRUPT_SIGNAL SET Function - * :VehicleSensGetSysGpsInterruptSignal() Vehicle sensor Sys_GPS_INTERRUPT_SIGNAL GET function - ******************************************************************************/ - -#include <vehicle_service/positioning_base_library.h> -#include "VehicleSens_DataMaster.h" - -#define VEHICLE_SENS_DID_SYS_GPS_INTERRUPT_SIGNAL_DEBUG_FACTORY 0 - -/*************************************************/ -/* Global variable */ -/*************************************************/ -static VEHICLESENS_DATA_MASTER_GPS_INTERRUPT_SIGNAL gstSysGpsInterruptSignal; // NOLINT(readability/nolint) - -/******************************************************************************* -* MODULE : VehicleSensInitSysGpsInterruptSignal -* ABSTRACT : Vehicle sensor Sys_GPS_INTERRUPT_SIGNAL initialization function -* FUNCTION : Sys_GPS_INTERRUPT_SIGNAL data master initialization processing -* ARGUMENT : None -* NOTE : -* RETURN : None -******************************************************************************/ -void VehicleSensInitSysGpsInterruptSignal(void) { - (void)memset(reinterpret_cast<void *>(&(gstSysGpsInterruptSignal)), static_cast<int>(0x00), - sizeof(VEHICLESENS_DATA_MASTER_GPS_INTERRUPT_SIGNAL)); - gstSysGpsInterruptSignal.ul_did = VEHICLE_DID_SYS_GPS_INTERRUPT_SIGNAL; - gstSysGpsInterruptSignal.us_size = VEHICLE_DSIZE_SYS_GPS_INTERRUPT_SIGNAL; - gstSysGpsInterruptSignal.uc_data = VEHICLE_DINIT_SYS_GPS_INTERRUPT_SIGNAL; - -#if VEHICLE_SENS_DID_SYS_GPS_INTERRUPT_SIGNAL_DEBUG_FACTORY - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, - "#[FACTORY] gstSysGpsInterruptSignal.uc_data == 0x%x\r\n", gstSysGpsInterruptSignal.uc_data); -#endif -} - -/******************************************************************************* -* MODULE : VehicleSensSetSysGpsInterruptSignal -* ABSTRACT : Vehicle sensor SYS_GPS_INTERRUPT_SIGNAL SET function -* FUNCTION : Update the Sys_GPS_INTERRUPT_SIGNAL data master -* ARGUMENT : *pst_data : Pointer to received message data -* NOTE : -* RETURN : VEHICLESENS_EQ : No data change -* VEHICLESENS_NEQ : Data change -******************************************************************************/ -u_int8 VehicleSensSetSysGpsInterruptSignal(const LSDRV_MSG_LSDATA_DAT_GPS_INTERRUPT_SIGNAL *pst_data) { // LCOV_EXCL_START 8: dead code // NOLINT(whitespace/line_length) - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - u_int8 uc_ret = VEHICLESENS_EQ; - VEHICLESENS_DATA_MASTER_GPS_INTERRUPT_SIGNAL *pst_master; - - if (pst_data == NULL) { - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "pst_data == NULL\r\n"); - } else { - pst_master = &gstSysGpsInterruptSignal; - - /* Compare data master and received data */ - uc_ret = VehicleSensmemcmp(reinterpret_cast<void *>(&(pst_master->uc_data)), - (const void *)(&(pst_data->uc_data)), (size_t)(pst_data->uc_size)); - - /* Received data is set in the data master. */ - pst_master->ul_did = pst_data->ul_did; - pst_master->us_size = (u_int16)pst_data->uc_size; - pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON; - (void)memcpy(reinterpret_cast<void *>(&(pst_master->uc_data)), - (const void *)(&(pst_data->uc_data)), sizeof(pst_master->uc_data)); - -#if VEHICLE_SENS_DID_SYS_GPS_INTERRUPT_SIGNAL_DEBUG_FACTORY - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, - "#[FACTORY] pst_data->ul_did == 0x%x", pst_data->ul_did); - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, - "#[FACTORY] gstSysGpsInterruptSignal.ul_did == 0x%x\r\n", gstSysGpsInterruptSignal.ul_did); - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, - "#[FACTORY] (u_int8)pst_data->ucSize == 0x%x", (u_int8)pst_data->uc_size); - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, - "#[FACTORY] gstSysGpsInterruptSignal.us_size == 0x%x\r\n", gstSysGpsInterruptSignal.us_size); - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, - "#[FACTORY] pst_data->uc_data == 0x%x", pst_data->uc_data); - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, - "#[FACTORY] gstSysGpsInterruptSignal.uc_data == 0x%x\r\n", gstSysGpsInterruptSignal.uc_data); -#endif - } - - return(uc_ret); -} - -/******************************************************************************* -* MODULE : VehicleSensGetSysGpsInterruptSignal -* ABSTRACT : Vehicle sensor SYS_GPS_INTERRUPT_SIGNAL GET function -* FUNCTION : Provide the SYS_GPS_INTERRUPT_SIGNAL data master -* ARGUMENT : *pst_data : Pointer to the data master acquisition destination -* NOTE : -* RETURN : None -******************************************************************************/ -void VehicleSensGetSysGpsInterruptSignal(VEHICLESENS_DATA_MASTER_GPS_INTERRUPT_SIGNAL *pst_data) { - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - const VEHICLESENS_DATA_MASTER_GPS_INTERRUPT_SIGNAL *pst_master; - - if (pst_data == NULL) { - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "pst_data == NULL\r\n"); - } else { - pst_master = &gstSysGpsInterruptSignal; - - /* Store the data master in the specified destination. */ - pst_data->ul_did = pst_master->ul_did; - pst_data->us_size = pst_master->us_size; - pst_data->uc_rcvflag = pst_master->uc_rcvflag; - (void)memcpy(reinterpret_cast<void *>(&(pst_data->uc_data)), - (const void *)(&(pst_master->uc_data)), sizeof(pst_data->uc_data)); - } -} -// LCOV_EXCL_STOP diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_WknRollover.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_WknRollover.cpp deleted file mode 100755 index e98d364..0000000 --- a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_WknRollover.cpp +++ /dev/null @@ -1,51 +0,0 @@ -/* - * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @file - * VehicleSens_Did_WknRollover.cpp - * @brief - */ - -/*---------------------------------------------------------------------------------* - * Include Files * - *---------------------------------------------------------------------------------*/ -#include <vehicle_service/positioning_base_library.h> -#include "VehicleSens_DataMaster.h" - -/*---------------------------------------------------------------------------------* - * Function * - *---------------------------------------------------------------------------------*/ -/** - * @brief - * GPS Rollover Standard Week Number Data Master GET Processing - * - * @param[out] VEHICLESENS_DATA_MASTER* - * @param[in] u_int8 - */ -void VehicleSensGetWknRollover(SENSOR_MSG_GPSDATA_DAT *pst_data, u_int8 uc_get_method) { - switch (uc_get_method) { - case VEHICLESENS_GETMETHOD_GPS: - { - /** To acquire from GPS */ - VehicleSensGetWknRolloverG(pst_data); - break; - } - - default: - break; - } -} diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_WknRollover_g.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_WknRollover_g.cpp deleted file mode 100755 index 4a5defe..0000000 --- a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Did_WknRollover_g.cpp +++ /dev/null @@ -1,102 +0,0 @@ -/* - * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @file - * VehicleSens_Did_WknRollover_g.cpp - * @brief - */ - -/*---------------------------------------------------------------------------------* - * Include Files * - *---------------------------------------------------------------------------------*/ -#include <vehicle_service/positioning_base_library.h> -#include "VehicleSens_DataMaster.h" - -/*---------------------------------------------------------------------------------* - * Global Value * - *---------------------------------------------------------------------------------*/ -static VEHICLESENS_DATA_MASTER gstWknRollover_g; // NOLINT(readability/nolint) - -/*---------------------------------------------------------------------------------* - * Function * - *---------------------------------------------------------------------------------*/ -/** - * @brief - * GPS rollover standard week number data master initialization processing - */ -void VehicleSensInitWknRolloverG(void) { - SENSOR_WKNROLLOVER st_wkn_rollover; - - memset(&gstWknRollover_g, 0x00, sizeof(VEHICLESENS_DATA_MASTER)); - - /** Data ID setting */ - gstWknRollover_g.ul_did = POSHAL_DID_GPS_WKNROLLOVER; - /** Data size setting */ - gstWknRollover_g.us_size = sizeof(SENSOR_WKNROLLOVER); - /** Data content setting */ - memset(&st_wkn_rollover, 0x00, sizeof(st_wkn_rollover)); - memcpy(&gstWknRollover_g.uc_data[0], &st_wkn_rollover, sizeof(st_wkn_rollover)); - - return; -} - -/** - * @brief - * GPS Rollover Standard Week Number Data Master SET Process - * - * @param[in] SENSOR_WKNROLLOVER* - * - * @return u_int8 - */ -u_int8 VehicleSensSetWknRolloverG(const SENSOR_WKNROLLOVER *pst_wkn_rollover) { - u_int8 uc_ret; - VEHICLESENS_DATA_MASTER *pst_master; - - pst_master = &gstWknRollover_g; - - /** With the contents of the current data master,Compare received data */ - uc_ret = VehicleSensmemcmp(pst_master->uc_data, pst_wkn_rollover, sizeof(SENSOR_WKNROLLOVER)); - - /** Received data is set in the data master. */ - pst_master->ul_did = POSHAL_DID_GPS_WKNROLLOVER; - pst_master->us_size = sizeof(SENSOR_WKNROLLOVER); - pst_master->uc_rcvflag = VEHICLE_RCVFLAG_ON; - memset(pst_master->uc_data, 0x00, sizeof(pst_master->uc_data)); - memcpy(pst_master->uc_data, pst_wkn_rollover, sizeof(SENSOR_WKNROLLOVER)); - - return(uc_ret); -} - -/** - * @brief - * GPS Rollover Standard Week Number Data Master GET Processing - * - * @param[out] SENSOR_MSG_GPSDATA_DAT* - */ -void VehicleSensGetWknRolloverG(SENSOR_MSG_GPSDATA_DAT *pst_data) { - const VEHICLESENS_DATA_MASTER *pst_master; - - pst_master = &gstWknRollover_g; - - /* Store the data master in the specified destination. */ - pst_data->ul_did = pst_master->ul_did; - pst_data->us_size = pst_master->us_size; - pst_data->uc_rcv_flag = pst_master->uc_rcvflag; - memcpy(pst_data->uc_data, pst_master->uc_data, pst_master->us_size); - - return; -} diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_FromAccess.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_FromAccess.cpp deleted file mode 100755 index 99f2dc3..0000000 --- a/vehicleservice/positioning/server/src/Sensor/VehicleSens_FromAccess.cpp +++ /dev/null @@ -1,319 +0,0 @@ -/* - * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/******************************************************************************* - * File name :VehicleSens_FromAccess.cpp - * System name :PastModel002 - * Subsystem name :Vehicle sensor process - * Program name :Functions for accessing vehicle sensor FROM - ******************************************************************************/ - -#include <vehicle_service/positioning_base_library.h> -#include "VehicleSens_FromAccess.h" -#include "ClockDataMng.h" - -/******************************************************************************** - * Global variable * - ********************************************************************************/ - -/******************************************************************************** - * prototype declalation * - ********************************************************************************/ -static RET_API VehicleSensReadNV(NV_DATA_VEHICLESENS *p_nv_data); - -/******************************************************************************** - * Definition * - ********************************************************************************/ -#define VEHICLESENS_FROM_ACCESS_DEBUG 0 - -/******************************************************************************* -* MODULE : VehicleSensFromAccessInitialize -* ABSTRACT : Initializing process -* FUNCTION : -* ARGUMENT : None -* NOTE : -* RETURN : None -******************************************************************************/ -void VehicleSensFromAccessInitialize(void) { - /* The result of tag registration for non-volatile memory access is stored in g_nv_access_available, so no confirmation is required. */ - (void)VehicleSensRegistNvTag(); - -} - -/******************************************************************************* -* MODULE : VehicleSensRegistNvTag -* ABSTRACT : Tag registration process -* FUNCTION : Registering Tag Name to Identify Data Storage Destination -* ARGUMENT : None -* NOTE : -* RETURN : RET_NORMAL :Successful registration -* : RET_ERROR :Registration failure -******************************************************************************/ -RET_API VehicleSensRegistNvTag(void) { - RET_API lret = RET_NORMAL; - return lret; -} - -/******************************************************************************* -* MODULE : VehicleSensReadNV -* ABSTRACT : Get local time Lonlat -* FUNCTION : Reading local time Lonlat from non-volatile memory -* ARGUMENT : NV_DATA_VEHICLESENS * p_nv_data : Pointer to data acquired from non-volatile memory -* NOTE : None -* RETURN : RET_NORMAL :Read success -* : RET_ERROR :Failed to read -******************************************************************************/ -static RET_API VehicleSensReadNV(NV_DATA_VEHICLESENS * p_nv_data) { // LCOV_EXCL_START 8 : dead code - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - RET_API lret = RET_NORMAL; - FILE *fp; - NV_DATA_VEHICLESENS nv_data_tmp; - BOOL ret_read = FALSE; - BOOL ret_read2 = FALSE; - - u_int32 loop; - u_int8 CK_A = 0; - u_int8 CK_B = 0; - u_int8 *ptr; - - fp = fopen(NV_FILE_VEHICLESENS_TEMP, "rb"); - - /* Read File1 */ - if (fp != NULL) { - if ((fread(reinterpret_cast<void *>(p_nv_data), sizeof(u_int8), sizeof(NV_DATA_VEHICLESENS), fp)) == \ - sizeof(NV_DATA_VEHICLESENS)) { - /* Checksum processing */ - ptr = reinterpret_cast<u_int8 *>(p_nv_data); /* #QAC confirmation Rule11.4 1Byte accesses for checksums */ - CK_A = 0; - CK_B = 0; - - /* The 2Byte portion from the end of the checksum data is excluded because the checksum storage area. */ - for (loop = 0; loop < (sizeof(NV_DATA_VEHICLESENS) - 2); loop++) { - CK_A = static_cast<u_int8>(CK_A + ptr[loop]); - CK_B = static_cast<u_int8>(CK_B + CK_A); - } - - - if ((p_nv_data->cka == CK_A) && (p_nv_data->ckb == CK_B)) { - ret_read = TRUE; - -#if VEHICLESENS_FROM_ACCESS_DEBUG - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "NV read, status, year, month, day, hour, min, sec, lat, lon, "\ - "timediff, update_counter, cka, ckb "); - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "NV read, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d ", - p_nv_data->localtime.status, - p_nv_data->localtime.year, - p_nv_data->localtime.month, - p_nv_data->localtime.day, - p_nv_data->localtime.hour, - p_nv_data->localtime.min, - p_nv_data->localtime.sec, - p_nv_data->lonlat.latitude, - p_nv_data->lonlat.longitude, - p_nv_data->timediff, - p_nv_data->update_counter, - p_nv_data->cka, - p_nv_data->ckb); -#endif /* VEHICLESENS_FROM_ACCESS_DEBUG */ - } else { - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "Checksum1 failed."); - ret_read = FALSE; - } - } else { - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "fread1 failed."); - } - fclose(fp); - } else { - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "fopen1 failed."); - } - - /* Read File2 */ - fp = fopen(NV_FILE_VEHICLESENS2_TEMP, "rb"); - - if (fp != NULL) { - if ((fread(reinterpret_cast<void *>(&nv_data_tmp), sizeof(u_int8), sizeof(NV_DATA_VEHICLESENS), fp)) == \ - sizeof(NV_DATA_VEHICLESENS)) { - /* Checksum processing */ - ptr = reinterpret_cast<u_int8 *>(&nv_data_tmp); /* #QAC confirmation Rule11.4 1Byte accesses for checksums */ - CK_A = 0; - CK_B = 0; - - /* The 2Byte portion from the end of the checksum data is excluded because the checksum storage area. */ - for (loop = 0; loop < (sizeof(NV_DATA_VEHICLESENS) - 2); loop++) { - CK_A = static_cast<u_int8>(CK_A + ptr[loop]); - CK_B = static_cast<u_int8>(CK_B + CK_A); - } - - - if ((nv_data_tmp.cka == CK_A) && (nv_data_tmp.ckb == CK_B)) { - ret_read2 = TRUE; - -#if VEHICLESENS_FROM_ACCESS_DEBUG - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "NV read2, status, year, month, day, hour, min, sec, lat, lon, "\ - "timediff, update_counter, cka, ckb "); - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "NV read2, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d ", - nv_data_tmp.localtime.status, - nv_data_tmp.localtime.year, - nv_data_tmp.localtime.month, - nv_data_tmp.localtime.day, - nv_data_tmp.localtime.hour, - nv_data_tmp.localtime.min, - nv_data_tmp.localtime.sec, - nv_data_tmp.lonlat.latitude, - nv_data_tmp.lonlat.longitude, - nv_data_tmp.timediff, - nv_data_tmp.update_counter, - nv_data_tmp.cka, - nv_data_tmp.ckb); -#endif /* VEHICLESENS_FROM_ACCESS_DEBUG */ - } else { - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "Checksum2 failed."); - ret_read2 = FALSE; - } - } else { - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "fread2 failed."); - } - fclose(fp); - } else { - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "fopen2 failed."); - } - - - /* Check the read results of File 1 and File 2. */ - if ((ret_read == TRUE) && (ret_read2 == TRUE)) { - /* Whether File 1 or File 2 is the most recent file,Check with the update count counter */ - if (p_nv_data->update_counter < nv_data_tmp.update_counter) { - (void)memcpy(reinterpret_cast<void *>(p_nv_data), reinterpret_cast<void *>(&nv_data_tmp), \ - sizeof(NV_DATA_VEHICLESENS)); - } - lret = RET_NORMAL; - } else if (ret_read == TRUE) { - /* Use file 1 */ - lret = RET_NORMAL; - } else if (ret_read2 == TRUE) { - /* Use file 2 */ - (void)memcpy(reinterpret_cast<void *>(p_nv_data), reinterpret_cast<void *>(&nv_data_tmp), \ - sizeof(NV_DATA_VEHICLESENS)); - lret = RET_NORMAL; - } else { - /* Read failed for both file 1 and file 2 */ - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "fread failed."); - lret = RET_ERROR; - } - - return lret; -} - -/******************************************************************************* -* MODULE : VehicleSensReadNVLocalTime -* ABSTRACT : Local time acquisition at shutdown -* FUNCTION : Read local time at shutdown from non-volatile memory -* ARGUMENT : LOCALTIME * local_time : Local time at shutdown -* NOTE : None -* RETURN : RET_NORMAL :Successful acquisition -* : RET_ERROR :Failed to acquire -******************************************************************************/ -RET_API VehicleSensReadNVLocalTime(LOCALTIME * local_time) { - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - RET_API lret; - NV_DATA_VEHICLESENS nv_data; - - lret = VehicleSensReadNV(&nv_data); - - if (lret == RET_NORMAL) { - (void)memcpy(reinterpret_cast<void *>(local_time), (const void *)(&nv_data.localtime), sizeof(LOCALTIME)); - } - - return lret; -} - -/******************************************************************************* -* MODULE : VehicleSensReadNVLonLat -* ABSTRACT : Obtain position at shutdown -* FUNCTION : Read the shutdown position from the non-volatile memory -* ARGUMENT : LONLAT * lonlat : Shutdown position -* NOTE : None -* RETURN : RET_NORMAL :Successful acquisition -* : RET_ERROR :Failed to acquire -******************************************************************************/ -RET_API VehicleSensReadNVLonLat(LONLAT * lonlat) { - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - RET_API lret; - NV_DATA_VEHICLESENS nv_data; - - lret = VehicleSensReadNV(&nv_data); - - if (lret == RET_NORMAL) { - (void)memcpy(reinterpret_cast<void *>(lonlat), (const void *)(&nv_data.lonlat), sizeof(LONLAT)); - } - - return lret; -} - -/******************************************************************************* -* MODULE : VehicleSensReadNVTimeDiff -* ABSTRACT : Shutdown time difference acquisition -* FUNCTION : Reading the shutdown time difference from the non-volatile memory -* ARGUMENT : int32 * time_diff : Shutdown position -* NOTE : None -* RETURN : RET_NORMAL :Successful acquisition -* : RET_ERROR :Failed to acquire -******************************************************************************/ -RET_API VehicleSensReadNVTimeDiff(int32 * time_diff) { - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - RET_API lret; - NV_DATA_VEHICLESENS nv_data; - - lret = VehicleSensReadNV(&nv_data); - - if (lret == RET_NORMAL) { - *time_diff = nv_data.timediff; - } - - return lret; -} - -/******************************************************************************* -* MODULE : VehicleSensStoreLonlat -* ABSTRACT : Store location data in non-volatile memory -* FUNCTION : -* ARGUMENT : LONLAT * plonlat : Position data -* NOTE : -* RETURN : None -******************************************************************************/ -void VehicleSensStoreLonlat(LONLAT * plonlat) { - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - - return; -} - -/******************************************************************************* -* MODULE : VehicleSensWriteNVLocaltime -* ABSTRACT : Local Time Write -* FUNCTION : Write local time -* ARGUMENT : LOCALTIME * local_time : Local time -* NOTE : -* RETURN : RET_NORMAL :Successful write -* : RET_ERROR :Writing failure -******************************************************************************/ -RET_API VehicleSensWriteNVLocaltime(LOCALTIME * local_time, int32 * time_diff) { - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - RET_API lret = RET_NORMAL; - - return lret; -} - -// LCOV_EXCL_STOP diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_SelectionItemList.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_SelectionItemList.cpp deleted file mode 100755 index 4172b1e..0000000 --- a/vehicleservice/positioning/server/src/Sensor/VehicleSens_SelectionItemList.cpp +++ /dev/null @@ -1,466 +0,0 @@ -/* - * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/******************************************************************************* - * File name :VehicleSens_SelectionItemList.cpp - * System name :_CWORD107_ - * Subsystem name :Vehicle sensor process - * Program name :Vehicle Sensor Selection Item List - * Module configuration :VehicleSensInitSelectionItemList() Vehicle sensor selection item list initialization function - * :VehicleSensGetSelectionItemList() Vehicle sensor selection item list acquisition method GET function - * :VehicleSensGetSelectionItemListCanId() Vehicle Sensor Selection Items List CANID GET Functions - * :VehicleSensSetSelectionItemListCanId() Vehicle Sensor Selection Items List CANID SET Functions - * :VehicleSensCommWatchTblInit() Disruption monitoring data management table initialization function - * :VehicleSensCommWatchTblSave() Disruption monitoring data management table storage function - * :VehicleSensCommWatchTblRun() Disruption monitoring data management table execution function - ******************************************************************************/ - -#include <positioning_hal.h> -#include <vehicle_service/positioning_base_library.h> - -#include "VehicleSens_SelectionItemList.h" - -/*************************************************/ -/* Global variable */ -/*************************************************/ -static VEHICLESENS_SELECTION_ITEM_LIST g_st_selection_itemlist[VEHICLESENS_SELECTION_ITEM_LIST_LEN]; -static VEHICLE_COMM_WATCH_TBL g_st_comm_watchtbl[VEHICLE_COMM_WATCHTBL_DID_NUM]; - -/******************************************************************************* -* MODULE : VehicleSensInitSelectionItemList -* ABSTRACT : Vehicle sensor selection item list initialization function -* FUNCTION : Vehicle Sensor Selection Item List Initialization Process -* ARGUMENT : void -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensInitSelectionItemList(void) { - u_int8 uc_get_method; - - VehicleSensCommWatchTblInit(); - - /* Setting Acquisition Method (CAN/ Direct Line) for DataID in Vehicle Sensor Selection Item List. - BackDoor, Adim, Rev sets the CAN/ direct line obtained from the FROM - */ - memset(&g_st_selection_itemlist, 0x00, sizeof(g_st_selection_itemlist)); - - g_st_selection_itemlist[0].ul_did = VEHICLE_DID_HV; - g_st_selection_itemlist[0].ul_canid = VEHICLESENS_INVALID; - g_st_selection_itemlist[0].uc_get_method = VEHICLESENS_GETMETHOD_CAN; - g_st_selection_itemlist[1].ul_did = VEHICLE_DID_VB; - g_st_selection_itemlist[1].uc_get_method = VEHICLESENS_GETMETHOD_LINE; - g_st_selection_itemlist[2].ul_did = VEHICLE_DID_IG; - g_st_selection_itemlist[2].uc_get_method = VEHICLESENS_GETMETHOD_LINE; - g_st_selection_itemlist[3].ul_did = VEHICLE_DID_MIC; - g_st_selection_itemlist[3].uc_get_method = VEHICLESENS_GETMETHOD_LINE; - g_st_selection_itemlist[4].ul_did = VEHICLE_DID_ILL; - g_st_selection_itemlist[4].uc_get_method = VEHICLESENS_GETMETHOD_LINE; - g_st_selection_itemlist[5].ul_did = VEHICLE_DID_RHEOSTAT; - g_st_selection_itemlist[5].uc_get_method = VEHICLESENS_GETMETHOD_LINE; - g_st_selection_itemlist[6].ul_did = VEHICLE_DID_SYSTEMP; - g_st_selection_itemlist[6].uc_get_method = VEHICLESENS_GETMETHOD_LINE; - g_st_selection_itemlist[7].ul_did = POSHAL_DID_SPEED_PULSE; - g_st_selection_itemlist[7].uc_get_method = VEHICLESENS_GETMETHOD_LINE; - g_st_selection_itemlist[8].ul_did = POSHAL_DID_SPEED_KMPH; - g_st_selection_itemlist[8].uc_get_method = VEHICLESENS_GETMETHOD_LINE; - g_st_selection_itemlist[9].ul_did = POSHAL_DID_GYRO_X; - g_st_selection_itemlist[9].uc_get_method = VEHICLESENS_GETMETHOD_LINE; - g_st_selection_itemlist[10].ul_did = POSHAL_DID_GYRO_Y; - g_st_selection_itemlist[10].uc_get_method = VEHICLESENS_GETMETHOD_LINE; - g_st_selection_itemlist[11].ul_did = POSHAL_DID_GYRO_Z; - g_st_selection_itemlist[11].uc_get_method = VEHICLESENS_GETMETHOD_LINE; - g_st_selection_itemlist[12].ul_did = POSHAL_DID_GSNS_X; - g_st_selection_itemlist[12].uc_get_method = VEHICLESENS_GETMETHOD_LINE; - g_st_selection_itemlist[13].ul_did = POSHAL_DID_GSNS_Y; - g_st_selection_itemlist[13].uc_get_method = VEHICLESENS_GETMETHOD_LINE; - g_st_selection_itemlist[14].ul_did = POSHAL_DID_GSNS_Z; - g_st_selection_itemlist[14].uc_get_method = VEHICLESENS_GETMETHOD_LINE; - g_st_selection_itemlist[15].ul_did = VEHICLE_DID_REV; - g_st_selection_itemlist[15].ul_canid = VEHICLESENS_INVALID; - uc_get_method = VEHICLESENS_GETMETHOD_LINE; - g_st_selection_itemlist[15].uc_get_method = uc_get_method; - g_st_selection_itemlist[16].ul_did = POSHAL_DID_GPS_ANTENNA; - g_st_selection_itemlist[16].uc_get_method = VEHICLESENS_GETMETHOD_LINE; - g_st_selection_itemlist[17].ul_did = POSHAL_DID_SNS_COUNTER; - g_st_selection_itemlist[17].uc_get_method = VEHICLESENS_GETMETHOD_LINE; - g_st_selection_itemlist[18].ul_did = VEHICLE_DID_GPS_COUNTER; - g_st_selection_itemlist[18].uc_get_method = VEHICLESENS_GETMETHOD_GPS; - g_st_selection_itemlist[19].ul_did = POSHAL_DID_GPS_VERSION; - g_st_selection_itemlist[19].uc_get_method = VEHICLESENS_GETMETHOD_GPS; - g_st_selection_itemlist[20].ul_did = VEHICLE_DID_LOCATION; - g_st_selection_itemlist[20].uc_get_method = VEHICLESENS_GETMETHOD_GPS; - g_st_selection_itemlist[21].ul_did = VEHICLE_DID_REV_LINE; - g_st_selection_itemlist[21].uc_get_method = VEHICLESENS_GETMETHOD_LINE; - g_st_selection_itemlist[22].ul_did = VEHICLE_DID_REV_CAN; - g_st_selection_itemlist[22].ul_canid = VEHICLESENS_INVALID; - g_st_selection_itemlist[22].uc_get_method = VEHICLESENS_GETMETHOD_CAN; - /* ++ GPS _CWORD82_ support */ - g_st_selection_itemlist[23].ul_did = POSHAL_DID_GPS__CWORD82___CWORD44_GP4; - g_st_selection_itemlist[23].uc_get_method = VEHICLESENS_GETMETHOD_GPS; - g_st_selection_itemlist[24].ul_did = VEHICLE_DID_GPS__CWORD82__NMEA; - g_st_selection_itemlist[24].uc_get_method = VEHICLESENS_GETMETHOD_GPS; - g_st_selection_itemlist[25].ul_did = POSHAL_DID_GPS__CWORD82__FULLBINARY; - g_st_selection_itemlist[25].uc_get_method = VEHICLESENS_GETMETHOD_GPS; - /* -- GPS _CWORD82_ support */ -#if CONFIG_SENSOR_EXT_VALID /* Initial Sensor Response */ - g_st_selection_itemlist[26].ul_did = POSHAL_DID_GYRO_EXT; - g_st_selection_itemlist[26].uc_get_method = VEHICLESENS_GETMETHOD_LINE; - g_st_selection_itemlist[27].ul_did = POSHAL_DID_SPEED_PULSE_FST; - g_st_selection_itemlist[27].uc_get_method = VEHICLESENS_GETMETHOD_LINE; - g_st_selection_itemlist[28].ul_did = POSHAL_DID_GYRO_X_FST; - g_st_selection_itemlist[28].uc_get_method = VEHICLESENS_GETMETHOD_LINE; - g_st_selection_itemlist[29].ul_did = POSHAL_DID_GYRO_Y_FST; - g_st_selection_itemlist[29].uc_get_method = VEHICLESENS_GETMETHOD_LINE; - g_st_selection_itemlist[30].ul_did = POSHAL_DID_GYRO_Z_FST; - g_st_selection_itemlist[30].uc_get_method = VEHICLESENS_GETMETHOD_LINE; - g_st_selection_itemlist[31].ul_did = VEHICLE_DID_GPS_UBLOX_NAV_POSLLH; - g_st_selection_itemlist[31].uc_get_method = VEHICLESENS_GETMETHOD_GPS; - g_st_selection_itemlist[32].ul_did = VEHICLE_DID_GPS_UBLOX_NAV_STATUS; - g_st_selection_itemlist[32].uc_get_method = VEHICLESENS_GETMETHOD_GPS; - g_st_selection_itemlist[33].ul_did = VEHICLE_DID_GPS_UBLOX_NAV_TIMEUTC; - g_st_selection_itemlist[33].uc_get_method = VEHICLESENS_GETMETHOD_GPS; - g_st_selection_itemlist[34].ul_did = VEHICLE_DID_GPS_UBLOX_NAV_VELNED; - g_st_selection_itemlist[34].uc_get_method = VEHICLESENS_GETMETHOD_GPS; - g_st_selection_itemlist[35].ul_did = VEHICLE_DID_GPS_UBLOX_NAV_DOP; - g_st_selection_itemlist[35].uc_get_method = VEHICLESENS_GETMETHOD_GPS; - g_st_selection_itemlist[36].ul_did = VEHICLE_DID_GPS_UBLOX_NAV_TIMEGPS; - g_st_selection_itemlist[36].uc_get_method = VEHICLESENS_GETMETHOD_GPS; - g_st_selection_itemlist[37].ul_did = VEHICLE_DID_GPS_UBLOX_NAV_SVINFO; - g_st_selection_itemlist[37].uc_get_method = VEHICLESENS_GETMETHOD_GPS; - g_st_selection_itemlist[38].ul_did = VEHICLE_DID_GPS_UBLOX_NAV_CLOCK; - g_st_selection_itemlist[38].uc_get_method = VEHICLESENS_GETMETHOD_GPS; - g_st_selection_itemlist[39].ul_did = VEHICLE_DID_GPS_UBLOX_MON_HW; - g_st_selection_itemlist[39].uc_get_method = VEHICLESENS_GETMETHOD_GPS; - g_st_selection_itemlist[40].ul_did = POSHAL_DID_SPEED_PULSE_FLAG; - g_st_selection_itemlist[40].uc_get_method = VEHICLESENS_GETMETHOD_LINE; - g_st_selection_itemlist[41].ul_did = VEHICLE_DID_GYRO_TROUBLE; - g_st_selection_itemlist[41].ul_canid = VEHICLESENS_INVALID; - g_st_selection_itemlist[41].uc_get_method = VEHICLESENS_GETMETHOD_LINE; - g_st_selection_itemlist[42].ul_did = VEHICLE_DID_SYS_GPS_INTERRUPT_SIGNAL; - g_st_selection_itemlist[42].ul_canid = VEHICLESENS_INVALID; - g_st_selection_itemlist[42].uc_get_method = VEHICLESENS_GETMETHOD_LINE; - g_st_selection_itemlist[43].ul_did = VEHICLE_DID_MAIN_GPS_INTERRUPT_SIGNAL; - g_st_selection_itemlist[43].ul_canid = VEHICLESENS_INVALID; - g_st_selection_itemlist[43].uc_get_method = VEHICLESENS_GETMETHOD_LINE; - g_st_selection_itemlist[44].ul_did = VEHICLE_DID_GYRO_CONNECT_STATUS; - g_st_selection_itemlist[44].ul_canid = VEHICLESENS_INVALID; - g_st_selection_itemlist[44].uc_get_method = VEHICLESENS_GETMETHOD_LINE; - g_st_selection_itemlist[45].ul_did = POSHAL_DID_SPEED_PULSE_FLAG_FST; - g_st_selection_itemlist[45].uc_get_method = VEHICLESENS_GETMETHOD_LINE; - g_st_selection_itemlist[46].ul_did = POSHAL_DID_REV_FST; - g_st_selection_itemlist[46].ul_canid = VEHICLESENS_INVALID; - uc_get_method = VEHICLESENS_GETMETHOD_LINE; - g_st_selection_itemlist[46].uc_get_method = uc_get_method; - g_st_selection_itemlist[47].ul_did = POSHAL_DID_GPS_NMEA; - g_st_selection_itemlist[47].uc_get_method = VEHICLESENS_GETMETHOD_GPS; - g_st_selection_itemlist[48].ul_did = POSHAL_DID_GPS_TIME; - g_st_selection_itemlist[48].ul_canid = VEHICLESENS_INVALID; - g_st_selection_itemlist[48].uc_get_method = VEHICLESENS_GETMETHOD_GPS; - g_st_selection_itemlist[49].ul_did = VEHICLE_DID_NAVIINFO_DIAG_GPS; - g_st_selection_itemlist[49].ul_canid = VEHICLESENS_INVALID; - g_st_selection_itemlist[49].uc_get_method = VEHICLESENS_GETMETHOD_GPS; - g_st_selection_itemlist[50].ul_did = POSHAL_DID_GYRO_TEMP; - g_st_selection_itemlist[50].ul_canid = VEHICLESENS_INVALID; - g_st_selection_itemlist[50].uc_get_method = VEHICLESENS_GETMETHOD_LINE; - g_st_selection_itemlist[51].ul_did = POSHAL_DID_GYRO_TEMP_FST; - g_st_selection_itemlist[51].ul_canid = VEHICLESENS_INVALID; - g_st_selection_itemlist[51].uc_get_method = VEHICLESENS_GETMETHOD_LINE; - g_st_selection_itemlist[52].ul_did = POSHAL_DID_GSNS_X_FST; - g_st_selection_itemlist[52].ul_canid = VEHICLESENS_INVALID; - g_st_selection_itemlist[52].uc_get_method = VEHICLESENS_GETMETHOD_LINE; - g_st_selection_itemlist[53].ul_did = POSHAL_DID_GSNS_Y_FST; - g_st_selection_itemlist[53].ul_canid = VEHICLESENS_INVALID; - g_st_selection_itemlist[53].uc_get_method = VEHICLESENS_GETMETHOD_LINE; - g_st_selection_itemlist[54].ul_did = POSHAL_DID_GSNS_Z_FST; - g_st_selection_itemlist[54].ul_canid = VEHICLESENS_INVALID; - g_st_selection_itemlist[54].uc_get_method = VEHICLESENS_GETMETHOD_LINE; - g_st_selection_itemlist[55].ul_did = VEHICLE_DID_LOCATION_LONLAT; - g_st_selection_itemlist[55].ul_canid = VEHICLESENS_INVALID; - g_st_selection_itemlist[55].uc_get_method = VEHICLESENS_GETMETHOD_GPS; - g_st_selection_itemlist[56].ul_did = VEHICLE_DID_LOCATION_ALTITUDE; - g_st_selection_itemlist[56].ul_canid = VEHICLESENS_INVALID; - g_st_selection_itemlist[56].uc_get_method = VEHICLESENS_GETMETHOD_GPS; - g_st_selection_itemlist[57].ul_did = VEHICLE_DID_MOTION_HEADING; - g_st_selection_itemlist[57].ul_canid = VEHICLESENS_INVALID; - g_st_selection_itemlist[57].uc_get_method = VEHICLESENS_GETMETHOD_GPS; - g_st_selection_itemlist[58].ul_did = VEHICLE_DID_LOCATION_LONLAT_NAVI; - g_st_selection_itemlist[58].ul_canid = VEHICLESENS_INVALID; - g_st_selection_itemlist[58].uc_get_method = VEHICLESENS_GETMETHOD_NAVI; - g_st_selection_itemlist[59].ul_did = VEHICLE_DID_LOCATION_ALTITUDE_NAVI; - g_st_selection_itemlist[59].ul_canid = VEHICLESENS_INVALID; - g_st_selection_itemlist[59].uc_get_method = VEHICLESENS_GETMETHOD_NAVI; - g_st_selection_itemlist[60].ul_did = VEHICLE_DID_MOTION_HEADING_NAVI; - g_st_selection_itemlist[60].ul_canid = VEHICLESENS_INVALID; - g_st_selection_itemlist[60].uc_get_method = VEHICLESENS_GETMETHOD_NAVI; - g_st_selection_itemlist[61].ul_did = VEHICLE_DID_SETTINGTIME; - g_st_selection_itemlist[61].ul_canid = VEHICLESENS_INVALID; - g_st_selection_itemlist[61].uc_get_method = VEHICLESENS_GETMETHOD_OTHER; - g_st_selection_itemlist[62].ul_did = VEHICLE_DID_MOTION_SPEED; - g_st_selection_itemlist[62].ul_canid = VEHICLESENS_INVALID; - g_st_selection_itemlist[62].uc_get_method = VEHICLESENS_GETMETHOD_GPS; - g_st_selection_itemlist[63].ul_did = VEHICLE_DID_MOTION_SPEED_NAVI; - g_st_selection_itemlist[63].ul_canid = VEHICLESENS_INVALID; - g_st_selection_itemlist[63].uc_get_method = VEHICLESENS_GETMETHOD_NAVI; - g_st_selection_itemlist[64].ul_did = VEHICLE_DID_MOTION_SPEED_INTERNAL; - g_st_selection_itemlist[64].ul_canid = VEHICLESENS_INVALID; - g_st_selection_itemlist[64].uc_get_method = VEHICLESENS_GETMETHOD_INTERNAL; - g_st_selection_itemlist[65].ul_did = POSHAL_DID_PULSE_TIME; - g_st_selection_itemlist[65].ul_canid = VEHICLESENS_INVALID; - g_st_selection_itemlist[65].uc_get_method = VEHICLESENS_GETMETHOD_LINE; - g_st_selection_itemlist[66].ul_did = POSHAL_DID_GPS_TIME_RAW; - g_st_selection_itemlist[66].ul_canid = VEHICLESENS_INVALID; - g_st_selection_itemlist[66].uc_get_method = VEHICLESENS_GETMETHOD_GPS; - g_st_selection_itemlist[67].ul_did = POSHAL_DID_GPS_WKNROLLOVER; - g_st_selection_itemlist[67].ul_canid = VEHICLESENS_INVALID; - g_st_selection_itemlist[67].uc_get_method = VEHICLESENS_GETMETHOD_GPS; - g_st_selection_itemlist[68].ul_did = POSHAL_DID_GPS_CLOCK_DRIFT; - g_st_selection_itemlist[68].ul_canid = VEHICLESENS_INVALID; - g_st_selection_itemlist[68].uc_get_method = VEHICLESENS_GETMETHOD_GPS; - g_st_selection_itemlist[69].ul_did = POSHAL_DID_GPS_CLOCK_FREQ; - g_st_selection_itemlist[69].ul_canid = VEHICLESENS_INVALID; - g_st_selection_itemlist[69].uc_get_method = VEHICLESENS_GETMETHOD_GPS; -#else - g_st_selection_itemlist[26].ul_did = VEHICLE_DID_GPS_UBLOX_NAV_POSLLH; - g_st_selection_itemlist[26].uc_get_method = VEHICLESENS_GETMETHOD_GPS; - g_st_selection_itemlist[27].ul_did = VEHICLE_DID_GPS_UBLOX_NAV_STATUS; - g_st_selection_itemlist[27].uc_get_method = VEHICLESENS_GETMETHOD_GPS; - g_st_selection_itemlist[28].ul_did = VEHICLE_DID_GPS_UBLOX_NAV_TIMEUTC; - g_st_selection_itemlist[28].uc_get_method = VEHICLESENS_GETMETHOD_GPS; - g_st_selection_itemlist[29].ul_did = VEHICLE_DID_GPS_UBLOX_NAV_VELNED; - g_st_selection_itemlist[29].uc_get_method = VEHICLESENS_GETMETHOD_GPS; - g_st_selection_itemlist[30].ul_did = VEHICLE_DID_GPS_UBLOX_NAV_DOP; - g_st_selection_itemlist[30].uc_get_method = VEHICLESENS_GETMETHOD_GPS; - g_st_selection_itemlist[31].ul_did = VEHICLE_DID_GPS_UBLOX_NAV_TIMEGPS; - g_st_selection_itemlist[31].uc_get_method = VEHICLESENS_GETMETHOD_GPS; - g_st_selection_itemlist[32].ul_did = VEHICLE_DID_GPS_UBLOX_NAV_SVINFO; - g_st_selection_itemlist[32].uc_get_method = VEHICLESENS_GETMETHOD_GPS; - g_st_selection_itemlist[33].ul_did = VEHICLE_DID_GPS_UBLOX_NAV_CLOCK; - g_st_selection_itemlist[33].uc_get_method = VEHICLESENS_GETMETHOD_GPS; - g_st_selection_itemlist[34].ul_did = VEHICLE_DID_GPS_UBLOX_MON_HW; - g_st_selection_itemlist[34].uc_get_method = VEHICLESENS_GETMETHOD_GPS; - g_st_selection_itemlist[35].ul_did = POSHAL_DID_SPEED_PULSE_FLAG; - g_st_selection_itemlist[35].uc_get_method = VEHICLESENS_GETMETHOD_LINE; - g_st_selection_itemlist[36].ul_did = VEHICLE_DID_GYRO_TROUBLE; - g_st_selection_itemlist[36].ul_canid = VEHICLESENS_INVALID; - g_st_selection_itemlist[36].uc_get_method = VEHICLESENS_GETMETHOD_LINE; - g_st_selection_itemlist[37].ul_did = VEHICLE_DID__CWORD56__GPS_INTERRUPT_SIGNAL; - g_st_selection_itemlist[37].ul_canid = VEHICLESENS_INVALID; - g_st_selection_itemlist[37].uc_get_method = VEHICLESENS_GETMETHOD_LINE; - g_st_selection_itemlist[38].ul_did = VEHICLE_DID__CWORD102__GPS_INTERRUPT_SIGNAL; - g_st_selection_itemlist[38].ul_canid = VEHICLESENS_INVALID; - g_st_selection_itemlist[38].uc_get_method = VEHICLESENS_GETMETHOD_LINE; - g_st_selection_itemlist[39].ul_did = VEHICLE_DID_GYRO_CONNECT_STATUS; - g_st_selection_itemlist[39].ul_canid = VEHICLESENS_INVALID; - g_st_selection_itemlist[39].uc_get_method = VEHICLESENS_GETMETHOD_LINE; -#endif -} - -/******************************************************************************* -* MODULE : VehicleSensGetSelectionItemList -* ABSTRACT : Vehicle sensor_data acquisition method GET function -* FUNCTION : Provide data acquisition methods -* ARGUMENT : ul_did Data ID -* NOTE : -* RETURN : VEHICLESENS_GETMETHOD_CAN :CAN line -* VEHICLESENS_GETMETHOD_LINE :Direct Line -* VEHICLESENS_GETMETHOD_NO_DETECTION :Not downloaded -* VEHICLESENS_GETMETHOD_GPS :GPS -* VEHICLESENS_GETMETHOD_NAVI :Navi -* VEHICLESENS_GETMETHOD_CLOCK :Clock -* VEHICLESENS_GETMETHOD_OTHER :Others -******************************************************************************/ -u_int8 VehicleSensGetSelectionItemList(DID ul_did) { - int32 i; - u_int8 uc_get_method = VEHICLESENS_GETMETHOD_NO_DETECTION; - /* Ignore->MISRA-C++:2008 Rule 2-13-3 */ /* Ignore->MISRA-C++:2008 Rule 5-0-13, 5-0-14, 5-3-1 */ - if ( (ul_did & VEHICLESENS_BIT31_29) != 0 ) { - /* For other than CAN frame data */ - for (i = 0; i < VEHICLESENS_SELECTION_ITEM_LIST_LEN; i++) { - if (g_st_selection_itemlist[i].ul_did == ul_did) { - uc_get_method = g_st_selection_itemlist[i].uc_get_method; - break; - } - } - } else { - /* CAN frame data */ - uc_get_method = VEHICLESENS_GETMETHOD_CAN; - } - return uc_get_method; -} - -/******************************************************************************* -* MODULE : VehicleSensGetSelectionItemListCanId -* ABSTRACT : Vehicle Sensor Selection Item List_CANID GET Function -* FUNCTION : Provide CANID -* ARGUMENT : -* NOTE : -* RETURN : ul_canid CANID -******************************************************************************/ -u_int32 VehicleSensGetSelectionItemListCanId(DID ul_did) { // LCOV_EXCL_START 8 : dead code - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - int32 i; - u_int32 ul_canid = VEHICLESENS_INVALID; - - for (i = 0; i < VEHICLESENS_SELECTION_ITEM_LIST_LEN; i++) { - if (g_st_selection_itemlist[i].ul_did == ul_did) { - if (VEHICLESENS_GETMETHOD_CAN == g_st_selection_itemlist[i].uc_get_method) { - /* When the data source type is CAN communication */ - ul_canid = g_st_selection_itemlist[i].ul_canid; - } - break; - } - } - return ul_canid; -} -// LCOV_EXCL_STOP - -/******************************************************************************* -* MODULE : VehicleSensSetSelectionItemListCanId -* ABSTRACT : Vehicle Sensor Selection Item List_CANID SET Function -* FUNCTION : Sets when the CANID associated with the specified DID is unconfirmed. -* ARGUMENT : ul_canid u-int32(CANID) -* NOTE : -* RETURN : TRUE :Successful registration(Including when the CANID is fixed) -* : FALSE :Registration failure -******************************************************************************/ -BOOL VehicleSensSetSelectionItemListCanId(DID ul_did, u_int32 ul_canid) { // LCOV_EXCL_START 8 : dead code - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - BOOL b_ret = TRUE; - u_int8 uc_cnt = 0; - int32 uc_last_cnt = 0; - - u_int8 uc_effective_flg = VEHICLESENS_EFFECTIVE; - - for (uc_cnt = 0; uc_cnt < VEHICLE_COMM_WATCHTBL_DID_NUM; uc_cnt++) { - if (g_st_comm_watchtbl[uc_cnt].ul_did == ul_did) { - /* Obtain CANID determination flg */ - uc_effective_flg = g_st_comm_watchtbl[uc_cnt].uc_effective_flg; - break; - } - } - - if (uc_cnt >= VEHICLE_COMM_WATCHTBL_DID_NUM) { - return FALSE; - } - - if (VEHICLESENS_EFFECTIVE != uc_effective_flg) { - /* When the CANID is undetermined */ - b_ret = FALSE; - for (uc_last_cnt = 0; uc_last_cnt < VEHICLESENS_SELECTION_ITEM_LIST_LEN; uc_last_cnt++) { - if (g_st_selection_itemlist[uc_last_cnt].ul_did == ul_did) { - /* Updating the CANID of the Vehicle Sensor Selection Items List */ - g_st_selection_itemlist[uc_last_cnt].ul_canid = ul_canid; - /* To fix the CANID */ - g_st_comm_watchtbl[uc_cnt].uc_effective_flg = VEHICLESENS_EFFECTIVE; - - /* During CANID indoubt,When Vehicle API ""Vehicle Sensor Information Disruption Monitoring"" is called */ - /* Register for disruption monitoring of pending CAN threads */ - if (0x00 < g_st_comm_watchtbl[uc_cnt].uc_vehicle_comm_watch_cnt) { - VehicleSensCommWatchTblRun(ul_did); - } - b_ret = TRUE; - break; - } - } - } - return b_ret; -} -// LCOV_EXCL_STOP - -/******************************************************************************* -* MODULE : VehicleSensCommWatchTblInit -* ABSTRACT : Disruption monitoring data management table initialization function -* FUNCTION : Disruption monitoring data management table initialization processing -* ARGUMENT : void -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensCommWatchTblInit(void) { - memset(&g_st_comm_watchtbl, 0x00, sizeof(g_st_comm_watchtbl)); - - /* DID initialization */ - g_st_comm_watchtbl[0].ul_did = VEHICLE_DID_REV; - g_st_comm_watchtbl[1].ul_did = VEHICLE_DID_REV_CAN; -} - -/******************************************************************************* -* MODULE : VehicleSensCommWatchTblSave -* ABSTRACT : Disruption monitoring data management table storage function -* FUNCTION : When the target CANID is undetermined, save the discontinuation monitoring data... -* ARGUMENT : -* NOTE : -* RETURN : TRUE : To fix the CANID -* : FALSE : CANID undetermined -******************************************************************************/ -BOOL VehicleSensCommWatchTblSave(const VEHICLE_MSG_WATCH_STOPPAGE *pst_msg) { // LCOV_EXCL_START 8 : dead code - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - BOOL b_ret = TRUE; /* Function return value */ - u_int8 uc_cnt = 0; /* Generic counters */ - u_int8 uc_last_cnt = 0; /* Vehicle Sensor Information Disruption Monitoring Request Count */ - u_int8 uc_get_method = VEHICLESENS_GETMETHOD_CAN; /* Acquisition method */ - u_int8 uc_effective_flg = VEHICLESENS_EFFECTIVE; /* CANID determination flg */ - - - uc_get_method = VehicleSensGetSelectionItemList(pst_msg->st_data.ul_did); - - /* If the retrieval method is CAN: Check if the CANID is fixed */ - if (VEHICLESENS_GETMETHOD_CAN == uc_get_method) { - for ( uc_cnt = 0; uc_cnt < VEHICLE_COMM_WATCHTBL_DID_NUM; uc_cnt++ ) { - if ( g_st_comm_watchtbl[uc_cnt].ul_did == pst_msg->st_data.ul_did ) { - /* Obtain CANID determination flg */ - uc_effective_flg = g_st_comm_watchtbl[uc_cnt].uc_effective_flg; - break; - } - } - } - - if ( VEHICLESENS_EFFECTIVE != uc_effective_flg ) { - /* Due to being asked for disruption monitoring of CANID indoubt data,Keep parameters required for disruption monitoring */ - /* Returns success to the API user,No Disruption Monitoring Registration at this time */ - /* Ask the CAN thread to monitor for disruption when the CANID is fixed. */ - - uc_last_cnt = g_st_comm_watchtbl[uc_cnt].uc_vehicle_comm_watch_cnt; - if ( VEHICLE_COMM_WATCHTBL_DAT_NUM > uc_last_cnt ) { - /* Destination PNO,Keep Disrupted Monitoring Time */ - g_st_comm_watchtbl[uc_cnt].st_comm_watch_dat[uc_last_cnt].us_pno = pst_msg->st_data.us_pno; - g_st_comm_watchtbl[uc_cnt].st_comm_watch_dat[uc_last_cnt].us_watch_time = pst_msg->st_data.us_watch_time; - - /* Vehicle sensor information disruption monitoring request count is incremented. */ - uc_last_cnt++; - g_st_comm_watchtbl[uc_cnt].uc_vehicle_comm_watch_cnt = uc_last_cnt; - } - b_ret = FALSE; - } - return b_ret; -} -// LCOV_EXCL_STOP - -/******************************************************************************* -* MODULE : VehicleSensCommWatchTblRun -* ABSTRACT : Disruption monitoring data management table execution function -* FUNCTION : Execute requested disruption monitoring when CANID is unconfirmed -* ARGUMENT : ul_did DID -* NOTE : -* RETURN : TRUE : Normal completion -* : FALSE : ABENDs -******************************************************************************/ -BOOL VehicleSensCommWatchTblRun(DID ul_did) { // LCOV_EXCL_START 8 : dead code - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - BOOL b_ret = TRUE; - - return b_ret; -} -// LCOV_EXCL_STOP diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_SharedMemory.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_SharedMemory.cpp deleted file mode 100755 index 1fc9954..0000000 --- a/vehicleservice/positioning/server/src/Sensor/VehicleSens_SharedMemory.cpp +++ /dev/null @@ -1,521 +0,0 @@ -/* - * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/******************************************************************************* - * File name :VehicleSens_SharedMemory.cpp - * System name :PastModel002 - * Subsystem name :Vehicle sensor process - * Program name :Vehicle sensor shared memory management - ******************************************************************************/ - -#include <vehicle_service/positioning_base_library.h> -#include "VehicleSens_SharedMemory.h" -#include "Sensor_API.h" -#include "VehicleSens_DataMaster.h" -#include "Sensor_API_private.h" -#include "SensorLocation_API.h" -#include "SensorLocation_API_private.h" - -/******************************************************************************** - * prototype declalation * - ********************************************************************************/ -static void VehicleSensLinkSharedMemory(char *shared_memory_name, void **p_share_addr); -static RET_API VehicleSensWriteDataGpsInterruptSignal(DID ul_did); -static RET_API VehicleSensWriteDataGyroConnectStatus(DID ul_did); -static RET_API VehicleSensWriteDataLocalTime(void); -static RET_API VehicleSensWriteDataLonLat(void); - -/******************************************************************************** - * Definition * - ********************************************************************************/ - -/******************************************************************************* -* MODULE : VehicleSensInitSharedMemory -* ABSTRACT : Shared Memory Initialization -* FUNCTION : Initialize shared memory -* ARGUMENT : None -* NOTE : -* RETURN : RET_NORMAL :Normal -* : RET_ERROR :Abnormality -******************************************************************************/ -RET_API VehicleSensInitSharedMemory(void) { // LCOV_EXCL_START 8 : dead code - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - RET_API l_ret; /* Return of the functions */ - - /* All shared memory initialization */ - l_ret = VehicleSensWriteDataGpsInterruptSignal(VEHICLE_DID_MAIN_GPS_INTERRUPT_SIGNAL); - if (l_ret == RET_NORMAL) { - l_ret = VehicleSensWriteDataGpsInterruptSignal(VEHICLE_DID_SYS_GPS_INTERRUPT_SIGNAL); - } - if (l_ret == RET_NORMAL) { - l_ret = VehicleSensWriteDataGyroConnectStatus(VEHICLE_DID_GYRO_CONNECT_STATUS); - } - - /* Initializes the effective ephemeris count when the shared memory is shut down. */ - if (l_ret == RET_NORMAL) { - l_ret = VehicleSensWriteDataValidEphemerisNum(0); /* Initialized with effective ephemeris number 0 */ - } - - /* Writes the value read from the non-volatile memory to the shared memory. */ - /* This process is executed only at startup.,After that, the shared memory will not be overwritten. */ - if (l_ret == RET_NORMAL) { - l_ret = VehicleSensWriteDataLocalTime(); - } - - if (l_ret == RET_NORMAL) { - l_ret = VehicleSensWriteDataLonLat(); - } - - return l_ret; -} - -/******************************************************************************* -* MODULE : VehicleSensLinkSharedMemory -* ABSTRACT : Shared memory link -* FUNCTION : Link to shared memory -* ARGUMENT : -* NOTE : -* RETURN : None -******************************************************************************/ -static void VehicleSensLinkSharedMemory(char *shared_memory_name, void **p_share_addr) { - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - RET_API ret_api; - void *pv_share_mem; /* Store Shared Memory Address */ - u_int32 ul_share_mem_size; /* Size of the linked shared memory */ - - /* Link to the handle storage area */ - ret_api = _pb_LinkShareData(shared_memory_name, &pv_share_mem, &ul_share_mem_size); - - if (ret_api == RET_NORMAL) { - /* If the link is successful */ - *p_share_addr = pv_share_mem; /* Set the address */ - } else { - /* If the link fails */ - *p_share_addr = NULL; - } -} - -/******************************************************************************* -* MODULE : VehicleSensWriteDataGpsInterruptSignal -* ABSTRACT : Writing of data -* FUNCTION : Writing Data to Shared Memory -* ARGUMENT : DID : Data ID -* NOTE : -* RETURN : RET_NORMAL :Normal -* : RET_ERROR :Abnormality -******************************************************************************/ -static RET_API VehicleSensWriteDataGpsInterruptSignal(DID ul_did) { - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - static GPS_INTERRUPT *gpsInterruptSharedAddr = NULL; /* Store Shared Memory Address */ - static SemID sem_id = 0; /* ID of shared memory exclusive semaphore */ - - VEHICLESENS_DATA_MASTER_GPS_INTERRUPT_SIGNAL pst_data; - - RET_API l_ret = RET_NORMAL; /* Return of the functions */ - RET_API l_ret_api; /* Return of the functions */ - - - /* Get Semaphore ID */ - if (sem_id == 0) { - sem_id = _pb_CreateSemaphore(const_cast<char *>(GPS_INTERRUPT_SIGNAL_SEMAPHO_NAME)); - } - - if (sem_id != 0) { - /* Semaphore ID successfully acquired */ - l_ret_api = _pb_SemLock(sem_id); /* Semaphore Lock */ - - if (l_ret_api == RET_NORMAL) { - /* Semaphore lock successful */ - - /* When the shared memory is not linked */ - if (gpsInterruptSharedAddr == NULL) { - /* Link to shared memory */ - /* #QAC confirmation Rule11.4 Use structure for member reference(Cast according to shared memory link IF) */ - VehicleSensLinkSharedMemory(const_cast<char *>(GPS_INTERRUPT_SIGNAL_SHARE_NAME), - reinterpret_cast<void **>(&gpsInterruptSharedAddr)); - } - - if (gpsInterruptSharedAddr != NULL) { - /* The link to shared memory is successful. */ - switch (ul_did) { - case VEHICLE_DID_MAIN_GPS_INTERRUPT_SIGNAL: - { - /* Get data from data master */ - VehicleSensGetDataMasterMainGpsInterruptSignal(ul_did, 0, &pst_data); - - /* Writing Data to Shared Memory */ - gpsInterruptSharedAddr->_CWORD102__interrupt = pst_data.uc_data; - break; - } - case VEHICLE_DID_SYS_GPS_INTERRUPT_SIGNAL: - { - /* Get data from data master */ - VehicleSensGetDataMasterSysGpsInterruptSignal(ul_did, 0, &pst_data); - - /* Writing Data to Shared Memory */ - gpsInterruptSharedAddr->_CWORD56__interrupt = pst_data.uc_data; - break; - } - default: - l_ret = RET_ERROR; - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "DID is unknown. \r\n"); - break; - } - - } else { - l_ret = RET_ERROR; - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "gpsInterruptSharedAddr == NULL \r\n"); - } - - /* Semaphore unlock */ - (void)_pb_SemUnlock(sem_id); - } else { - l_ret = RET_ERROR; - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "_pb_SemLock failed"); - } - } else { - l_ret = RET_ERROR; - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "sem_id == 0"); - } - - return l_ret; -} - -/******************************************************************************* -* MODULE : VehicleSensWriteDataGyroConnectStatus -* ABSTRACT : Writing of data -* FUNCTION : Writing Data to Shared Memory -* ARGUMENT : DID : Data ID -* NOTE : -* RETURN : RET_NORMAL :Normal -* : RET_ERROR :Abnormality -******************************************************************************/ -static RET_API VehicleSensWriteDataGyroConnectStatus(DID ul_did) { - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - static u_int8 *gyroConnectSharedAddr = NULL; /* Store Shared Memory Address */ - static SemID sem_id = 0; /* ID of shared memory exclusive semaphore */ - - VEHICLESENS_DATA_MASTER_GYRO_CONNECT_STATUS pst_data; - - RET_API l_ret = RET_NORMAL; /* Return of the functions */ - RET_API l_ret_api; /* Return of the functions */ - - /* Get Semaphore ID */ - if (sem_id == 0) { - sem_id = _pb_CreateSemaphore(const_cast<char *>(GYRO_CONNECT_STATUS_SEMAPHO_NAME)); - } - - if (sem_id != 0) { - /* Semaphore ID successfully acquired */ - l_ret_api = _pb_SemLock(sem_id); /* Semaphore Lock */ - - if (l_ret_api == RET_NORMAL) { - /* Semaphore lock successful */ - - /* When the shared memory is not linked */ - if (gyroConnectSharedAddr == NULL) { - /* Link to shared memory */ - /* #QAC confirmation Rule11.4 Use structure for member reference(Cast according to shared memory link IF) */ - VehicleSensLinkSharedMemory(const_cast<char *>(GYRO_CONNECT_STATUS_SHARE_NAME), - reinterpret_cast<void **>(&gyroConnectSharedAddr)); - } - - if (gyroConnectSharedAddr != NULL) { - /* The link to shared memory is successful. */ - - /* Get data from data master */ - VehicleSensGetDataMasterGyroConnectStatus(ul_did, 0, &pst_data); - - /* Writing Data to Shared Memory */ - *gyroConnectSharedAddr = pst_data.uc_data; - - } else { - l_ret = RET_ERROR; - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, - "gyroConnectSharedAddr == NULL \r\n"); - } - - /* Semaphore unlock */ - (void)_pb_SemUnlock(sem_id); - } else { - l_ret = RET_ERROR; - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "_pb_SemLock failed"); - } - } else { - l_ret = RET_ERROR; - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "sem_id == 0"); - } - - return l_ret; -} - -/******************************************************************************* -* MODULE : VehicleSensWriteDataValidEphemerisNum -* ABSTRACT : Write effective ephemeris number at shutdown -* FUNCTION : Write effective ephemeris number at shutdown to shared memory -* ARGUMENT : u_int8 valid_ephemer_isnum : Number of effective ephemeris written to shared memory during shutdown -* NOTE : -* RETURN : RET_NORMAL :Normal -* : RET_ERROR :Abnormality -******************************************************************************/ -RET_API VehicleSensWriteDataValidEphemerisNum(u_int8 valid_ephemer_isnum) { - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - static u_int8 *shared_addr = NULL; /* Store Shared Memory Address */ - static SemID sem_id = 0; /* ID of shared memory exclusive semaphore */ - - RET_API l_ret; /* Return of the functions */ - RET_API l_ret_api; /* Return of the functions */ - - /* Get Semaphore ID */ - if (sem_id == 0) { - sem_id = _pb_CreateSemaphore(const_cast<char *>(EPHEMERIS_NUM_SEMAPHO_NAME)); - } - - if (sem_id != 0) { - /* Semaphore ID successfully acquired */ - l_ret_api = _pb_SemLock(sem_id); /* Semaphore Lock */ - - if (l_ret_api == RET_NORMAL) { - /* Semaphore lock successful */ - - /* When the shared memory is not linked */ - if (shared_addr == NULL) { - /* Link to shared memory */ - /* #QAC confirmation Rule11.4 Use structure for member reference(Cast according to shared memory link IF) */ - VehicleSensLinkSharedMemory(const_cast<char *>(EPHEMERIS_NUM_SHARE_NAME), - reinterpret_cast<void **>(&shared_addr)); - } - - if (shared_addr != NULL) { - *shared_addr = valid_ephemer_isnum; - l_ret = RET_NORMAL; - - } else { - l_ret = RET_ERROR; - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "shared_addr == NULL \r\n"); - } - - /* Semaphore unlock */ - l_ret_api = _pb_SemUnlock(sem_id); - if (l_ret_api != RET_NORMAL) { - /* Semaphore unlock failure */ - l_ret = RET_ERROR; - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "_pb_SemUnlock failed"); - } - } else { - /* Semaphore ID acquisition failure */ - l_ret = RET_ERROR; - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "_pb_SemLock failed"); - } - } else { - l_ret = RET_ERROR; - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "sem_id == 0"); - } - - return l_ret; -} - -/******************************************************************************* -* MODULE : VehicleSensWriteDataLocalTime -* ABSTRACT : Writing Local Time at Shutdown -* FUNCTION : Write local time on shutdown to shared memory -* ARGUMENT : None -* NOTE : -* RETURN : RET_NORMAL :Acquisition normal -* : RET_ERROR :Acquisition anomaly -******************************************************************************/ -static RET_API VehicleSensWriteDataLocalTime(void) { - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - static LOCALTIME *shared_addr = NULL; /* Store Shared Memory Address */ - static SemID sem_id = 0; /* ID of shared memory exclusive semaphore */ - - RET_API l_ret; /* Return of the functions */ - RET_API l_ret_api; /* Return of the functions */ - - LOCALTIME LocalTime; - - /* Get Semaphore ID */ - if (sem_id == 0) { - sem_id = _pb_CreateSemaphore(const_cast<char *>(LOCALTIME_SEMAPHO_NAME)); - } - - if (sem_id != 0) { - /* Semaphore ID successfully acquired */ - l_ret_api = _pb_SemLock(sem_id); /* Semaphore Lock */ - - if (l_ret_api == RET_NORMAL) { - /* Semaphore lock successful */ - - /* When the shared memory is not linked */ - if (shared_addr == NULL) { - /* Link to shared memory */ - /* #QAC confirmation Rule11.4 Use structure for member reference(Cast according to shared memory link IF) */ - VehicleSensLinkSharedMemory(const_cast<char *>(LOCALTIME_SHARE_NAME), - reinterpret_cast<void **>(&shared_addr)); - } - - if (shared_addr != NULL) { - /* The link to shared memory is successful. */ - - /* Acquires data from the non-volatile memory and writes it to the shared memory. */ - l_ret_api = VehicleSensReadNVLocalTime(&LocalTime); - if (l_ret_api == RET_NORMAL) { - *shared_addr = LocalTime; - l_ret = RET_NORMAL; - } else { - /* When data acquisition from non-volatile memory fails,Set an invalid value */ - (*shared_addr).status = CLOCK_INVALID; - (*shared_addr).year = 0xFFFFU; /* invalid */ - (*shared_addr).month = 255U; /* invalid */ - (*shared_addr).day = 255U; /* invalid */ - (*shared_addr).hour = 255U; /* invalid */ - (*shared_addr).min = 255U; /* invalid */ - (*shared_addr).sec = 255U; /* invalid */ - l_ret = RET_NORMAL; - } - - } else { - l_ret = RET_ERROR; - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "shared_addr == NULL \r\n"); - } - - /* Semaphore unlock */ - l_ret_api = _pb_SemUnlock(sem_id); - if (l_ret_api != RET_NORMAL) { - /* Semaphore unlock failure */ - l_ret = RET_ERROR; - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "_pb_SemUnlock failed"); - } - } else { - /* Semaphore ID acquisition failure */ - l_ret = RET_ERROR; - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "_pb_SemLock failed"); - } - } else { - l_ret = RET_ERROR; - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "sem_id == 0"); - } - - return l_ret; -} - -/******************************************************************************* -* MODULE : VehicleSensWriteDataLonLat -* ABSTRACT : Write position at shutdown -* FUNCTION : Write shutdown position to shared memory -* ARGUMENT : None -* NOTE : -* RETURN : RET_NORMAL :Successful acquisition -* : RET_ERROR :Failed to acquire -******************************************************************************/ -static RET_API VehicleSensWriteDataLonLat(void) { - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - static LONLAT *shared_addr = NULL; /* Store Shared Memory Address */ - static SemID sem_id = 0; /* ID of shared memory exclusive semaphore */ - - RET_API l_ret; /* Return of the functions */ - RET_API l_ret_api; /* Return of the functions */ - - LONLAT lonlat; /* Position */ - - /* Get Semaphore ID */ - if (sem_id == 0) { - sem_id = _pb_CreateSemaphore(const_cast<char *>(LONLAT_SEMAPHO_NAME)); - } - - if (sem_id != 0) { - /* Semaphore ID successfully acquired */ - l_ret_api = _pb_SemLock(sem_id); /* Semaphore Lock */ - - if (l_ret_api == RET_NORMAL) { - /* Semaphore lock successful */ - - /* When the shared memory is not linked */ - if (shared_addr == NULL) { - /* Link to shared memory */ - /* #QAC confirmation Rule11.4 Use structure for member reference(Cast according to shared memory link IF) */ - VehicleSensLinkSharedMemory(const_cast<char *>(LONLAT_SHARE_NAME), - reinterpret_cast<void **>(&shared_addr)); - } - - if (shared_addr != NULL) { - /* The link to shared memory is successful. */ - - /* Acquires data from the non-volatile memory and writes it to the shared memory. */ - l_ret_api = VehicleSensReadNVLonLat(&lonlat); - if (l_ret_api == RET_NORMAL) { - *shared_addr = lonlat; - l_ret = RET_NORMAL; - } else { - /* When data acquisition from non-volatile memory fails */ - (*shared_addr).latitude = SENSORLOCATION_LATITUDE_INIT_VALUE; - (*shared_addr).longitude = SENSORLOCATION_LONGITUDE_INIT_VALUE; - l_ret = RET_NORMAL; - } - - } else { - l_ret = RET_ERROR; - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "shared_addr == NULL \r\n"); - } - - /* Semaphore unlock */ - l_ret_api = _pb_SemUnlock(sem_id); - if (l_ret_api != RET_NORMAL) { - /* Semaphore unlock failure */ - l_ret = RET_ERROR; - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "_pb_SemUnlock failed"); - } - } else { - /* Semaphore ID acquisition failure */ - l_ret = RET_ERROR; - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "_pb_SemLock failed"); - } - } else { - l_ret = RET_ERROR; - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "sem_id == 0"); - } - - return l_ret; -} - -/******************************************************************************* -* MODULE : VehicleSensWriteSharedMemory -* ABSTRACT : Write Shared Memory -* FUNCTION : Write Shared Memory -* ARGUMENT : DID : Data ID -* RETURN : None -* NOTE : -******************************************************************************/ -void VehicleSensWriteSharedMemory(DID ul_did) { - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - switch (ul_did) { - case VEHICLE_DID_MAIN_GPS_INTERRUPT_SIGNAL: - case VEHICLE_DID_SYS_GPS_INTERRUPT_SIGNAL: - { - (void)VehicleSensWriteDataGpsInterruptSignal(ul_did); - break; - } - case VEHICLE_DID_GYRO_CONNECT_STATUS: - { - (void)VehicleSensWriteDataGyroConnectStatus(ul_did); - break; - } - default: - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "DID is unknown. \r\n"); - break; - } -} -// LCOV_EXCL_STOP diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Thread.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleSens_Thread.cpp deleted file mode 100755 index 8dc3922..0000000 --- a/vehicleservice/positioning/server/src/Sensor/VehicleSens_Thread.cpp +++ /dev/null @@ -1,2144 +0,0 @@ -/* - * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/******************************************************************************* - * File name :VehicleSens_Thread.cpp - * System name :GPF - * Subsystem name :Vehicle sensor process - * Program name :Vehicle sensor thread - * Module configuration :VehicleSensThread() Vehicle Sensor Thread Domain Functions - * :VehicleSensThreadInit() Vehicle sensor thread initials - * :VehicleSensDeliveryEntry() Vehicle sensor information delivery registration - * :VehicleSensGetVehicleData() Vehicle sensor information acquisition - * :VehicleSensWatchStopPage() Vehicle sensor interruption monitoring - * :VehicleSensPkgDeliveryEntry() Vehicle sensor information package delivery registration - * :VehicleSensGetVehiclePkgData() Vehicle sensor information package data acquisition - * :VehicleSensLineSensDataDelivery() LineSensor Vehicle Signal Notification - * :VehicleSensGpsDataDelivery() GPS data notification - * :VehicleSens_CanDataDelivery() CAN data delivery notice - * :VehicleSensDataMasterSetN() Data master set notification process(Callback function) - * :VehicleSensSetVehicleData() GPS command request processing - ******************************************************************************/ -#include "VehicleSens_Thread.h" -#include <vehicle_service/positioning_base_library.h> -#include <other_service/VP_GetEnv.h> -#include "POS_private.h" -#include "positioning_common.h" -#include "SensorLog.h" -#include "VehicleUtility.h" -#include "VehicleSensor_Thread.h" - -#include "VehicleIf.h" - -/*************************************************/ -/* Global variable */ -/*************************************************/ -static VEHICLE_MSG_BUF g_wait_for_resp_msg; /* Message waiting to receive a response */ -static PFUNC_DMASTER_SET_N g_wait_for_resp_set_n; /* Response waiting data master set */ -static BOOL g_sent_fst_pkg_delivery_ext; /* Initial expansion package data delivery status */ - -static VEHICLESENS_VEHICLE_SPEED_INFO g_vehicle_speed_info; - -uint32_t gPseudoSecClockCounter = 0u; - -/*************************************************/ -/* Function prototype */ -/*************************************************/ -static void VehicleSensInitDataDisrptMonitor(void); -static void VehicleSensDataDisrptMonitorProc(DID did); -static void VehicleSensRcvMsgTout(TimerToutMsg* rcv_msg); - -static void VehilceSens_InitVehicleSpeed(void); -static void VehicleSens_StoreVehicleSpeed(VEHICLESENS_VEHICLE_SPEED_DAT* pVehicleSpeed); -static void VehicleSens_LoadVehicleSpeed(VEHICLESENS_VEHICLE_SPEED_INFO* pVehicleSpeedInfo); -static RET_API VehicleSens_CatNmeaSentenceFieldWithDelimiter(char* str1, const size_t size, const char* str2, const size_t n); -static RET_API VehicleSens_CatNmeaSentenceFieldWithoutDelimiter(char* str1, const size_t size, const char* str2, const size_t n); -static inline RET_API VehicleSens_GeneratePASCDFieldId(char* pascd, size_t size); -static inline RET_API VehicleSens_GeneratePASCDFieldTimestamp(char* pascd, size_t size); -static inline RET_API VehicleSens_GeneratePASCDFieldSensorType(char* pascd, size_t size); -static inline RET_API VehicleSens_GeneratePASCDFieldTransmissionState(char* pascd, size_t size); -static inline RET_API VehicleSens_GeneratePASCDFieldSlipDetect(char* pascd, size_t size); -static inline RET_API VehicleSens_GeneratePASCDFieldSampleCount(char* pascd, size_t size); -static inline RET_API VehicleSens_GeneratePASCDFieldTimeOffsetNSpeed(char* pascd, size_t size); -static inline RET_API VehicleSens_GeneratePASCDFieldChecksum(char* pascd, size_t size); -static inline RET_API VehicleSens_GeneratePASCDFieldCRLF(char* pascd, size_t size); -static RET_API VehicleSens_DeriveTransmissionStateFor_CWORD27_(VEHICLESENS_TRANSMISSION_PKG* pPkg); - - -/******************************************************************************* -* MODULE : VehicleSensThread -* ABSTRACT : Vehicle Sensor Thread Domain Functions -* FUNCTION : Main processing -* ARGUMENT : lpv_para : -* NOTE : -* RETURN : -******************************************************************************/ -EFrameworkunifiedStatus VehicleSensThread(HANDLE h_app) { - RET_API ret_api = RET_NORMAL; /* Return Values of System API Functions */ - T_APIMSG_MSGBUF_HEADER *p; /* Message header */ - RET_API ret_val; /* Return value of initialization processing */ - VEHICLE_MSG_DELIVERY_ENTRY delivery_entry; - - static u_int8 msg_buf[MAX_MSG_BUF_SIZE]; /* message buffer */ - - void* p_msg_buf = &msg_buf; - LSDRV_MSG_LSDATA_G** p_lsdrv_msg; - VEHICLE_MSG_BUF** p_vehicle_msg; - POS_MSGINFO *p_pos_msg; - - - - p_lsdrv_msg = reinterpret_cast<LSDRV_MSG_LSDATA_G**>(&p_msg_buf); - p_vehicle_msg = reinterpret_cast<VEHICLE_MSG_BUF**>(&p_msg_buf); - - VehicleUtilityInitTimer(); - (void)PosSetupThread(h_app, ETID_POS_MAIN); - - memset(&(delivery_entry), 0, sizeof(VEHICLE_MSG_DELIVERY_ENTRY)); - - /* Thread initialization process */ - ret_val = VehicleSensThreadInit(); - - gPseudoSecClockCounter = 0u; - - if (RET_NORMAL == ret_val) { // LCOV_EXCL_BR_LINE 6: always be RET_NORMAL - while (1) { - /* Message reception processing */ - p_msg_buf = &msg_buf; - ret_api = _pb_RcvMsg(PNO_VEHICLE_SENSOR, sizeof(msg_buf), &p_msg_buf, RM_WAIT); - - /* Internal debug log output */ - FRAMEWORKUNIFIEDLOG(ZONE_26, __FUNCTION__, - "[ret_api = 0x%x]", - ret_api); - - /* When the message is received successfully */ - if (ret_api == RET_RCVMSG) { - p = reinterpret_cast<T_APIMSG_MSGBUF_HEADER *>(p_msg_buf); - - switch (p->hdr.cid) { // LCOV_EXCL_BR_LINE 200: some DID is not used - case CID_VEHICLEIF_DELIVERY_ENTRY: - { - memcpy(&(delivery_entry), &(p_msg_buf), sizeof(VEHICLE_MSG_DELIVERY_ENTRY)); - - /* Sort by received DID */ - switch (delivery_entry.data.did) { // LCOV_EXCL_BR_LINE 200: DR DID is not used - case VEHICLE_DID_DR_ALTITUDE : - case VEHICLE_DID_DR_LATITUDE : - case VEHICLE_DID_DR_SPEED : - case VEHICLE_DID_DR_HEADING : - case VEHICLE_DID_DR_GYRO_SCALE_FACTOR_LEVEL : - case VEHICLE_DID_DR_SPEED_PULSE_SCALE_FACTOR_LEVEL : - { - // LCOV_EXCL_START 8: dead code - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - VehicleSensDrDeliveryEntry((const VEHICLE_MSG_DELIVERY_ENTRY *)p_msg_buf); - // LCOV_EXCL_STOP - } - break; - default: - /* Vehicle sensor information delivery registration */ - VehicleSensDeliveryEntry((const VEHICLE_MSG_DELIVERY_ENTRY *)p_msg_buf); - break; - } - break; - } - case CID_VEHICLEIF_GET_VEHICLE_DATA: - { - /* Vehicle sensor information acquisition */ - VehicleSensGetVehicleData((const VEHICLE_MSG_GET_VEHICLE_DATA *)p_msg_buf); - break; - } - case CID_LINESENS_VEHICLE_DATA: - { - /* LineSensor Vehicle Signal Notification */ - VehicleSensLineSensDataDelivery((const LSDRV_MSG_LSDATA *)p_msg_buf, - (PFUNC_DMASTER_SET_N)VehicleSensDataMasterSetN); - break; - } - case CID_LINESENS_VEHICLE_DATA_G: - { - /* Data disruption monitoring process */ - VehicleSensDataDisrptMonitorProc( - (reinterpret_cast<LSDRV_MSG_LSDATA_G*>(*p_lsdrv_msg))->st_para.st_data[0].ul_did); - VehicleSensLineSensDataDeliveryG((const LSDRV_MSG_LSDATA_G *)p_msg_buf, - (PFUNC_DMASTER_SET_N)VehicleSensDataMasterSetN); - break; - } - case CID_LINESENS_VEHICLE_DATA_GYRO_TROUBLE: - { - // LCOV_EXCL_START 8: dead code - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - /* Gyro Failure Status Notification */ - VehicleSensLineSensDataDeliveryGyroTrouble((const LSDRV_MSG_LSDATA_GYRO_TROUBLE *)p_msg_buf, - (PFUNC_DMASTER_SET_N)VehicleSensDataMasterSetN); - break; - // LCOV_EXCL_STOP - } - case CID_LINESENS_VEHICLE_DATA_SYS_GPS_INTERRUPT_SIGNAL: - { - // LCOV_EXCL_START 8: dead code - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - /* SYS GPS interrupt notification */ - VehicleSensLineSensDataDeliverySysGpsInterruptSignal( - (const LSDRV_MSG_LSDATA_GPS_INTERRUPT_SIGNAL *)p_msg_buf, - (PFUNC_DMASTER_SET_SHARED_MEMORY)VehicleSensDataMasterSetSharedMemory); - break; - // LCOV_EXCL_STOP - } - case CID_LINESENS_VEHICLE_DATA_GYRO_CONNECT_STATUS: - { - // LCOV_EXCL_START 8: dead code - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - /* Gyro Failure Status Notification */ - VehicleSensLineSensDataDeliveryGyroConnectStatus( - (const LSDRV_MSG_LSDATA_GYRO_CONNECT_STATUS *)p_msg_buf, - (PFUNC_DMASTER_SET_SHARED_MEMORY)VehicleSensDataMasterSetSharedMemory); - break; - // LCOV_EXCL_STOP - } - case CID_LINESENS_VEHICLE_DATA_GPS_ANTENNA_STATUS: - { - // LCOV_EXCL_START 8: dead code - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - /* GPS antenna failure status notification */ - VehicleSensLineSensDataDeliveryGpsAntennaStatus( - (const LSDRV_MSG_LSDATA_GPS_ANTENNA_STATUS *)p_msg_buf, - (PFUNC_DMASTER_SET_N)VehicleSensDataMasterSetN); - break; - // LCOV_EXCL_STOP - } - case CID_SENSORIF_PKG_DELIVERY_ENTRY_EXT: - { - /* Vehicle Sensor Information Extended Package Delivery Registration */ - VehicleSensPkgDeliveryEntryExt((const SENSOR_MSG_DELIVERY_ENTRY *)p_msg_buf); - break; - } - case CID_LINESENS_VEHICLE_DATA_FST: - { - /* LineSensor Vehicle Initial Sensor Signal Notification */ - VehicleSensLineSensDataDeliveryFstG((const LSDRV_MSG_LSDATA_FST *)p_msg_buf, - (PFUNC_DMASTER_SET_N)VehicleSensDataMasterSetN); - break; - } - case CID_GPS_DATA: - { - /* GPS information notification */ - VehicleSensGpsDataDelivery(reinterpret_cast<SENSOR_MSG_GPSDATA *>(p_msg_buf), - (PFUNC_DMASTER_SET_N)VehicleSensDataMasterSetN, - (PFUNC_DMASTER_SET_SHARED_MEMORY)VehicleSensDataMasterSetSharedMemory); - break; - } - case CID_POSIF_SET_DATA: - { - p_pos_msg = - reinterpret_cast<POS_MSGINFO*>((reinterpret_cast<VEHICLE_MSG_BUF*>(*p_vehicle_msg))->data); - /* Data disruption monitoring process */ - VehicleSensDataDisrptMonitorProc(p_pos_msg->did); - - /* Data Setting Notification */ - VehicleSensCommonDataDelivery((const VEHICLE_MSG_BUF *)p_msg_buf, - (PFUNC_DMASTER_SET_N)VehicleSensDataMasterSetN); - break; - } - case CID_GPS_RETTIMESETTING: - { - /* GPS time setting result notification */ - VehicleSensGpsTimeDelivery((const VEHICLE_MSG_BUF *)p_msg_buf); - break; - } - case CID_DEAD_RECKONING_GPS_DATA : /* GPS data distribution for DR */ - case CID_DEAD_RECKONING_SENS_DATA : /* Sensor Data Delivery for DR */ - case CID_DEAD_RECKONING_SENS_FST_DATA : /* Initial Sensor Data Delivery for DR */ - { - // LCOV_EXCL_START 8: dead code - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - VehicleSensDrRcvMsg((const DEAD_RECKONING_RCVDATA *)p_msg_buf); - break; - // LCOV_EXCL_STOP - } - case CID_VEHICLEIF_GET_DR_DATA : - { - // LCOV_EXCL_START 8: dead code - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - /* Vehicle sensor information acquisition */ - DeadReckoningGetDRData((const DEADRECKONING_MSG_GET_DR_DATA *)p_msg_buf); - break; - // LCOV_EXCL_STOP - } - case CID_DR_MAP_MATCHING_DATA : /* Map matching information */ - { - // LCOV_EXCL_START 8: dead code - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - DeadReckoningSetMapMatchingData((const DR_MSG_MAP_MATCHING_DATA *)p_msg_buf); - break; - // LCOV_EXCL_STOP - } - case CID_DR_CLEAR_BACKUP_DATA : /* Clear backup data */ - { - // LCOV_EXCL_START 8: dead code - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - DeadReckoningClearBackupData((const DR_MSG_CLEAR_BACKUP_DATA*)p_msg_buf); - break; - // LCOV_EXCL_STOP - } - case CID_VEHICLEDEBUG_LOG_GET : /* Log acquisition request */ - { - // LCOV_EXCL_START 8: dead code - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - VehicleSensGetLog((const VEHICLEDEBUG_MSG_BUF *)p_msg_buf); - break; - // LCOV_EXCL_STOP - } - case CID_VEHICLEDEBUG_LOG_SET : /* Log Setting Request */ - { - // LCOV_EXCL_START 8: dead code - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - VehicleSensSetLog((const VEHICLEDEBUG_MSG_BUF *)p_msg_buf); - break; - // LCOV_EXCL_STOP - } - case CANINPUT_CID_LOCALTIME_NOTIFICATION : /* CAN information acquisition */ - { - // LCOV_EXCL_START 8: dead code - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - VehicleSensWriteLocalTime((const CANINPUT_MSG_INFO*)p_msg_buf); - break; - // LCOV_EXCL_STOP - } - case CID_EPH_NUM_NOTIFICATION : /* Set effective ephemeris count at shutdown */ - { - // LCOV_EXCL_START 8: dead code - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - VehicleSensSetEphNumSharedMemory((const SENSOR_MSG_GPSDATA *)p_msg_buf); - break; - // LCOV_EXCL_STOP - } - case CID_SENSORIF__CWORD82__REQUEST: - { - // LCOV_EXCL_START 8: dead code - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - /* Requests to send GPS _CWORD82_ commands */ - VehicleSensSetVehicleData((const VEHICLE_MSG_SEND *)p_msg_buf); - break; - // LCOV_EXCL_STOP - } - case CID_THREAD_STOP_REQ: - { - /* Thread stop processing */ - VehicleSensThreadStopProcess(); - break; - } - case CID_TIMER_TOUT: - { - /* Timeout notification reception processing */ - VehicleSensRcvMsgTout(reinterpret_cast<TimerToutMsg*>(p_msg_buf)); - break; - } - default: - break; - } - } else { - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "ret_api != RET_RCVMSG\r\n"); - } - } - } else { - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "VehicleSens: VehicleSens_MainThread Initial Error!! :%d", ret_val); - _pb_Exit(); - } - - return eFrameworkunifiedStatusOK; -} - -/******************************************************************************* -* MODULE : VehicleSensThreadInit -* ABSTRACT : Vehicle sensor thread initials -* FUNCTION : Initial process -* ARGUMENT : void -* NOTE : -* RETURN : CAN data delivery registration result -******************************************************************************/ -RET_API VehicleSensThreadInit(void) { - RET_API ret_val = RET_NORMAL; - - /* Initialization of Vehicle Selection Item List Table */ - VehicleSensInitSelectionItemList(); - - /* Vehicle sensor data master initialization */ - VehicleSensInitDataMaster(); - - /* Initialization of shipping destination management table */ - VehicleSensInitDeliveryCtrlTbl(); - - /* Initialization of shipping destination management table management information */ - VehicleSensInitDeliveryCtrlTblMng(); - - /* Initialization of package delivery management table */ - VehicleSensInitPkgDeliveryTblMng(); - - /* Initialization of non-volatile access function block */ - VehicleSensFromAccessInitialize(); - - /* Clear message information waiting to receive a response */ - (void)memset(&g_wait_for_resp_msg, 0x00, sizeof(VEHICLE_MSG_BUF)); - g_wait_for_resp_set_n = NULL; - g_sent_fst_pkg_delivery_ext = FALSE; /* Initial expansion package data undelivered */ - - VehilceSens_InitVehicleSpeed(); /* for PASCD */ - - /* Start of data interruption monitoring */ - VehicleSensInitDataDisrptMonitor(); - return ret_val; -} - -/******************************************************************************* - * MODULE : VehicleSensDeliveryEntry - * ABSTRACT : Vehicle sensor information delivery registration - * FUNCTION : - * ARGUMENT : *msg : message buffer - * NOTE : - * RETURN : void - ******************************************************************************/ -void VehicleSensDeliveryEntry(const VEHICLE_MSG_DELIVERY_ENTRY *msg) { - int32 event_val; - EventID event_id; - - /* Call the process of creating the delivery destination management table */ - event_val = static_cast<int32>(VehicleSensEntryDeliveryCtrl(msg)); - - /* Internal debug log output */ - FRAMEWORKUNIFIEDLOG(ZONE_26, __FUNCTION__, "+"); - - /* Event Generation */ - event_id = VehicleCreateEvent(msg->data.pno); - - /* Publish Events */ - (void)_pb_SetEvent(event_id, SAPI_EVSET_ABSOLUTE, event_val); - - if (VEHICLE_RET_NORMAL == event_val) { - /* Successful delivery registration */ - /* Deliver data for the first time */ - VehicleSensFirstDelivery((PNO)(msg->data.pno), (DID)(msg->data.did)); - } - - /* Event deletion */ - (void)VehicleDeleteEvent(event_id); - - /* Internal debug log output */ - FRAMEWORKUNIFIEDLOG(ZONE_26, __FUNCTION__, "-"); -} - -/******************************************************************************* -* MODULE : VehicleSensGetVehicleData -* ABSTRACT : Vehicle sensor information acquisition -* FUNCTION : -* ARGUMENT : *msg : message buffer -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensGetVehicleData(const VEHICLE_MSG_GET_VEHICLE_DATA *msg) { - void *share_top; /* Start address of shared memory */ - u_int32 share_size; /* Size of shared memory area */ - u_int8 get_method; /* Data collection way */ - VEHICLESENS_DATA_MASTER master; /* Data master */ - RET_API ret_api; - int32 ret_val; - int32 event_val; - EventID event_id; - SENSOR_MSG_GPSDATA_DAT gps_master; /* GPS Data Master */ - - /* Check the DID */ - ret_val = VehicleSensCheckDid(msg->data.did); - if (VEHICLESENS_INVALID != ret_val) { // LCOV_EXCL_BR_LINE 6:did always valid - /* DID normal */ - - /* Link to shared memory */ - ret_api = _pb_LinkShareData(const_cast<char *>(VEHICLE_SHARE_NAME), &share_top, &share_size); - if (RET_NORMAL == ret_api) { - /* Acquire the specified data from the data master. */ - get_method = VehicleSensGetSelectionItemList(msg->data.did); - if ((VEHICLESENS_GETMETHOD_GPS == get_method) && - ((msg->data.did != VEHICLE_DID_LOCATION_LONLAT) && - (msg->data.did != VEHICLE_DID_LOCATION_ALTITUDE) && - (msg->data.did != VEHICLE_DID_MOTION_HEADING))) { - /* _CWORD71_ processing speed(Memset modification) */ - /* Retrieval of the data master fails.,Initialize size to 0 to prevent unauthorized writes */ - gps_master.us_size = 0; - VehicleSensGetGpsDataMaster(msg->data.did, get_method, &gps_master); - /* Check the data size */ - if (msg->data.size < gps_master.us_size) { - /* Shared memory error(Insufficient storage size) */ - event_val = VEHICLE_RET_ERROR_OUTOF_MEMORY; - } else { - /* Write data master to shared memory */ - PosSetShareData(share_top, - msg->data.offset, (const void *)&gps_master.uc_data, gps_master.us_size); - - /* Set Successful Completion */ - event_val = VEHICLE_RET_NORMAL; - SensLogWriteOutputData(SENSLOG_DATA_O_UNSPECIFIED, - msg->data.did, msg->data.pno, - reinterpret_cast<uint8_t *>(&(gps_master.uc_data[0])), - gps_master.us_size, SENSLOG_RES_SUCCESS); - } - } else { - (void)memset(reinterpret_cast<void *>(&master), 0, sizeof(VEHICLESENS_DATA_MASTER)); - VehicleSensGetDataMaster(msg->data.did, get_method, &master); - - /* Check the data size */ - if (msg->data.size < master.us_size) { - /* Shared memory error(Insufficient storage size) */ - event_val = VEHICLE_RET_ERROR_OUTOF_MEMORY; - } else { - /* Write data master to shared memory */ - PosSetShareData(share_top, - msg->data.offset, (const void *)master.uc_data, master.us_size); - - /* Set Successful Completion */ - event_val = VEHICLE_RET_NORMAL; - SensLogWriteOutputData(SENSLOG_DATA_O_UNSPECIFIED, - msg->data.did, msg->data.pno, - reinterpret_cast<uint8_t *>(&(master.uc_data[0])), - master.us_size, SENSLOG_RES_SUCCESS); - } - } - } else { - /* Shared memory error */ - event_val = VEHICLE_RET_ERROR_OUTOF_MEMORY; - } - } else { - /* DID error */ - event_val = VEHICLE_RET_ERROR_DID; - } - - /* Event Generation */ - event_id = VehicleCreateEvent(msg->data.pno); - - /* Publish Events */ - ret_api = _pb_SetEvent(event_id, SAPI_EVSET_ABSOLUTE, event_val); - if (RET_NORMAL != ret_api) { - /* Event issuance failure */ - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "_pb_SetEvent ERROR!! [ret_api = %d]", ret_api); - } - - /* Event deletion */ - (void)VehicleDeleteEvent(event_id); - - return; -} - -/******************************************************************************* -* MODULE : VehicleSensWatchStopPage -* ABSTRACT : Vehicle sensor interruption monitoring -* FUNCTION : -* ARGUMENT : *msg : message buffer -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensWatchStopPage(const VEHICLE_MSG_WATCH_STOPPAGE *msg) { // LCOV_EXCL_START 8 : dead code - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - /* Not used(Delete Used Functions After Investigation) */ -} -// LCOV_EXCL_STOP - -/******************************************************************************* -* MODULE : VehicleSensPkgDeliveryEntry -* ABSTRACT : Vehicle sensor information package delivery registration -* FUNCTION : -* ARGUMENT : *msg : message buffer -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensPkgDeliveryEntry(const SENSOR_MSG_DELIVERY_ENTRY *msg) { // LCOV_EXCL_START 8 : dead code - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - int32 event_val; - EventID event_id; - - /* Call the process of creating the delivery destination management table */ - event_val = static_cast<int32>(VehicleSensEntryPkgDeliveryCtrl(msg , VEHICLESENS_EXT_OFF)); - /* #Polaris_003 */ - - /* Event Generation */ - event_id = PosCreateEvent(msg->data.pno); - - /* Publish Events */ - (void)_pb_SetEvent(msg->data.event_id, SAPI_EVSET_ABSOLUTE, event_val); - - if (VEHICLE_RET_NORMAL == event_val) { - /* Successful delivery registration */ - /* Deliver package data for the first time */ - VehicleSensFirstPkgDelivery(&msg->data); - } - - /* Event deletion */ - (void)PosDeleteEvent(event_id); -} -// LCOV_EXCL_STOP - -#if CONFIG_SENSOR_EXT_VALID /* Initial Sensor Support */ -/******************************************************************************* -* MODULE : VehicleSensPkgDeliveryEntryExt -* ABSTRACT : Vehicle Sensor Information Extended Package Delivery Registration -* FUNCTION : -* ARGUMENT : *msg : message buffer -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensPkgDeliveryEntryExt(const SENSOR_MSG_DELIVERY_ENTRY *msg) { - int32 event_val; - - /* Internal debug log output */ - FRAMEWORKUNIFIEDLOG(ZONE_26, __FUNCTION__, "+"); - - /* Call the process of creating the delivery destination management table */ - event_val = static_cast<int32>(VehicleSensEntryPkgDeliveryCtrl(msg , VEHICLESENS_EXT_ON)); - - /* Event Generation */ - (void)PosCreateEvent(msg->data.pno); - - /* Publish Events */ - (void)_pb_SetEvent(msg->data.event_id, SAPI_EVSET_ABSOLUTE, event_val); - - if (VEHICLE_RET_NORMAL == event_val) { - /* Successful delivery registration */ - /* Provide initial expansion package data delivery */ - VehicleSensFirstPkgDeliveryExt(&msg->data); - - /* Initial expansion package data delivered */ - g_sent_fst_pkg_delivery_ext = TRUE; - - FRAMEWORKUNIFIEDLOG(ZONE_26, __FUNCTION__, - "FirstPkgDeliveryExt call.[%d]", - g_sent_fst_pkg_delivery_ext); /* TODO */ - } - - /* Internal debug log output */ - FRAMEWORKUNIFIEDLOG(ZONE_26, __FUNCTION__, "-"); -} - -#else -/******************************************************************************* -* MODULE : VehicleSensPkgDeliveryEntryError -* ABSTRACT : Vehicle Sensor Information Extended Package Delivery Registration -* FUNCTION : -* ARGUMENT : *msg : message buffer -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensPkgDeliveryEntryError(const SENSOR_MSG_DELIVERY_ENTRY *msg) { - RET_API ret_api; - EventID event_id; - - /* Event Generation */ - event_id = PosCreateEvent(msg->data.pno); - - /* Publish Event Set DID Error */ - ret_api = _pb_SetEvent(msg->data.event_id, SAPI_EVSET_ABSOLUTE, VEHICLE_RET_ERROR_DID); -} - -#endif - -/******************************************************************************* -* MODULE : VehicleSensGetVehiclePkgData -* ABSTRACT : Vehicle sensor information package data acquisition -* FUNCTION : -* ARGUMENT : *msg : message buffer -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensGetVehiclePkgData(const SENSOR_MSG_GET_SENSOR_DATA *msg) { // LCOV_EXCL_START 8 : dead code - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert -} -// LCOV_EXCL_STOP - -/******************************************************************************* -* MODULE : VehicleSensLineSensDataDelivery -* ABSTRACT : LineSensor Vehicle Signal Notification -* FUNCTION : -* ARGUMENT : *msg : message buffer -* : p_datamaster_set_n : Data Master Set Notification(Callback function) -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensLineSensDataDelivery(const LSDRV_MSG_LSDATA *msg, PFUNC_DMASTER_SET_N p_datamaster_set_n) { - int32 i; - BOOL sens_ext; - - sens_ext = TRUE; - - for (i = 0; i < msg->st_para.uc_data_num; i++) { - /* Setting Vehicle Signal Data from LineSensor as Data Master */ - VehicleSensSetDataMasterLineSens((const LSDRV_LSDATA *) & (msg->st_para.st_data[i]), - p_datamaster_set_n, sens_ext); - } -} - -/******************************************************************************* -* MODULE : VehicleSensLineSensDataDeliveryG -* ABSTRACT : LineSensor Vehicle Signal Notification -* FUNCTION : -* ARGUMENT : *msg : message buffer -* : p_datamaster_set_n : Data Master Set Notification(Callback function) -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensLineSensDataDeliveryG(const LSDRV_MSG_LSDATA_G *msg, PFUNC_DMASTER_SET_N p_datamaster_set_n) { - int32 i; - BOOL sens_ext; - - sens_ext = TRUE; - if (g_sent_fst_pkg_delivery_ext == TRUE) { - /* Initial Expansion Package Data Delivery,Without storing extended data */ - sens_ext = FALSE; - } - - for (i = 0; i < msg->st_para.uc_data_num; i++) { - /* Setting Vehicle Signal Data from LineSensor as Data Master */ - VehicleSensSetDataMasterLineSensG((const LSDRV_LSDATA_G *) & (msg->st_para.st_data[i]), - p_datamaster_set_n, sens_ext); - } -} - -/******************************************************************************* -* MODULE : VehicleSensLineSensDataDeliveryGyroTrouble -* ABSTRACT : Gyro Failure Status Notification -* FUNCTION : Notify of a gyro failure condition -* ARGUMENT : *msg : message buffer -* : p_datamaster_set_n : Data Master Set Notification(Callback function) -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensLineSensDataDeliveryGyroTrouble(const LSDRV_MSG_LSDATA_GYRO_TROUBLE *msg, PFUNC_DMASTER_SET_N p_datamaster_set_n) { // LCOV_EXCL_START 8 : dead code // NOLINT(whitespace/line_length) - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - /* Setting Gyro Failure Status Data from LineSensor to Data Master */ - VehicleSensSetDataMasterGyroTrouble((const LSDRV_MSG_LSDATA_DAT_GYRO_TROUBLE *)&(msg->st_para), - p_datamaster_set_n); -} -// LCOV_EXCL_STOP - -/******************************************************************************* -* MODULE : VehicleSensLineSensDataDeliverySysGpsInterruptSignal -* ABSTRACT : SYS GPS interrupt notification -* FUNCTION : Notify SYS GPS interrupt signals -* ARGUMENT : *msg : message buffer -* : p_datamaster_set_sharedmemory : Data Master Set Notification(Callback function) -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensLineSensDataDeliverySysGpsInterruptSignal(const LSDRV_MSG_LSDATA_GPS_INTERRUPT_SIGNAL *msg, PFUNC_DMASTER_SET_SHARED_MEMORY p_datamaster_set_sharedmemory) { // LCOV_EXCL_START 8 :dead code // NOLINT(whitespace/line_length) - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - /* Sets the SYS GPS interrupt data from the LineSensor to the data master. */ - VehicleSensSetDataMasterSysGpsInterruptSignal((const LSDRV_MSG_LSDATA_DAT_GPS_INTERRUPT_SIGNAL *)&(msg->st_para), - p_datamaster_set_sharedmemory); -} -// LCOV_EXCL_STOP - -/******************************************************************************* -* MODULE : VehicleSensLineSensDataDeliveryGyroConnectStatus -* ABSTRACT : Gyro Connection Status Notification -* FUNCTION : Notify the state of the gyro connection -* ARGUMENT : *msg : message buffer -* : p_datamaster_set_sharedmemory : Data Master Set Notification(Callback function) -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensLineSensDataDeliveryGyroConnectStatus(const LSDRV_MSG_LSDATA_GYRO_CONNECT_STATUS *msg, PFUNC_DMASTER_SET_SHARED_MEMORY p_datamaster_set_sharedmemory) { // LCOV_EXCL_START 8 : dead code // NOLINT(whitespace/line_length) - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - /* Setting Gyro Connection Status Data from LineSensor to Data Master */ - VehicleSensSetDataMasterGyroConnectStatus((const LSDRV_MSG_LSDATA_DAT_GYRO_CONNECT_STATUS *)&(msg->st_para), - p_datamaster_set_sharedmemory); -} -// LCOV_EXCL_STOP - -/******************************************************************************* -* MODULE : VehicleSensLineSensDataDeliveryGpsAntennaStatus -* ABSTRACT : GPS Antenna Connection Status Notification -* FUNCTION : Notify the GPS antenna connection status -* ARGUMENT : *msg : message buffer -* : p_datamaster_set_n : Data Master Set Notification(Callback function) -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensLineSensDataDeliveryGpsAntennaStatus(const LSDRV_MSG_LSDATA_GPS_ANTENNA_STATUS *msg, PFUNC_DMASTER_SET_N p_datamaster_set_n) { // LCOV_EXCL_START 8 : dead code // NOLINT(whitespace/line_length) - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - /* Setting GPS Antenna Connection Status Data from LineSensor as Data Master */ - VehicleSensSetDataMasterGpsAntennaStatus((const LSDRV_MSG_LSDATA_DAT_GPS_ANTENNA_STATUS *)&(msg->st_para), - p_datamaster_set_n); -} -// LCOV_EXCL_STOP - -#if CONFIG_SENSOR_EXT_VALID /* Initial Sensor Support */ -/******************************************************************************* -* MODULE : VehicleSensLineSensDataDeliveryFst -* ABSTRACT : LineSensor Vehicle Signal Notification(Initial Sensor) -* FUNCTION : -* ARGUMENT : *msg : message buffer -* : p_datamaster_set_n : Data Master Set Notification(Callback function) -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensLineSensDataDeliveryFst(const LSDRV_MSG_LSDATA_FST *msg, PFUNC_DMASTER_SET_N p_datamaster_set_n) { // LCOV_EXCL_START 8 : dead code // NOLINT(whitespace/line_length) - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert -} -// LCOV_EXCL_STOP -#endif - -#if CONFIG_SENSOR_EXT_VALID /* Initial Sensor Support */ -/******************************************************************************* -* MODULE : VehicleSensLineSensDataDeliveryFstG -* ABSTRACT : LineSensor Vehicle Signal Notification(Initial Sensor) -* FUNCTION : -* ARGUMENT : *msg : message buffer -* : p_datamaster_set_n : Data Master Set Notification(Callback function) -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensLineSensDataDeliveryFstG(const LSDRV_MSG_LSDATA_FST *msg, PFUNC_DMASTER_SET_N p_datamaster_set_n) { - /* Internal debug log output */ - FRAMEWORKUNIFIEDLOG(ZONE_26, __FUNCTION__, "+"); - - if (msg == NULL) { // LCOV_EXCL_BR_LINE 6:msg cannot be null - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "msg == NULL\r\n"); // LCOV_EXCL_LINE 8: dead code - } else { - /* Set Vehicle Signal Data from LineSensor (Initial Sensor) as Data Master */ - VehicleSensSetDataMasterLineSensFstG((const LSDRV_MSG_LSDATA_DAT_FST *) & (msg->st_para), - p_datamaster_set_n); - } - - /* Internal debug log output */ - FRAMEWORKUNIFIEDLOG(ZONE_26, __FUNCTION__, "-"); -} -#endif - -/******************************************************************************* -* MODULE : VehicleSensGpsDataDelivery -* ABSTRACT : GPS data notification -* FUNCTION : -* ARGUMENT : *msg : message buffer -* : p_datamaster_set_n : For Data Master Set Notification(Callback function) delivery -* : p_datamaster_set_sharedmemory : Data Master Set Notification (Callback Function) Shared Memory Write -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensGpsDataDelivery(SENSOR_MSG_GPSDATA *msg, - PFUNC_DMASTER_SET_N p_datamaster_set_n, - PFUNC_DMASTER_SET_SHARED_MEMORY p_datamaster_set_sharedmemory) { - /* Setting GPS Data as Data Master */ - if (msg->st_para.ul_did == VEHICLE_DID_MAIN_GPS_INTERRUPT_SIGNAL) { // LCOV_EXCL_BR_LINE 6:DID is not used - // LCOV_EXCL_START 8: dead code - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - /* [PastModel002 Specifications] GPS->_CWORD102_ interrupt or not is obtained from GPS */ - VehicleSensSetDataMasterMainGpsInterruptSignal((const SENSOR_MSG_GPSDATA_DAT *)&(msg->st_para), - p_datamaster_set_sharedmemory); - // LCOV_EXCL_STOP - } else { - FRAMEWORKUNIFIEDLOG(ZONE_27, __FUNCTION__, - "VehicleSensGpsDataDelivery VehicleSensSetDataMasterGps() -->"); - VehicleSensSetDataMasterGps(reinterpret_cast<SENSOR_MSG_GPSDATA_DAT *>(&(msg->st_para)), - p_datamaster_set_n); - FRAMEWORKUNIFIEDLOG(ZONE_27, __FUNCTION__, - "VehicleSensGpsDataDelivery VehicleSensSetDataMasterGps() <--"); - } -} - -/******************************************************************************* -* MODULE : VehicleSensDataMasterSetN -* ABSTRACT : Data master set notification process(Callback function) -* FUNCTION : Call the data delivery process -* ARGUMENT : did : Data ID -* : chg_type : Change type(no change/with change) -* : get_method : Acquisition method(Direct Line/CAN) -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensDataMasterSetN(DID did, u_int8 chg_type, u_int8 get_method) { - - u_int8 chgType; - - chgType = chg_type; - - switch (did) { - case POSHAL_DID_SPEED_KMPH: - { - if (ChkUnitType(UNIT_TYPE_GRADE1) == TRUE) { - /* For creating PASCD Sentence of NMEA */ - - int ret; - VEHICLESENS_VEHICLE_SPEED_DAT stVehicleSpeed; - - ret = clock_gettime(CLOCK_MONOTONIC, &(stVehicleSpeed.ts)); - if (ret != 0) { - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "clock_gettime error:%m"); - } else { - VEHICLESENS_DATA_MASTER stData; - SENSORMOTION_SPEEDINFO_DAT* pSpdInfo; - - VehicleSensGetMotionSpeed(&stData, VEHICLESENS_GETMETHOD_INTERNAL); // LCOV_EXCL_BR_LINE 6:unexpected branch //NOLINT (whitespace/line_length) - pSpdInfo = (SENSORMOTION_SPEEDINFO_DAT*)(stData.uc_data); - - stVehicleSpeed.speed = pSpdInfo->Speed; - - VehicleSens_StoreVehicleSpeed(&stVehicleSpeed); // LCOV_EXCL_BR_LINE 6:unexpected branch //NOLINT (whitespace/line_length) - } - } - - break; - } - case POSHAL_DID_GPS_NMEA: - { - VehilceSens_InitVehicleSpeed(); - - break; - } - default: - break; - } - - /* Call the data delivery process */ - VehicleSensDeliveryProc( did, chgType, get_method ); -} - -/******************************************************************************* -* MODULE : VehicleSensDataMasterSetSharedMemory -* ABSTRACT : Data master set notification process(Callback function) -* FUNCTION : Call Write Shared Memory -* ARGUMENT : did : Data ID -* : chg_type : Whether or not data is updated -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensDataMasterSetSharedMemory(DID did, u_int8 chg_type) { // LCOV_EXCL_START 8: dead code - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - /* When there is no change, the shared memory write process is not called. */ - if (chg_type == VEHICLESENS_NEQ) { - VehicleSensWriteSharedMemory(did); - } -} -// LCOV_EXCL_STOP - -/* ++ GPS _CWORD82_ support */ -/******************************************************************************* -* MODULE : VehicleSensSetVehicleData -* ABSTRACT : GPS command request processing -* FUNCTION : Transfer a GPS command request -* ARGUMENT : *msg : message buffer -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensSetVehicleData(const VEHICLE_MSG_SEND *msg) { - u_int16 size; /* Data length setting */ - u_int16 all_len; /* Sent message length */ - u_int16 mode; /* Mode information */ - RID req_id = 0; /* Resources ID */ - - T_APIMSG_MSGBUF_HEADER header; /* Message header */ - TG_GPS_SND_DATA data; /* Message body */ - u_int8 snd_buf[(sizeof(T_APIMSG_MSGBUF_HEADER) + sizeof(TG_GPS_SND_DATA))]; - - /* Message header generation */ - size = sizeof(data); - header.signo = 0; /* Signal information */ - header.hdr.sndpno = PNO_VEHICLE_SENSOR; /* Source thread number */ - header.hdr.respno = 0; /* Destination process No. */ - header.hdr.cid = CID_GPS__CWORD82__REQUEST; /* Command ID */ - header.hdr.msgbodysize = size; /* Message data length setting */ - header.hdr.rid = req_id; /* Resource ID Setting */ - header.hdr.reserve = 0; /* Reserved Area Clear */ - - /* Message body generating */ - data.us_size = msg->data.size; - memcpy(&(data.ub_data[0]), &(msg->data.data[0]), msg->data.size); - - /* Reserved Area Clear */ - data.reserve[0] = 0; - data.reserve[1] = 0; - data.reserve[2] = 0; - data.reserve[3] = 0; - - /* Message generation */ - (void)memcpy(&snd_buf[0], &header, sizeof(header)); - (void)memcpy(&snd_buf[sizeof(header)], &data, sizeof(data)); - all_len = static_cast<u_int16>(size + sizeof(header)); - mode = 0; - - FRAMEWORKUNIFIEDLOG(ZONE_27, __FUNCTION__, "VehicleSensSetVehicleData NMEA = %s", data.ub_data); - (void)_pb_SndMsg(PNO_NAVI_GPS_MAIN, all_len, reinterpret_cast<void *>(&snd_buf[0]), mode); -} - -/******************************************************************************* - * MODULE : VehicleSensDrDeliveryEntry - * ABSTRACT : Sensor Internal Information Delivery Registration for DR - * FUNCTION : - * ARGUMENT : *msg : message buffer - * NOTE : - * RETURN : void - ******************************************************************************/ -void VehicleSensDrDeliveryEntry(const VEHICLE_MSG_DELIVERY_ENTRY *msg) { // LCOV_EXCL_START 8 : dead code - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - int32 event_val; - EventID event_id; - - /* Call the process of creating the delivery destination management table */ - event_val = static_cast<int32>(DeadReckoningEntryDeliveryCtrl((const DEADRECKONING_MSG_DELIVERY_ENTRY*)msg)); - /* #QAC confirmation Rule11.4 Member reference to suppress address reference error in data R/W */ - - /* Event Generation */ - event_id = VehicleCreateEvent(msg->data.pno); - - /* Publish Events */ - (void)_pb_SetEvent(event_id, SAPI_EVSET_ABSOLUTE, event_val); - - if (VEHICLE_RET_NORMAL == event_val) { - /* Successful delivery registration */ - /* Deliver data for the first time */ - DeadReckoningFirstDelivery((PNO)(msg->data.pno), (DID)(msg->data.did)); - } -} -// LCOV_EXCL_STOP - -/******************************************************************************* - * MODULE : VehicleSensGetLog - * ABSTRACT : Log acquisition request - * FUNCTION : - * ARGUMENT : *msg : message buffer - * NOTE : - * RETURN : void - ******************************************************************************/ -void VehicleSensGetLog(const VEHICLEDEBUG_MSG_BUF *msg) { // LCOV_EXCL_START 8 : dead code - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - DeadReckoningGetLocationLogStatus(msg->hdr.hdr.sndpno); -} -// LCOV_EXCL_STOP - -/******************************************************************************* - * MODULE : VehicleSensSetLog - * ABSTRACT : Log Setting Request - * FUNCTION : - * ARGUMENT : *msg : message buffer - * NOTE : - * RETURN : void - ******************************************************************************/ -void VehicleSensSetLog(const VEHICLEDEBUG_MSG_BUF* msg) { // LCOV_EXCL_START 8 : dead code - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - return; -} -// LCOV_EXCL_STOP - -/******************************************************************************* - * MODULE : VehicleSensWriteLocalTime - * ABSTRACT : Set LOCALTIME to non-volatile - * FUNCTION : - * ARGUMENT : *msg : message buffer - * NOTE : - * RETURN : void - ******************************************************************************/ -void VehicleSensWriteLocalTime(const CANINPUT_MSG_INFO *msg) { // LCOV_EXCL_START 8 : dead code - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - LOCALTIME localtime = {0}; - int32 time_diff; - RET_API ret_write_api; - static u_int8 cnt = 0U; /* For update cycle count */ - if (msg != NULL) { - memset(&time_diff, 0x00, sizeof(time_diff)); /* Coverity CID:18813 compliant */ - - /* Determine that the 1s cycle (cnt == 1) has elapsed for 1 second. */ - cnt++; - - /* When 5 seconds or more have elapsed since the last update */ - /* Saving Time Information in Non-volatile Memory */ - if (cnt >= NV_UPDATE_CYCLE_LOCALTIME) { - /* Non-volatile write */ - ret_write_api = VehicleSensWriteNVLocaltime(&localtime, &time_diff); - if (ret_write_api != RET_NORMAL) { - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "NV write error."); - } - cnt = 0U; - } - } else { - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "ARGUMENT NULL"); - } -} -// LCOV_EXCL_STOP - -/******************************************************************************* -* MODULE : VehicleSensSetEphNumSharedMemory -* ABSTRACT : Write effective ephemeris number to shared memory -* FUNCTION : -* ARGUMENT : *msg : message buffer -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensSetEphNumSharedMemory(const SENSOR_MSG_GPSDATA *msg) { // LCOV_EXCL_START 8 : dead code - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - RET_API ret_api; - u_int8 ephemeris_num; - - if (msg != NULL) { - ephemeris_num = msg->st_para.uc_data[0]; - - ret_api = VehicleSensWriteDataValidEphemerisNum(ephemeris_num); - - if (ret_api != RET_NORMAL) { - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "Share Memory write error."); - } - } - - return; -} -// LCOV_EXCL_STOP - -/******************************************************************************* -* MODULE : VehicleSensDrRcvMsg -* ABSTRACT : Data delivery for DR,Write location information to shared memory -* FUNCTION : -* ARGUMENT : const EPHEMERIS_NUM_DATA_DAT * : Incoming message -* NOTE : -* RETURN : void -******************************************************************************/ -void VehicleSensDrRcvMsg(const DEAD_RECKONING_RCVDATA * msg) { // LCOV_EXCL_START 8 : dead code - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - DEAD_RECKONING_LONLAT_INFO lonlat_info; - - if (msg != NULL) { - DeadReckoningRcvMsg(msg, &lonlat_info); - - /* Process for storing location information in non-volatile memory during shutdown */ - /* With a refresh interval of 1 second,Save only when location information is valid data */ - if (lonlat_info.calc_called == TRUE) { - static u_int8 cnt = 0U; /* For update cycle count */ - - /* Sensor data is 100ms cycle,Determine that (cnt == 10) has elapsed for 1 second */ - /* Cnt increments to 10 */ - if (cnt < NV_UPDATE_CYCLE_LONLAT) { - cnt++; - } - - /* When 1 second or more has elapsed since the last update and the location information is valid, */ - /* Saving Location Information in Non-Volatile Memory */ - if ((cnt >= NV_UPDATE_CYCLE_LONLAT) && (lonlat_info.available == static_cast<u_int8>(TRUE))) { - VehicleSensStoreLonlat(&(lonlat_info.lonlat)); - cnt = 0U; - } - } - } else { - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "ARGUMENT NULL"); - } - - return; -} -// LCOV_EXCL_STOP - -/** - * @brief - * Data setting process - * - * Setting Specified Data to Data Master - * - * @param[in] const VEHICLE_MSG_BUF *msg : message buffer - * @param[out] PFUNC_DMASTER_SET_N p_datamaster_set_n : Data Master Set Notification(Callback function) - * @return none - * @retval none - */ -void VehicleSensCommonDataDelivery(const VEHICLE_MSG_BUF *msg, PFUNC_DMASTER_SET_N p_datamaster_set_n) { - const POS_MSGINFO *pstPosMsg = (const POS_MSGINFO *) & (msg->data[0]); - - /* Individual processing for each data ID */ - switch (pstPosMsg->did) { - case VEHICLE_DID_SETTINGTIME: - { - /* By checking the evacuation message information,Determine whether the GPS time has already been set and requested */ - if (NULL == g_wait_for_resp_set_n) { - /* GPS time settable */ - /* GPS time setting data transmission */ - VehicleSensGpsTimeSndMsg(pstPosMsg); - - /* Save message information(Used when a response is received.)*/ - (void)memcpy(&g_wait_for_resp_msg, msg, sizeof(VEHICLE_MSG_BUF)); - g_wait_for_resp_set_n = p_datamaster_set_n; - } else { - /* GPS time setting process is already in progress:Reply BUSY to requesting processes */ - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "SetGpsTime already."); - } - break; - } - default: - /* Set the specified data in the data master */ - VehicleSensSetDataMasterData((const POS_MSGINFO *)msg->data, p_datamaster_set_n); - break; - } - - return; -} - -/** - * @brief - * GPS time setting data transmission process - * - * Send the specified data to the GPS thread - * - * @param[in] const POS_MSGINFO *pos_msg : message buffer - * @return none - * @retval none - */ -void VehicleSensGpsTimeSndMsg(const POS_MSGINFO *pos_msg) { - RET_API ret_api = RET_NORMAL; /* System API return value */ - u_int16 size = 0; /* Data length setting */ - u_int16 all_len = 0; /* Sent message length */ - u_int16 mode = 0; /* Mode information */ - RID req_id = 0; /* Resources ID */ - T_APIMSG_MSGBUF_HEADER header; /* Message header */ - TG_GPS_SND_DATA data; /* Message body */ - u_int8 snd_buf[(sizeof(T_APIMSG_MSGBUF_HEADER) + sizeof(TG_GPS_SND_DATA))]; - - memset(&header, 0x00, sizeof(T_APIMSG_MSGBUF_HEADER)); - memset(&data, 0x00, sizeof(TG_GPS_SND_DATA)); - - /* Message header generation */ - size = sizeof(data); - header.signo = 0; /* Signal information */ - header.hdr.sndpno = PNO_VEHICLE_SENSOR; /* Source thread number */ - header.hdr.respno = 0; /* Destination process No. */ - header.hdr.cid = CID_GPS_TIMESETTING; /* Command ID */ - header.hdr.msgbodysize = size; /* Message data length setting */ - header.hdr.rid = req_id; /* Resource ID Setting */ - - /* Message body generating */ - data.us_size = pos_msg->size; - memcpy(&(data.ub_data[0]), &(pos_msg->data[0]), pos_msg->size); - - /* Messaging */ - (void)memcpy(&snd_buf[0], &header, sizeof(header)); - (void)memcpy(&snd_buf[sizeof(header)], &data, sizeof(data)); - all_len = static_cast<u_int16>(size + sizeof(header)); - mode = 0; - ret_api = _pb_SndMsg(PNO_NAVI_GPS_MAIN, all_len, reinterpret_cast<void *>(&snd_buf[0]), mode); - if (RET_NORMAL != ret_api) { - /* Message transmission processing failed */ - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "send Message failed."); - } - - return; -} - -/** - * @brief - * GPS time setting result notification process - * - * Setting Specified Data to Data Master - * - * @param[in] const VEHICLE_MSG_BUF *msg : message buffer - * @return none - * @retval none - */ -void VehicleSensGpsTimeDelivery(const VEHICLE_MSG_BUF *msg) { - int32 event_val = POS_RET_ERROR_INNER; /* Event value */ - const TG_GPS_RET_TIMESET_MSG *gps_ret_time; /* GPS time setting response message */ - - /* Determine the GPS time setting result */ - gps_ret_time = (const TG_GPS_RET_TIMESET_MSG *)msg; - - if (GPS_SENDOK == gps_ret_time->status) { - event_val = POS_RET_NORMAL; - } else { - event_val = POS_RET_ERROR_TIMEOUT; - } - - /* Set the specified data in the data master */ - if (POS_RET_NORMAL == event_val) { - VehicleSensSetDataMasterData((const POS_MSGINFO *)&g_wait_for_resp_msg.data, g_wait_for_resp_set_n); - } - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, - "SetGpsTime Result[%d] EventVal[%d]", - static_cast<uint32_t>(gps_ret_time->status), static_cast<uint32_t>(event_val)); - - /* Clear saved message information */ - (void)memset(&g_wait_for_resp_msg, 0x00, sizeof(VEHICLE_MSG_BUF)); - g_wait_for_resp_set_n = NULL; - - return; -} - -/** - * @brief - * Specified process No. event transmission processing - * - * Send an event to the specified process No. - * - * @param[in] uint16_t snd_pno : Destination process number - * @param[in] int32_t event_val : Sent event value - * @return RET_API - * @retval RET_NORMAL Normal completion<br> - * RET_ERROR Event generation failure<br> - * RET_ERRPARAM Configuration mode error<br> - * RET_EV_NONE Specified event does not exist<br> - * RET_EV_MAX The set event value exceeds the maximum value<br> - * RET_EV_MIN The set event value is below the minimum value. - */ -RET_API VehicleSensSendEvent(uint16_t snd_pno, int32_t event_val) { // LCOV_EXCL_START 8 : dead code - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - RET_API ret_val = RET_ERROR; /* Return value */ - EventID event_id = 0; /* Event ID */ - - /* Event Generation */ - event_id = VehicleCreateEvent(snd_pno); - if (0 != event_id) { - /* Event publishing(Release Event Wait) */ - ret_val = _pb_SetEvent(event_id, SAPI_EVSET_ABSOLUTE, event_val); - if (RET_NORMAL != ret_val) { - /* Event issuance failure */ - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "set Event failed."); - } - - /* Event deletion */ - (void)VehicleDeleteEvent(event_id); - } else { - /* Event generation failure */ - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "create Event failed."); - } - - return ret_val; -} -// LCOV_EXCL_STOP - -/** - * @brief - * Pos_Main thread stop processing - */ -void VehicleSensThreadStopProcess(void) { - /* Exit Process Implementation Point >>> */ - - - /* <<< Exit Process Implementation Point */ - - /* Thread stop processing */ - PosTeardownThread(ETID_POS_MAIN); - - /* don't arrive here */ - return; -} - -/** - * @brief - * Initialization of data interruption monitoring process<br> - * 1.Initial data reception monitoring timer issuance - */ -static void VehicleSensInitDataDisrptMonitor(void) { - - /* Initial sensor data reception monitoring timer */ - VehicleUtilitySetTimer(SNS_FST_TIMER); - - return; -} - -/** - * @brief - * Data disruption monitoring process<br> - * 1.Stop timer for monitoring initial data reception<br> - * 2.Stop timer for periodic data reception monitoring<br> - * 3.Periodic data reception monitoring timer issuance - * - * @param[in] did Data type - */ -static void VehicleSensDataDisrptMonitorProc(DID did) { - static BOOL is_rcv_sns_data = FALSE; - - switch (did) { - case POSHAL_DID_GYRO_X: - case POSHAL_DID_GYRO_Y: - case POSHAL_DID_GYRO_Z: - case POSHAL_DID_GSNS_X: - case POSHAL_DID_GSNS_Y: - case POSHAL_DID_GSNS_Z: - case POSHAL_DID_SPEED_PULSE: - case POSHAL_DID_REV: - case POSHAL_DID_GPS_ANTENNA: - case POSHAL_DID_GYRO_EXT: - case POSHAL_DID_GYRO_TEMP: - case POSHAL_DID_PULSE_TIME: - case POSHAL_DID_SNS_COUNTER: - { - if (is_rcv_sns_data == FALSE) { - /* Initial sensor data reception monitoring timer */ - VehicleUtilityStopTimer(SNS_FST_TIMER); - is_rcv_sns_data = TRUE; - - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "is_rcv_sns_data=TRUE"); - } - - /* Cyclic sensor data reception monitoring timer stopped */ - VehicleUtilityStopTimer(SNS_CYCLE_TIMER); - /* Cyclic sensor data reception monitoring timer setting */ - VehicleUtilitySetTimer(SNS_CYCLE_TIMER); - /* Sensor data interruption log output timer */ - VehicleUtilityStopTimer(SNS_DISRPT_TIMER); - - break; - } - default: - { - /* nop */ - } - } - - return; -} - -/** - * @brief - * Timeout message reception processing - * - * @param[in] rcv_msg Incoming message - */ -static void VehicleSensRcvMsgTout(TimerToutMsg* rcv_msg) { - uint8_t tim_kind = static_cast<uint8_t>(rcv_msg->TimerSeq >> 8); - - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "+ ### TIMEOUT ### Seq=0x%04x", rcv_msg->TimerSeq); - switch (tim_kind) { - case SNS_FST_TIMER: - case SNS_CYCLE_TIMER: - case SNS_DISRPT_TIMER: - { - /* Sensor data interruption log output timer setting */ - VehicleUtilityStopTimer(SNS_DISRPT_TIMER); - VehicleUtilitySetTimer(SNS_DISRPT_TIMER); - break; - } - default: - { - /* nop */ - } - } - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "-"); - return; -} - - -/** - * @brief - * Initialize Vehilce Speed Information - * - * @details This is for creating PASCD Sentence of NMEA. <br> - * You can initialize the buffer of Vehicle Speed Information. - */ -static void VehilceSens_InitVehicleSpeed(void) { - (void)memset(&g_vehicle_speed_info, 0x00, sizeof(g_vehicle_speed_info)); - return; -} - -/** - * @brief - * Store Vehilce Speed Data - * - * @details This is for creating PASCD Sentence of NMEA. <br> - * You can store Vehicle Speed Information for a cycle. - * - * @param[in] VEHICLESENS_VEHICLE_SPEED_DAT* pVehicleSpeed : Speed [m/s] and TimeSpec - */ -static void VehicleSens_StoreVehicleSpeed(VEHICLESENS_VEHICLE_SPEED_DAT* pVehicleSpeed) { - VEHICLESENS_VEHICLE_SPEED_INFO* pInfo = &g_vehicle_speed_info; - - -// if (pInfo->sampleCount < VEHICLESENS_NMEA_PASCD_SAMPLECOUNT_MAX) { - if (pInfo->sampleCount == 0) { - (void)memcpy((pInfo->listSpd) + (pInfo->sampleCount), pVehicleSpeed, sizeof(VEHICLESENS_VEHICLE_SPEED_DAT)); - pInfo->sampleCount++; - - } else if (pInfo->sampleCount < VEHICLESENS_NMEA_PASCD_SAMPLECOUNT_MAX) { - (void)_pb_memcpy((pInfo->listSpd) + (pInfo->sampleCount), pVehicleSpeed, sizeof(VEHICLESENS_VEHICLE_SPEED_DAT)); - - VEHICLESENS_VEHICLE_SPEED_DAT* pS0 = &(pInfo->listSpd[0]); - VEHICLESENS_VEHICLE_SPEED_DAT* pS = &(pInfo->listSpd[pInfo->sampleCount]); - uint32_t ts_i; /* Interger Part of timestamp [s] */ - if (pS->ts.tv_nsec - pS0->ts.tv_nsec >= 0) { // LCOV_EXCL_BR_LINE 200: can not less than zero - ts_i = (pS->ts.tv_sec - pS0->ts.tv_sec) % VEHICLESENS_NMEA_PASCD_TS_MAX; - } else { - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - ts_i = (pS->ts.tv_sec - pS0->ts.tv_sec - 1) % VEHICLESENS_NMEA_PASCD_TS_MAX; // LCOV_EXCL_LINE 8: invalid - } - if (ts_i == 0) { /* Offset is 0 to 1 second */ - pInfo->sampleCount++; - } - - } else { - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, - "WARNING: Num of stored datas is over 50. (%ld.%ld spd = %d)", - pVehicleSpeed->ts.tv_sec, pVehicleSpeed->ts.tv_nsec, pVehicleSpeed->speed ); - } - - return; -} - -/** - * @brief - * Load Vehicle Speed Information (Vehicle Speed Data x 50(max)) - * - * @details This is for creating PASCD Sentence of NMEA. <br> - * You can load Vehicle Speed Informations from the last initialization. - * - * @param[in] VEHICLESENS_VEHICLE_SPEED_INFO* pVehicleSpeedInfo : Speeds [m/s] and TimeSpecs - */ -static void VehicleSens_LoadVehicleSpeed(VEHICLESENS_VEHICLE_SPEED_INFO* pVehicleSpeedInfo) { - (void)memcpy(pVehicleSpeedInfo, &g_vehicle_speed_info, sizeof(g_vehicle_speed_info)); - return; -} - -/** - * @brief - * Concatenate NMEA Sentence Fields with Delimiter - * - * @details This is for creating NMEA Sentence. <br> - * You can concatenate the two strings given as arguments 'str1' and 'str2'. <br> - * And at the time, it puts the delimiter between 'str1' and 'str2' automaticaly. - * - * @param[in] char* str1 : destination - * @param[in] const size_t size : buffer size of destination - * @param[in] const char* str2 : source - * @param[in] const size_t n : copy size of source - * - * @return RET_NORMAL : success - * @return RET_ERROR : failed - */ -static RET_API VehicleSens_CatNmeaSentenceFieldWithDelimiter(char* str1, const size_t size, - const char* str2, const size_t n) { - RET_API ret_api = RET_NORMAL; - - size_t len1 = strlen(str1); - size_t len2 = strlen(str2); - size_t len3 = strlen(VEHICLESENS_NMEA_FIELDDELIMITER); - size_t sn = n; - - if (sn > len2) { // LCOV_EXCL_BR_LINE 200: can not exceed size - sn = len2; - } - - if (len1 + len3 + sn <= size - 1) { - (void)strncat(str1, VEHICLESENS_NMEA_FIELDDELIMITER, len3); /* Add Delimiter (,) */ - (void)strncat(str1, str2, sn); - } else { - ret_api = RET_ERROR; - - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, - "ERROR: Buffer size is too small to connatenate. len1:%d len2:%d len3:%d n:%d", len1, len2, len3, n); - } - - return ret_api; -} - -/** - * @brief - * Concatenate NMEA Sentence Fields without Delimiter - * - * @details This is for creating NMEA Sentence. <br> - * You can concatenate the two strings given as arguments 'str1' and 'str2'. - * - * @param[in] char* str1 : destination - * @param[in] const size_t size : buffer size of destination - * @param[in] const char* str2 : source - * @param[in] const size_t n : copy size of source - * - * @return RET_NORMAL : success - * @return RET_ERROR : failed - */ -static RET_API VehicleSens_CatNmeaSentenceFieldWithoutDelimiter(char* str1, const size_t size, - const char* str2, const size_t n) { - RET_API ret_api = RET_NORMAL; - - size_t len1 = strlen(str1); - size_t len2 = strlen(str2); - size_t sn = n; - - if (sn > len2) { // LCOV_EXCL_BR_LINE 200: can not exceed size - sn = len2; - } - - if (len1 + sn <= size - 1) { - (void)strncat(str1, str2, sn); - } else { - ret_api = RET_ERROR; - - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, - "ERROR: Buffer size is too small to connatenate. len1:%d len2:%d n:%d", len1, len2, n); - } - - return ret_api; -} - -/** - * @brief - * Generate ID Field of PASCD Sentence - * - * @details This is for creating PASCD Sentence of NMEA. <br> - * You can generate ID Field of PASCD Sentence and <br> - * concatenate it with the string given as argument 'pascd'. <br> - * It should be called in the specific order. - * - * @param[in/out] char* pascd : buffer pointer for PASCD Sentence - * @param[in] size_t size : buffer size - * - * @return RET_NORMAL : success - * @return RET_ERROR : failed - */ -static inline RET_API VehicleSens_GeneratePASCDFieldId(char* pascd, size_t size) { - RET_API ret_api; - - ret_api = VehicleSens_CatNmeaSentenceFieldWithoutDelimiter(pascd, size, VEHICLESENS_NMEA_PASCD_ID, size); - if (ret_api == RET_ERROR) { - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, - "ERROR: VehicleSens_CatNmeaSentenceFieldWithoutDelimiter:%d", ret_api); - } - - return ret_api; -} - -/** - * @brief - * Generate Timestamp Field of PASCD Sentence - * - * @details This is for creating PASCD Sentence of NMEA. <br> - * You can generate Timestamp Field of PASCD Sentence and <br> - * concatenate it with the string given as argument 'pascd'. <br> - * It should be called in the specific order. - * - * @param[in/out] char* pascd : buffer pointer for PASCD Sentence - * @param[in] size_t size : buffer size - * - * @return RET_NORMAL : success - * @return RET_ERROR : failed - */ -static inline RET_API VehicleSens_GeneratePASCDFieldTimestamp(char* pascd, size_t size) { - RET_API ret_api; - - VEHICLESENS_VEHICLE_SPEED_INFO stVehicleSpeedInfo; - - uint32_t ts_i; /* Interger Part of timestamp [s] */ - uint32_t ts_f; /* Fractional Part of timestamp [ms] */ - char ts_ci[32]; /* ts_i in charactor */ - char ts_cf[32]; /* ts_f in charactor */ - - VehicleSens_LoadVehicleSpeed(&stVehicleSpeedInfo); - - -#if 1 /* PASCD *//* Suppose that GPS NMEA data are updated 1 sec interval */ - ts_i = gPseudoSecClockCounter; /* Synchronize: GPS NMEA */ - ts_f = 0u; - gPseudoSecClockCounter += 1u; /* PASCD *//* Suppose that GPS NMEA data are updated 1 sec interval */ - if (gPseudoSecClockCounter >= VEHICLESENS_NMEA_PASCD_TS_MAX) { - gPseudoSecClockCounter = 0u; - } -#else /* PASCD *//* Suppose that GPS NMEA data are updated 1 sec interval */ - - ts_i = stVehicleSpeedInfo.listSpd[0].ts.tv_sec % VEHICLESENS_NMEA_PASCD_TS_MAX; - ts_f = stVehicleSpeedInfo.listSpd[0].ts.tv_nsec; - -#endif /* PASCD *//* Suppose that GPS NMEA data are updated 1 sec interval */ - - (void)snprintf(ts_ci, sizeof(ts_ci), "%d", ts_i); - (void)snprintf(ts_cf, sizeof(ts_cf), "%06d", ts_f); - - /* Integer Part */ - ret_api = VehicleSens_CatNmeaSentenceFieldWithDelimiter(pascd, size, ts_ci, VEHICLESENS_NMEA_PASCD_TS_INT_LEN_MAX); - if (ret_api == RET_ERROR) { - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, - "ERROR: VehicleSens_CatNmeaSentenceFieldWithoutDelimiter:%d", ret_api); - } - - /* Decimal Point */ - ret_api = VehicleSens_CatNmeaSentenceFieldWithoutDelimiter(pascd, size, VEHICLESENS_NMEA_DECIMALPOINT, size); - if (ret_api == RET_ERROR) { - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, - "ERROR: VehicleSens_CatNmeaSentenceFieldWithoutDelimiter:%d", ret_api); - } - - /* Fractional Part */ - ret_api = VehicleSens_CatNmeaSentenceFieldWithoutDelimiter(pascd, size, - ts_cf, VEHICLESENS_NMEA_PASCD_TS_FRA_LEN_MAX); - if (ret_api == RET_ERROR) { - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, - "ERROR: VehicleSens_CatNmeaSentenceFieldWithDelimiter:%d", ret_api); - } - - return ret_api; -} - -/** - * @brief - * Generate SensorType Field of PASCD Sentence - * - * @details This is for creating PASCD Sentence of NMEA. <br> - * You can generate SensorType Field of PASCD Sentence and <br> - * concatenate it with the string given as argument 'pascd'. <br> - * It should be called in the specific order. - * - * @param[in/out] char* pascd : buffer pointer for PASCD Sentence - * @param[in] size_t size : buffer size - * - * @return RET_NORMAL : success - * @return RET_ERROR : failed - */ -static inline RET_API VehicleSens_GeneratePASCDFieldSensorType(char* pascd, size_t size) { - RET_API ret_api; - - ret_api = VehicleSens_CatNmeaSentenceFieldWithDelimiter(pascd, size, VEHICLESENS_NMEA_PASCD_SENSORTYPE_C, size); - if (ret_api == RET_ERROR) { - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, - "ERROR: VehicleSens_CatNmeaSentenceFieldWithDelimiter:%d", ret_api); - } - - return ret_api; -} - -/** - * @brief - * Generate TransmissionState Field of PASCD Sentence - * - * @details This is for creating PASCD Sentence of NMEA. <br> - * You can generate TransmissionState Field of PASCD Sentence and <br> - * concatenate it with the string given as argument 'pascd'. <br> - * It should be called in the specific order. - * - * @param[in/out] char* pascd : buffer pointer for PASCD Sentence - * @param[in] size_t size : buffer size - * - * @return RET_NORMAL : success - * @return RET_ERROR : failed - */ -static inline RET_API VehicleSens_GeneratePASCDFieldTransmissionState(char* pascd, size_t size) { - RET_API ret_api = RET_NORMAL; - EFrameworkunifiedStatus eStatus; - - uint8_t ucType; /* type of transmission */ - uint8_t ucShift; - -#if 1 /* For Plus _CWORD27_ Gear Data Support 180115 */ - uint8_t ucPkb; /* state of parking brake */ -#endif /* For Plus _CWORD27_ Gear Data Support 180115 */ - - BOOL bIsAvailable; - - /* Get Type of Transmission */ - -// eStatus = VehicleIf_GetTypeOfTransmission(&ucType, &bIsAvailable); - eStatus = VehicleIf_GetTypeOfTransmission(&ucType, &ucPkb, &bIsAvailable); - if ((bIsAvailable != true) || (eStatus != eFrameworkunifiedStatusOK)) { - if (bIsAvailable == TRUE) { - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, - "ERROR: VehicleIf_GetTypeOfTransmission:%d", eStatus); - } - ret_api = RET_ERROR; - } - - if (ret_api != RET_ERROR) { - /* Get Shift Position */ - eStatus = VehicleIf_GetShiftPosition(&ucShift, &bIsAvailable); - if ((bIsAvailable != true) || (eStatus != eFrameworkunifiedStatusOK)) { - if (bIsAvailable == TRUE) { - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, - "ERROR: VehicleIf_GetShiftPosition:%d", eStatus); - } - ret_api = RET_ERROR; - } - } - - if (ret_api != RET_ERROR) { - VEHICLESENS_TRANSMISSION_PKG tsmPkg; - - tsmPkg.type = ucType; - tsmPkg.shift = ucShift; - -#if 1 /* For Plus _CWORD27_ Gear Data Support 180115 */ - tsmPkg.pkb = ucPkb; -#endif /* For Plus _CWORD27_ Gear Data Support 180115 */ - - - ret_api = VehicleSens_DeriveTransmissionStateFor_CWORD27_(&tsmPkg); - if (ret_api != RET_NORMAL) { - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, - "ERROR: VehicleSensDeriveTransmissionStateFor_CWORD27_:%d", ret_api); - } else { - ret_api = VehicleSens_CatNmeaSentenceFieldWithDelimiter(pascd, size, tsmPkg.state, size); - if (ret_api == RET_ERROR) { - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, - "ERROR: VehicleSens_CatNmeaSentenceFieldWithDelimiter:%d", ret_api); - } - } - } - - return ret_api; -} - -/** - * @brief - * Generate SlipDetect Field of PASCD Sentence - * - * @details This is for creating PASCD Sentence of NMEA. <br> - * You can generate SlipDetect Field of PASCD Sentence and <br> - * concatenate it with the string given as argument 'pascd'. <br> - * It should be called in the specific order. - * - * @param[in/out] char* pascd : buffer pointer for PASCD Sentence - * @param[in] size_t size : buffer size - * - * @return RET_NORMAL : success - * @return RET_ERROR : failed - */ -static inline RET_API VehicleSens_GeneratePASCDFieldSlipDetect(char* pascd, size_t size) { - RET_API ret_api; - - ret_api = VehicleSens_CatNmeaSentenceFieldWithDelimiter(pascd, size, VEHICLESNES_NMEA_PASCD_NOSLIP, size); - if (ret_api == RET_ERROR) { - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, - "ERROR: VehicleSens_CatNmeaSentenceFieldWithDelimiter:%d", ret_api); - } - - return ret_api; -} - -/** - * @brief - * Generate SampleCount Field of PASCD Sentence - * - * @details This is for creating PASCD Sentence of NMEA. <br> - * You can generate SampleCount Field of PASCD Sentence and <br> - * concatenate it with the string given as argument 'pascd'. <br> - * It should be called in the specific order. - * - * @param[in/out] char* pascd : buffer pointer for PASCD Sentence - * @param[in] size_t size : buffer size - */ -static inline RET_API VehicleSens_GeneratePASCDFieldSampleCount(char* pascd, size_t size) { - RET_API ret_api; - - VEHICLESENS_VEHICLE_SPEED_INFO stVehicleSpeedInfo; - char cSampleCount[32]; - - VehicleSens_LoadVehicleSpeed(&stVehicleSpeedInfo); - (void)snprintf(cSampleCount, sizeof(cSampleCount), "%d", stVehicleSpeedInfo.sampleCount); - - ret_api = VehicleSens_CatNmeaSentenceFieldWithDelimiter(pascd, size, cSampleCount, size); - if (ret_api == RET_ERROR) { - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, - "ERROR: VehicleSens_CatNmeaSentenceFieldWithDelimiter:%d", ret_api); - } - - return ret_api; -} - -/** - * @brief - * Generate TimeOffset and Speed Field of PASCD Sentence - * - * @details This is for creating PASCD Sentence of NMEA. <br> - * You can generate TimeOffset and Speed Field of PASCD Sentence and <br> - * concatenate it with the string given as argument 'pascd'. <br> - * It should be called in the specific order. - * - * @param[in/out] char* pascd : buffer pointer for PASCD Sentence - * @param[in] size_t size : buffer size - * - * @return RET_NORMAL : success - * @return RET_ERROR : failed - */ -static inline RET_API VehicleSens_GeneratePASCDFieldTimeOffsetNSpeed(char* pascd, size_t size) { - RET_API ret_api = RET_ERROR; - - VEHICLESENS_VEHICLE_SPEED_INFO stVehicleSpeedInfo; - VEHICLESENS_VEHICLE_SPEED_DAT *pS0 = &(stVehicleSpeedInfo.listSpd[0]); - - int32_t i; - - VehicleSens_LoadVehicleSpeed(&stVehicleSpeedInfo); - - for (i = 0; i < stVehicleSpeedInfo.sampleCount; i++) { - VEHICLESENS_VEHICLE_SPEED_DAT *pS = &(stVehicleSpeedInfo.listSpd[i]); - - /* timeoffset */ - uint32_t ts_i; /* Interger Part of timestamp [s] */ - uint32_t ts_f; /* Fractional Part of timestamp [us] */ - char ts_ci[32]; /* ts_i in charactor */ - char ts_cf[32]; /* ts_f in charactor */ - - if (pS->ts.tv_nsec - pS0->ts.tv_nsec >= 0) { // LCOV_EXCL_BR_LINE 200: can not less than zero - ts_i = (pS->ts.tv_sec - pS0->ts.tv_sec) % VEHICLESENS_NMEA_PASCD_TS_MAX; - ts_f = (pS->ts.tv_nsec - pS0->ts.tv_nsec) / 1000; /* [ns] -> [us] */ - } else { - // LCOV_EXCL_START 8: invalid - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - ts_i = (pS->ts.tv_sec - pS0->ts.tv_sec - 1) % VEHICLESENS_NMEA_PASCD_TS_MAX; - ts_f = (1000000000 + pS->ts.tv_nsec - pS0->ts.tv_nsec) / 1000; /* [ns] -> [us] */ - // LCOV_EXCL_STOP - } - - (void)snprintf(ts_ci, sizeof(ts_ci), "%d", ts_i); - (void)snprintf(ts_cf, sizeof(ts_cf), "%06d", ts_f); - - /* Integer Part */ - ret_api = VehicleSens_CatNmeaSentenceFieldWithDelimiter(pascd, size, ts_ci, size); - if (ret_api == RET_ERROR) { // LCOV_EXCL_BR_LINE 200: can not exceed buffer size - // LCOV_EXCL_START 8: invalid - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, - "ERROR: VehicleSens_CatNmeaSentenceFieldWithDelimiter:%d", ret_api); - break; - // LCOV_EXCL_STOP - } - - /* Decimal Point */ - ret_api = VehicleSens_CatNmeaSentenceFieldWithoutDelimiter(pascd, size, VEHICLESENS_NMEA_DECIMALPOINT, size); - if (ret_api == RET_ERROR) { // LCOV_EXCL_BR_LINE 200: can not exceed buffer size - // LCOV_EXCL_START 8: invalid - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, - "ERROR: VehicleSens_CatNmeaSentenceFieldWithoutDelimiter:%d", ret_api); - break; - // LCOV_EXCL_STOP - } - - /* Fractional Part */ - ret_api = VehicleSens_CatNmeaSentenceFieldWithoutDelimiter(pascd, size, - ts_cf, VEHICLESENS_NMEA_PASCD_TO_FRA_LEN_MAX); - if (ret_api == RET_ERROR) { // LCOV_EXCL_BR_LINE 200: can not exceed buffer size - // LCOV_EXCL_START 8: invalid - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, - "ERROR: VehicleSens_CatNmeaSentenceFieldWithoutDelimiter:%d", ret_api); - break; - // LCOV_EXCL_STOP - } - - /* speed */ - uint16_t spd_i; /* Interger Part of speed [m/s] */ - uint16_t spd_f; /* Fractional Part of speed [mm/s] */ - char spd_ci[32]; /* spd_i in charactor */ - char spd_cf[32]; /* spd_f in charactor */ - - spd_i = pS->speed / 100; /* [0.01m/s] -> [m/s] */ - spd_f = (pS->speed % 100) * 10; /* [0.01m/s] -> [mm/s] */ - - (void)snprintf(spd_ci, sizeof(spd_ci), "%d", spd_i); - (void)snprintf(spd_cf, sizeof(spd_cf), "%03d", spd_f); - - /* Integer Part */ - ret_api = VehicleSens_CatNmeaSentenceFieldWithDelimiter(pascd, size, spd_ci, size); - if (ret_api == RET_ERROR) { - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, - "ERROR: VehicleSens_CatNmeaSentenceFieldWithDelimiter:%d", ret_api); - break; - } - - /* Decimal Point */ - ret_api = VehicleSens_CatNmeaSentenceFieldWithoutDelimiter(pascd, size, VEHICLESENS_NMEA_DECIMALPOINT, size); - if (ret_api == RET_ERROR) { // LCOV_EXCL_BR_LINE 200: can not exceed buffer size - // LCOV_EXCL_START 8: invalid - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, - "ERROR: VehicleSens_CatNmeaSentenceFieldWithoutDelimiter:%d", ret_api); - break; - // LCOV_EXCL_STOP - } - - /* Fractional Part */ - ret_api = VehicleSens_CatNmeaSentenceFieldWithoutDelimiter(pascd, size, - spd_cf, VEHICLESENS_NMEA_PASCD_SPD_FRA_LEN_MAX); - if (ret_api == RET_ERROR) { // LCOV_EXCL_BR_LINE 200: can not exceed buffer size - // LCOV_EXCL_START 8: invalid - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, - "ERROR: VehicleSens_CatNmeaSentenceFieldWithoutDelimiter:%d", ret_api); - break; - // LCOV_EXCL_STOP - } - } - - return ret_api; -} - -/** - * @brief - * Generate Checksum Field of PASCD Sentence - * - * @details This is for creating PASCD Sentence of NMEA. <br> - * You can generate Checksum Field of PASCD Sentence and <br> - * concatenate it with the string given as argument 'pascd'. <br> - * It should be called in the specific order. - * - * @param[in/out] char* pascd : buffer pointer for PASCD Sentence - * @param[in] size_t size : buffer size - * - * @return RET_NORMAL : success - * @return RET_ERROR : failed - */ -static inline RET_API VehicleSens_GeneratePASCDFieldChecksum(char* pascd, size_t size) { - RET_API ret_api; - - size_t length; - uint8_t chk = 0; - char cChk[3]; - uint16_t i = 0; - - length = strnlen(pascd, size); - - /* Calculate Checksum (start with the 2th Bype except '$') */ - for (i = 1; i < length; i++) { - chk ^= pascd[i]; - } - (void)snprintf(cChk, sizeof(cChk), "%02X", chk); - - /* Set Astarisk before Checksum */ - ret_api = VehicleSens_CatNmeaSentenceFieldWithoutDelimiter(pascd, size, VEHICLESENS_NMEA_ASTARISK, size); - if (ret_api == RET_ERROR) { - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, - "ERROR: VehicleSens_CatNmeaSentenceFieldWithoutDelimiter:%d", ret_api); - } - - /* Set Checksum */ - ret_api = VehicleSens_CatNmeaSentenceFieldWithoutDelimiter(pascd, size, cChk, size); - if (ret_api == RET_ERROR) { - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, - "ERROR: VehicleSens_CatNmeaSentenceFieldWithDelimiter:%d", ret_api); - } - - return ret_api; -} - -/** - * @brief - * Generate CR & LF Field of PASCD Sentence - * - * @details This is for creating PASCD Sentence of NMEA. <br> - * You can generate CRLF Field of PASCD Sentence and <br> - * concatenate it with the string given as argument 'pascd'. <br> - * It should be called in the specific order. - * - * @param[in/out] char* pascd : buffer pointer for PASCD Sentence - * @param[in] size_t size : buffer size - * - * @return RET_NORMAL : success - * @return RET_ERROR : failed - */ -static inline RET_API VehicleSens_GeneratePASCDFieldCRLF(char* pascd, size_t size) { - RET_API ret_api; - - /* Set Carriage Return */ - ret_api = VehicleSens_CatNmeaSentenceFieldWithoutDelimiter(pascd, size, VEHICLESENS_NMEA_CR, size); - if (ret_api == RET_ERROR) { - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, - "ERROR: VehicleSens_CatNmeaSentenceFieldWithDelimiter:%d", ret_api); - } - - /* Set Line Feed */ - ret_api = VehicleSens_CatNmeaSentenceFieldWithoutDelimiter(pascd, size, VEHICLESENS_NMEA_LF, size); - if (ret_api == RET_ERROR) { - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, - "ERROR: VehicleSens_CatNmeaSentenceFieldWithDelimiter:%d", ret_api); - } - - return ret_api; -} - -/** - * @brief - * Derive Transmission State For _CWORD27_ - * - * @details This is for creating PASCD Sentence of NMEA. <br> - * You can derive transmissionState from the transmission type and <br> - * the shift positiong from Vehicle Service. - * - * @param[in/out] VEHICLESENS_TRANSMISSION_PKG* pPkg : source data set for Transmission State - * - * @return RET_NORMAL : success - * @return RET_ERROR : failed - */ -static RET_API VehicleSens_DeriveTransmissionStateFor_CWORD27_(VEHICLESENS_TRANSMISSION_PKG* pPkg) { - RET_API ret_api = RET_NORMAL; - uint32_t i; - - static const VEHICLESENS_TRANSMISSION_PKG TmsLut[VEHICLEIF_TRANSMISSION_TYPE_NUM * VEHICLEIF_SHIFT_POSITION_NUM] = { - -// /* Transmission Type : MT */ -// { VEHICLEIF_TRANSMISSION_TYPE_MT, VEHICLEIF_SHIFT_POSITION_U, VEHICLESENS_NMEA_PASCD_TMS_D }, -// { VEHICLEIF_TRANSMISSION_TYPE_MT, VEHICLEIF_SHIFT_POSITION_R, VEHICLESENS_NMEA_PASCD_TMS_R }, -// { VEHICLEIF_TRANSMISSION_TYPE_MT, VEHICLEIF_SHIFT_POSITION_P, VEHICLESENS_NMEA_PASCD_TMS_D }, -// { VEHICLEIF_TRANSMISSION_TYPE_MT, VEHICLEIF_SHIFT_POSITION_N, VEHICLESENS_NMEA_PASCD_TMS_D }, -// { VEHICLEIF_TRANSMISSION_TYPE_MT, VEHICLEIF_SHIFT_POSITION_D, VEHICLESENS_NMEA_PASCD_TMS_D }, -// /* Tranmission Type : AT */ -// { VEHICLEIF_TRANSMISSION_TYPE_AT, VEHICLEIF_SHIFT_POSITION_U, VEHICLESENS_NMEA_PASCD_TMS_U }, -// { VEHICLEIF_TRANSMISSION_TYPE_AT, VEHICLEIF_SHIFT_POSITION_R, VEHICLESENS_NMEA_PASCD_TMS_R }, -// { VEHICLEIF_TRANSMISSION_TYPE_AT, VEHICLEIF_SHIFT_POSITION_P, VEHICLESENS_NMEA_PASCD_TMS_P }, -// { VEHICLEIF_TRANSMISSION_TYPE_AT, VEHICLEIF_SHIFT_POSITION_N, VEHICLESENS_NMEA_PASCD_TMS_U }, -// { VEHICLEIF_TRANSMISSION_TYPE_AT, VEHICLEIF_SHIFT_POSITION_D, VEHICLESENS_NMEA_PASCD_TMS_D }, -// /* Transmission Type : UNKNOWN */ -// { VEHICLEIF_TRANSMISSION_TYPE_UNKNOWN, VEHICLEIF_SHIFT_POSITION_U, VEHICLESENS_NMEA_PASCD_TMS_U }, -// { VEHICLEIF_TRANSMISSION_TYPE_UNKNOWN, VEHICLEIF_SHIFT_POSITION_R, VEHICLESENS_NMEA_PASCD_TMS_U }, -// { VEHICLEIF_TRANSMISSION_TYPE_UNKNOWN, VEHICLEIF_SHIFT_POSITION_P, VEHICLESENS_NMEA_PASCD_TMS_U }, -// { VEHICLEIF_TRANSMISSION_TYPE_UNKNOWN, VEHICLEIF_SHIFT_POSITION_N, VEHICLESENS_NMEA_PASCD_TMS_U }, -// { VEHICLEIF_TRANSMISSION_TYPE_UNKNOWN, VEHICLEIF_SHIFT_POSITION_D, VEHICLESENS_NMEA_PASCD_TMS_U }, - /* Transmission Type : MT */ - { VEHICLEIF_TRANSMISSION_TYPE_MT, VEHICLEIF_SHIFT_POSITION_U, VEHICLEIF_PKB_UNKNOWN, VEHICLESENS_NMEA_PASCD_TMS_D }, - { VEHICLEIF_TRANSMISSION_TYPE_MT, VEHICLEIF_SHIFT_POSITION_R, VEHICLEIF_PKB_UNKNOWN, VEHICLESENS_NMEA_PASCD_TMS_R }, - { VEHICLEIF_TRANSMISSION_TYPE_MT, VEHICLEIF_SHIFT_POSITION_P, VEHICLEIF_PKB_UNKNOWN, VEHICLESENS_NMEA_PASCD_TMS_D }, - { VEHICLEIF_TRANSMISSION_TYPE_MT, VEHICLEIF_SHIFT_POSITION_N, VEHICLEIF_PKB_UNKNOWN, VEHICLESENS_NMEA_PASCD_TMS_D }, - { VEHICLEIF_TRANSMISSION_TYPE_MT, VEHICLEIF_SHIFT_POSITION_D, VEHICLEIF_PKB_UNKNOWN, VEHICLESENS_NMEA_PASCD_TMS_D }, - /* Tranmission Type : AT */ -#if 1 /* For Plus _CWORD27_ Gear Data Support 180115 */ - { VEHICLEIF_TRANSMISSION_TYPE_AT, VEHICLEIF_SHIFT_POSITION_U, VEHICLEIF_PKB_UNKNOWN, VEHICLESENS_NMEA_PASCD_TMS_U }, -#else /* For Plus _CWORD27_ Gear Data Support 180115 */ - { VEHICLEIF_TRANSMISSION_TYPE_AT, VEHICLEIF_SHIFT_POSITION_U, VEHICLEIF_PKB_UNKNOWN, VEHICLESENS_NMEA_PASCD_TMS_D }, -#endif /* For Plus _CWORD27_ Gear Data Support 180115 */ - { VEHICLEIF_TRANSMISSION_TYPE_AT, VEHICLEIF_SHIFT_POSITION_R, VEHICLEIF_PKB_UNKNOWN, VEHICLESENS_NMEA_PASCD_TMS_R }, - { VEHICLEIF_TRANSMISSION_TYPE_AT, VEHICLEIF_SHIFT_POSITION_P, VEHICLEIF_PKB_UNKNOWN, VEHICLESENS_NMEA_PASCD_TMS_P }, - { VEHICLEIF_TRANSMISSION_TYPE_AT, VEHICLEIF_SHIFT_POSITION_N, VEHICLEIF_PKB_UNKNOWN, VEHICLESENS_NMEA_PASCD_TMS_N }, /* However, the Vehicle does not notify you by Phase3. */ - { VEHICLEIF_TRANSMISSION_TYPE_AT, VEHICLEIF_SHIFT_POSITION_D, VEHICLEIF_PKB_UNKNOWN, VEHICLESENS_NMEA_PASCD_TMS_D }, - /* Transmission Type : UNKNOWN */ -#if 1 /* For Plus _CWORD27_ Gear Data Support 180115 */ - { VEHICLEIF_TRANSMISSION_TYPE_UNKNOWN, VEHICLEIF_SHIFT_POSITION_U, VEHICLEIF_PKB_UNKNOWN, VEHICLESENS_NMEA_PASCD_TMS_U }, - { VEHICLEIF_TRANSMISSION_TYPE_UNKNOWN, VEHICLEIF_SHIFT_POSITION_R, VEHICLEIF_PKB_UNKNOWN, VEHICLESENS_NMEA_PASCD_TMS_U }, - { VEHICLEIF_TRANSMISSION_TYPE_UNKNOWN, VEHICLEIF_SHIFT_POSITION_P, VEHICLEIF_PKB_UNKNOWN, VEHICLESENS_NMEA_PASCD_TMS_U }, - { VEHICLEIF_TRANSMISSION_TYPE_UNKNOWN, VEHICLEIF_SHIFT_POSITION_N, VEHICLEIF_PKB_UNKNOWN, VEHICLESENS_NMEA_PASCD_TMS_U }, - { VEHICLEIF_TRANSMISSION_TYPE_UNKNOWN, VEHICLEIF_SHIFT_POSITION_D, VEHICLEIF_PKB_UNKNOWN, VEHICLESENS_NMEA_PASCD_TMS_U }, -#else /* For Plus _CWORD27_ Gear Data Support 180115 */ - { VEHICLEIF_TRANSMISSION_TYPE_UNKNOWN, VEHICLEIF_SHIFT_POSITION_U, VEHICLEIF_PKB_UNKNOWN, VEHICLESENS_NMEA_PASCD_TMS_D }, - { VEHICLEIF_TRANSMISSION_TYPE_UNKNOWN, VEHICLEIF_SHIFT_POSITION_R, VEHICLEIF_PKB_UNKNOWN, VEHICLESENS_NMEA_PASCD_TMS_D }, - { VEHICLEIF_TRANSMISSION_TYPE_UNKNOWN, VEHICLEIF_SHIFT_POSITION_P, VEHICLEIF_PKB_UNKNOWN, VEHICLESENS_NMEA_PASCD_TMS_D }, - { VEHICLEIF_TRANSMISSION_TYPE_UNKNOWN, VEHICLEIF_SHIFT_POSITION_N, VEHICLEIF_PKB_UNKNOWN, VEHICLESENS_NMEA_PASCD_TMS_D }, - { VEHICLEIF_TRANSMISSION_TYPE_UNKNOWN, VEHICLEIF_SHIFT_POSITION_D, VEHICLEIF_PKB_UNKNOWN, VEHICLESENS_NMEA_PASCD_TMS_D }, -#endif /* For Plus _CWORD27_ Gear Data Support 180115 */ - - }; - - for (i = 0; i < VEHICLEIF_TRANSMISSION_TYPE_NUM * VEHICLEIF_SHIFT_POSITION_NUM; i++) { - if ((pPkg->type == TmsLut[i].type) && (pPkg->shift == TmsLut[i].shift)) { - strncpy(pPkg->state, TmsLut[i].state, sizeof(pPkg->state)); - break; - } - } - - -#if 1 /* For Plus _CWORD27_ Gear Data Support 180115 */ - if ((pPkg->type == VEHICLEIF_TRANSMISSION_TYPE_MT) && (pPkg->pkb == VEHICLEIF_PKB_ON)) { - strncpy(pPkg->state, VEHICLESENS_NMEA_PASCD_TMS_P, sizeof(VEHICLESENS_NMEA_PASCD_TMS_P)); - } -#endif /* For Plus _CWORD27_ Gear Data Support 180115 */ - - - if (i == VEHICLEIF_TRANSMISSION_TYPE_NUM * VEHICLEIF_SHIFT_POSITION_NUM) { - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, - "FORBIDDEN ERROR: Can't find Transmission State. type:%d shift:%d", pPkg->type, pPkg->shift); - ret_api = RET_ERROR; - } - - return ret_api; -} diff --git a/vehicleservice/positioning/server/src/Sensor/VehicleUtility.cpp b/vehicleservice/positioning/server/src/Sensor/VehicleUtility.cpp deleted file mode 100755 index 0201326..0000000 --- a/vehicleservice/positioning/server/src/Sensor/VehicleUtility.cpp +++ /dev/null @@ -1,455 +0,0 @@ -/* - * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/*************************************************************************** -@file VehicleUtility.cpp -@detail Common processing function of Vehicle -*****************************************************************************/ - -#include "VehicleUtility.h" -#include <vehicle_service/positioning_base_library.h> - -#include "gps_hal.h" -#include "positioning_common.h" - - -/*---------------------------------------------------------------------------------* - * Grobal Value * - *---------------------------------------------------------------------------------*/ -/** Timer management table */ -static VEHICLEUTILITY_TIM_MNG g_st_tim_mng; - -/** Timer setting information table */ -static const VEHICLEUTILITY_TIM_INFO g_tim_info[TIM_NUM] = { - /* GSP-related */ - {TIMVAL_GPS_STARTUP, PNO_NAVI_GPS_MAIN}, /* Start confirmation monitoring timer */ - {TIMVAL_GPS_RCVCYCLDAT, PNO_NAVI_GPS_MAIN}, /* Periodic reception data monitoring timer */ - {TIMVAL_GPS_RCVACK, PNO_NAVI_GPS_MAIN}, /* ACK reception monitoring timer */ - {TIMVAL_GPS_NAVIFST, PNO_NAVI_GPS_MAIN}, /* Initial Navigation Monitoring Timer */ - {TIMVAL_GPS_NAVICYCLE, PNO_NAVI_GPS_MAIN}, /* Navi monitoring timer */ - {TIMVAL_GPS_NAVIDISRPT, PNO_NAVI_GPS_MAIN}, /* Navigation Monitoring Disruption Log Output Timer */ - {TIMVAL_GPS_DIAGCLKGUARD, PNO_NAVI_GPS_MAIN}, /* Diag provision time guard monitoring timer */ - {TIMVAL_GPS_NMEADATAGUARD, PNO_NAVI_GPS_MAIN}, /* NMEA data-providing guard monitoring timer */ - {TIMVAL_GPS_RECOVERY, PNO_NAVI_GPS_MAIN}, /* GPS recovery timer */ - {TIMVAL_GPS_RECEIVERERR, PNO_NAVI_GPS_MAIN}, /* GPS receiver anomaly detection timer */ - /* Sensor Related Extensions */ - {TIMVAL_SNS_RCVFSTDAT, PNO_VEHICLE_SENSOR}, /* Initial cyclic sensor data reception monitoring timer */ - {TIMVAL_SNS_RCVCYCLDAT, PNO_VEHICLE_SENSOR}, /* Cyclic sensor data reception monitoring timer */ - {TIMVAL_SNS_RCVDISRPT, PNO_VEHICLE_SENSOR}, /* Cyclic sensor data interruption log output timer */ -}; - -/*---------------------------------------------------------------------------------* - * Prototype * - *---------------------------------------------------------------------------------*/ -static uint16_t VehicleUtilityTimeMakSeqNo(VEHICLEUTILITY_TIM_KIND tim_kind); - -/*************************************************************************** -@brief send message function for Vehicle domain. -@outline send message function with put error diag function if error occurred. -@type Completion return type -@param[in] PNO pno : PNO -@param[in] u_int16 size : size of message data -@param[in] void* msgbuf : message data -@param[in] u_int16 mode : mode -@threshold -@return RET_API -@retval RET_NORMAL : Normal end -@retval RET_ERROR : Abnormal end -*****************************************************************************/ -RET_API VehicleUtilitySndMsg(PNO pno, u_int16 size, void *msgbuf, u_int16 mode) { - RET_API ret_api; - if (msgbuf != NULL) { // LCOV_EXCL_BR_LINE 6: msgbuf cannot be null - ret_api = _pb_SndMsg(pno, size, msgbuf, mode); - /* RET_ERROR: Execute _pb_Exit() after dialog registration */ - if (ret_api == RET_ERROR) { - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "_pb_SndMsg ERROR [ret_api:%d]", ret_api); - } - } else { - ret_api = RET_ERRPARAM; - } - - return ret_api; -} - -/*************************************************************************** -@brief send message function for Vehicle domain. -@outline receive message function with put error diag function if error occurred. -@type Completion return type -@param[in] PNO pno : PNO -@param[in] u_int16 size : size of message data -@param[in] void* msgbuf : message data -@param[in] u_int16 mode : mode -@threshold -@return RET_API -@retval RET_NORMAL : Normal end -@retval RET_ERROR : Abnormal end -*****************************************************************************/ -RET_API VehicleUtilityRcvMsg(PNO pno, u_int16 size, void **msgbuf, u_int16 mode) -{ - RET_API ret_api; - - if (msgbuf != NULL) { // LCOV_EXCL_BR_LINE 6: msgbuf cannot be null - ret_api = _pb_RcvMsg(pno, size, msgbuf, mode); - /* For RET_ERROR Sys_Exit() after dialog registration */ - if (ret_api == RET_ERROR) { - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "_pb_RcvMsg ERROR [ret_api:%d]", ret_api); - } - } else { - ret_api = RET_ERRPARAM; - } - - return ret_api; -} - -/*************************************************************************** -@brief Diagcode submit for Vehicle domain. -@outline submit the DiagCode for Vehicle domain. -@type Completion return type -@param[in] u_int32 err_id : Diag Code -@param[in] u_int16 positioning_code : Positioning Code -@param[in] void* msgbuf : message data -@return void -*****************************************************************************/ -void VehicleUtilityDiagCodePut(u_int32 err_id, u_int16 positioning_code) { // LCOV_EXCL_START 8 : dead code - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert -} -// LCOV_EXCL_STOP - -/** - * @brief - * Timer function initialization processing - * - */ -void VehicleUtilityInitTimer(void) { - VEHICLEUTILITY_TIM_MNG *pst_tim_mng; - u_int32 i; - - pst_tim_mng = &g_st_tim_mng; - - /* Initialize timer management table */ - memset(pst_tim_mng, 0x00, sizeof(VEHICLEUTILITY_TIM_MNG)); - - for (i = 0; i < TIM_NUM; i++) { - pst_tim_mng->sts[i].flag = TIMER_OFF; - pst_tim_mng->sts[i].cnt = 0; - } -} - -/** - * @brief - * Timer start processing<br> - * - * Starts a timer of the specified type<br> - * 1.Increment total number of timer start<br> - * 2.Timer Sequence Number Creation<br> - * 3.Get timeout value<br> - * 4.Timer start<br> - * - * @param[in] Tim_kind Timer type - * - * @return TRUE Normal completion<br> - * FALSE abend<br> - */ -BOOL VehicleUtilitySetTimer(VEHICLEUTILITY_TIM_KIND tim_kind) { - VEHICLEUTILITY_TIM_MNG *pst_tim_mng; - const uint32_t *p_time_val; - const PNO *p_pno; - RET_API api_ret; /* Timer API return value */ - u_int16 seq_no; - BOOL ret = TRUE; - - pst_tim_mng = &g_st_tim_mng; - - p_time_val = &(g_tim_info[tim_kind].timer_val); /* Timer set value */ - p_pno = &(g_tim_info[tim_kind].pno); /* Notify party PNO */ - - if (pst_tim_mng->sts[tim_kind].flag == TIMER_ON) { - /*-----------------------------------------------------------------------*/ - /* When the same timer has already started */ - /* Terminate without starting the timer because the timer is set multiple times. */ - /*-----------------------------------------------------------------------*/ - ret = FALSE; - } else { - /*-----------------------------------------------------------------------*/ - /* Count up the timer counter of the corresponding timer by 1. */ - /*-----------------------------------------------------------------------*/ - if (pst_tim_mng->sts[tim_kind].cnt >= TIM_CNTMAX) { - /*-----------------------------------------------------------------------*/ - /* When the count reaches the maximum number,Count again from 1 */ - /*-----------------------------------------------------------------------*/ - pst_tim_mng->sts[tim_kind].cnt = TIM_CNTMIN; - } else { - /*-----------------------------------------------------------------------*/ - /* If the count has not reached the maximum,Count up */ - /*-----------------------------------------------------------------------*/ - pst_tim_mng->sts[tim_kind].cnt++; - } - - /*-----------------------------------------------------------------------*/ - /* Creating Timer Sequence Numbers */ - /*-----------------------------------------------------------------------*/ - seq_no = VehicleUtilityTimeMakSeqNo(tim_kind); - - /*-----------------------------------------------------------------------*/ - /* Start the timer */ - /*-----------------------------------------------------------------------*/ - api_ret = _pb_ReqTimerStart(*p_pno, seq_no, TIMER_TYPE_USN, (u_int32)*p_time_val); - if (api_ret != RET_NORMAL) { - ret = FALSE; - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, \ - "_pb_ReqTimerStart ERROR!! [api_ret=%d]", api_ret); - } else { - /*-----------------------------------------------------------------------*/ - /* Successful timer start */ - /* Set the start/stop flag of the corresponding timer to start (MCSUB_ON) */ - /*-----------------------------------------------------------------------*/ - pst_tim_mng->sts[tim_kind].flag = TIMER_ON; - } - } - - return ret; -} - -/** - * @brief - * Timer stop processing<br> - * - * Stops a timer of the specified type<br> - * 1.Get the sequence number of the specified type<br> - * 2.Timer stop<br> - * - * @param[in] Tim_kind Timer type - * @param[in] pno Process number - * - * @return TRUE Normal completion<br> - * FALSE abend<br> - */ -BOOL VehicleUtilityStopTimer(VEHICLEUTILITY_TIM_KIND tim_kind) { - VEHICLEUTILITY_TIM_MNG *pst_tim_mng; - const PNO *p_pno; - BOOL ret = TRUE; - RET_API api_ret; - u_int16 seq_no; - - pst_tim_mng = &g_st_tim_mng; - - p_pno = &(g_tim_info[tim_kind].pno); /* Notify party PNO */ - - /* Check timer start/stop flag */ - if (pst_tim_mng->sts[tim_kind].flag == TIMER_OFF) { - /* If it is already stopped, do nothing. */ - ret = FALSE; - } else { - /*-----------------------------------------------------------------------*/ - /* Creating Timer Sequence Numbers */ - /*-----------------------------------------------------------------------*/ - seq_no = VehicleUtilityTimeMakSeqNo(tim_kind); - - /*-----------------------------------------------------------------------*/ - /* Set the corresponding timer to stop */ - /*-----------------------------------------------------------------------*/ - api_ret = _pb_TimerStop(*p_pno, seq_no, TIMER_TYPE_USN); - if (api_ret != RET_NORMAL) { - ret = FALSE; - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "_pb_TimerStop ERROR!! [api_ret=%d]", api_ret); - } - - /*-----------------------------------------------------------------------*/ - /* Set the start/stop flag of the corresponding timer to stop (MCSUB_OFF) */ - /* Set the ID of the corresponding timer to invalid (DEV_TED_INVALID) */ - /*-----------------------------------------------------------------------*/ - pst_tim_mng->sts[tim_kind].flag = TIMER_OFF; - } - return ret; -} - -/** - * @brief - * Timer Sequence Number Determination<br> - * - * Determine whether the timer sequence number corresponds to the one being managed - * - * @param[in] seqno Timer Sequence Number - * - * @return TRUE Normal completion(No problem)<br> - * FALSE abend(Unusual number)<br> - */ -BOOL VehicleUtilityTimeJdgKnd(uint16_t seqno) { // LCOV_EXCL_START 8 : dead code - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - VEHICLEUTILITY_TIM_MNG *pst_tim_mng; - BOOL ret; - u_int8 timekind; - u_int8 count; - - pst_tim_mng = &g_st_tim_mng; - - timekind = (u_int8)((seqno & 0xff00) >> 8); - count = (u_int8)(seqno & 0x00ff); - - /* Timer type is unexpected */ - if (timekind >= TIM_NUM) { - ret = FALSE; - } else { - if ((pst_tim_mng->sts[timekind].cnt == count) && - (pst_tim_mng->sts[timekind].flag == TIMER_ON)) { - /* The counter matches and the counter start/stop flag is "Start". */ - ret = TRUE; - } else { - /* Not applicable due to differences */ - ret = FALSE; - } - } - - return ret; -} -// LCOV_EXCL_STOP - -/** - * @brief - * Timer Sequence Number Creation<br> - * - * Creating a Sequence Number for a Timer<br> - * 1. The upper 1 byte is the timer type.,So that the lower 1 times is the total number of timer starts - * Create a sequence number. - * - * @param[in] Tim_kind Timer type - * - * @return Timer Sequence Number - */ -static uint16_t VehicleUtilityTimeMakSeqNo(VEHICLEUTILITY_TIM_KIND tim_kind) { - VEHICLEUTILITY_TIM_MNG *pst_tim_mng; - u_int16 seq_no; /* Timer Sequence Number */ - - pst_tim_mng = &g_st_tim_mng; - - /*------------------------------------------------------------------------*/ - /* Definition of Sequence Number */ - /* |------------------- Sequence number(2Byte) -----------------------| */ - /* 15 8 7 0 */ - /* +-------------------------------+-----------------------------------+ */ - /* | Timer type(1Byte) | Counter(1Byte)(0x01 ? 0xFF) | */ - /* +-------------------------------+-----------------------------------+ */ - /* For the timer type,0x00 ? (Number of timers-1) */ - /* For counters,0x01 ? 0xFF(Do not use 0x00.) */ - /* (Counters are counted up each time a timer is started. */ - /* Count up when counter is 0xFF, */ - /* Be counted up from the 0x01) */ - /*------------------------------------------------------------------------*/ - seq_no = static_cast<u_int16>(((u_int16)tim_kind << 8) | (pst_tim_mng->sts[tim_kind].cnt)); - - return seq_no; -} - -/** - * @brief - * External pin status request - */ -void LineSensDrvExtTermStsReq(void) { - T_APIMSG_MSGBUF_HEADER st_snd_msg; - RET_API lret; - - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "+"); - - memset(&st_snd_msg, 0x00, sizeof(st_snd_msg)); - - st_snd_msg.hdr.sndpno = PNO_LINE_SENS_DRV; - st_snd_msg.hdr.respno = 0x0000; - st_snd_msg.hdr.cid = CID_EXTTERM_REQ; - st_snd_msg.hdr.msgbodysize = 0x00; /* No data */ - st_snd_msg.hdr.rid = 0x00; - - /* Messaging */ - lret = _pb_SndMsg(PNO_LINE_SENS_DRV, sizeof(T_APIMSG_MSGBUF_HEADER), &st_snd_msg, 0); - if (lret != RET_NORMAL) { - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "_pb_SndMsg ERROR!! lret=%d", lret); - lret = RET_ERROR; - } - - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "-"); - - return; -} - - -/** - * @brief - * Backup data read request send processing<BR> - * - * @return RET_NORMAL Normal completion - * @return RET_ERROR ABENDs - */ -RET_API DEVGpsSndBackupDataLoadReq(void) { - RET_API lret; - T_APIMSG_MSGBUF_HEADER st_snd_msg; - - /** Create GPS Data Notification Message */ - (void)memset(&st_snd_msg, 0x00, sizeof(st_snd_msg)); /* QAC 3200 */ - /** Message header */ - st_snd_msg.hdr.sndpno = 0x0000; - st_snd_msg.hdr.respno = 0x0000; - st_snd_msg.hdr.cid = CID_GPS_BACKUPDATA_LOAD; - st_snd_msg.hdr.msgbodysize = 0x00; - st_snd_msg.hdr.rid = 0x00; - - /* Messaging */ - lret = _pb_SndMsg(PNO_NAVI_GPS_MAIN, sizeof(st_snd_msg), &st_snd_msg, 0); - if (lret != RET_NORMAL) { - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "_pb_SndMsg ERROR!! [lret=%d]", lret); - lret = RET_ERROR; - } - - return(lret); -} - -/** - * @brief - * Acquisition of GPS-format error count information (dump) - * - * @param[out] p_buf Dump information - */ -void DEVGpsGetDebugGpsFormatFailCnt(void* p_buf) { // LCOV_EXCL_START 8 : dead code - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - if (p_buf != NULL) { - snprintf(reinterpret_cast<char *>(p_buf), \ - 512, "GPS Format Fail Count is not supported.\n"); // NOLINT(readability/nolint) - } - return; -} -// LCOV_EXCL_STOP - -/** - * @brief - * Initial sensor data reception flag acquisition - */ -u_int8 LineSensDrvGetSysRecvFlag(void) { // LCOV_EXCL_START 7: uesd only in FrameworkunifiedOnDebugDump - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - return 0; -} -// LCOV_EXCL_STOP - -/** - * @brief - * Get GPS Rollover Standard Week Number - * - * @return GPS rollover base week number - */ -uint16_t DEVGpsGetWknRollover(void) { // LCOV_EXCL_START 7: uesd only in FrameworkunifiedOnDebugDump - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - return 0; -} -// LCOV_EXCL_STOP - -/* end of file */ diff --git a/vehicleservice/positioning/server/src/ServiceInterface/BackupMgrIf.cpp b/vehicleservice/positioning/server/src/ServiceInterface/BackupMgrIf.cpp deleted file mode 100755 index da5dba2..0000000 --- a/vehicleservice/positioning/server/src/ServiceInterface/BackupMgrIf.cpp +++ /dev/null @@ -1,211 +0,0 @@ -/* - * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @file - * BackupMgrIf.cpp - * @brief - * BackupMgr service-to-service interface - */ - -/*---------------------------------------------------------------------------------* - * Include Files * - *---------------------------------------------------------------------------------*/ -#include <vehicle_service/positioning_base_library.h> -#include "BackupMgrIf.h" - -/*---------------------------------------------------------------------------------* - * Definition * - *---------------------------------------------------------------------------------*/ - -/*---------------------------------------------------------------------------------* - * Structre * - *---------------------------------------------------------------------------------*/ - -/*---------------------------------------------------------------------------------* - * Local Function Prototype * - *---------------------------------------------------------------------------------*/ - -/*---------------------------------------------------------------------------------* - * Grobal Value * - *---------------------------------------------------------------------------------*/ - -// static BOOL g_backup_mgr_availability = FALSE; -BOOL g_backup_mgr_availability = FALSE; - -/*---------------------------------------------------------------------------------* - * Function * - *---------------------------------------------------------------------------------*/ - -/** - * @brief - * BackupMgr Services IF Availability Change Notification Registration - * - * @param[in] fp_on_cmd Callback function - * @return eFrameworkunifiedStatusOK - * @return eFrameworkunifiedStatusFail - */ -EFrameworkunifiedStatus BackupMgrIfNotifyOnBackupMgrAvailability(CbFuncPtr fp_on_cmd) { - EFrameworkunifiedStatus estatus = eFrameworkunifiedStatusFail; - HANDLE happ; - - happ = _pb_GetAppHandle(); - if (happ != NULL) { - /* NS_BackupMgr/Availability Changing notification registration */ - estatus = FrameworkunifiedSubscribeNotificationWithCallback(happ, NTFY_BackupMgr_Availability, (CbFuncPtr)fp_on_cmd); // LCOV_EXCL_BR_LINE 6:unexpected branch //NOLINT (whitespace/line_length) - if (eFrameworkunifiedStatusOK != estatus) { - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, \ - "PositioningSubscriveNotificationswithCallback ERROR!! [estatus=%d]", estatus); - } - } else { - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "_pb_GetAppHandle ERROR!! [happ=%p]", happ); - } - - return estatus; -} - -/** - * @brief - * BackupMgr Services IF-Availability Settings - * - * @param[in] b_is_available Available state - * @return none - */ -void BackupMgrIfSetAvailability(BOOL b_is_available) { - g_backup_mgr_availability = b_is_available; - - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, \ - "g_backup_mgr_availability=%d", g_backup_mgr_availability); - - return; -} - -#ifdef __cplusplus -extern "C" { -#endif -/** - * @brief - * BackupMgr Services IF-Availability Acquisition - * - * @param[in] none - * @return gb_BackupMgrAvailability - */ - -BOOL BackupMgrIf_GetAvailability(void) -{ - return g_backup_mgr_availability; -} -#ifdef __cplusplus -} -#endif - -/** - * @brief - * Import BackupMgr Services IFs - * - * @param[in] tag_id - * @param[in] ui_offset - * @param[in] *pv_buf - * @param[in] ui_size - * @param[out] pb_is_available Available state - * @return eFrameworkunifiedStatusOK - * @return eFrameworkunifiedStatusFail - */ -EFrameworkunifiedStatus BackupMgrIfBackupDataRd(PCSTR tag_id, uint32_t ui_offset, void *pv_buf, \ - uint32_t ui_size, BOOL* pb_is_available) { - EFrameworkunifiedStatus estatus = eFrameworkunifiedStatusFail; - int32_t lret; - - if (BackupMgrIf_GetAvailability() == TRUE) { - lret = Backup_DataRd(tag_id, ui_offset, pv_buf, ui_size); - if (lret == BKUP_RET_NORMAL) { - /* 8Byte fixed outputs */ - FRAMEWORKUNIFIEDLOG(ZONE_28, __FUNCTION__, \ - "Backup_DataRd Done [tag_id=%s, pv_buf(Hex):%02x %02x %02x %02x %02x %02x %02x %02x, offset=%d, size=%d]", - tag_id, - *(reinterpret_cast<int8_t*>(pv_buf)), - *((reinterpret_cast<int8_t*>(pv_buf))+1), - *((reinterpret_cast<int8_t*>(pv_buf))+2), - *((reinterpret_cast<int8_t*>(pv_buf))+3), - *((reinterpret_cast<int8_t*>(pv_buf))+4), - *((reinterpret_cast<int8_t*>(pv_buf))+5), - *((reinterpret_cast<int8_t*>(pv_buf))+6), - *((reinterpret_cast<int8_t*>(pv_buf))+7), - ui_offset, ui_size); - - estatus = eFrameworkunifiedStatusOK; - } else { - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, \ - "Backup_DataRd ERROR!! [lret=%d, tag_id=%s, ui_offset=%d, pv_buf=%p, ui_size=%d]", \ - lret, tag_id, ui_offset, pv_buf, ui_size); - } - } else { - /* nop */ - } - - *pb_is_available = BackupMgrIf_GetAvailability(); - - return estatus; -} - -/** - * @brief - * BackupMgr Services IF Write - * - * @param[in] tag_id - * @param[in] *pv_buf - * @param[in] ui_offset - * @param[in] ui_size - * @param[out] pb_is_available Available state - * @return eFrameworkunifiedStatusOK - * @return eFrameworkunifiedStatusFail - */ -EFrameworkunifiedStatus BackupMgrIfBackupDataWt(PCSTR tag_id, void *pv_buf, uint32_t ui_offset, \ - uint32_t ui_size, BOOL* pb_is_available) { - EFrameworkunifiedStatus estatus = eFrameworkunifiedStatusFail; - int32_t lret; - - if (BackupMgrIf_GetAvailability() == TRUE) { - lret = Backup_DataWt(tag_id, pv_buf, ui_offset, ui_size); - if (lret == BKUP_RET_NORMAL) { - /* 8Byte fixed outputs */ - FRAMEWORKUNIFIEDLOG(ZONE_28, __FUNCTION__, - "Backup_DataWt Done [tag_id=%s, pv_buf(Hex):%02x %02x %02x %02x %02x %02x %02x %02x, offset=%d, size=%d]", - tag_id, - *(reinterpret_cast<int8_t*>(pv_buf)), - *((reinterpret_cast<int8_t*>(pv_buf))+1), - *((reinterpret_cast<int8_t*>(pv_buf))+2), - *((reinterpret_cast<int8_t*>(pv_buf))+3), - *((reinterpret_cast<int8_t*>(pv_buf))+4), - *((reinterpret_cast<int8_t*>(pv_buf))+5), - *((reinterpret_cast<int8_t*>(pv_buf))+6), - *((reinterpret_cast<int8_t*>(pv_buf))+7), - ui_offset, ui_size); - - estatus = eFrameworkunifiedStatusOK; - } else { - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, \ - "Backup_DataWt ERROR!! [lret=%d, tag_id=%s, pv_buf=%p, ui_offset=%d, ui_size=%d]", \ - lret, tag_id, pv_buf, ui_offset, ui_size); - } - } else { - /* nop */ - } - - *pb_is_available = BackupMgrIf_GetAvailability(); - - return estatus; -} diff --git a/vehicleservice/positioning/server/src/ServiceInterface/ClockIf.cpp b/vehicleservice/positioning/server/src/ServiceInterface/ClockIf.cpp deleted file mode 100755 index 52fd4cf..0000000 --- a/vehicleservice/positioning/server/src/ServiceInterface/ClockIf.cpp +++ /dev/null @@ -1,138 +0,0 @@ -/* - * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @file - * ClockIf.cpp - * @brief - * Clock service-to-service interface - */ - -/*---------------------------------------------------------------------------------* - * Include Files * - *---------------------------------------------------------------------------------*/ -#include <vehicle_service/positioning_base_library.h> -#include "ClockIf.h" -#include <stub/clock_notifications.h> - -/*---------------------------------------------------------------------------------* - * Definition * - *---------------------------------------------------------------------------------*/ - -/*---------------------------------------------------------------------------------* - * Structre * - *---------------------------------------------------------------------------------*/ - -/*---------------------------------------------------------------------------------* - * Local Function Prototype * - *---------------------------------------------------------------------------------*/ - -/*---------------------------------------------------------------------------------* - * Grobal Value * - *---------------------------------------------------------------------------------*/ -static BOOL g_clock_availability = FALSE; - -/*---------------------------------------------------------------------------------* - * Function * - *---------------------------------------------------------------------------------*/ -/** - * @brief - * Clock Services IF Availability Change Notification Registration - * - * @param[in] fp_on_cmd Callback function - * @return eFrameworkunifiedStatusOK - * @return eFrameworkunifiedStatusFail - */ -EFrameworkunifiedStatus ClockIfNotifyOnClockAvailability(CbFuncPtr fp_on_cmd) { - EFrameworkunifiedStatus estatus = eFrameworkunifiedStatusFail; - HANDLE happ; - - happ = _pb_GetAppHandle(); - if (happ != NULL) { - /* Clock/Availability Changing notification registration */ - estatus = FrameworkunifiedSubscribeNotificationWithCallback(happ, NTFY_Clock_Availability, fp_on_cmd); // LCOV_EXCL_BR_LINE 6:unexpected branch //NOLINT (whitespace/line_length) - if (eFrameworkunifiedStatusOK != estatus) { // LCOV_EXCL_BR_LINE 4: nsfw error - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, - "PositioningSubscriveNotificationswithCallback ERROR!! [estatus=%d]", estatus); - } - } else { - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "_pb_GetAppHandle ERROR!! [happ=%p]", happ); - } - - return estatus; -} - -/** - * @brief - * Clock Services IF-Availability Settings - * - * @param[in] b_is_available Available state - * @return none - */ -void ClockIfSetAvailability(BOOL b_is_available) { - g_clock_availability = b_is_available; - - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "g_clock_availability=%d", g_clock_availability); - - return; -} - -/** - * @brief - * Clock Services IF GPS Time - * - * @param[in] *gps_time GPS time - * @param[out] *b_is_available Available state - * @return eFrameworkunifiedStatusOK - * @return eFrameworkunifiedStatusFail - */ -EFrameworkunifiedStatus ClockIfDtimeSetGpsTime(const SENSOR_MSG_GPSTIME *pst_gps_time, BOOL* pb_is_available) { - EFrameworkunifiedStatus estatus = eFrameworkunifiedStatusFail; - HANDLE happ; - T_DTIME_MSG_GPSTIME st_dtime_gpstime; - - if (g_clock_availability == TRUE) { - happ = _pb_GetAppHandle(); - if (happ != NULL) { // LCOV_EXCL_BR_LINE 4: nsfw error - st_dtime_gpstime.utc.year = pst_gps_time->utc.year; - st_dtime_gpstime.utc.month = pst_gps_time->utc.month; - st_dtime_gpstime.utc.date = pst_gps_time->utc.date; - st_dtime_gpstime.utc.hour = pst_gps_time->utc.hour; - st_dtime_gpstime.utc.minute = pst_gps_time->utc.minute; - st_dtime_gpstime.utc.second = pst_gps_time->utc.second; - st_dtime_gpstime.tdsts = pst_gps_time->tdsts; - - /* Set GPS time for Clock services */ - estatus = DTime_setGpsTime(happ, &st_dtime_gpstime); - if (estatus != eFrameworkunifiedStatusOK) { - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, \ - "DTime_setGpsTime ERROR!! [ret=%d, y=%d, m=%d, d=%d, h=%d, n=%d, s=%d, sts=%d]", \ - estatus, st_dtime_gpstime.utc.year, st_dtime_gpstime.utc.month, st_dtime_gpstime.utc.date, \ - st_dtime_gpstime.utc.hour, st_dtime_gpstime.utc.minute, st_dtime_gpstime.utc.second, \ - st_dtime_gpstime.tdsts); - } - } else { - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "_pb_GetAppHandle ERROR!! [happ=%p]", happ); - } - } else { - /* nop */ - } - - *pb_is_available = g_clock_availability; - - return estatus; -} - diff --git a/vehicleservice/positioning/server/src/ServiceInterface/CommUsbIf.cpp b/vehicleservice/positioning/server/src/ServiceInterface/CommUsbIf.cpp deleted file mode 100755 index b776ff0..0000000 --- a/vehicleservice/positioning/server/src/ServiceInterface/CommUsbIf.cpp +++ /dev/null @@ -1,147 +0,0 @@ -/* - * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @file - * CommUsbIf.cpp - * @brief - * CommUSB service-to-service interface - */ - -/*---------------------------------------------------------------------------------* - * Include Files * - *---------------------------------------------------------------------------------*/ -#include <vehicle_service/positioning_base_library.h> -#include "CommUsbIf.h" - -/*---------------------------------------------------------------------------------* - * Definition * - *---------------------------------------------------------------------------------*/ - -/*---------------------------------------------------------------------------------* - * Structre * - *---------------------------------------------------------------------------------*/ - -/*---------------------------------------------------------------------------------* - * Local Function Prototype * - *---------------------------------------------------------------------------------*/ - -/*---------------------------------------------------------------------------------* - * Grobal Value * - *---------------------------------------------------------------------------------*/ -static BOOL g_comm_usb_availability = FALSE; - -/*---------------------------------------------------------------------------------* - * Function * - *---------------------------------------------------------------------------------*/ -/** - * @brief - * Registering CommUSB Services IF Callback Functions - * - * @param[in] *p_msg_handler Callback function table - * @param[in] Ui_handler_count Number of callback functions - * @return eFrameworkunifiedStatusOK - * @return eFrameworkunifiedStatusFail - */ -EFrameworkunifiedStatus CommUsbIfAttachCallbacksToDispatcher( // NOLINT(readability/nolint) - _FrameworkunifiedProtocolCallbackHandler const* p_msg_handler, - unsigned int ui_handler_count) { - EFrameworkunifiedStatus estatus = eFrameworkunifiedStatusFail; - HANDLE happ; - - happ = _pb_GetAppHandle(); - if (happ != NULL) { - estatus = FrameworkunifiedAttachCallbacksToDispatcher(happ, "NS_ANY_SRC", p_msg_handler, ui_handler_count); - if (eFrameworkunifiedStatusOK != estatus) { // LCOV_EXCL_BR_LINE 4: nsfw error - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, - "FrameworkunifiedAttachCallbacksToDispatcher ERROR!! [estatus=%d]", estatus); - } - } else { - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "_pb_GetAppHandle ERROR!! [happ=%p]", happ); - } - - return estatus; -} - -/** - * @brief - * Remove CommUSB Services IF Callback Functions - * - * @param[in] *p_msg_handler CID table - * @param[in] ui_handler_count Number of CIDs - * @return eFrameworkunifiedStatusOK - * @return eFrameworkunifiedStatusFail - */ -EFrameworkunifiedStatus CommUsbIfDetachCallbacksFromDispatcher(const PUI_32 pui_cmd_array, UI_32 ui_command_count) { - EFrameworkunifiedStatus estatus = eFrameworkunifiedStatusFail; - HANDLE happ; - - happ = _pb_GetAppHandle(); - if (happ != NULL) { - estatus = FrameworkunifiedDetachCallbacksFromDispatcher(happ, "NS_ANY_SRC", pui_cmd_array, ui_command_count, NULL); - /* In the event of failure */ - if (estatus != eFrameworkunifiedStatusOK) { - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, \ - "PositioningDetachCallbacksToDispatcher Failed in FrameworkunifiedOnStop [estatus=%d]", estatus); - } - } else { - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "_pb_GetAppHandle ERROR!! [happ=%p]", happ); - } - - return estatus; -} - -/** - * @brief - * CommUSB Services IF Availability Change Notification Registration - * - * @param[in] fp_on_cmd Callback function - * @return eFrameworkunifiedStatusOK - * @return eFrameworkunifiedStatusFail - */ -EFrameworkunifiedStatus CommUsbIfNotifyOnCommUSBAvailability(CbFuncPtr fp_on_cmd) { - EFrameworkunifiedStatus estatus = eFrameworkunifiedStatusFail; - HANDLE happ; - - happ = _pb_GetAppHandle(); - if (happ != NULL) { // LCOV_EXCL_BR_LINE 4: nsfw error - /* PS_CommUSB/Availability Changing notification registration */ - estatus = FrameworkunifiedSubscribeNotificationWithCallback(happ, NTFY_CommUSB_Availability, fp_on_cmd); // LCOV_EXCL_BR_LINE 6:unexpected branch //NOLINT (whitespace/line_length) - if (eFrameworkunifiedStatusOK != estatus) { // LCOV_EXCL_BR_LINE 4: nsfw error - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, - "PositioningSubscriveNotificationswithCallback ERROR!! [estatus=%d]", estatus); - } - } else { - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "_pb_GetAppHandle ERROR!! [happ=%p]", happ); - } - - return estatus; -} - -/** - * @brief - * CommUSB Services IF-Availability Settings - * - * @param[in] pb_is_available - * @return none - */ -void CommUsbIfSetAvailability(BOOL b_is_available) { - g_comm_usb_availability = b_is_available; - - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "g_comm_usb_availability=%d", g_comm_usb_availability); - - return; -} diff --git a/vehicleservice/positioning/server/src/ServiceInterface/DevDetectSrvIf.cpp b/vehicleservice/positioning/server/src/ServiceInterface/DevDetectSrvIf.cpp deleted file mode 100755 index 800429f..0000000 --- a/vehicleservice/positioning/server/src/ServiceInterface/DevDetectSrvIf.cpp +++ /dev/null @@ -1,279 +0,0 @@ -/* - * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @file - * DevDetectSrvIf.cpp - * @brief - * DevDetectSrv service-to-service interface - */ - -/*---------------------------------------------------------------------------------* - * Include Files * - *---------------------------------------------------------------------------------*/ -#include <vehicle_service/positioning_base_library.h> -#include "DevDetectSrvIf.h" - -/*---------------------------------------------------------------------------------* - * Definition * - *---------------------------------------------------------------------------------*/ - -/*---------------------------------------------------------------------------------* - * Structre * - *---------------------------------------------------------------------------------*/ - -/*---------------------------------------------------------------------------------* - * Local Function Prototype * - *---------------------------------------------------------------------------------*/ - -/*---------------------------------------------------------------------------------* - * Grobal Value * - *---------------------------------------------------------------------------------*/ -static BOOL g_dev_detect_srv_availability = FALSE; - -/** Device insertion detection */ -DeviceDetectionServiceIf g_if_ss_dev; - - -/*---------------------------------------------------------------------------------* - * Function * - *---------------------------------------------------------------------------------*/ -/** - * @brief - * DevDetectSrv Services IF-Availability Settings - * - * @param[in] b_is_available Available state - * @return none - */ -void DevDetectSrvIfSetAvailability(BOOL b_is_available) { - g_dev_detect_srv_availability = b_is_available; - - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, \ - "g_dev_detect_srv_availability=%d", g_dev_detect_srv_availability); - - return; -} - -/** - * @brief - * DevDetectSrv Services IF-Initialization - * - * @return eFrameworkunifiedStatusOK - * @return eFrameworkunifiedStatusFail - */ -EFrameworkunifiedStatus DevDetectSrvIfInitialize(void) { - EFrameworkunifiedStatus estatus = eFrameworkunifiedStatusFail; - BOOL bret; - HANDLE happ; - - happ = _pb_GetAppHandle(); - if (happ != NULL) { - bret = g_if_ss_dev.Initialize(happ); - if (bret == TRUE) { - estatus = eFrameworkunifiedStatusOK; - } else { - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, \ - "g_if_ss_dev::Initialize ERROR!! [estatus=%d]", estatus); - } - } else { - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "_pb_GetAppHandle ERROR!! [happ=%p]", happ); - } - - return estatus; -} - -/** - * @brief - * DevDetectSrv Services IF Availability Change Notification Registration - * - * @param[in] fp_call_back_fn Callback function - * @return eFrameworkunifiedStatusOK - * @return eFrameworkunifiedStatusFail - */ -EFrameworkunifiedStatus DevDetectSrvIfNotifyOnDeviceDetectionAvailability(CbFuncPtr fp_call_back_fn) { - EFrameworkunifiedStatus estatus = eFrameworkunifiedStatusFail; - - estatus = g_if_ss_dev.NotifyOnDeviceDetectionAvailability(fp_call_back_fn); - if (eFrameworkunifiedStatusOK != estatus) { - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, - "DeviceDetectionServiceIf Availability ERROR!! [estatus = %d]", estatus); - } - - return estatus; -} - -/** - * @brief - * DevDetectSrv Services IF OpenSessionRequest Complete Answer Receive Callback Registration - * - * @param[in] fp_call_back_fn Callback function - * @param[out] pb_is_available Available state - * @return eFrameworkunifiedStatusOK - * @return eFrameworkunifiedStatusFail - */ -EFrameworkunifiedStatus DevDetectSrvIfNotifyOnOpenSessionAck(CbFuncPtr fp_call_back_fn, BOOL* pb_is_available) { - EFrameworkunifiedStatus estatus = eFrameworkunifiedStatusFail; - - if (g_dev_detect_srv_availability == TRUE) { - estatus = g_if_ss_dev.NotifyOnOpenSessionAck(fp_call_back_fn); - } else { - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "g_dev_detect_srv_availability=FALSE"); - } - - *pb_is_available = g_dev_detect_srv_availability; - - return estatus; -} - -/** - * @brief - * DevDetectSrv Services IF CloseSessionRequest Complete Answer Receive Callback Registration - * - * @param[in] fp_call_back_fn Callback function - * @param[out] pb_is_available Available state - * @return eFrameworkunifiedStatusOK - * @return eFrameworkunifiedStatusFail - */ -EFrameworkunifiedStatus DevDetectSrvIfNotifyOnCloseSessionAck(CbFuncPtr fp_call_back_fn, BOOL* pb_is_available) { - EFrameworkunifiedStatus estatus = eFrameworkunifiedStatusFail; - - if (g_dev_detect_srv_availability == TRUE) { - estatus = g_if_ss_dev.NotifyOnCloseSessionAck(fp_call_back_fn); - } else { - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "g_dev_detect_srv_availability=FALSE"); - } - - *pb_is_available = g_dev_detect_srv_availability; - - return estatus; -} - -/** - * @brief - * DevDetectSrv Service IF Service and Session Generation - * - * @param[out] pb_is_available Available state - * @return eFrameworkunifiedStatusOK - * @return eFrameworkunifiedStatusFail - */ -EFrameworkunifiedStatus DevDetectSrvIfOpenSessionRequest(BOOL* pb_is_available) { - EFrameworkunifiedStatus estatus = eFrameworkunifiedStatusFail; - - if (g_dev_detect_srv_availability == TRUE) { - estatus = g_if_ss_dev.OpenSessionRequest(); - } else { - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "g_dev_detect_srv_availability=FALSE"); - } - - *pb_is_available = g_dev_detect_srv_availability; - - return estatus; -} - -/** - * @brief - * DevDetectSrv Services IF-Session Id Retention - * - * @param[out] pb_is_available Available state - * @return eFrameworkunifiedStatusOK - * @return eFrameworkunifiedStatusFail - */ -EFrameworkunifiedStatus DevDetectSrvIfDecodeOpenSessionResponse(BOOL* pb_is_available) { - EFrameworkunifiedStatus estatus = eFrameworkunifiedStatusFail; - - if (g_dev_detect_srv_availability == TRUE) { - estatus = g_if_ss_dev.DecodeOpenSessionResponse(); - } else { - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "g_dev_detect_srv_availability=FALSE"); - } - - *pb_is_available = g_dev_detect_srv_availability; - - return estatus; -} - -/** - * @brief - * DevDetectSrv Services IF-Device Event Receive Callback Registration - * - * @param[in] fe_dev_detect_event - * @param[in] fp_call_back_fn - * @param[in] p_file_path - * @param[out] pb_is_available Available state - * @return eFrameworkunifiedStatusOK - * @return eFrameworkunifiedStatusFail - */ -EFrameworkunifiedStatus DevDetectSrvIfRegisterForDeviceDetectionEvent(SS_DeviceDetectionServerEvents fe_dev_detect_event, \ - CbFuncPtr fp_call_back_fn, PCSTR p_file_path, BOOL* pb_is_available) { - EFrameworkunifiedStatus estatus = eFrameworkunifiedStatusFail; - - if (g_dev_detect_srv_availability == TRUE) { - estatus = g_if_ss_dev.RegisterForDeviceDetectionEvent(fe_dev_detect_event, fp_call_back_fn, p_file_path); - } else { - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "g_dev_detect_srv_availability=FALSE"); - } - - *pb_is_available = g_dev_detect_srv_availability; - - return estatus; -} - -/** - * @brief - * DevDetectSrv Services IF DeviceDetectionServiceIf Callback Release - * - * @param[in] fe_dev_detect_event - * @param[out] pb_is_available Available state - * @return eFrameworkunifiedStatusOK - * @return eFrameworkunifiedStatusFail - */ -EFrameworkunifiedStatus DevDetectSrvIfUnRegisterForDeviceDetectionEvent(SS_DeviceDetectionServerEvents fe_dev_detect_event, \ - BOOL* pb_is_available) { - EFrameworkunifiedStatus estatus = eFrameworkunifiedStatusFail; - - if (g_dev_detect_srv_availability == TRUE) { - estatus = g_if_ss_dev.UnRegisterForDeviceDetectionEvent(fe_dev_detect_event); - } else { - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "g_dev_detect_srv_availability=FALSE"); - } - - *pb_is_available = g_dev_detect_srv_availability; - - return estatus; -} - -/** - * @brief - * DevDetectSrv Service IF Service and Destroy Sessions - * - * @param[out] pb_is_available Available state - * @return eFrameworkunifiedStatusOK - * @return eFrameworkunifiedStatusFail - */ -EFrameworkunifiedStatus DevDetectSrvIfCloseSessionRequest(BOOL* pb_is_available) { - EFrameworkunifiedStatus estatus = eFrameworkunifiedStatusFail; - - if (g_dev_detect_srv_availability == TRUE) { - estatus = g_if_ss_dev.CloseSessionRequest(); - } else { - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "g_dev_detect_srv_availability=FALSE"); - } - - *pb_is_available = g_dev_detect_srv_availability; - - return estatus; -} - diff --git a/vehicleservice/positioning/server/src/ServiceInterface/DiagSrvIf.cpp b/vehicleservice/positioning/server/src/ServiceInterface/DiagSrvIf.cpp deleted file mode 100755 index 195555e..0000000 --- a/vehicleservice/positioning/server/src/ServiceInterface/DiagSrvIf.cpp +++ /dev/null @@ -1,64 +0,0 @@ -/* - * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @file - * DiagSrvIf.cpp - * @brief - * DiagSrv service-to-service interface - */ - -/*---------------------------------------------------------------------------------* - * Include Files * - *---------------------------------------------------------------------------------*/ -#include <vehicle_service/positioning_base_library.h> -#include "DiagSrvIf.h" - -/*---------------------------------------------------------------------------------* - * Definition * - *---------------------------------------------------------------------------------*/ - -/*---------------------------------------------------------------------------------* - * Structre * - *---------------------------------------------------------------------------------*/ - -/*---------------------------------------------------------------------------------* - * Local Function Prototype * - *---------------------------------------------------------------------------------*/ - -/*---------------------------------------------------------------------------------* - * Grobal Value * - *---------------------------------------------------------------------------------*/ -static BOOL g_registration_permission = FALSE; /* Whether or not the dialog code can be registered */ - -/*---------------------------------------------------------------------------------* - * Function * - *---------------------------------------------------------------------------------*/ -/** - * @brief - * DiagSrv Services IF Registration Enable Status Setting - * - * @param[in] b_is_true - * @return none - */ -void DiagSrvIfSetRegistrationPermission(BOOL b_is_true) { - g_registration_permission = b_is_true; - - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, \ - "g_registration_permission=%d", g_registration_permission); - - return; -} diff --git a/vehicleservice/positioning/server/src/ServiceInterface/Makefile b/vehicleservice/positioning/server/src/ServiceInterface/Makefile deleted file mode 100755 index fba98e8..0000000 --- a/vehicleservice/positioning/server/src/ServiceInterface/Makefile +++ /dev/null @@ -1,54 +0,0 @@ -# -# @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -######### installed library(*.a) ############# -INST_LIBS = libPOS_ServiceInterface - -######### compiled sources ############# -libPOS_ServiceInterface_SRCS += BackupMgrIf.cpp -libPOS_ServiceInterface_SRCS += ClockIf.cpp -libPOS_ServiceInterface_SRCS += CommUsbIf.cpp -libPOS_ServiceInterface_SRCS += DevDetectSrvIf.cpp -libPOS_ServiceInterface_SRCS += DiagSrvIf.cpp -libPOS_ServiceInterface_SRCS += PSMShadowIf.cpp -libPOS_ServiceInterface_SRCS += VehicleIf.cpp - -######### add include path ############# -CPPFLAGS += -I../../include/common/ -CPPFLAGS += -I../../include/nsfw/ -CPPFLAGS += -I../../include/ServiceInterface - -CPPFLAGS += -I../../../client/include - -#CPPFLAGS += -I../../../../diag_code/library/include - -######### add compile option ############# -CPPFLAGS += -DLINUX - -LDFLAGS += -Wl,--no-undefined -LDFLAGS += -Wl,--no-as-needed -CPPFLAGS += -Werror=implicit-function-declaration -CPPFLAGS += -Werror=format-security -CPPFLAGS += -Wconversion -CPPFLAGS += -Wint-to-pointer-cast -CPPFLAGS += -Wpointer-arith -CPPFLAGS += -Wformat - -######### add library path ############# -LDFLAGS += - -include ../../../../vehicle_service.mk - diff --git a/vehicleservice/positioning/server/src/ServiceInterface/PSMShadowIf.cpp b/vehicleservice/positioning/server/src/ServiceInterface/PSMShadowIf.cpp deleted file mode 100755 index 99d9a52..0000000 --- a/vehicleservice/positioning/server/src/ServiceInterface/PSMShadowIf.cpp +++ /dev/null @@ -1,102 +0,0 @@ -/* - * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @file - * PSMShadowIf.cpp - * @brief - * PSMShadow service-to-service interface - */ - -/*---------------------------------------------------------------------------------* - * Include Files * - *---------------------------------------------------------------------------------*/ -#include <vehicle_service/positioning_base_library.h> -#include "PSMShadowIf.h" - -/*---------------------------------------------------------------------------------* - * Definition * - *---------------------------------------------------------------------------------*/ - -/*---------------------------------------------------------------------------------* - * Structre * - *---------------------------------------------------------------------------------*/ - -/*---------------------------------------------------------------------------------* - * Local Function Prototype * - *---------------------------------------------------------------------------------*/ - -/*---------------------------------------------------------------------------------* - * Grobal Value * - *---------------------------------------------------------------------------------*/ - -/*---------------------------------------------------------------------------------* - * Function * - *---------------------------------------------------------------------------------*/ -/** - * @brief - * PSMShadow Services IF Availability Change Notification Registration - * - * @param[in] fp_on_cmd Callback function - * @return eFrameworkunifiedStatusOK - * @return eFrameworkunifiedStatusFail - */ -EFrameworkunifiedStatus PSMShadowIfNotifyOnPSMShadowAvailability(CbFuncPtr fp_on_cmd) { - EFrameworkunifiedStatus estatus = eFrameworkunifiedStatusFail; - HANDLE happ; - - happ = _pb_GetAppHandle(); - if (happ != NULL) { - /* PS_PSMShadow/Availability Changing notification registration */ - estatus = FrameworkunifiedSubscribeNotificationWithCallback(happ, NTFY_PSMShadowService_Availability, fp_on_cmd); // LCOV_EXCL_BR_LINE 6:unexpected branch //NOLINT (whitespace/line_length) - if (eFrameworkunifiedStatusOK != estatus) { // LCOV_EXCL_BR_LINE 4: nsfw error - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, - "PositioningSubscriveNotificationswithCallback ERROR!! [estatus=%d]", estatus); - } - } else { - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "_pb_GetAppHandle ERROR!! [happ=%p]", happ); - } - - return estatus; -} - -/** - * @brief - * Register PSMShadow services IF start completion notification - * - * @param[in] fp_on_cmd Callback function - * @return eFrameworkunifiedStatusOK - * @return eFrameworkunifiedStatusFail - */ -EFrameworkunifiedStatus PSMShadowIfNotifyOnPSMShadowInitComp(CbFuncPtr fp_on_cmd) { - EFrameworkunifiedStatus estatus = eFrameworkunifiedStatusFail; - HANDLE happ; - - happ = _pb_GetAppHandle(); - if (happ != NULL) { - /* PS_PSMShadow startup completion notice */ - estatus = FrameworkunifiedSubscribeNotificationWithCallback(happ, NTFY_PSM_INITCOMP, fp_on_cmd); // LCOV_EXCL_BR_LINE 6:unexpected branch //NOLINT (whitespace/line_length) - if (eFrameworkunifiedStatusOK != estatus) { // LCOV_EXCL_BR_LINE 4: nsfw error - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, - "PositioningSubscriveNotificationswithCallback ERROR!! [estatus=%d]", estatus); - } - } else { - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "_pb_GetAppHandle ERROR!! [happ=%p]", happ); - } - - return estatus; -} - diff --git a/vehicleservice/positioning/server/src/ServiceInterface/VehicleIf.cpp b/vehicleservice/positioning/server/src/ServiceInterface/VehicleIf.cpp deleted file mode 100755 index 0ef5e15..0000000 --- a/vehicleservice/positioning/server/src/ServiceInterface/VehicleIf.cpp +++ /dev/null @@ -1,364 +0,0 @@ -/* - * @copyright Copyright (c) 2018-2020 TOYOTA MOTOR CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @file - * VehilceIf.cpp - * @brief - * Vehicle Service Interface - */ - -/*---------------------------------------------------------------------------------* - * Include Files * - *---------------------------------------------------------------------------------*/ -#include <vehicle_service/positioning_base_library.h> -#include <stub/Vehicle_Sensor_Common_API.h> -#include <stub/Vehicle_API.h> -#include <stub/vehicle_notifications.h> - -#include "VehicleIf.h" - -/*---------------------------------------------------------------------------------* - * Definition * - *---------------------------------------------------------------------------------*/ - -/*---------------------------------------------------------------------------------* - * Structre * - *---------------------------------------------------------------------------------*/ - -/*---------------------------------------------------------------------------------* - * Local Function Prototype * - *---------------------------------------------------------------------------------*/ - -/*---------------------------------------------------------------------------------* - * Grobal Value * - *---------------------------------------------------------------------------------*/ -static BOOL gb_vehicleAvailability = FALSE; - -/*---------------------------------------------------------------------------------* - * Function * - *---------------------------------------------------------------------------------*/ -/** - * @brief - * Registering Vehicle Services IF Callback Functions - * - * @param[in] *p_msg_handler Callback function table - * @param[in] Ui_handler_count Number of callback functions - * @return eFrameworkunifiedStatusOK - * @return eFrameworkunifiedStatusFail - */ -EFrameworkunifiedStatus VehicleIfAttachCallbacksToDispatcher( // NOLINT(readability/nolint) - _FrameworkunifiedProtocolCallbackHandler const* p_msg_handler, - unsigned int ui_handler_count) { - EFrameworkunifiedStatus estatus = eFrameworkunifiedStatusFail; - HANDLE happ; - - happ = _pb_GetAppHandle(); - if (NULL != happ) { - estatus = FrameworkunifiedAttachCallbacksToDispatcher(happ, "NS_ANY_SRC", p_msg_handler, ui_handler_count); - if (eFrameworkunifiedStatusOK != estatus) { // LCOV_EXCL_BR_LINE 4: nsfw error - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, - "FrameworkunifiedAttachCallbacksToDispatcher ERROR!! [estatus=%d]", estatus); - } - } else { - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "_pb_GetAppHandle ERROR!! [happ=%p]", happ); - } - - return estatus; -} - -/** - * @brief - * Vehicle IF: Set Availability Status - * - * @details This function sets status of Vehicle/Availablity stored in local. <br> - * Only when the status is true, Vehicle I/F is called by wrappers. - * - * @param[in] BOOL bIsAvailable : Availability Status - */ -void VehicleIf_SetAvailability(BOOL bIsAvailable) -{ - gb_vehicleAvailability = bIsAvailable; - - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "gb_vehicleAvailability=%d", gb_vehicleAvailability); - - return; -} - -/** - * @brief - * Remove Vehicle Services IF Callback Functions - * - * @param[in] *p_msg_handler CID table - * @param[in] ui_handler_count Number of CIDs - * @return eFrameworkunifiedStatusOK - * @return eFrameworkunifiedStatusFail - */ -EFrameworkunifiedStatus VehicleIfDetachCallbacksFromDispatcher(const PUI_32 pui_cmd_array, UI_32 ui_command_count) { - EFrameworkunifiedStatus estatus = eFrameworkunifiedStatusFail; - HANDLE happ; - - happ = _pb_GetAppHandle(); - if (NULL != happ) { - estatus = FrameworkunifiedDetachCallbacksFromDispatcher(happ, "NS_ANY_SRC", pui_cmd_array, ui_command_count, NULL); - /* In the event of failure */ - if (eFrameworkunifiedStatusOK != estatus) { - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, - "PositioningDetachCallbacksToDispatcher Failed in FrameworkunifiedOnStop [estatus=%d]", estatus); - } - } else { - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "_pb_GetAppHandle ERROR!! [happ=%p]", happ); - } - - return estatus; -} - -/** - * @brief - * Vehicle IF: Get Type of Transmission - * - * @details This function is wrapper function of Vehicle I/F. <br> - * You can get the type of transmission of the vehicle. - * - * @param[out] uint8_t* pType : Type of Transmission - * @param[out] BOOL* bIsAvailable : Availability Status - * - * @return eFrameworkunifiedStatusOK - * @return eFrameworkunifiedStatusFail - */ - -//EFrameworkunifiedStatus VehicleIf_GetTypeOfTransmission(uint8_t* pType, BOOL* pbIsAvailable) -EFrameworkunifiedStatus VehicleIf_GetTypeOfTransmission(uint8_t* pType, uint8_t* pPkb, BOOL* pbIsAvailable) -{ - EFrameworkunifiedStatus eStatus = eFrameworkunifiedStatusFail; - VEHICLE_RET_API ret; - HANDLE hApp; - uint8_t ucVartrm; - -#if 1 /* Plus _CWORD27_ Gear Data Support 180115 */ - uint8_t ucPkb; -#endif /* Plus _CWORD27_ Gear Data Support 180115 */ - - - if (gb_vehicleAvailability == TRUE) - { - hApp = _pb_GetAppHandle(); - if (hApp != NULL) - { - ret = Vehicle_GetVehicleData(hApp, VEHICLE_DID_VARTRM1, &ucVartrm, sizeof(ucVartrm)); - if (ret < VEHICLE_RET_NORMAL) - { - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "ERROR: Vehicle_GetVehicleData:%d", ret); - } - else - { - eStatus = eFrameworkunifiedStatusOK; - - switch (ucVartrm) - { - case VEHICLE_SNS_VARTRM1_AT: - case VEHICLE_SNS_VARTRM1_CVT: - case VEHICLE_SNS_VARTRM1_HV_AT: - { - *pType = VEHICLEIF_TRANSMISSION_TYPE_AT; - break; - } - case VEHICLE_SNS_VARTRM1_MT: - case VEHICLE_SNS_VARTRM1_MMT: - case VEHICLE_SNS_VARTRM1_SMT: - { - *pType = VEHICLEIF_TRANSMISSION_TYPE_MT; - break; - } - case VEHICLE_SNS_VARTRM1_UNCERTAINTY: - { - *pType = VEHICLEIF_TRANSMISSION_TYPE_UNKNOWN; - break; - } - default: - { - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, - "ERROR: Type of transmission is unknown. (%d)", ucVartrm); - - *pType = VEHICLEIF_TRANSMISSION_TYPE_UNKNOWN; - break; - } - } - } - -#if 1 /* Plus _CWORD27_ Gear Data Support 180115 */ - ret = Vehicle_GetVehicleData(hApp, VEHICLE_DID_PKB, &ucPkb, sizeof(ucPkb)); - if (ret < VEHICLE_RET_NORMAL) - { - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "ERROR: Vehicle_GetVehicleData:%d", ret); - } - else - { - eStatus = eFrameworkunifiedStatusOK; - - switch (ucPkb) - { - case VEHICLE_SNS_OFF: // R-state - //case VEHICLE_SNS_ANTI: // Antilock(Vehicle undefined) - { - *pPkb = VEHICLEIF_PKB_OFF; - break; - } - case VEHICLE_SNS_ON: // Lock state - { - *pPkb = VEHICLEIF_PKB_ON; - break; - } - default: - { - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, - "ERROR: State of parking brake is unknown. (%d)", ucPkb); - - *pPkb = VEHICLEIF_PKB_OFF; - break; - } - } - } -#endif /* Plus _CWORD27_ Gear Data Support 180115 */ - - } - else - { - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "ERROR: _pb_GetAppHandle hApp:%p", hApp); - } - } - else - { - /* nop */ - } - - *pbIsAvailable = gb_vehicleAvailability; - - return eStatus; -} - -/** - * @brief - * Vehicle Services IF Availability Change Notification Registration - * - * @param[in] fp_on_cmd Callback function - * @return eFrameworkunifiedStatusOK - * @return eFrameworkunifiedStatusFail - */ -EFrameworkunifiedStatus VehicleIfNotifyOnVehicleAvailability(CbFuncPtr fp_on_cmd) { - EFrameworkunifiedStatus estatus = eFrameworkunifiedStatusFail; - HANDLE happ; - - happ = _pb_GetAppHandle(); - if (NULL != happ) { - /* Vehicle/Availability Changing notification registration */ - estatus = FrameworkunifiedSubscribeNotificationWithCallback(happ, NTFY_Vehicle_Availability, fp_on_cmd); // LCOV_EXCL_BR_LINE 6:unexpected branch //NOLINT (whitespace/line_length) - if (eFrameworkunifiedStatusOK != estatus) { // LCOV_EXCL_BR_LINE 4: nsfw error - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, - "PositioningSubscriveNotificationswithCallback ERROR!! [estatus=%d]", estatus); - } - } else { - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "_pb_GetAppHandle ERROR!! [happ=%p]", happ); - } - - return estatus; -} - -/** - * @brief - * Vehicle IF: Get Shift Position - * - * @details This function is wrapper function of Vehicle I/F. <br> - * You can get the shift position of the vehicle. - * - * @param[out] uint8_t* pShift : Shift Position - * @param[out] BOOL* bIsAvailable : Availability Status - * - * @return eFrameworkunifiedStatusOK - * @return eFrameworkunifiedStatusFail - */ -EFrameworkunifiedStatus VehicleIf_GetShiftPosition(uint8_t* pShift, BOOL* pbIsAvailable) -{ - EFrameworkunifiedStatus eStatus = eFrameworkunifiedStatusFail; - VEHICLE_RET_API ret; - HANDLE hApp; - - if (gb_vehicleAvailability == TRUE) - { - hApp = _pb_GetAppHandle(); - if (hApp != NULL) - { - ret = Vehicle_GetVehicleData(hApp, VEHICLE_DID_SHIFT, pShift, sizeof(*pShift)); - if (ret < VEHICLE_RET_NORMAL) - { - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "ERROR: Vehicle_GetVehicleData:%d", ret); - } - else - { - eStatus = eFrameworkunifiedStatusOK; - } - } - else - { - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "ERROR: _pb_GetAppHandle hApp:%p", hApp); - } - } - else - { - /* nop */ - } - - *pbIsAvailable = gb_vehicleAvailability; - - return eStatus; -} - - -/** - * @brief - * Vehicle services IF Info data-delivery registry - * - * @param[in] ul_did - * @return eFrameworkunifiedStatusOK - * @return eFrameworkunifiedStatusFail - */ - -EFrameworkunifiedStatus VehicleIfDeliveryEntry(uint32_t ul_did) { - EFrameworkunifiedStatus estatus = eFrameworkunifiedStatusFail; - HANDLE happ; - VEHICLE_RET_API iret; - - if (TRUE == gb_vehicleAvailability) { - happ = _pb_GetAppHandle(); - if (NULL != happ) { - /* Sensor data delivery registration */ - iret = Vehicle_DeliveryEntry(happ, (PCSTR)POS_THREAD_NAME, ul_did, - VEHICLE_DELIVERY_REGIST, VEHICLE_DELIVERY_TIMING_UPDATE); - if (VEHICLE_RET_NORMAL != iret) { - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, - "Vehicle_DeliveryEntry ERROR!! [iret=%d]", iret); - } else { - estatus = eFrameworkunifiedStatusOK; - } - } else { - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "_pb_GetAppHandle ERROR!! [happ=%p]", happ); - } - } else { - /* nop */ - } - return estatus; -} - diff --git a/vehicleservice/positioning/server/src/nsfw/Makefile b/vehicleservice/positioning/server/src/nsfw/Makefile deleted file mode 100755 index 403e29f..0000000 --- a/vehicleservice/positioning/server/src/nsfw/Makefile +++ /dev/null @@ -1,89 +0,0 @@ -# -# @copyright Copyright (c) 2017-2020 TOYOTA MOTOR CORPORATION. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -######### installed program ############# -INST_PROGS = Positioning - -######### compiled sources ############# -Positioning_SRCS += ps_main.cpp -Positioning_SRCS += positioning_application.cpp - -ifeq ($(ARCH),arm64) -LDLIBS += -Wl,-Bdynamic -lpositioning_hal -else -LDLIBS += -Wl,-Bdynamic -lpositioning_hal -endif #($(ARCH),arm64) - -######### add include path ############# -CPPFLAGS += -I../../../client/include -CPPFLAGS += -I../../include/common/ -CPPFLAGS += -I../../include/Sensor/ -CPPFLAGS += -I../../include/ServiceInterface/ -CPPFLAGS += -I../../include/nsfw/ -#CPPFLAGS += -I../../../../diag_code/library/include - -######### add compile option ############# -CPPFLAGS += -DLINUX -CPPFLAGS += -DIMPL_AGL_APPLICATION_CALLBACKS_PRE_BACKGROUND -LDFLAGS += -Wl,--no-undefined -LDFLAGS += -Wl,--no-as-needed -CPPFLAGS += -Werror=implicit-function-declaration -CPPFLAGS += -Werror=format-security -CPPFLAGS += -Wconversion -CPPFLAGS += -Wint-to-pointer-cast -CPPFLAGS += -Wpointer-arith -CPPFLAGS += -Wformat - -######### linked library(static) ############# -LDLIBS += -Wl,-Bstatic -lPOS_Sensor -LDLIBS += -Wl,-Bstatic -lPOS_ServiceInterface - -# LDLIBS += -Wl,-Bstatic -lVehicle_API - -######### linked library (dynamic) ############# -ifeq (arm64, $(ARCH)) -LDLIBS += -Wl,-Bdynamic -lpositioning_hal -LDLIBS += -Wl,-Bdynamic -lVehicle_API -endif -LDLIBS += -Wl,-Bdynamic -lClock_API -#LDLIBS += -Wl,-Bdynamic -lMM_DREC_API -#LDLIBS += -Wl,-Bdynamic -lextension -LDLIBS += -Wl,-Bdynamic -lPOS_base_API -LDLIBS += -Wl,-Bdynamic -lPOS_common_API -LDLIBS += -Wl,-Bdynamic -lPOS_gps_API -LDLIBS += -Wl,-Bdynamic -lPOS_sensor_API -LDLIBS += -Wl,-Bdynamic -lz -LDLIBS += -Wl,-Bdynamic -lSS_SystemIfUnified -LDLIBS += -Wl,-Bdynamic -lNS_FrameworkUnified -LDLIBS += -Wl,-Bdynamic -lns_backup -LDLIBS += -Wl,-Bdynamic -lssver -LDLIBS += -Wl,-Bdynamic -lstdc++ -#LDLIBS += -Wl,-Bdynamic -lDiagCodeAPI -LDLIBS += -Wl,-Bdynamic -lDTime_Api -LDLIBS += -Wl,-Bdynamic -lVehicle_API -LDLIBS += -Wl,-Bdynamic -lvp -LDLIBS += -Wl,-Bdynamic -lev -LDLIBS += -Wl,-Bdynamic -lCommUSB - -######### add library path ############# -LDFLAGS += -L../../positioning_hal -LDFLAGS += -L../Sensor -LDFLAGS += -L../ServiceInterface -LDFLAGS += -L../../../client/src/POS_common_API -LDFLAGS += -L../../../client/src/POS_gps_API -LDFLAGS += -L../../../client/src/POS_sensor_API - -include ../../../../vehicle_service.mk diff --git a/vehicleservice/positioning/server/src/nsfw/positioning_application.cpp b/vehicleservice/positioning/server/src/nsfw/positioning_application.cpp deleted file mode 100755 index d23daad..0000000 --- a/vehicleservice/positioning/server/src/nsfw/positioning_application.cpp +++ /dev/null @@ -1,2593 +0,0 @@ -/* - * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @file - * positioning_application.cpp - * @brief - * Module : POSITIONING - * Implements Vehicle service functionality - */ - -/*---------------------------------------------------------------------------------* - * Include Files * - *---------------------------------------------------------------------------------*/ -#include <native_service/frameworkunified_application.h> -#include <native_service/frameworkunified_framework_if.h> -#include <native_service/frameworkunified_multithreading.h> -#include <native_service/frameworkunified_service_protocol.h> -#include <native_service/frameworkunified_types.h> -#include <native_service/ns_message_center_if.h> -#include <peripheral_service/ps_services.h> -#include <vehicle_service/POS_sensor_API.h> -#include <vehicle_service/POS_gps_API.h> -#include <system_service/ss_sm_client_if.h> -#include <vehicle_service/positioning_base_library.h> -#include <stub/vehicle_notifications.h> -#include <peripheral_service/communication_notifications.h> -#include <other_service/VP_GetEnv.h> -#include <cstdlib> -#include <iostream> - -#include "SensorLog.h" -#include "positioning_common.h" -#include "POS_private.h" -#include "Gps_API_private.h" -#include "POS_common_private.h" -#include "Vehicle_API.h" -#include "Vehicle_API_private.h" -#include "Sensor_API_private.h" -#include "Naviinfo_API.h" -#include "VehicleSensor_Thread.h" -#include "ClockGPS_Process_Proto.h" -#include "VehicleSens_Common.h" -#include "VehicleSens_DataMaster.h" -#include "VehicleSens_DeliveryCtrl.h" -#include "VehicleUtility.h" -#include "BackupMgrIf.h" -#include "ClockIf.h" -#include "CommUsbIf.h" -#include "DevDetectSrvIf.h" -#include "DiagSrvIf.h" -#include "PSMShadowIf.h" -#include "VehicleIf.h" -#include "positioning_hal.h" -#include "gps_hal.h" -#include "CommonDefine.h" - -#include "VehicleIf.h" - -/*---------------------------------------------------------------------------------* - * Definition * - *---------------------------------------------------------------------------------*/ -#define DATMOD_RETRY (3) /* Number of shared memory generation retries */ -#define DATMOD_PREINIT (0) /* Shared Memory State Before Initialization */ -#define PRIM_NAME_MAX (32) /* Maximum Name Size */ - -/* Mask for managing various notification reception conditions */ -#define NTFY_MSK_NONE (0x00) -/* Service availability notification */ -#define NTFY_MSK_COMMUNICATION_AVAILABILITY (0x01) -#define NTFY_MSK_PS_COMMUSB_AVAILABILITY (0x02) -#define NTFY_MSK_PS_PSMSHADOW_AVAILABILITY (0x04) -#define NTFY_MSK_CLOCK_AVAILABILITY (0x08) -#define NTFY_MSK_NS_BACKUPMGR_AVAILABILITY (0x10) -#define NTFY_MSK_SS_DEVDETSRV_AVAILABILITY (0x20) -#define NTFY_MSK_VS_VEHICLE_AVAILABILITY (0x40) -/* Other Notices */ -#define NTFY_MSK_PS_PSMSHADOW_INIT_COMP (0x01) /* PSMShadow startup completion notice */ - -/* Thread state */ -#define THREAD_STS_NOEXIST (0x00) -#define THREAD_STS_CREATING (0x01) -#define THREAD_STS_CREATED (0x02) - -#define POS_SNDMSG_DTSIZE_1 1 /* SndMSG data size 1Byte */ -#define POS_SNDMSG_DTSIZE_2 2 /* SndMSG data size 2Byte */ -#define POS_SNDMSG_DTSIZE_20 20 /* SndMSG data size of 20 bytes */ -#define POS_SNDMSG_DTSIZE_132 132 /* SndMSG data size: 132 bytes */ - -/* PositioningLogFlag */ -#define POSITIONINGLOG_FLAG_NAVI 9 - -/* Definition for thinning out sensor log at anomaly */ -#define POSITIONINGLOG_SYS_1_ABNORMAL_DATA_NUM 3 -#define POSITIONINGLOG_SYS_2_ABNORMAL_DATA_NUM 4 -#define POSITIONINGLOG_SYS_3_ABNORMAL_DATA_NUM 4 -#define POSITIONINGLOG_SYS_4_ABNORMAL_DATA_NUM 129 -#define POSITIONINGLOG_SYS_ABNORMAL_DATA_NUM (POSITIONINGLOG_SYS_1_ABNORMAL_DATA_NUM + \ - POSITIONINGLOG_SYS_2_ABNORMAL_DATA_NUM + \ - POSITIONINGLOG_SYS_3_ABNORMAL_DATA_NUM + \ - POSITIONINGLOG_SYS_4_ABNORMAL_DATA_NUM) -#define POSITIONINGLOG_SYS_1_ABNORMAL_DATA_OFFSET 11 -#define POSITIONINGLOG_SYS_2_ABNORMAL_DATA_OFFSET 32 -#define POSITIONINGLOG_SYS_3_ABNORMAL_DATA_OFFSET 54 -#define POSITIONINGLOG_SYS_4_ABNORMAL_DATA_OFFSET 114 -#define POSITIONINGLOG_SYS_1_ABNORMAL_SET_DATA_OFFSET 0 -#define POSITIONINGLOG_SYS_2_ABNORMAL_SET_DATA_OFFSET POSITIONINGLOG_SYS_1_ABNORMAL_DATA_NUM -#define POSITIONINGLOG_SYS_3_ABNORMAL_SET_DATA_OFFSET (POSITIONINGLOG_SYS_1_ABNORMAL_DATA_NUM + POSITIONINGLOG_SYS_2_ABNORMAL_DATA_NUM) -#define POSITIONINGLOG_SYS_4_ABNORMAL_SET_DATA_OFFSET (POSITIONINGLOG_SYS_1_ABNORMAL_DATA_NUM + \ - POSITIONINGLOG_SYS_2_ABNORMAL_DATA_NUM + \ - POSITIONINGLOG_SYS_3_ABNORMAL_DATA_NUM) -#define POSITIONINGLOG_SYS_OPC_OFFSET 9 -#define POSITIONINGLOG_SYS_PULSE_TIME_NUM_OFFSET 114 -#define POSITIONINGLOG_SYS_NORMAL_DATA 0xC1 -#define POSITIONINGLOG_SYS_FST_DATA 0xF4 -#define _pb_strcat(pdest, psrc, size) (strncat(pdest, psrc, size) , (0)) - -// Vehicle sensor information notification message -typedef struct { - uint32_t did; // Data ID corresponding to vehicle sensor information - uint16_t size; // Data size of vehicle sensor information - uint8_t rcv_flag; // Vehicle sensor information reception flag - uint8_t reserve; // Reserved - uint8_t data[VEHICLE_VSINFO_DSIZE]; // Vehicle sensor information -} VEHICLE_UNIT_MSG_VSINFO_DAT; - -// Vehicle sensor information notification message -typedef struct { - VEHICLE_UNIT_MSG_VSINFO_DAT data; // Message data -} VEHICLE_UNIT_MSG_VSINFO; -/*---------------------------------------------------------------------------------* - * Structre * - *---------------------------------------------------------------------------------*/ -/*! - @brief Structure to create shared data -*/ -typedef struct { - char share_data_name[PRIM_NAME_MAX]; /**< Shared data name */ - u_int32 data_size; /**< Shared data size */ -} ST_SHAREDATA; - -/*! - @brief Thread management information -*/ -typedef struct { - EnumTID_POS id; /**< Thread ID */ - const int8_t* p_name; /**< Thread name */ - PNO pno; /**< Process number */ - CbFuncPtr routine; /**< Start Routine */ - uint8_t msk_available; /**< Dependent services Availability */ - uint8_t msk_ntfy; /**< Dependency notification */ - uint8_t msk_thread; /**< Dependent threads */ - BOOL is_depended; /**< Positioning/Availability->TRUE change dependency */ - uint8_t status; /**< Thread activation state */ - uint8_t order; /**< Boot Sequence(Performance) */ - uint8_t reserve[2]; -} ST_THREAD_CREATE_INFO; - - -/* GPS fix count information */ -typedef struct { - uint32_t ul3d; /* 3D */ - uint32_t ul2d; /* 2D */ - uint32_t ul_else; /* Not fix */ - uint8_t dummy[4]; /* Dummy */ -} ST_GPS_FIX_CNT; - -/*! - @brief Structure that stores the time set by the time setting or the time updated(For GRADE1) -*/ -typedef struct { - u_int16 year; /* Year */ - u_int8 month; /* Month */ - u_int8 date; /* Day */ - u_int8 hour; /* Hour */ - u_int8 minute;/* Minutes */ - u_int8 second;/* Minutes */ - u_int8 flag; /* Whether or not the time is set */ -} ST_GPS_SET_TIME; - -/*---------------------------------------------------------------------------------* - * Local Function Prototype * - *---------------------------------------------------------------------------------*/ -static EFrameworkunifiedStatus PositioningOnStartImpl(const HANDLE hApp, const EPWR_SC_WAKEUP_TYPE wakeupType, - const ESMDataResetModeInfo dataResetMode); -static EFrameworkunifiedStatus PosNotifyCommunicationAvailability(HANDLE h_app); -static EFrameworkunifiedStatus PosNotifyCommUSBAvailability(HANDLE h_app); -static EFrameworkunifiedStatus PosNotifyPSMShadowAvailability(HANDLE h_app); -static EFrameworkunifiedStatus PosNotifyPSMShadowInitComp(HANDLE h_app); -static EFrameworkunifiedStatus PosNotifyClockAvailability(HANDLE h_app); -static EFrameworkunifiedStatus PosNotifyNSBackupMgrAvailability(HANDLE h_app); -static EFrameworkunifiedStatus PosNotifyDevDetectSrvAvailability(HANDLE h_app); -static EFrameworkunifiedStatus PosNotifyVehicleAvailability(HANDLE h_app); - -static EFrameworkunifiedStatus PosStopThreadDummy(HANDLE h_app); -static void PosCreateSharedMemory(void); -static void PosCreateThread(HANDLE h_app); -static void PosStopThread(void); -static void PosBackupDataInit(void); - -/* Message Dispatching Functions */ -static EFrameworkunifiedStatus PosThreadCreateComp(HANDLE h_app); -static EFrameworkunifiedStatus PosThreadStopComp(HANDLE h_app); -static EFrameworkunifiedStatus PosPosifRegisterListenerPkgSensorData(HANDLE h_app); -static EFrameworkunifiedStatus PosPosifRegisterListenerSensorData(HANDLE h_app); -static EFrameworkunifiedStatus PosPosifReqGpsSetting(HANDLE h_app); -static EFrameworkunifiedStatus PosPosifSetGpsInfo(HANDLE h_app); -static EFrameworkunifiedStatus PosPosifGetGpsInfo(HANDLE h_app); -static EFrameworkunifiedStatus PosPosifSetData(HANDLE h_app); -static EFrameworkunifiedStatus PosPosifReqGpsReset(HANDLE h_app); -static EFrameworkunifiedStatus PosVehicleInfoRcv(HANDLE h_app); -static uint32_t PosGetMsg(HANDLE h_app, void** p_buf, uint32_t size); -static RET_API PosSndMsg(PNO pno, CID cid, void* p_msg_body, uint32_t size); -static void PosOutputDebugDumpLog(uint8_t* p_buf); - -/* Function scan for device insertion detection */ -static EFrameworkunifiedStatus PosOnDevDetectOpenSessionAck(HANDLE h_app); -static EFrameworkunifiedStatus PosOnDevDetectCloseSessionAck(HANDLE h_app); -static EFrameworkunifiedStatus PosOnDevDetectEvent(HANDLE h_app); - -/*---------------------------------------------------------------------------------* - * Grobal Value * - *---------------------------------------------------------------------------------*/ -/* Thread name */ -static const int8_t kThreadNamePosMain[15] = "POS_Main"; -static const int8_t kThreadNamePosSens[15] = "POS_Sens"; -static const int8_t kThreadNamePosGps[15] = "POS_Gps"; -static const int8_t kThreadNamePosGpsRecv[15] = "POS_Gps_Recv"; -static const int8_t kThreadNamePosGpsRollover[15] = "POS_Gps_Rolovr"; - -/** Shared memory generation table */ -static ST_SHAREDATA g_sharedata_tbl[] = { - /* Shared data name to be generated, Shared data size */ - { {VEHICLE_SHARE_NAME}, 512 * 11 }, /* Vehicle sensor information acquisition */ -#if 0 /* Less than 0.1 SBU,Not used in _CWORD71_ */ - { {"SENSOR_SHARE_MEMORY"}, 512 * 11 }, /* Vehicle sensor information Pkg acquisition */ - { {"GPS_INT_SIGNAL_SHARE_MEMORY"}, 4 }, /* GPS Interrupt Signal Acquisition */ - { {"LOG_SETTING_SHARE_MEMORY"}, 36 }, /* DR feature log acquisition */ - { {"GYRO_CONNECT_STTS_SHARE_MEMORY"}, 4 }, /* Get Gyro Connection Status */ - { {"EPHEMERIS_NUM_SHARE_MEMORY"}, 4 }, /* For acquiring effective ephemeris count at shutdown */ - { {"LOCALTIME_SHARE_MEMORY"}, 12 }, /* Local time acquisition at shutdown */ - { {"LONLAT_SHARE_MEMORY"}, 8 }, /* Location acquisition at shutdown */ -#endif - { {'\0'}, 0 } /* Termination */ -}; - -/** Sub-thread creation table - (1) Thread ID (Locally defined Enumeration) - (2) Thread name - (3) Process number - (4) Start Routine - (5) Dependent Availability - (6) Dependency notification - (7) Dependent threads * If there are dependent threads, do not create them until those threads are created. - (8) Positioning/Availability->TRUE depending on change - (9) Thread activation state (THREAD_STS_NOEXIST:Not started,THREAD_STS_CREATING:Starting,THREAD_STS_CREATED:Completion of the activation) - (10) Boot Sequence(Performance) (0,1,2, ... Note : 0 = Initial value(Not started)) Time of termination,Be destroyed in the reverse order of startup - */ -static ST_THREAD_CREATE_INFO g_pos_thread_create_info_Grade1[] = { // LCOV_EXCL_BR_LINE 11: unexpected branch - { /* Pos_main */ - ETID_POS_MAIN, /* (1) */ - kThreadNamePosMain, /* (2) */ - PNO_VEHICLE_SENSOR, /* (3) */ - &VehicleSensThread, /* (4) */ - (NTFY_MSK_NONE), /* (5) */ - (NTFY_MSK_NONE), /* (6) */ - 0, /* (7) */ - TRUE, /* (8) */ - THREAD_STS_NOEXIST, /* (9) */ - 0 /* (10) */ - }, - { /* Pos_sens */ - ETID_POS_SENS, /* (1) */ - kThreadNamePosSens, /* (2) */ - PNO_LINE_SENS_DRV, /* (3) */ - &StartLineSensorThreadPositioning, /* (4) */ - (NTFY_MSK_PS_PSMSHADOW_AVAILABILITY), /* (5) */ - (NTFY_MSK_NONE), /* (6) */ - THREAD_STS_MSK_POS_MAIN, /* (7) */ - FALSE, /* (8) */ - THREAD_STS_NOEXIST, /* (9) */ - 0 /* (10) */ - }, - { /* Pos_gps */ - ETID_POS_GPS, /* (1) */ - kThreadNamePosGps, /* (2) */ - PNO_NAVI_GPS_MAIN, /* (3) */ - &StartGpsMainThreadPositioning, /* (4) */ - (NTFY_MSK_NONE), /* (5) */ - (NTFY_MSK_NONE), /* (6) */ - THREAD_STS_MSK_POS_MAIN, /* (7) */ - TRUE, /* (8) */ - THREAD_STS_NOEXIST, /* (9) */ - 0 /* (10) */ - }, - { /* Pos_gps_recv */ - ETID_POS_GPS_RECV, /* (1) */ - kThreadNamePosGpsRecv, /* (2) */ - PNO_NAVI_GPS_RCV, /* (3) */ - &StartGpsRecvThreadPositioning, /* (4) */ - (NTFY_MSK_NONE), /* (5) */ - (NTFY_MSK_NONE), /* (6) */ - THREAD_STS_MSK_POS_GPS, /* (7) */ - FALSE, /* (8) */ - THREAD_STS_NOEXIST, /* (9) */ - 0 /* (10) */ - }, - { /* Pos_gps_rollover */ - ETID_POS_GPS_ROLLOVER, /* (1) */ - kThreadNamePosGpsRollover, /* (2) */ - PNO_CLK_GPS, /* (3) */ - &StartGpsRolloverThreadPositioning, /* (4) */ - (NTFY_MSK_NS_BACKUPMGR_AVAILABILITY), /* (5) */ - (NTFY_MSK_NONE), /* (6) */ - THREAD_STS_MSK_POS_GPS, /* (7) */ - FALSE, /* (8) */ - THREAD_STS_NOEXIST, /* (9) */ - 0 /* (10) */ - }, - { /* Termination */ - ETID_POS_MAX, NULL, 0, NULL, NTFY_MSK_NONE, NTFY_MSK_NONE, 0, FALSE, THREAD_STS_NOEXIST, 0 - }, -}; - -/* State Management Variables */ -static bool g_start_flg = false; /** Start Processed Flag */ -static EnumExeSts_POS g_exe_sts; /** Positioning running status */ -static EnumSetupMode_POS g_setup_mode; /** Thread activation mode */ -static uint8_t g_last_thread_sts; /** Latest internal thread activation state */ -static uint8_t g_last_srv_sts; /** Latest service availability */ -static uint8_t g_last_ntfy_sts; /** Receive state of latest notification */ -static uint8_t g_last_num_of_thread; /** Number of Current Startup Threads */ - -/** Sub-thread creation table */ -static ST_THREAD_CREATE_INFO* g_pos_thread_create_info; - -/** Interprocess message receive buffer */ -static uint8_t g_rcv_msg_buf[MAX_MSG_BUF_SIZE]; - -/** Dispatcher Registration Callback Table */ -static const FrameworkunifiedProtocolCallbackHandler kPositioningPcbhs[] = { // LCOV_EXCL_BR_LINE 11: unexpected branch - {CID_THREAD_CREATE_COMP, &PosThreadCreateComp }, /* Thread start completion notification */ - {CID_THREAD_STOP_COMP, &PosThreadStopComp }, /* Thread stop completion notice */ - {CID_SENSORIF_PKG_DELIVERY_ENTRY_EXT, &PosPosifRegisterListenerPkgSensorData}, - {CID_VEHICLEIF_DELIVERY_ENTRY, &PosPosifRegisterListenerSensorData }, - {CID_SENSORIF__CWORD82__REQUEST, &PosPosifReqGpsSetting }, - {CID_NAVIINFO_DELIVER, &PosPosifSetGpsInfo }, - {CID_VEHICLEIF_GET_VEHICLE_DATA, &PosPosifGetGpsInfo }, - {CID_POSIF_SET_DATA, &PosPosifSetData }, - {CID_GPS_REQRESET, &PosPosifReqGpsReset }, -}; - -static const FrameworkunifiedProtocolCallbackHandler kPositioningPcbhsVehicle[] = { // LCOV_EXCL_BR_LINE 11: unexpected branch - {CID_VEHICLESENS_VEHICLE_INFO, &PosVehicleInfoRcv}, -}; - -/** Dispatcher unregister command ID table */ -static uint32_t g_positioning_cids[] = { - CID_THREAD_CREATE_COMP, - CID_THREAD_STOP_COMP, - CID_SENSORIF_PKG_DELIVERY_ENTRY_EXT, - CID_VEHICLEIF_DELIVERY_ENTRY, - CID_SENSORIF__CWORD82__REQUEST, - CID_NAVIINFO_DELIVER, - CID_VEHICLEIF_GET_VEHICLE_DATA, - CID_POSIF_SET_DATA, - CID_GPS_REQRESET, -}; - -static uint32_t g_positioning_cids_vehicle[] = { - CID_VEHICLESENS_VEHICLE_INFO, -}; - - - -/** Stop request flag for GPS reception thread */ -BOOL g_thread_stop_req; - -/*---------------------------------------------------------------------------------* - * Function * - *---------------------------------------------------------------------------------*/ -/** - * @brief - * FrameworkunifiedOnInitialization<br> - * Sends message to Notification Service - * - * Mm 21 API perform initialization.<br> - * Generatings shared memories used by Vehicle function block..<br> - * Creates a sub-thread of the Vehicle feature block.. - * - * @param[in] h_app Application handle - * - * @return eFrameworkunifiedStatusOK Normal completion - * eFrameworkunifiedStatusFail ABENDs - */ -EFrameworkunifiedStatus FrameworkunifiedOnInitialization(HANDLE h_app) { - RET_API ret_api; - EFrameworkunifiedStatus e_status = eFrameworkunifiedStatusOK; - uint8_t* p_last_srv_sts = &g_last_srv_sts; - uint8_t* p_last_thread_sts = &g_last_thread_sts; - uint8_t* p_last_ntfy_sts = &g_last_ntfy_sts; - ST_THREAD_CREATE_INFO** pp_thr_cre_info = &g_pos_thread_create_info; - uint8_t* p_last_num_thr = &g_last_num_of_thread; - BOOL* p_thr_stop_req = &g_thread_stop_req; - EnumExeSts_POS* p_exe_sts = &g_exe_sts; - EnumSetupMode_POS* pe_mode = &g_setup_mode; - - FRAMEWORKUNIFIEDLOG(ZONE_INIT, __FUNCTION__, "+"); - - /* Global variable initialization */ - *p_last_srv_sts = 0; - *p_last_thread_sts = 0; - *p_last_ntfy_sts = 0; - *pp_thr_cre_info = g_pos_thread_create_info_Grade1; - *p_last_num_thr = 0; - *p_thr_stop_req = FALSE; - *p_exe_sts = EPOS_EXE_STS_STOP; - *pe_mode = EPOS_SETUP_MODE_NORMAL; - - /* null check */ - if (h_app == NULL) { // LCOV_EXCL_BR_LINE 4: nsfw error - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "h_app is NULL"); - e_status = eFrameworkunifiedStatusFail; - } else { - /* Positioning Base API initialization */ - ret_api = _pb_Setup_CWORD64_API(h_app); - if (ret_api != RET_NORMAL) { // LCOV_EXCL_BR_LINE 4: can not return error - // LCOV_EXCL_START 8: invalid - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, - "_pb_Setup_CWORD64_API ERROR!! [ret_api = %d]", - ret_api); - - e_status = eFrameworkunifiedStatusFail; - // LCOV_EXCL_STOP - } else { - /* Availability at Positioning startup,Set internal thread activation state */ - if (ChkUnitType(UNIT_TYPE_GRADE1) == true) { /* GRADE1 environment */ - *pp_thr_cre_info = g_pos_thread_create_info_Grade1; - FRAMEWORKUNIFIEDLOG(ZONE_INIT, __FUNCTION__, - "*pp_thr_cre_info = g_pos_thread_create_info_Grade1"); - } else if (ChkUnitType(UNIT_TYPE_GRADE2) == true) { - /* - * Note. - * This feature branches processing depending on the unit type. - */ - } else { - FRAMEWORKUNIFIEDLOG(ZONE_INIT, __FUNCTION__, "_pb_ChkUnitType UNKNOWN!!"); - } - - /* Shared Memory Creation */ - PosCreateSharedMemory(); - - if (e_status == eFrameworkunifiedStatusOK) { - /* Register callback functions for Positioning internals */ - e_status = FrameworkunifiedAttachCallbacksToDispatcher(h_app, - "NS_ANY_SRC", - kPositioningPcbhs, - _countof(kPositioningPcbhs)); // LCOV_EXCL_BR_LINE 4:nsfw error - if (e_status != eFrameworkunifiedStatusOK) { - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, - "FrameworkunifiedAttachCallbacksToDispatcher ERROR!! [e_status = %d]", e_status); - } - - (void)VehicleIfAttachCallbacksToDispatcher(kPositioningPcbhsVehicle, - _countof(kPositioningPcbhsVehicle)); - } - - if (e_status == eFrameworkunifiedStatusOK) { // LCOV_EXCL_BR_LINE 4: nsfw error - /* Positioning/Availability registration */ - e_status = FrameworkunifiedRegisterServiceAvailabilityNotification(h_app, POS_AVAILABILITY); - if (eFrameworkunifiedStatusOK != e_status) { - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, - "FrameworkunifiedRegisterServiceAvailabilityNotification ERROR!! [e_status = %d]", e_status); - } - } - - if (e_status == eFrameworkunifiedStatusOK) { // LCOV_EXCL_BR_LINE 4: nsfw error - /* Positioning/Availability -> FALSE */ - e_status = FrameworkunifiedPublishServiceAvailability(h_app, FALSE); - if (eFrameworkunifiedStatusOK != e_status) { - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, - "FrameworkunifiedPublishServiceAvailability ERROR!! [e_status = %d]", e_status); - } else { - FRAMEWORKUNIFIEDLOG(ZONE_INIT, __FUNCTION__, "Positioning/Availability -> FALSE"); - } - } - - /* Communication/Availability Changing notification registration */ - FrameworkunifiedSubscribeNotificationWithCallback(h_app, NTFY_Communication_Availability, &PosNotifyCommunicationAvailability); // LCOV_EXCL_BR_LINE 6: not a branch // NOLINT(whitespace/line_length) - - /* PS_CommUSB/Availability Changing notification registration */ - (void)CommUsbIfNotifyOnCommUSBAvailability(&PosNotifyCommUSBAvailability); // LCOV_EXCL_BR_LINE 6: not a branch // NOLINT(whitespace/line_length) - - /* PS_PSMShadow/Availability Changing notification registration */ - (void)PSMShadowIfNotifyOnPSMShadowAvailability(&PosNotifyPSMShadowAvailability); // LCOV_EXCL_BR_LINE 6: not a branch // NOLINT(whitespace/line_length) - /* PS_PSMShadow Startup completion notification registration */ - (void)PSMShadowIfNotifyOnPSMShadowInitComp(&PosNotifyPSMShadowInitComp); // LCOV_EXCL_BR_LINE 6: not a branch // NOLINT(whitespace/line_length) - - /* Clock/Availability Changing notification registration */ - (void)ClockIfNotifyOnClockAvailability(&PosNotifyClockAvailability); // LCOV_EXCL_BR_LINE 6: not a branch // NOLINT(whitespace/line_length) - - /* NS_BackupMgr/Availability Changing notification registration */ - (void)BackupMgrIfNotifyOnBackupMgrAvailability(&PosNotifyNSBackupMgrAvailability); // LCOV_EXCL_BR_LINE 6: not a branch // NOLINT(whitespace/line_length) - - /* Regist Vehilce Availability Notification */ - (void)VehicleIfNotifyOnVehicleAvailability(&PosNotifyVehicleAvailability); // LCOV_EXCL_BR_LINE 6: not a branch // NOLINT(whitespace/line_length) - - /* DeviceDetectionServiceIf initialization */ - if (DevDetectSrvIfInitialize() == eFrameworkunifiedStatusOK) { - /* SS_DevDetectSrv/Availability Changing notification registration */ - (void)DevDetectSrvIfNotifyOnDeviceDetectionAvailability(&PosNotifyDevDetectSrvAvailability); // LCOV_EXCL_BR_LINE 6: not a branch // NOLINT(whitespace/line_length) - } - } - } - - FRAMEWORKUNIFIEDLOG(ZONE_INIT, __FUNCTION__, "-"); - - return e_status; -} - -/** - * @brief - * PositioningOnStartImpl - */ -static EFrameworkunifiedStatus PositioningOnStartImpl(const HANDLE hApp, const EPWR_SC_WAKEUP_TYPE wakeupType, - const ESMDataResetModeInfo dataResetMode) { - EnumExeSts_POS* p_exe_sts = &g_exe_sts; - EnumSetupMode_POS* pe_mode = &g_setup_mode; - - FRAMEWORKUNIFIEDLOG(ZONE_INIT, __FUNCTION__, "+"); - - if (g_start_flg == false) { - g_start_flg = true; - - /* Running */ - *p_exe_sts = EPOS_EXE_STS_RUNNING; - - /* Cold start */ - if (wakeupType == epsstCOLDSTART) { - FRAMEWORKUNIFIEDLOG(ZONE_INIT, __FUNCTION__, "wakeupType:COLDSTART"); - - *p_exe_sts = EPOS_EXE_STS_RUNNING_COLDSTART; - - /* Initialize GPS time setting information */ - PosBackupDataInit(); - } else { /* Time of warm start */ - FRAMEWORKUNIFIEDLOG(ZONE_INIT, __FUNCTION__, "wakeupType:WARMSTART"); - } - - /* Time of factory initialization */ - if (dataResetMode == e_SS_SM_DATA_RESET_MODE_FACTORY) { - FRAMEWORKUNIFIEDLOG(ZONE_INIT, __FUNCTION__, "dataResetMode:FACTORYRESET"); - - /* Set thread start mode to ""data reset start"" */ - *pe_mode = EPOS_SETUP_MODE_DATA_RESET; - - /* Initialize GPS time setting information */ - PosBackupDataInit(); - } - - PosCreateThread(hApp); - } - - FRAMEWORKUNIFIEDLOG(ZONE_INIT, __FUNCTION__, "-"); - return eFrameworkunifiedStatusOK; -} - -/** - * @brief - * FrameworkunifiedOnStart - */ -EFrameworkunifiedStatus FrameworkunifiedOnStart(HANDLE hApp) { - EFrameworkunifiedStatus ret = eFrameworkunifiedStatusFail; - uint32_t size; - - FRAMEWORKUNIFIEDLOG(ZONE_INIT, __FUNCTION__, "+"); - - size = PosGetMsg(hApp, reinterpret_cast<void**>(&g_rcv_msg_buf), MAX_MSG_BUF_SIZE); - if (size != 0) { - T_SS_SM_START_DataStructType* p_start_data; - p_start_data = reinterpret_cast<T_SS_SM_START_DataStructType*>(g_rcv_msg_buf); - - ret = PositioningOnStartImpl(hApp, p_start_data->wakeupType, p_start_data->dataResetMode); - } - - FRAMEWORKUNIFIEDLOG(ZONE_INIT, __FUNCTION__, "-"); - return ret; -} - -/** - * @brief - * FrameworkunifiedOnStop - * - * @param[in] h_app Application handle - * - * @return eFrameworkunifiedStatusOK Normal completion - * eFrameworkunifiedStatusFail ABENDs - */ -EFrameworkunifiedStatus FrameworkunifiedOnStop(HANDLE h_app) { - EFrameworkunifiedStatus e_status; - EnumExeSts_POS* p_exe_sts = &g_exe_sts; - - FRAMEWORKUNIFIEDLOG(ZONE_INIT, __FUNCTION__, "+"); - - /* null check */ - if (h_app == NULL) { // LCOV_EXCL_BR_LINE 200: can not NULL - // LCOV_EXCL_START 8: invalid - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "h_app is NULL"); - // LCOV_EXCL_STOP - } else { - *p_exe_sts = EPOS_EXE_STS_STOP; - - e_status = FrameworkunifiedPublishServiceAvailability(h_app, FALSE); - if (eFrameworkunifiedStatusOK != e_status) { - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, - "FrameworkunifiedPublishServiceAvailability ERROR!! [e_status = %d]", - e_status); - } else { - FRAMEWORKUNIFIEDLOG(ZONE_INIT, __FUNCTION__, "Positioning/Availability -> FALSE"); - } - - PosStopThread(); - - g_start_flg = false; - } - - FRAMEWORKUNIFIEDLOG(ZONE_INIT, __FUNCTION__, "-"); - - /* Return end response to SM at timing after completion of internal thread stop */ - return eFrameworkunifiedStatusFail; -} - -/** - * @brief - * FrameworkunifiedOnPreStart - */ -EFrameworkunifiedStatus FrameworkunifiedOnPreStart(HANDLE hApp) { - EFrameworkunifiedStatus ret = eFrameworkunifiedStatusFail; - uint32_t size; - - FRAMEWORKUNIFIEDLOG(ZONE_INIT, __FUNCTION__, "+"); - - size = PosGetMsg(hApp, reinterpret_cast<void**>(&g_rcv_msg_buf), MAX_MSG_BUF_SIZE); - if (size != 0) { - T_SS_SM_START_DataStructType* p_start_data; - p_start_data = reinterpret_cast<T_SS_SM_START_DataStructType*>(g_rcv_msg_buf); - - ret = PositioningOnStartImpl(hApp, p_start_data->wakeupType, p_start_data->dataResetMode); - } - - FRAMEWORKUNIFIEDLOG(ZONE_INIT, __FUNCTION__, "-"); - return ret; -} - -/** - * @brief - * FrameworkunifiedOnPreStop - */ -EFrameworkunifiedStatus FrameworkunifiedOnPreStop(HANDLE hApp) { - FRAMEWORKUNIFIEDLOG(ZONE_INIT, __FUNCTION__, "+"); - FRAMEWORKUNIFIEDLOG(ZONE_INIT, __FUNCTION__, "-"); - return eFrameworkunifiedStatusOK; -} - -/** - * @brief - * FrameworkunifiedOnBackgroundStart - */ -EFrameworkunifiedStatus FrameworkunifiedOnBackgroundStart(HANDLE hApp) { - EFrameworkunifiedStatus ret = eFrameworkunifiedStatusFail; - uint32_t size; - - FRAMEWORKUNIFIEDLOG(ZONE_INIT, __FUNCTION__, "+"); - - size = PosGetMsg(hApp, reinterpret_cast<void**>(&g_rcv_msg_buf), MAX_MSG_BUF_SIZE); - if (size != 0) { - T_SS_SM_START_DataStructType* p_start_data; - p_start_data = reinterpret_cast<T_SS_SM_START_DataStructType*>(g_rcv_msg_buf); - - ret = PositioningOnStartImpl(hApp, p_start_data->wakeupType, p_start_data->dataResetMode); - } - - FRAMEWORKUNIFIEDLOG(ZONE_INIT, __FUNCTION__, "-"); - return ret; -} - -/** - * @brief - * FrameworkunifiedOnBackgroundStop - */ -EFrameworkunifiedStatus FrameworkunifiedOnBackgroundStop(HANDLE hApp) { - FRAMEWORKUNIFIEDLOG(ZONE_INIT, __FUNCTION__, "+"); - FRAMEWORKUNIFIEDLOG(ZONE_INIT, __FUNCTION__, "-"); - return eFrameworkunifiedStatusOK; -} - -/** - * @brief - * FrameworkunifiedOnDestroy (Not mounted) - * - * @param[in] h_app Application handle - * - * @return eFrameworkunifiedStatusOK Normal completion - * eFrameworkunifiedStatusFail ABENDs - */ -EFrameworkunifiedStatus FrameworkunifiedOnDestroy(HANDLE h_app) { // LCOV_EXCL_START 14 Resident process, not called by NSFW - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "+"); - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "-"); - return eFrameworkunifiedStatusOK; -} -// LCOV_EXCL_STOP - -/** - * @brief - * FrameworkunifiedOnDebugDump - * - * @param[in] h_app Application handle - * - * @return eFrameworkunifiedStatusOK Normal completion - * eFrameworkunifiedStatusFail ABENDs - */ -EFrameworkunifiedStatus FrameworkunifiedOnDebugDump(HANDLE h_app) { // LCOV_EXCL_START 7: debug code - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - static uint8_t buf_tmp[256]; - static uint8_t buf_proc[128]; - static uint8_t buf_thread[512]; - static uint8_t buf_message[4][DEBUG_DUMP_MAX_SIZE]; - static uint8_t buf_mutex[3][DEBUG_DUMP_MAX_SIZE]; - static uint8_t buf_timer[DEBUG_DUMP_MAX_SIZE]; - static uint8_t buf_event[9][DEBUG_DUMP_MAX_SIZE]; - static uint8_t buf_memory[DEBUG_DUMP_MAX_SIZE]; - static uint8_t buf_other[DEBUG_DUMP_MAX_SIZE]; - static uint8_t buf_nand[256]; - static uint8_t buf_ram[256]; - static uint8_t buf_gps_format_fail[512]; - static uint8_t buf_antenna[256]; - static uint8_t buf_gps_info[DEBUG_DUMP_MAX_SIZE]; - static uint8_t buf_navi_info[DEBUG_DUMP_MAX_SIZE]; - static uint8_t buf_deli_ctrl_tbl[DEBUG_DUMP_MAX_SIZE]; - static uint8_t buf_deli_ctrl_tbl_mng[DEBUG_DUMP_MAX_SIZE]; - static uint8_t buf_pkg_deli_tbl_mng[DEBUG_DUMP_MAX_SIZE]; - static uint8_t buf_deli_pno_tbl[DEBUG_DUMP_MAX_SIZE]; - static uint8_t buf_sys[128]; - int32_t i; - ST_THREAD_CREATE_INFO* p_thr_cre_info = g_pos_thread_create_info; - ST_GPS_FIX_CNT st_gps_fix_cnt; - ST_GPS_SET_TIME st_gps_set_time; - uint8_t len_msg = 4; - uint8_t len_mtx = 3; - uint8_t len_evt = 9; - EFrameworkunifiedStatus e_status; - BOOL b_is_available; - UNIT_TYPE e_type = UNIT_TYPE_NONE; - u_int8 sys_recv_flg; - uint16_t wkn_rollover; - - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "+"); - - memset(&buf_proc[0], 0x00, sizeof(buf_proc)); - memset(&buf_thread[0], 0x00, sizeof(buf_thread)); - memset(&buf_nand[0], 0x00, sizeof(buf_nand)); - memset(&buf_ram[0], 0x00, sizeof(buf_ram)); - memset(&buf_gps_format_fail[0], 0x00, sizeof(buf_gps_format_fail)); - memset(&buf_antenna[0], 0x00, sizeof(buf_antenna)); - memset(&buf_gps_info[0], 0x00, sizeof(buf_gps_info)); - memset(&buf_navi_info[0], 0x00, sizeof(buf_navi_info)); - memset(&buf_deli_ctrl_tbl[0], 0x00, sizeof(buf_deli_ctrl_tbl)); - memset(&buf_deli_ctrl_tbl_mng[0], 0x00, sizeof(buf_deli_ctrl_tbl_mng)); - memset(&buf_pkg_deli_tbl_mng[0], 0x00, sizeof(buf_pkg_deli_tbl_mng)); - memset(&buf_deli_pno_tbl[0], 0x00, sizeof(buf_deli_pno_tbl)); - memset(&buf_sys[0], 0x00, sizeof(buf_sys)); - - for (i = 0; i < len_msg; i++) { - memset(&buf_message[i][0], 0x00, sizeof(buf_message[i])); - } - for (i = 0; i < len_mtx; i++) { - memset(&buf_mutex[i][0], 0x00, sizeof(buf_mutex[i])); - } - memset(&buf_timer[0], 0x00, sizeof(buf_timer)); - for (i = 0; i < len_evt; i++) { - memset(&buf_event[i][0], 0x00, sizeof(buf_event[i])); - } - memset(&buf_memory[0], 0x00, sizeof(buf_memory)); - memset(&buf_other[0], 0x00, sizeof(buf_other)); - e_type = GetEnvSupportInfo(); - - /* Availability status of related processes */ - snprintf(reinterpret_cast<char *>(&buf_proc[0]), sizeof(buf_proc), - "Availability\n thread:0x%02x, srv:0x%02x, ntfy:0x%02x", - g_last_thread_sts, /* Latest internal thread activation state */ - g_last_srv_sts, /* Latest service availability */ - g_last_ntfy_sts); /* Receive state of latest notification */ - - /* Internal thread activation state */ - snprintf(reinterpret_cast<char *>(&buf_thread[0]), sizeof(buf_thread), "Thread"); - for (i = 0; i < ETID_POS_MAX; i++) { - memset(&buf_tmp[0], 0x00, sizeof(buf_tmp)); - snprintf(reinterpret_cast<char *>(&buf_tmp[0]), sizeof(buf_tmp), - "\n [%d]id:%d, pno:0x%04x, name:%16s, sts:0x%02x, order:%d", - i, - p_thr_cre_info->id, /* Thread ID */ - p_thr_cre_info->pno, /* Process number */ - p_thr_cre_info->p_name, /* Thread name */ - p_thr_cre_info->status, /* Thread activation state */ - p_thr_cre_info->order); /* Boot Sequence */ - _pb_strcat(reinterpret_cast<char *>(&buf_thread[0]), reinterpret_cast<char *>(&buf_tmp[0]), sizeof(buf_tmp)); - p_thr_cre_info++; - } - - /* BASE API control data */ - /* Message */ - (void)_pb_GetDebugMsgMngTbl(&buf_message[0][0], &len_msg); - /* Mutex */ - (void)_pb_GetDebugMutexMngTbl(&buf_mutex[0][0], &len_mtx); - /* Timer */ - (void)_pb_GetDebugTimerMngTbl(&buf_timer[0]); - /* Event */ - (void)_pb_GetDebugEventMngTbl(&buf_event[0][0], &len_evt); - /* Shared Memory */ - (void)_pb_GetDebugMemoryMngTbl(&buf_memory[0]); - /* Other */ - (void)_pb_GetDebugOtherMngTbl(&buf_other[0]); - - /* NAND data */ - snprintf(reinterpret_cast<char *>(&buf_nand[0]), sizeof(buf_nand), "NAND"); - /* GPS fix count */ - memset(&buf_tmp[0], 0x00, sizeof(buf_tmp)); - memset(&st_gps_fix_cnt, 0x00, sizeof(st_gps_fix_cnt)); - - e_status = BackupMgrIfBackupDataRd(D_BK_ID_POS_GPS_FIX_CNT, - 0, - &st_gps_fix_cnt, - sizeof(st_gps_fix_cnt), &b_is_available); - snprintf(reinterpret_cast<char *>(&buf_tmp[0]), sizeof(buf_tmp), - "\n %20s rd:0x%08x av:%d, 3d:%d, 2d:%d, else:%d, dmy:0x%02x%02x%02x%02x", - "GPS_FIX_CNT", - e_status, - b_is_available, - st_gps_fix_cnt.ul3d, - st_gps_fix_cnt.ul2d, - st_gps_fix_cnt.ul_else, - st_gps_fix_cnt.dummy[0], st_gps_fix_cnt.dummy[1], st_gps_fix_cnt.dummy[2], st_gps_fix_cnt.dummy[3]); - _pb_strcat(reinterpret_cast<char *>(&buf_nand[0]), reinterpret_cast<char *>(&buf_tmp[0]), sizeof(buf_tmp)); - - /* Data of the backup RAM */ - snprintf(reinterpret_cast<char *>(&buf_ram[0]), sizeof(buf_ram), "BackupRAM"); - /* Set GPS date and time(Information) */ - memset(&buf_tmp[0], 0x00, sizeof(buf_tmp)); - (void)memset( reinterpret_cast<void *>(&st_gps_set_time), 0, (size_t)sizeof(st_gps_set_time) ); - - e_status = BackupMgrIfBackupDataRd(D_BK_ID_POS_GPS_TIME_SET_INFO, - 0, - &st_gps_set_time, - sizeof(st_gps_set_time), - &b_is_available); - snprintf(reinterpret_cast<char *>(&buf_tmp[0]), sizeof(buf_tmp), - "\n %20s rd:0x%08x av:%d, %d/%d/%d %d:%d:%d flag:0x%02x", - "GPS_TIME_SET_INFO", - e_status, - b_is_available, - st_gps_set_time.year, - st_gps_set_time.month, - st_gps_set_time.date, - st_gps_set_time.hour, - st_gps_set_time.minute, - st_gps_set_time.second, - st_gps_set_time.flag); - _pb_strcat(reinterpret_cast<char *>(&buf_ram[0]), reinterpret_cast<char *>(&buf_tmp[0]), sizeof(buf_tmp)); - - if (e_type == UNIT_TYPE_GRADE1) { - /* GPS format anomaly counter */ /* There is no lock control. */ - (void)DEVGpsGetDebugGpsFormatFailCnt(&buf_gps_format_fail[0]); - - /* GPS antenna connection status */ /* There is no lock control. */ - VEHICLESENS_DATA_MASTER st_sns_data = {0}; - (void)VehicleSensGetGpsAntenna(&st_sns_data, VEHICLESENS_GETMETHOD_LINE); - snprintf(reinterpret_cast<char *>(&buf_antenna[0]), sizeof(buf_antenna), - "Antenna\n sts:0x%02x", - st_sns_data.uc_data[0]); - - /* GPS position time */ /* There is no lock control. */ - (void)VehicleSensGetDebugPosDate(&buf_gps_info[0], VEHICLESENS_GETMETHOD_GPS); - } - - if (e_type == UNIT_TYPE_GRADE1) { - /* Navigation position time */ /* There is no lock control. */ - (void)VehicleSensGetDebugPosDate(&buf_navi_info[0], VEHICLESENS_GETMETHOD_NAVI); - } - - /* Delivery table */ /* There is no lock control. */ - (void)VehicleSensGetDebugDeliveryCtrlTbl(&buf_deli_ctrl_tbl[0]); - (void)VehicleSensGetDebugDeliveryCtrlTblMng(&buf_deli_ctrl_tbl_mng[0]); - (void)VehicleSensGetDebugPkgDeliveryTblMng(&buf_pkg_deli_tbl_mng[0]); - (void)VehicleSensGetDebugDeliveryPnoTbl(&buf_deli_pno_tbl[0]); - - /* Initial Sensor Data Status from Sys */ - sys_recv_flg = LineSensDrvGetSysRecvFlag(); - snprintf(reinterpret_cast<char *>(&buf_sys[0]), sizeof(buf_sys), - "Rx 1st Sensor Data %d\n", sys_recv_flg); - - /* Dump Information Out */ - PosOutputDebugDumpLog(&buf_proc[0]); - PosOutputDebugDumpLog(&buf_thread[0]); - for (i = 0; i < len_msg; i++) { - PosOutputDebugDumpLog(&buf_message[i][0]); - } - for (i = 0; i < len_mtx; i++) { - PosOutputDebugDumpLog(&buf_mutex[i][0]); - } - PosOutputDebugDumpLog(&buf_timer[0]); - for (i = 0; i < len_evt; i++) { - PosOutputDebugDumpLog(&buf_event[i][0]); - } - PosOutputDebugDumpLog(&buf_memory[0]); - PosOutputDebugDumpLog(&buf_other[0]); - PosOutputDebugDumpLog(&buf_nand[0]); - PosOutputDebugDumpLog(&buf_ram[0]); - if (e_type == UNIT_TYPE_GRADE1) { - PosOutputDebugDumpLog(&buf_gps_format_fail[0]); - PosOutputDebugDumpLog(&buf_antenna[0]); - PosOutputDebugDumpLog(&buf_gps_info[0]); - } - if (e_type == UNIT_TYPE_GRADE1) { - PosOutputDebugDumpLog(&buf_navi_info[0]); - } - PosOutputDebugDumpLog(&buf_deli_ctrl_tbl[0]); - PosOutputDebugDumpLog(&buf_deli_ctrl_tbl_mng[0]); - PosOutputDebugDumpLog(&buf_pkg_deli_tbl_mng[0]); - PosOutputDebugDumpLog(&buf_deli_pno_tbl[0]); - PosOutputDebugDumpLog(&buf_sys[0]); - - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "-"); - return eFrameworkunifiedStatusOK; -} -// LCOV_EXCL_STOP - -/** - * @brief - * FrameworkunifiedCreateStateMachine (Not mounted) - * - * @param[in] h_app Application handle - * - * @return eFrameworkunifiedStatusOK Normal completion - * eFrameworkunifiedStatusFail ABENDs - */ -EFrameworkunifiedStatus FrameworkunifiedCreateStateMachine(HANDLE h_app) { // LCOV_EXCL_START 8 : dead code - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "+"); - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "-"); - return eFrameworkunifiedStatusOK; -} -// LCOV_EXCL_STOP - -#ifdef __cplusplus -extern "C" { -#endif -/** - * @brief - * Common processing after thread startup - * - * Thread naming,Create Message Queue,Thread activation response - * - * @param[in] h_app Application handle - * @param[in] e_tid Thread ID - * - * @return Thread activation mode - */ -EnumSetupMode_POS PosSetupThread(HANDLE h_app, EnumTID_POS e_tid) { - RET_API ret; - ST_THREAD_CREATE_INFO* p_thr_cre_info = g_pos_thread_create_info; - ST_THREAD_CREATE_INFO* p_info; - ST_THREAD_SETUP_INFO st_setup_info; - ST_THREAD_SETUP_INFO* pst_setup_info = &st_setup_info; - - FRAMEWORKUNIFIEDLOG(ZONE_INIT, __FUNCTION__, "+"); - - p_info = p_thr_cre_info + e_tid; - - /* Application handle setting */ - _pb_SetAppHandle(h_app); - - /* Create Message Queue */ - _pb_CreateMsg(p_info->pno); - - /* Get Thread Startup Information */ - pst_setup_info->e_mode = EPOS_SETUP_MODE_NORMAL; - (void)PosGetMsg(h_app, reinterpret_cast<void**>(&pst_setup_info), sizeof(ST_THREAD_SETUP_INFO)); - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "[e_mode = %d]", pst_setup_info->e_mode); - - /* Issue thread creation completion notice */ - ret = _pb_SndMsg_Ext(POS_THREAD_NAME, CID_THREAD_CREATE_COMP, sizeof(EnumTID_POS), (const void*)&e_tid, 0); - if (ret != RET_NORMAL) { - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "_pb_SndMsg_Ext ERROR!! [ret = %d]", ret); - } - - FRAMEWORKUNIFIEDLOG(ZONE_INIT, __FUNCTION__, "-"); - - return pst_setup_info->e_mode; -} - -/** - * @brief - * Common Processing at Thread Stop - * - * Thread stop response,Thread destruction - * - * @param[in] e_tid Thread ID - */ -void PosTeardownThread(EnumTID_POS e_tid) { - RET_API ret; - - FRAMEWORKUNIFIEDLOG(ZONE_INIT, __FUNCTION__, "+"); - - /* Issue thread stop completion notice */ - ret = _pb_SndMsg_Ext(POS_THREAD_NAME, CID_THREAD_STOP_COMP, sizeof(EnumTID_POS), (const void*)&e_tid, 0); - if (ret != RET_NORMAL) { - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "_pb_SndMsg_Ext ERROR!! [ret = %d]", ret); - } - - /* Thread destruction */ - _pb_ExitThread((DWORD)0); - - /* don't arrive here */ - FRAMEWORKUNIFIEDLOG(ZONE_INIT, __FUNCTION__, "-"); - - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - return; // LCOV_EXCL_LINE 8 : cannot reach here -} - -#ifdef __cplusplus -} -#endif - -/** - * @brief - * FrameworkunifiedCreateChildThread dummy functions - * - * @param[in] Application handle - * - * @return eFrameworkunifiedStatusOK successful completion - */ -static EFrameworkunifiedStatus PosStopThreadDummy(HANDLE h_app) { // LCOV_EXCL_START 8 : dead code - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "+"); - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "-"); - return eFrameworkunifiedStatusOK; -} -// LCOV_EXCL_STOP - -/*---------------------------------------------------------------------------------* - * Local Function * - *---------------------------------------------------------------------------------*/ -/** - * @brief - * Communication services Availability notification callback functions - * - * @param[in] h_app Application handle - * - * @return eFrameworkunifiedStatusOK Normal completion - */ -static EFrameworkunifiedStatus PosNotifyCommunicationAvailability(HANDLE h_app) { - BOOL isAvailable; - uint8_t* pLastSrvSts = &g_last_srv_sts; - - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "+"); - - isAvailable = FrameworkunifiedIsServiceAvailable(h_app); - if (isAvailable == TRUE) { // LCOV_EXCL_BR_LINE 4: nsfw error - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "Communication/Availability -> TRUE"); - - *pLastSrvSts |= NTFY_MSK_COMMUNICATION_AVAILABILITY; - - PosCreateThread(h_app); - - /* Sensor Log Initial Processing(First)*/ - SensLogInitialize(NULL); - } else { - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "Communication/Availability -> FALSE"); - - *pLastSrvSts = static_cast<uint8_t>(*pLastSrvSts & ~NTFY_MSK_COMMUNICATION_AVAILABILITY); - } - - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "-"); - - return eFrameworkunifiedStatusOK; -} - -/** - * @brief - * CommUSB services Availability notification callback functions - * - * @param[in] h_app Application handle - * - * @return eFrameworkunifiedStatusOK Normal completion - */ -static EFrameworkunifiedStatus PosNotifyCommUSBAvailability(HANDLE h_app) { - BOOL isAvailable; - uint8_t* pLastSrvSts = &g_last_srv_sts; - - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "+"); - - isAvailable = FrameworkunifiedIsServiceAvailable(h_app); - if (isAvailable == TRUE) { - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "PS_CommUSB/Availability -> TRUE"); - - *pLastSrvSts |= NTFY_MSK_PS_COMMUSB_AVAILABILITY; - - PosCreateThread(h_app); - } else { - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "PS_CommUSB/Availability -> FALSE"); - - *pLastSrvSts = static_cast<uint8_t>(*pLastSrvSts & ~NTFY_MSK_PS_COMMUSB_AVAILABILITY); - } - - /* Update CommUSB I/F availability */ - CommUsbIfSetAvailability(isAvailable); - - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "-"); - - return eFrameworkunifiedStatusOK; -} - -/** - * @brief - * PSMShadow services Availability notification callback functions - * - * @param[in] h_app Application handle - * - * @return eFrameworkunifiedStatusOK Normal completion - */ -static EFrameworkunifiedStatus PosNotifyPSMShadowAvailability(HANDLE h_app) { - BOOL isAvailable; - uint8_t* pLastSrvSts = &g_last_srv_sts; - - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "+"); - - isAvailable = FrameworkunifiedIsServiceAvailable(h_app); - if (isAvailable == TRUE) { - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "PS_PSMShadow/Availability -> TRUE"); - - *pLastSrvSts |= NTFY_MSK_PS_PSMSHADOW_AVAILABILITY; - - PosCreateThread(h_app); - } else { - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "PS_PSMShadow/Availability -> FALSE"); - - *pLastSrvSts = static_cast<uint8_t>(*pLastSrvSts & ~NTFY_MSK_PS_PSMSHADOW_AVAILABILITY); - } - - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "-"); - - return eFrameworkunifiedStatusOK; -} - -/** - * @brief - * PSMShadow services Callback function for notifying completion of startup - * - * @param[in] h_app Application handle - * - * @return eFrameworkunifiedStatusOK Normal completion - */ -static EFrameworkunifiedStatus PosNotifyPSMShadowInitComp(HANDLE h_app) { - uint8_t* pLastNtfySts = &g_last_ntfy_sts; - ST_THREAD_CREATE_INFO* pThrCreInfo = g_pos_thread_create_info; - - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "+"); - - *pLastNtfySts |= NTFY_MSK_PS_PSMSHADOW_INIT_COMP; - - /* When the Pos_Sens thread is started */ - if (((pThrCreInfo + ETID_POS_SENS)->status) == THREAD_STS_CREATED) { - /* External pin status request */ - LineSensDrvExtTermStsReq(); - } - - PosCreateThread(h_app); - - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "-"); - - return eFrameworkunifiedStatusOK; -} - -/** - * @brief - * Clock Services Availability Notification Callback Functions - * - * @param[in] h_app Application handle - * - * @return eFrameworkunifiedStatusOK successful completion - */ -static EFrameworkunifiedStatus PosNotifyClockAvailability(HANDLE h_app) { - BOOL isAvailable; - uint8_t* pLastSrvSts = &g_last_srv_sts; - - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "+"); - - isAvailable = FrameworkunifiedIsServiceAvailable(h_app); - if (isAvailable == TRUE) { - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "Clock/Availability -> TRUE"); - - *pLastSrvSts |= NTFY_MSK_CLOCK_AVAILABILITY; - - PosCreateThread(h_app); - } else { - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "Clock/Availability -> FALSE"); - - *pLastSrvSts = static_cast<uint8_t>(*pLastSrvSts & ~NTFY_MSK_CLOCK_AVAILABILITY); - } - - /* Update Clock I/F availability */ - ClockIfSetAvailability(isAvailable); - - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "-"); - - return eFrameworkunifiedStatusOK; -} - -/** - * @brief - * NS_BackupMgr service Availability notification callback function - * - * @param[in] h_app Application handle - * - * @return eFrameworkunifiedStatusOK successful completion - */ -static EFrameworkunifiedStatus PosNotifyNSBackupMgrAvailability(HANDLE h_app) { - EnumExeSts_POS* pExeSts = &g_exe_sts; - uint8_t* pLastSrvSts = &g_last_srv_sts; - ST_THREAD_CREATE_INFO* pThrCreInfo = g_pos_thread_create_info; - EnumSetupMode_POS* peMode = &g_setup_mode; - BOOL bIsAvailable; - - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "+"); - - bIsAvailable = FrameworkunifiedIsServiceAvailable(h_app); - - /* Update BackupMgr I/F availability */ - BackupMgrIfSetAvailability(bIsAvailable); - - if (bIsAvailable == TRUE) { - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "NS_BackupMgr/Availability -> TRUE"); - - *pLastSrvSts |= NTFY_MSK_NS_BACKUPMGR_AVAILABILITY; - - /* Executing after cold start or during factory initialization*/ - if ((*pExeSts == EPOS_EXE_STS_RUNNING_COLDSTART) || - (*peMode == EPOS_SETUP_MODE_DATA_RESET)) { - /* Backup RAM initialization */ - PosBackupDataInit(); - } - - /* When the GPS management thread is started */ - if (((pThrCreInfo + ETID_POS_GPS)->status) == THREAD_STS_CREATED) { - if ((*pExeSts == EPOS_EXE_STS_RUNNING_COLDSTART) || - (*peMode == EPOS_SETUP_MODE_DATA_RESET)) { - // GPS reset request. - SENSOR_INTERNAL_MSG_BUF msg_buf = {}; - T_APIMSG_MSGBUF_HEADER *msg_hdr = &msg_buf.hdr; - msg_hdr->hdr.cid = CID_GPS_REQRESET; - msg_hdr->hdr.msgbodysize = sizeof(POS_RESETINFO); - POS_RESETINFO *msg_data = reinterpret_cast<POS_RESETINFO *>(&msg_buf.data); - msg_data->mode = GPS_RST_COLDSTART; - - RET_API ret = _pb_SndMsg(PNO_NAVI_GPS_MAIN, sizeof(msg_buf), &msg_buf, 0); - if (ret != RET_NORMAL) { - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "_pb_SndMsg ERROR!! [ret=%d]", ret); - } - } - - /* Backup data read request to GSP management thread */ - (void)DEVGpsSndBackupDataLoadReq(); - } - /* Enable Diag Code Writing */ - DiagSrvIfSetRegistrationPermission(TRUE); - - PosCreateThread(h_app); - } else { - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "NS_BackupMgr/Availability -> FALSE"); - - *pLastSrvSts = static_cast<uint8_t>(*pLastSrvSts & ~NTFY_MSK_NS_BACKUPMGR_AVAILABILITY); - /* Write prohibited dialog code */ - DiagSrvIfSetRegistrationPermission(FALSE); - } - - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "-"); - - return eFrameworkunifiedStatusOK; -} - -/** - * @brief - * SS_DevDetectSrv service Availability Callback Functions - * - * @param[in] h_app Application handle - * - * @return eFrameworkunifiedStatusOK successful completion - */ -static EFrameworkunifiedStatus PosNotifyDevDetectSrvAvailability(HANDLE h_app) { - EFrameworkunifiedStatus eStatus = eFrameworkunifiedStatusOK; - BOOL isAvailable; - BOOL bDummy; - uint8_t* pLastSrvSts = &g_last_srv_sts; - - FRAMEWORKUNIFIEDLOG(ZONE_INIT, __FUNCTION__, "+"); - - isAvailable = FrameworkunifiedIsServiceAvailable(h_app); - - /* Update DevDetectSrv I/F availability */ - DevDetectSrvIfSetAvailability(isAvailable); - - if (isAvailable == TRUE) { - FRAMEWORKUNIFIEDLOG(ZONE_INIT, __FUNCTION__, "SS_DevDetectSrv/Availability -> TRUE"); - *pLastSrvSts |= NTFY_MSK_SS_DEVDETSRV_AVAILABILITY; - - eStatus = DevDetectSrvIfOpenSessionRequest(&bDummy); - if (eFrameworkunifiedStatusOK != eStatus) { - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, - "DeviceDetectionServiceIf OpenSession ERROR!! [eStatus = %d]", eStatus); - } else { - eStatus = DevDetectSrvIfNotifyOnOpenSessionAck(&PosOnDevDetectOpenSessionAck, &bDummy); - if (eFrameworkunifiedStatusOK != eStatus) { - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, - "DeviceDetectionServiceIf NotifyOnOpenSessionAck ERROR!! [eStatus = %d]", eStatus); - } - } - } else { - FRAMEWORKUNIFIEDLOG(ZONE_INIT, __FUNCTION__, "SS_DevDetectSrv/Availability -> FALSE"); - *pLastSrvSts = static_cast<uint8_t>(*pLastSrvSts & ~NTFY_MSK_SS_DEVDETSRV_AVAILABILITY); - } - - FRAMEWORKUNIFIEDLOG(ZONE_INIT, __FUNCTION__, "-"); - - return eFrameworkunifiedStatusOK; -} - - -/** - * @brief - * Vehicle Availability notification callback functions - * - * @param[in] h_app Application handle - * - * @return eFrameworkunifiedStatusOK Normal completion - * - */ -static EFrameworkunifiedStatus PosNotifyVehicleAvailability(HANDLE h_app) { - BOOL isAvailable; - uint8_t* pLastSrvSts = &g_last_srv_sts; - - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "+"); - - isAvailable = FrameworkunifiedIsServiceAvailable(h_app); - - /* Update Vechile I/F Abailability */ - VehicleIf_SetAvailability(isAvailable); - - if (isAvailable == TRUE) { - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "Vehicle/Availability -> TRUE"); - - *pLastSrvSts |= NTFY_MSK_VS_VEHICLE_AVAILABILITY; - - if (eFrameworkunifiedStatusFail == VehicleIfDeliveryEntry(VEHICLE_DID_SPEED)) { - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "VehicleIfDeliveryEntry SPEED ERROR"); - } - - if (eFrameworkunifiedStatusFail == VehicleIfDeliveryEntry(VEHICLE_DID_REV)) { - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "VehicleIfDeliveryEntry REV ERROR"); - } - - if (eFrameworkunifiedStatusFail == VehicleIfDeliveryEntry(VEHICLE_DID_SPEED_PULSE_VEHICLE)) { - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "VehicleIfDeliveryEntry SPEED PULSE ERROR"); - } - - PosCreateThread(h_app); - - } else { - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "Vehicle/Availability -> FALSE"); - - *pLastSrvSts &= ~NTFY_MSK_VS_VEHICLE_AVAILABILITY; - } - - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "-"); - - return eFrameworkunifiedStatusOK; -} - -/** - * @brief - * Shared Memory Creation for Positioning Function - * - * @return RET_NORMAL Normal completion - * RET_ERROR ABENDs - */ -static void PosCreateSharedMemory(void) { - RET_API ret_api = RET_NORMAL; - void *mod_exec_dmy; /* Module data pointer(dummy) */ - int retry; /* Retry counter */ - ST_SHAREDATA *p_shm_tbl; - - /* Configure Shared Data Generating Tables */ - p_shm_tbl = g_sharedata_tbl; - - while ( *(p_shm_tbl->share_data_name) != '\0' ) { - for ( retry = 0; retry < DATMOD_RETRY; retry++ ) { - /* Shared Memory Generation */ - ret_api = _pb_CreateShareData(p_shm_tbl->share_data_name, p_shm_tbl->data_size, &mod_exec_dmy); - if (ret_api == RET_NORMAL) { /* If successful */ - /* Set the shared memory status flag to ""Before initialization (0)"" */ - *reinterpret_cast<u_int32 *>(mod_exec_dmy) = DATMOD_PREINIT; - - break; - } else { /* In the event of failure */ - /* Error Handling */ - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, - "_pb_CreateShareData ERROR [ret_api:%d]", - ret_api); - } - } - - if (retry >= DATMOD_RETRY) { - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "_pb_CreateShareData failed more %d times.", - DATMOD_RETRY); - - _pb_Exit(); - /* don't arrive here. */ - } - - /* Next shared memory generation */ - p_shm_tbl++; - } - - return; -} - -/** - * @brief - * Positioning in-process thread creation - * - * @param[in] hApp application handles - */ -static void PosCreateThread(HANDLE h_app) { - HANDLE threadHandle; - EFrameworkunifiedStatus eStatus = eFrameworkunifiedStatusOK; - EnumSetupMode_POS* peMode = &g_setup_mode; - int32_t i; - uint8_t* pLastSrvSts = &g_last_srv_sts; - uint8_t* pLastThreadSts = &g_last_thread_sts; - uint8_t* pLastNtfySts = &g_last_ntfy_sts; - EnumExeSts_POS* pExeSts = &g_exe_sts; - ST_THREAD_CREATE_INFO* pThrCreInfo = g_pos_thread_create_info; - - FRAMEWORKUNIFIEDLOG(ZONE_INIT, __FUNCTION__, "+"); - - for (i = 0; i < ETID_POS_MAX; i++) { - if ((pThrCreInfo->status == THREAD_STS_NOEXIST) && (pThrCreInfo->routine != NULL)) { - FRAMEWORKUNIFIEDLOG(ZONE_28, __FUNCTION__, - "i=%d, mskThread=0x%02x, *pLastThreadSts=0x%02x,"\ - "mskAvailable=0x%02x, *pLastSrvSts=0x%02x, mskNtfy=0x%02x, *pLastNtfySts=0x%02x", - i, - pThrCreInfo->msk_thread, - *pLastThreadSts, - pThrCreInfo->msk_available, - *pLastSrvSts, - pThrCreInfo->msk_ntfy, - *pLastNtfySts); - - if ((*pExeSts != EPOS_EXE_STS_STOP) - && ((((pThrCreInfo->msk_thread) & (*pLastThreadSts)) == pThrCreInfo->msk_thread) - || (pThrCreInfo->msk_thread == 0)) - && ((((pThrCreInfo->msk_available) & (*pLastSrvSts)) == pThrCreInfo->msk_available) - || (pThrCreInfo->msk_available == NTFY_MSK_NONE)) - && ((((pThrCreInfo->msk_ntfy) & (*pLastNtfySts)) == pThrCreInfo->msk_ntfy) - || (pThrCreInfo->msk_ntfy == NTFY_MSK_NONE))) { - if (pThrCreInfo->pno == PNO_LINE_SENS_DRV || \ - pThrCreInfo->pno == PNO_NAVI_GPS_MAIN || \ - pThrCreInfo->pno == PNO_NAVI_GPS_RCV || - pThrCreInfo->pno == PNO_CLK_GPS) { - (pThrCreInfo->routine)(h_app); - } else { - /* Thread creation */ - threadHandle = FrameworkunifiedCreateChildThread(h_app, - (PCSTR)(pThrCreInfo->p_name), - pThrCreInfo->routine, - &PosStopThreadDummy); - if (threadHandle == NULL) { /* If the thread creation fails */ - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, - "FrameworkunifiedCreateChildThread ERROR!! [tHandle=%p]", - threadHandle); - _pb_Exit(); - /* don't arrive here. */ - } else { - /* Thread activation (Notify the startup mode) */ - eStatus = FrameworkunifiedStartChildThread(h_app, - threadHandle, - sizeof(EnumSetupMode_POS), - reinterpret_cast<void*>(peMode)); - if (eStatus != eFrameworkunifiedStatusOK) { - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, - "FrameworkunifiedStartChildThread ERROR!! [eStatus=%d, name=%s]", - eStatus, - pThrCreInfo->p_name); - } else { - pThrCreInfo->status = THREAD_STS_CREATING; - FRAMEWORKUNIFIEDLOG(ZONE_INIT, __FUNCTION__, "name=%s", pThrCreInfo->p_name); - } - } - } - } - } - - pThrCreInfo++; - } - - FRAMEWORKUNIFIEDLOG(ZONE_INIT, __FUNCTION__, "-"); - - return; -} - - -/** - * @brief - * Termination of Positioning in-process threads - */ -static void PosStopThread(void) { - RET_API ret; - ST_THREAD_CREATE_INFO* p_thr_cre_info = g_pos_thread_create_info; - BOOL *p_thr_stop_req = &g_thread_stop_req; - uint8_t uc_msg = 0; - uint8_t uc_order = 0; - PNO us_pno = 0; - int32_t i; - - FRAMEWORKUNIFIEDLOG(ZONE_INIT, __FUNCTION__, "+"); - - for (i = 0; i < ETID_POS_MAX; i++) { - if (uc_order < p_thr_cre_info->order) { - uc_order = p_thr_cre_info->order; - us_pno = p_thr_cre_info->pno; - } - p_thr_cre_info++; - } - - if (uc_order != 0) { - /* Send Thread Termination Request */ - if (us_pno == PNO_NAVI_GPS_RCV) { - /* Pos_gps_recv Only thread flag control */ - *p_thr_stop_req = TRUE; - } else { - ret = PosSndMsg(us_pno, CID_THREAD_STOP_REQ, &uc_msg, sizeof(uc_msg)); - if (ret != RET_NORMAL) { - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, - "PosSndMsg ERROR!! [ret = %d]", - ret); - } - } - } - - FRAMEWORKUNIFIEDLOG(ZONE_INIT, __FUNCTION__, "-"); - - return; -} - -/** - * @brief - * Backup RAM initialization - */ -static void PosBackupDataInit(void) { - UNIT_TYPE e_type = UNIT_TYPE_NONE; - EFrameworkunifiedStatus e_status; - BOOL b_is_available; - ST_GPS_SET_TIME st_gps_set_time; - - (void)memset( reinterpret_cast<void *>(&st_gps_set_time), 0, (size_t)sizeof(st_gps_set_time) ); - - FRAMEWORKUNIFIEDLOG(ZONE_INIT, __FUNCTION__, "+"); - - e_type = GetEnvSupportInfo(); - if (e_type == UNIT_TYPE_GRADE1) { - /* Set GPS date and time */ - e_status = BackupMgrIfBackupDataWt(D_BK_ID_POS_GPS_TIME_SET_INFO, - &st_gps_set_time, - 0, - sizeof(st_gps_set_time), - &b_is_available); - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "D_BK_ID_POS_GPS_TIME_SET_INFO:W:Clear"); - if (e_status != eFrameworkunifiedStatusOK) { - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, - "BackupMgrIfBackupDataWt ERROR!! [e_status=%d, b_is_available=%d]", - e_status, - b_is_available); - } - } else if (e_type == UNIT_TYPE_GRADE2) { - /* - * Note. - * This feature branches processing depending on the unit type. - */ - } else { - /* No processing */ - } - - FRAMEWORKUNIFIEDLOG(ZONE_INIT, __FUNCTION__, "-"); - - return; -} - -/** - * @brief - * Callback function for registering the dispatcher() - * - * @param[in] h_app Application handle - * - * @return eFrameworkunifiedStatusOK Normal completion - */ -static EFrameworkunifiedStatus PosThreadCreateComp(HANDLE h_app) { - EFrameworkunifiedStatus eStatus = eFrameworkunifiedStatusOK; - uint8_t* pRcvMsg; - uint32_t size; - uint8_t* pLastThreadSts = &g_last_thread_sts; - ST_THREAD_CREATE_INFO* pThrCreInfo = g_pos_thread_create_info; - uint8_t* pLastNumThr = &g_last_num_of_thread; - uint8_t* pLastSrvSts = &g_last_srv_sts; - uint8_t* pLastNtfySts = &g_last_ntfy_sts; - EnumTID_POS eTid; - int32_t i; - static BOOL isSetAvailable = FALSE; - - FRAMEWORKUNIFIEDLOG(ZONE_INIT, __FUNCTION__, "+"); - - pRcvMsg = g_rcv_msg_buf; - - size = PosGetMsg(h_app, reinterpret_cast<void**>(&pRcvMsg), MAX_MSG_BUF_SIZE); - if (size != 0) { // LCOV_EXCL_BR_LINE 4: nsfw error - (*pLastNumThr)++; - - eTid = *(reinterpret_cast<EnumTID_POS*>(pRcvMsg)); - - FRAMEWORKUNIFIEDLOG(ZONE_17, __FUNCTION__, - "Get message = [Sender:%s][CID:0x%X]", - (pThrCreInfo + eTid)->p_name, - CID_THREAD_CREATE_COMP); - - /* Thread Management Variable Updates */ - *pLastThreadSts = static_cast<uint8_t>(*pLastThreadSts | (0x1u << eTid)); - (pThrCreInfo + eTid)->status = THREAD_STS_CREATED; - (pThrCreInfo + eTid)->order = *pLastNumThr; - - /* Individual processing of started threads */ - switch (eTid) { - case ETID_POS_SENS: /* When sensor driver thread startup is completed */ - { - /* When PSMShadow startup completion notice has been received */ - if (((NTFY_MSK_PS_PSMSHADOW_INIT_COMP) & (*pLastNtfySts)) == NTFY_MSK_PS_PSMSHADOW_INIT_COMP) { - /* External pin status request */ - LineSensDrvExtTermStsReq(); - } - break; - } - case ETID_POS_GPS: /* When the GPS management thread has started */ - { - /* NSBackupMgr/Availability=When TRUE notification has been received */ - if (((NTFY_MSK_NS_BACKUPMGR_AVAILABILITY) & (*pLastSrvSts)) == NTFY_MSK_NS_BACKUPMGR_AVAILABILITY) { - /* Backup data read request to GSP management thread */ - (void)DEVGpsSndBackupDataLoadReq(); - } - break; - } - default: /* Other thread startup completion time */ - break; - } - - PosCreateThread(h_app); - - for (i = 0; i < ETID_POS_MAX; i++) { - if ((pThrCreInfo->is_depended == TRUE) && (pThrCreInfo->status != THREAD_STS_CREATED)) { - break; /* Positioning/Availability->TRUE condition does not meet */ - } - pThrCreInfo++; - } - - if ((i == ETID_POS_MAX) && (isSetAvailable == FALSE)) { - /* Positionig/Availability -> TRUE */ - eStatus = FrameworkunifiedPublishServiceAvailability(h_app, TRUE); - if (eFrameworkunifiedStatusOK != eStatus) { - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, - "FrameworkunifiedPublishServiceAvailability ERROR!! [eStatus = %d]", - eStatus); - } else { - FRAMEWORKUNIFIEDLOG(ZONE_INIT, __FUNCTION__, "Positioning/Availability -> TRUE"); - isSetAvailable = TRUE; - } - } - } - - FRAMEWORKUNIFIEDLOG(ZONE_INIT, __FUNCTION__, "-"); - - return eFrameworkunifiedStatusOK; -} - - -/** - * @brief - * Callback function for registering the dispatcher() - * - * @param[in] h_app Application handle - * - * @return eFrameworkunifiedStatusOK Normal completion - */ -static EFrameworkunifiedStatus PosThreadStopComp(HANDLE h_app) { - EFrameworkunifiedStatus eStatus; - BOOL bIsAvailable; - - uint8_t* pRcvMsg; - uint32_t size; - uint8_t* pLastThreadSts = &g_last_thread_sts; - ST_THREAD_CREATE_INFO* pThrCreInfo = g_pos_thread_create_info; - uint8_t* pLastNumThr = &g_last_num_of_thread; - BOOL *pThrStopReq = &g_thread_stop_req; - EnumTID_POS eTid; - - FRAMEWORKUNIFIEDLOG(ZONE_INIT, __FUNCTION__, "+"); - - pRcvMsg = g_rcv_msg_buf; - - size = PosGetMsg(h_app, reinterpret_cast<void**>(&pRcvMsg), MAX_MSG_BUF_SIZE); - if (size != 0) { // LCOV_EXCL_BR_LINE 4: nsfw error - (*pLastNumThr)--; - - eTid = *(reinterpret_cast<EnumTID_POS*>(pRcvMsg)); - - FRAMEWORKUNIFIEDLOG(ZONE_17, __FUNCTION__, - "Get message = [Sender:%s][CID:0x%X]", - (pThrCreInfo + eTid)->p_name, - CID_THREAD_STOP_COMP); - - *pLastThreadSts = static_cast<uint8_t>(*pLastThreadSts & ~(0x1u << eTid)); - - (pThrCreInfo + eTid)->status = THREAD_STS_NOEXIST; - (pThrCreInfo + eTid)->order = 0; - - if ((pThrCreInfo + eTid)->pno == PNO_NAVI_GPS_RCV) { - *pThrStopReq = FALSE; - } - } - - PosStopThread(); - - /* When all threads have stopped */ - if (*pLastThreadSts == 0) { - /* Unregister callback function */ - eStatus = FrameworkunifiedDetachCallbacksFromDispatcher(h_app, - "NS_ANY_SRC", - (const PUI_32)g_positioning_cids, - _countof(g_positioning_cids), NULL); - if (eStatus != eFrameworkunifiedStatusOK) { /* In the event of failure */ - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, - "PositioningDetachCallbacksToDispatcher Failed in FrameworkunifiedOnStop [eStatus:%d]", - eStatus); - } - - /* Sensor log stop processing */ - SensLogTerminate(); - - /* DeviceDetectionServiceIf termination process */ - eStatus = DevDetectSrvIfUnRegisterForDeviceDetectionEvent(SS_DEV_DETECT_ANY_USB_EV, &bIsAvailable); - if (eStatus != eFrameworkunifiedStatusOK) { - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, - "DeviceDetectionServiceIf UnRegisterEvent ERROR!! [sts:%d, ava:%d]", - eStatus, - bIsAvailable); - } else { - eStatus = DevDetectSrvIfCloseSessionRequest(&bIsAvailable); - if (eFrameworkunifiedStatusOK != eStatus) { - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, - "DeviceDetectionServiceIf CloseSession ERROR!! [sts=%d, ava:%d]", - eStatus, - bIsAvailable); - } - } - - (void)VehicleIfDetachCallbacksFromDispatcher((const PUI_32)g_positioning_cids_vehicle, - _countof(g_positioning_cids_vehicle)); - - /* Releasing Base API Resources */ - _pb_Teardown_CWORD64_API(); - - /* Stop processing completion response */ - SendInterfaceunifiedOnStopResponseToSystemManager(eFrameworkunifiedStatusOK); - } - - FRAMEWORKUNIFIEDLOG(ZONE_INIT, __FUNCTION__, "-"); - - return eFrameworkunifiedStatusOK; -} - -/** - * @brief - * Callback function for registering the dispatcher(POS_RegisterListenerPkgSensData) - * - * Send a message to an internal thread. - * - * @param[in] h_app Application handle - * - * @return eFrameworkunifiedStatusOK Normal completion - */ -static EFrameworkunifiedStatus PosPosifRegisterListenerPkgSensorData(HANDLE h_app) { - RET_API ret; - uint8_t* pRcvMsg; - uint32_t size; - EventID ulEventId; - PCSTR pName; - static const PCSTR pNone = "-"; - - FRAMEWORKUNIFIEDLOG(ZONE_28, __FUNCTION__, "+"); - - pRcvMsg = g_rcv_msg_buf; - - size = PosGetMsg(h_app, reinterpret_cast<void**>(&pRcvMsg), MAX_MSG_BUF_SIZE); - if (size != 0) { // LCOV_EXCL_BR_LINE 4: nsfw error - pName = _pb_CnvPno2Name((reinterpret_cast<SENSOR_MSG_DELIVERY_ENTRY_DAT*>(pRcvMsg))->pno); - if (pName == NULL) { - pName = pNone; - } - FRAMEWORKUNIFIEDLOG(ZONE_17, __FUNCTION__, - "Get message = [Sender:%s][CID:0x%X", - pName, - CID_SENSORIF_PKG_DELIVERY_ENTRY_EXT); - - /* Send Messages to Internal Thread */ - ret = PosSndMsg(PNO_VEHICLE_SENSOR, CID_SENSORIF_PKG_DELIVERY_ENTRY_EXT, pRcvMsg, size); - if (ret != RET_NORMAL) { - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "PosSndMsg ERROR!! [ret = %d]", ret); - /* Event Generation */ - ulEventId = PosCreateEvent((reinterpret_cast<SENSOR_MSG_DELIVERY_ENTRY_DAT*>(pRcvMsg))->pno); - if (ulEventId != 0) { - /* Event publishing */ - ret = _pb_SetEvent(ulEventId, SAPI_EVSET_ABSOLUTE, SENSOR_RET_ERROR_INNER); - if (ret != RET_NORMAL) { - /* Event issuance failure */ - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "_pb_SetEvent ERROR!! [ret = %d]", ret); - } - /* Event deletion */ - (void)PosDeleteEvent(ulEventId); - } else { - /* Event generation failure */ - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "PosCreateEvent ERROR!!"); - } - } - } - - FRAMEWORKUNIFIEDLOG(ZONE_28, __FUNCTION__, "-"); - - return eFrameworkunifiedStatusOK; -} - -/** - * @brief - * Callback function for registering the dispatcher(POS_RegisterListenerSensData) - * - * Send a message to an internal thread. - * - * @param[in] h_app Application handle - * - * @return eFrameworkunifiedStatusOK Normal completion - */ -static EFrameworkunifiedStatus PosPosifRegisterListenerSensorData(HANDLE h_app) { - RET_API ret; - uint8_t* pRcvMsg; - uint32_t size; - EventID ulEventId; - PCSTR pName; - static const PCSTR pNone = "-"; - - FRAMEWORKUNIFIEDLOG(ZONE_28, __FUNCTION__, "+"); - - pRcvMsg = g_rcv_msg_buf; - - size = PosGetMsg(h_app, reinterpret_cast<void**>(&pRcvMsg), MAX_MSG_BUF_SIZE); - if (size != 0) { // LCOV_EXCL_BR_LINE 4: nsfw error - pName = _pb_CnvPno2Name((reinterpret_cast<VEHICLE_MSG_DELIVERY_ENTRY_DAT*>(pRcvMsg))->pno); - if (pName == NULL) { - pName = pNone; - } - FRAMEWORKUNIFIEDLOG(ZONE_17, __FUNCTION__, - "Get message = [Sender:%s][CID:0x%X]", - pName, - CID_VEHICLEIF_DELIVERY_ENTRY); - - /* Send Messages to Internal Thread */ - ret = PosSndMsg(PNO_VEHICLE_SENSOR, CID_VEHICLEIF_DELIVERY_ENTRY, pRcvMsg, size); - if (ret != RET_NORMAL) { - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "PosSndMsg ERROR!! [ret = %d]", ret); - /* Event Generation */ - ulEventId = VehicleCreateEvent((reinterpret_cast<VEHICLE_MSG_DELIVERY_ENTRY_DAT*>(pRcvMsg))->pno); - if (ulEventId != 0) { - /* Event publishing */ - ret = _pb_SetEvent(ulEventId, SAPI_EVSET_ABSOLUTE, SENSOR_RET_ERROR_INNER); - if (ret != RET_NORMAL) { - /* Event issuance failure */ - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "_pb_SetEvent ERROR!! [ret = %d]", ret); - } - /* Event deletion */ - (void)VehicleDeleteEvent(ulEventId); - } else { - /* Event generation failure */ - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "VehicleCreateEvent ERROR!!"); - } - } - } - - FRAMEWORKUNIFIEDLOG(ZONE_28, __FUNCTION__, "-"); - - return eFrameworkunifiedStatusOK; -} - -/** - * @brief - * Callback function for registering the dispatcher(POS_ReqGPSSetting) - * - * Send a message to an internal thread. - * - * @param[in] h_app Application handle - * - * @return eFrameworkunifiedStatusOK Normal completion - */ -static EFrameworkunifiedStatus PosPosifReqGpsSetting(HANDLE h_app) { - RET_API ret; - uint8_t* pRcvMsg; - uint32_t size; - uint8_t ucResult = SENSLOG_RES_FAIL; - - FRAMEWORKUNIFIEDLOG(ZONE_28, __FUNCTION__, "+"); - - pRcvMsg = g_rcv_msg_buf; - - size = PosGetMsg(h_app, reinterpret_cast<void**>(&pRcvMsg), MAX_MSG_BUF_SIZE); - if (size != 0) { // LCOV_EXCL_BR_LINE 4: nsfw error - FRAMEWORKUNIFIEDLOG(ZONE_17, __FUNCTION__, - "Get message = [Sender:-][CID:0x%X]", - CID_SENSORIF__CWORD82__REQUEST); - ucResult = SENSLOG_RES_SUCCESS; - - /* Send Messages to Internal Thread */ - ret = PosSndMsg(PNO_VEHICLE_SENSOR, CID_SENSORIF__CWORD82__REQUEST, pRcvMsg, size); - if (ret != RET_NORMAL) { - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "PosSndMsg ERROR!! [ret = %d]", ret); - } - } - - SensLogWriteInputData(SENSLOG_DATA_I_GPSSET, 0, 0, pRcvMsg, static_cast<uint16_t>(size), - ucResult, SENSLOG_ON, SENSLOG_ON); - FRAMEWORKUNIFIEDLOG(ZONE_28, __FUNCTION__, "-"); - - return eFrameworkunifiedStatusOK; -} - -/** - * @brief - * Callback function for registering the dispatcher(POS_SetGPSInfo) - * - * Send a message to an internal thread. - * - * @param[in] h_app Application handle - * - * @return eFrameworkunifiedStatusOK Normal completion - */ -static EFrameworkunifiedStatus PosPosifSetGpsInfo(HANDLE h_app) { - RET_API ret; - uint8_t* pRcvMsg; - uint32_t size; - uint8_t ucResult = SENSLOG_RES_FAIL; - - FRAMEWORKUNIFIEDLOG(ZONE_28, __FUNCTION__, "+"); - - pRcvMsg = g_rcv_msg_buf; - - size = PosGetMsg(h_app, reinterpret_cast<void**>(&pRcvMsg), MAX_MSG_BUF_SIZE); - if (size != 0) { // LCOV_EXCL_BR_LINE 4: nsfw error - FRAMEWORKUNIFIEDLOG(ZONE_17, __FUNCTION__, - "Get message = [Sender:-][CID:0x%X]", - CID_NAVIINFO_DELIVER); - ucResult = SENSLOG_RES_SUCCESS; - - /* Send Messages to Internal Thread */ - ret = PosSndMsg(PNO_NAVI_GPS_MAIN, CID_NAVIINFO_DELIVER, pRcvMsg, size); - if (ret != RET_NORMAL) { - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "PosSndMsg ERROR!! [ret = %d]", ret); - } - } - SensLogWriteInputData(SENSLOG_DATA_I_GPSINF, 0, 0, pRcvMsg, static_cast<uint16_t>(size), - ucResult, SENSLOG_ON, SENSLOG_ON); - FRAMEWORKUNIFIEDLOG(ZONE_28, __FUNCTION__, "-"); - - return eFrameworkunifiedStatusOK; -} - -/** - * @brief - * Callback function for registering the dispatcher(POS_GetGPSInfo) - * - * Send a message to an internal thread. - * - * @param[in] h_app Application handle - * - * @return eFrameworkunifiedStatusOK Normal completion - */ -static EFrameworkunifiedStatus PosPosifGetGpsInfo(HANDLE h_app) { - RET_API ret; - uint8_t* pRcvMsg; - uint32_t size; - EventID ulEventId; - PCSTR pName; - static const PCSTR pNone = "-"; - - FRAMEWORKUNIFIEDLOG(ZONE_28, __FUNCTION__, "+"); - - pRcvMsg = g_rcv_msg_buf; - - size = PosGetMsg(h_app, reinterpret_cast<void**>(&pRcvMsg), MAX_MSG_BUF_SIZE); - if (size != 0) { // LCOV_EXCL_BR_LINE 4: nsfw error - pName = _pb_CnvPno2Name((reinterpret_cast<VEHICLE_MSG_GET_VEHICLE_DATA_DAT*>(pRcvMsg))->pno); - if (pName == NULL) { - pName = pNone; - } - FRAMEWORKUNIFIEDLOG(ZONE_17, __FUNCTION__, - "Get message = [Sender:%s][CID:0x%X]", - pName, - CID_VEHICLEIF_GET_VEHICLE_DATA); - - /* Send Messages to Internal Thread */ - ret = PosSndMsg(PNO_VEHICLE_SENSOR, CID_VEHICLEIF_GET_VEHICLE_DATA, pRcvMsg, size); - if (ret != RET_NORMAL) { - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "PosSndMsg ERROR!! [ret = %d]", ret); - /* Event Generation */ - ulEventId = VehicleCreateEvent((reinterpret_cast<VEHICLE_MSG_GET_VEHICLE_DATA_DAT*>(pRcvMsg))->pno); - if (ulEventId != 0) { - /* Event publishing */ - ret = _pb_SetEvent(ulEventId, SAPI_EVSET_ABSOLUTE, POS_RET_ERROR_INNER); - if (ret != RET_NORMAL) { - /* Event issuance failure */ - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, - "_pb_SetEvent ERROR!! [ret = %d]", - ret); - } - /* Event deletion */ - (void)VehicleDeleteEvent(ulEventId); - } else { - /* Event generation failure */ - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "VehicleCreateEvent ERROR!!"); - } - } - } - - FRAMEWORKUNIFIEDLOG(ZONE_28, __FUNCTION__, "-"); - - return eFrameworkunifiedStatusOK; -} - -/** - * @brief - * Callback function for registering the dispatcher(CID_POSIF_SET_DATA) - * - * Send a message to an internal thread. - * - * @param[in] h_app Application handle - * - * @return eFrameworkunifiedStatusOK Normal completion - */ -static EFrameworkunifiedStatus PosPosifSetData(HANDLE h_app) { - RET_API ret; - uint8_t* pRcvMsg; - uint32_t size; - EventID ulEventId; - PCSTR pName; - static const PCSTR pNone = "-"; - uint8_t ucResult = SENSLOG_RES_FAIL; - - FRAMEWORKUNIFIEDLOG(ZONE_28, __FUNCTION__, "+"); - - pRcvMsg = g_rcv_msg_buf; - - size = PosGetMsg(h_app, reinterpret_cast<void**>(&pRcvMsg), MAX_MSG_BUF_SIZE); - if (size != 0) { // LCOV_EXCL_BR_LINE 4: nsfw error - ucResult = SENSLOG_RES_SUCCESS; - - pName = _pb_CnvPno2Name((reinterpret_cast<POS_MSGINFO*>(pRcvMsg))->pno); - if (pName == NULL) { - pName = pNone; - } - FRAMEWORKUNIFIEDLOG(ZONE_17, __FUNCTION__, - "Get message = [Sender:%s][CID:0x%X][DID:0x%X]", - pName, - CID_POSIF_SET_DATA, - (reinterpret_cast<POS_MSGINFO*>(pRcvMsg))->did); - - /* Send Messages to Internal Thread */ - ret = PosSndMsg(PNO_VEHICLE_SENSOR, CID_POSIF_SET_DATA, pRcvMsg, size); - if (ret != RET_NORMAL) { - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "PosSndMsg ERROR!! [ret = %d]", ret); - if ((reinterpret_cast<POS_MSGINFO*>(pRcvMsg))->did == VEHICLE_DID_SETTINGTIME) { - /* GPS time setting(When waiting for completion of an event, an event is issued. */ - /* Event Generation */ - ulEventId = VehicleCreateEvent((reinterpret_cast<POS_MSGINFO*>(pRcvMsg))->pno); - if (ulEventId != 0) { - /* Event publishing */ - ret = _pb_SetEvent(ulEventId, SAPI_EVSET_ABSOLUTE, POS_RET_ERROR_INNER); - if (ret != RET_NORMAL) { - /* Event issuance failure */ - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, - "_pb_SetEvent ERROR!! [ret = %d]", - ret); - } - /* Event deletion */ - (void)VehicleDeleteEvent(ulEventId); - } else { - /* Event generation failure */ - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "VehicleCreateEvent ERROR!!"); - } - } - } - } - SensLogWriteInputData(SENSLOG_DATA_I_UNSPECIFIED, - (reinterpret_cast<POS_MSGINFO*>(pRcvMsg))->did, - 0, - pRcvMsg, - static_cast<uint16_t>(size), - ucResult, - SENSLOG_ON, - SENSLOG_ON); - FRAMEWORKUNIFIEDLOG(ZONE_28, __FUNCTION__, "-"); - - return eFrameworkunifiedStatusOK; -} - -/** - * @brief - * Callback function for registering the dispatcher(CID_GPS_REQRESET) - * - * Send a message to an internal thread. - * - * @param[in] h_app Application handle - * - * @return eFrameworkunifiedStatusOK Normal completion - */ -static EFrameworkunifiedStatus PosPosifReqGpsReset(HANDLE h_app) { - RET_API ret; - uint8_t* pRcvMsg; - uint32_t size; - EventID ulEventId; - PCSTR pName; - static const PCSTR pNone = "-"; - uint8_t ucResult = SENSLOG_RES_FAIL; - - FRAMEWORKUNIFIEDLOG(ZONE_28, __FUNCTION__, "+"); - - pRcvMsg = g_rcv_msg_buf; - - size = PosGetMsg(h_app, reinterpret_cast<void**>(&pRcvMsg), MAX_MSG_BUF_SIZE); - if (size != 0) { // LCOV_EXCL_BR_LINE 4: nsfw error - ucResult = SENSLOG_RES_SUCCESS; - - pName = _pb_CnvPno2Name((reinterpret_cast<POS_RESETINFO*>(pRcvMsg))->snd_pno); - if (pName == NULL) { - pName = pNone; - } - FRAMEWORKUNIFIEDLOG(ZONE_17, __FUNCTION__, - "Get message = [Sender:%s][CID:0x%X]", - pName, - CID_GPS_REQRESET); - - /* Send Messages to Internal Thread */ - ret = PosSndMsg(PNO_NAVI_GPS_MAIN, CID_GPS_REQRESET, pRcvMsg, size); - if (ret != RET_NORMAL) { - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "PosSndMsg ERROR!! [ret = %d]", ret); - - /* Event Generation */ - ulEventId = VehicleCreateEvent((reinterpret_cast<POS_RESETINFO*>(pRcvMsg))->snd_pno); - if (0 != ulEventId) { - /* Event publishing */ - ret = _pb_SetEvent(ulEventId, SAPI_EVSET_ABSOLUTE, POS_RET_ERROR_INNER); - if (ret != RET_NORMAL) { - /* Event issuance failure */ - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, - "_pb_SetEvent ERROR!! [ret = %d]", - ret); - } - /* Event deletion */ - (void)VehicleDeleteEvent(ulEventId); - } else { - /* Event generation failure */ - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "VehicleCreateEvent ERROR!!"); - } - } - } - - SensLogWriteInputData(SENSLOG_DATA_I_GPSRST, 0, 0, pRcvMsg, static_cast<uint16_t>(size), - ucResult, SENSLOG_ON, SENSLOG_ON); - FRAMEWORKUNIFIEDLOG(ZONE_28, __FUNCTION__, "-"); - - return eFrameworkunifiedStatusOK; -} - -/** - * @brief - * Callback function for registering the dispatcher(CID_VEHICLESENS_VEHICLE_INFO) - * - * Send a message to an internal thread. - * - * @param[in] h_app Application handle - * - * @return eFrameworkunifiedStatusOK Normal completion - */ -static EFrameworkunifiedStatus PosVehicleInfoRcv(HANDLE h_app) { - LSDRV_MSG_LSDATA_DAT_G line_sns_data; - RET_API ret = RET_NORMAL; - - memset(&line_sns_data, 0, sizeof(line_sns_data)); - LSDRV_MSG_LSDATA_DAT_G *p_line_sns_data = &line_sns_data; - VEHICLE_UNIT_MSG_VSINFO *p_vehicle_msg = NULL; - uint32_t size = 0; - uint16_t us_speed = 0; - - uint8_t* pRcvMsg = g_rcv_msg_buf; - - size = PosGetMsg(h_app, reinterpret_cast<void**>(&pRcvMsg), MAX_MSG_BUF_SIZE); - if (size != 0) { // LCOV_EXCL_BR_LINE 4: nsfw error - memset(p_line_sns_data, 0x00, sizeof(line_sns_data)); - p_vehicle_msg = (reinterpret_cast<VEHICLE_UNIT_MSG_VSINFO*>(pRcvMsg)); - switch (p_vehicle_msg->data.did) { - // SPEED info - case VEHICLE_DID_SPEED: - { - p_line_sns_data->uc_data_num = LSDRV_KINDS_MAX; - p_line_sns_data->st_data[LSDRV_SPEED_KMPH].ul_did = POSHAL_DID_SPEED_KMPH; - p_line_sns_data->st_data[LSDRV_SPEED_KMPH].uc_size = POS_SNDMSG_DTSIZE_2; - p_line_sns_data->st_data[LSDRV_SPEED_KMPH].uc_sns_cnt = 0; - - char p_env_variable[VP_MAX_LENGTH]; - - VP_GetEnv("VP__CWORD31__SPEED", p_env_variable); - if (0 == strcmp(p_env_variable, "direct")) { - int16_t speed = 0; - // To obtain the vehicle speed from Direct lanes,1 to 2 bytes of received data - memcpy(&speed, &p_vehicle_msg->data.data[0], sizeof(speed)); - us_speed = static_cast<uint16_t>(abs(speed)); - // Unit conversion [km/h] -> [0.01km/h] - us_speed = static_cast<uint16_t>(us_speed * 100); - } else if (0 == strcmp(p_env_variable, "CAN")) { - UINT16 speed = 0; - // To obtain the vehicle speed from CAN,2 to 3 bytes of received data - memcpy(&speed, &p_vehicle_msg->data.data[1], sizeof(speed)); - us_speed = static_cast<uint16_t>(abs(speed)); - // Unit conversion [km/h] -> [0.01km/h] - us_speed = static_cast<uint16_t>(us_speed * 100); - } else { - // In case of invalid value, the vehicle speed is acquired by CAN. - UINT16 speed = 0; - memcpy(&speed, &p_vehicle_msg->data.data[1], sizeof(speed)); - us_speed = static_cast<uint16_t>(abs(speed)); - // Unit conversion [km/h] -> [0.01km/h] - us_speed = static_cast<uint16_t>(us_speed * 100); - } - - memcpy(&p_line_sns_data->st_data[LSDRV_SPEED_KMPH].uc_data[0], &us_speed, sizeof(us_speed)); - - ret = PosSndMsg(PNO_VEHICLE_SENSOR, CID_LINESENS_VEHICLE_DATA_G, - reinterpret_cast<void*>(p_line_sns_data), sizeof(line_sns_data)); - - break; - } - // REV information - case VEHICLE_DID_REV: - { - p_line_sns_data->uc_data_num = LSDRV_KINDS_MAX; - p_line_sns_data->st_data[LSDRV_REV].ul_did = VEHICLE_DID_REV; - p_line_sns_data->st_data[LSDRV_REV].uc_size = POS_SNDMSG_DTSIZE_1; - p_line_sns_data->st_data[LSDRV_REV].uc_sns_cnt = 0; - p_line_sns_data->st_data[LSDRV_REV].uc_data[0] = p_vehicle_msg->data.data[0]; - - ret = PosSndMsg(PNO_VEHICLE_SENSOR, CID_LINESENS_VEHICLE_DATA_G, - reinterpret_cast<void*>(p_line_sns_data), sizeof(line_sns_data)); - break; - } - - // Speed Pulse information - case VEHICLE_DID_SPEED_PULSE_VEHICLE: - { - p_line_sns_data->uc_data_num = LSDRV_KINDS_MAX; - p_line_sns_data->st_data[LSDRV_SPEED_PULSE].ul_did = POSHAL_DID_SPEED_PULSE; - p_line_sns_data->st_data[LSDRV_SPEED_PULSE].uc_size = sizeof(float); - p_line_sns_data->st_data[LSDRV_SPEED_PULSE].uc_sns_cnt = 0; - - memcpy(&p_line_sns_data->st_data[LSDRV_SPEED_PULSE].uc_data[0], - &p_vehicle_msg->data.data[0], sizeof(float)); - - p_line_sns_data->st_data[LSDRV_PULSE_TIME].ul_did = POSHAL_DID_PULSE_TIME; - p_line_sns_data->st_data[LSDRV_PULSE_TIME].uc_size = sizeof(float); - p_line_sns_data->st_data[LSDRV_PULSE_TIME].uc_sns_cnt = 0; - - memcpy(&p_line_sns_data->st_data[LSDRV_PULSE_TIME].uc_data[0], - &p_vehicle_msg->data.data[sizeof(float)], sizeof(float)); - - ret = PosSndMsg(PNO_VEHICLE_SENSOR, CID_LINESENS_VEHICLE_DATA_G, - reinterpret_cast<void*>(p_line_sns_data), sizeof(line_sns_data)); - - break; - } - default: - break; - } - - if (ret != RET_NORMAL) { - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "PosSndMsg ERROR!! [ret = %d]", ret); - } - } - return eFrameworkunifiedStatusOK; -} - -/** - * @brief - * Get Message - * - * Get messages received by the dispatcher - * - * @param[in] h_app Application handle - * @param[out] p_buf Pointer to receive data storage buffer - * @param[in] Sizes of size receive data storage buffers - * - * @return Received data size(0:Receiving error) - */ -static uint32_t PosGetMsg(HANDLE h_app, void** p_buf, uint32_t size) { - EFrameworkunifiedStatus eStatus; - uint32_t ulSize = 0; - void* pRcvBuf; - - /* null check */ - if ((h_app == NULL) || (p_buf == NULL)) { // LCOV_EXCL_BR_LINE 200: can not NULL - // LCOV_EXCL_START 8: invalid - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, - "Argument ERROR!! [h_app = %p, p_buf = %p]", - h_app, - p_buf); - // LCOV_EXCL_STOP - } else { - /* Check the size of received data */ - ulSize = FrameworkunifiedGetMsgLength(h_app); - if (ulSize > size) { - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, - "Message size ERROR!! [ulSize = %d, maxsize = %d]", - ulSize, - size); - ulSize = 0; - } else { - /* Obtain data */ - eStatus = FrameworkunifiedGetDataPointer(h_app, &pRcvBuf); - if (eStatus == eFrameworkunifiedStatusOK) { - *p_buf = pRcvBuf; - } else if (eStatus == eFrameworkunifiedStatusInvldBufSize) { - eStatus = FrameworkunifiedGetMsgDataOfSize(h_app, *p_buf, ulSize); - /* When acquisition fails */ - if (eStatus != eFrameworkunifiedStatusOK) { - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, - "FrameworkunifiedGetMsgDataOfSize ERROR [eStatus:%d]", - eStatus); - ulSize = 0; - } - } else { - /* When acquisition fails */ - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, - "FrameworkunifiedGetDataPointer ERROR [eStatus:%d]", - eStatus); - ulSize = 0; - } - } - } - - return ulSize; -} - -/** - * @brief - * Sending Messages for Internal Threads - * - * Adds a header to the message received by the dispatcher and sends it to the internal thread.. - * - * @param[in] pno PNO - * @param[in] cid Command ID - * @param[in] p_msg_body Sent message body - * @param[in] size Send message size - * - * @return RET_NORAML Normal completion - * RET_ERROR ABENDs - */ -static RET_API PosSndMsg(PNO pno, CID cid, void* p_msg_body, uint32_t size) { - RET_API ret = RET_NORMAL; - T_APIMSG_MSGBUF_HEADER* p; - static u_int8 sndMsgBuf[MAX_MSG_BUF_SIZE + sizeof(T_APIMSG_MSGBUF_HEADER)]; - - if ((p_msg_body == NULL) || (size > MAX_MSG_BUF_SIZE)) { - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "Argument ERROR!! [p_msg_body = %p, size = %d]", p_msg_body, size); - ret = RET_ERROR; - } else { - p = reinterpret_cast<T_APIMSG_MSGBUF_HEADER*>(sndMsgBuf); - - /* Message header addition */ - p->hdr.cid = cid; - p->hdr.msgbodysize = static_cast<uint16_t>(size); - - /* Copy of the data section */ - memcpy((p + 1), p_msg_body, size); - - /* Send a message to an internal thread */ - ret = _pb_SndMsg(pno, static_cast<uint16_t>(size + sizeof(T_APIMSG_MSGBUF_HEADER)), p, 0); - /* When transmission fails */ - if (ret != RET_NORMAL) { - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "_pb_SndMsg ERROR [ret = %d]", ret); - ret = RET_ERROR; - } - } - - return ret; -} - -/** - * @brief - * SS_DevDetectSrv service OpenSessionAck Callback Functions - * - * @param none - * - * @return eFrameworkunifiedStatusOK successful completion - */ -static EFrameworkunifiedStatus PosOnDevDetectOpenSessionAck(HANDLE h_app) { - EFrameworkunifiedStatus eStatus = eFrameworkunifiedStatusOK; - BOOL bIsAvailable; - - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "+"); - - eStatus = DevDetectSrvIfDecodeOpenSessionResponse(&bIsAvailable); - if (eFrameworkunifiedStatusOK != eStatus) { - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, - "DeviceDetectionServiceIf OpenSession ERROR!! [sts=%d, ava=%d]", eStatus, bIsAvailable); - } else { - eStatus = DevDetectSrvIfRegisterForDeviceDetectionEvent(SS_DEV_DETECT_ANY_USB_EV, - &PosOnDevDetectEvent, - NULL, - &bIsAvailable); - if (eFrameworkunifiedStatusOK != eStatus) { - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, - "DeviceDetectionServiceIf RegisterEvent ERROR!! [sts=%d, ava=%d]", eStatus, bIsAvailable); - } else { - eStatus = DevDetectSrvIfNotifyOnCloseSessionAck(&PosOnDevDetectCloseSessionAck, &bIsAvailable); - if (eFrameworkunifiedStatusOK != eStatus) { - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, - "DeviceDetectionServiceIf CloseSessionAck ERROR!! [sts=%d, ava=%d]", - eStatus, - bIsAvailable); - } - } - } - - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "-"); - return eFrameworkunifiedStatusOK; -} - -/** - * @brief - * SS_DevDetectSrv service CloseSessionAck Callback Functions - * - * @param none - * - * @return eFrameworkunifiedStatusOK successful completion - */ -static EFrameworkunifiedStatus PosOnDevDetectCloseSessionAck(HANDLE h_app) { - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "+"); - - /* Sensor log stop processing */ - SensLogTerminate(); - - FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "-"); - return eFrameworkunifiedStatusOK; -} - -/** - * @brief - * SS_DevDetectSrv service Event Callback Functions - * - * @param none - * - * @return eFrameworkunifiedStatusOK successful completion - */ -static EFrameworkunifiedStatus PosOnDevDetectEvent(HANDLE h_app) { - SS_MediaDetectInfo stMedia; - EFrameworkunifiedStatus eStatus = eFrameworkunifiedStatusOK; - uint32_t ulSize = 0; - uint8_t mode; - - FRAMEWORKUNIFIEDLOG(ZONE_INIT, __FUNCTION__, "+"); - - /* Check the size of received data */ - ulSize = FrameworkunifiedGetMsgLength(h_app); - if (ulSize > sizeof(SS_MediaDetectInfo)) { - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "Message size ERROR!! [ulSize = %d, maxsize = %ld]", - ulSize, sizeof(SS_MediaDetectInfo)); - ulSize = 0; - } else { - /* Obtain data */ - eStatus = FrameworkunifiedGetMsgDataOfSize(h_app, &stMedia, ulSize); - /* When acquisition fails */ - if (eStatus != eFrameworkunifiedStatusOK) { - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, - "FrameworkunifiedGetMsgDataOfSize ERROR [eStatus:%d]", eStatus); - ulSize = 0; - } else { - if (eUSB == stMedia.dev_type) { - if (TRUE == stMedia.bIsDeviceAvailable) { - /* Mount detection */ - FRAMEWORKUNIFIEDLOG(ZONE_INIT, __FUNCTION__, - "USB mounted sts=[%d] path=[%s] fusedav=[%d]", - stMedia.bIsDeviceAvailable, stMedia.deviceMountpath, stMedia.bIsFuseDav); - - /* NOTE: bIsFuseDav -> From the _CWORD80_'s point of view, */ - /* TRUE(With a USB flash drive inserted into the _CWORD84_,Be synchronized on the FuseDav)*/ - /* FALSE(USB memory is inserted into the _CWORD80_.) */ - - if (stMedia.bIsFuseDav == FALSE) { - /* Inserted into your USB port */ - FRAMEWORKUNIFIEDLOG(ZONE_INIT, __FUNCTION__, "SensLog Initialize start."); - /* Get Debug/Release setting */ - eStatus = NsLogGetFrameworkunifiedLogFlag(POSITIONINGLOG_FLAG_NAVI, &mode); - /* When acquisition fails */ - if (eStatus != eFrameworkunifiedStatusOK) { - FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, - "NsLogGetFrameworkunifiedLogFlag ERROR [eStatus:%d]", eStatus); - } else { - if (mode == FRAMEWORKUNIFIEDLOG_FLAG_MODE_DEBUG) { - /* Sensor Log Initial Processing(Normal)*/ - SensLogInitialize(reinterpret_cast<uint8_t *>(stMedia.deviceMountpath)); - } - } - } else { - /* TODO: Mounts (FuseDav synchronized) that are not inserted into your device's USB port are not supported. */ - FRAMEWORKUNIFIEDLOG(ZONE_INIT, __FUNCTION__, "Don't output SensLog."); - } - } else { - /* Unmount detection */ - if (stMedia.bIsFuseDav == FALSE) { - /* When it is unmounted to its own USB */ - FRAMEWORKUNIFIEDLOG(ZONE_INIT, __FUNCTION__, - "USB umounted sts=[%d] fusedav=[%d]", - stMedia.bIsDeviceAvailable, stMedia.bIsFuseDav); - - /* Sensor log stop processing */ - SensLogTerminate(); - } - } - } - } - } - - FRAMEWORKUNIFIEDLOG(ZONE_INIT, __FUNCTION__, "-"); - return eStatus; -} - -/** - * @brief Debug dump log output function - * - * @param[in] *p_buf Pointer to the output string - */ -static void PosOutputDebugDumpLog(uint8_t* p_buf) { // LCOV_EXCL_START 7: uesd only in FrameworkunifiedOnDebugDump - AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert - SSDEBUGDUMP("%s\n", p_buf); - MilliSecSleep(1); - return; -} -// LCOV_EXCL_STOP - diff --git a/vehicleservice/positioning/server/src/nsfw/ps_main.cpp b/vehicleservice/positioning/server/src/nsfw/ps_main.cpp deleted file mode 100755 index de2732a..0000000 --- a/vehicleservice/positioning/server/src/nsfw/ps_main.cpp +++ /dev/null @@ -1,59 +0,0 @@ -/* - * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include <native_service/frameworkunified_dispatcher.h> -#include <native_service/frameworkunified_application.h> -#include <peripheral_service/ps_services.h> -#include <native_service/ns_version_if.h> -#include <system_service/ss_system_if.h> -#include <vehicle_service/positioning_base_library.h> -#include <cstdlib> -#include <iostream> -#include "vehicle_version.h" - -const CHAR kAppName[PS_APPNAME_MAX] = "Positioning"; - -CFrameworkunifiedVersion g_FrameworkunifiedVersion(MAJORNO, // NOLINT(readability/nolint) - MINORNO, // NOLINT(readability/nolint) - REVISION); - -/* FRAMEWORKUNIFIEDLOGPARAM : g_FrameworkunifiedLogParams : definition for LOG */ -FRAMEWORKUNIFIEDLOGPARAM g_FrameworkunifiedLogParams = { // NOLINT(readability/nolint) - FRAMEWORKUNIFIEDLOGOPTIONS, - { - ZONE_TEXT_10, ZONE_TEXT_11, ZONE_TEXT_12, - ZONE_TEXT_13, ZONE_TEXT_14, ZONE_TEXT_15, - ZONE_TEXT_16, ZONE_TEXT_17, ZONE_TEXT_18, - ZONE_TEXT_19, ZONE_TEXT_20, ZONE_TEXT_21, - ZONE_TEXT_22, ZONE_TEXT_23, ZONE_TEXT_24, - ZONE_TEXT_25, ZONE_TEXT_26, ZONE_TEXT_27, - ZONE_TEXT_28, ZONE_TEXT_29, ZONE_TEXT_30, - ZONE_TEXT_31, - ZONE_POS_SYS_IN, ZONE_POS_GPS_IN, ZONE_POS_CMD_IN, ZONE_POS_NAV_IN - }, - FRAMEWORKUNIFIEDLOGZONES -}; - -/* Function : main */ -int main(int argc, char *argv[]) { - EFrameworkunifiedStatus e_status = eFrameworkunifiedStatusOK; - FrameworkunifiedDefaultCallbackHandler cb_funcs; - FRAMEWORKUNIFIED_MAKE_DEFAULT_CALLBACK(cb_funcs); - - FRAMEWORKUNIFIED_SET_ZONES(); - e_status = FrameworkunifiedDispatcher(kAppName, &cb_funcs); - - return e_status; -} // LCOV_EXCL_BR_LINE 10:The final line |