forked from nanoframework/nf-interpreter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
nanoHAL_SystemInformation.cpp
45 lines (37 loc) · 1.63 KB
/
nanoHAL_SystemInformation.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
//
// Copyright (c) 2017 The nanoFramework project contributors
// Portions Copyright (c) Microsoft Corporation. All rights reserved.
// See LICENSE file in the project root for full license information.
//
#include <nanoHAL.h>
#include <targetHAL.h>
bool GetHalSystemInfo(HalSystemInfo& systemInfo)
{
#if defined(HAL_REDUCESIZE)
// No config update.
return FALSE;
#else
// NFReleaseInfo:
systemInfo.m_releaseInfo.Version.usMajor = VERSION_MAJOR;
systemInfo.m_releaseInfo.Version.usMinor = VERSION_MINOR;
systemInfo.m_releaseInfo.Version.usBuild = VERSION_BUILD;
systemInfo.m_releaseInfo.Version.usRevision = VERSION_REVISION;
const size_t len = sizeof(systemInfo.m_releaseInfo.InfoString);
hal_strncpy_s ((char*)&systemInfo.m_releaseInfo.InfoString[0], len, OEMSYSTEMINFOSTRING, len-1 );
// we are not supporting this at this time
// OEM_MODEL_SKU:
//memcpy((void*)&(systemInfo.m_OemModelInfo), (void*)&(g_ConfigurationSector.OEM_Model_SKU), sizeof(OEM_MODEL_SKU));
// we are not supporting this at this time
// OEM_SERIAL_NUMBERS:
//memcpy((void*)&(systemInfo.m_OemSerialNumbers), (void*)&(g_ConfigurationSector.OemSerialNumbers), sizeof(OEM_SERIAL_NUMBERS));
return TRUE;
#endif
}
bool Target_GetReleaseInfo(NFReleaseInfo& releaseInfo)
{
NFReleaseInfo::Init(releaseInfo,
VERSION_MAJOR, VERSION_MINOR, VERSION_BUILD, VERSION_REVISION,
OEMSYSTEMINFOSTRING, hal_strlen_s(OEMSYSTEMINFOSTRING)
);
return TRUE; // alternatively, return false if you didn't initialize the releaseInfo structure.
}