From 8774b83f9c0f3108abbb9d6317d7c62550f6d93e Mon Sep 17 00:00:00 2001 From: Tau Date: Tue, 20 Aug 2019 18:44:47 -0400 Subject: [PATCH] platform/config.c: Add struct pcbid_config --- platform/config.c | 16 ++++++++++++++++ platform/config.h | 6 ++++++ 2 files changed, 22 insertions(+) diff --git a/platform/config.c b/platform/config.c index 76d19069..17bf6594 100644 --- a/platform/config.c +++ b/platform/config.c @@ -135,6 +135,22 @@ void nusec_config_load(struct nusec_config *cfg, const wchar_t *filename) filename); } +void pcbid_config_load(struct pcbid_config *cfg, const wchar_t *filename) +{ + assert(cfg != NULL); + assert(filename != NULL); + + cfg->enable = GetPrivateProfileIntW(L"pcbid", L"enable", 1, filename); + + GetPrivateProfileStringW( + L"pcbid", + L"serialNo", + L"ACAE01A99999999", + cfg->serial_no, + _countof(cfg->serial_no), + filename); +} + void vfs_config_load(struct vfs_config *cfg, const wchar_t *filename) { assert(cfg != NULL); diff --git a/platform/config.h b/platform/config.h index 45baa80a..64d979b5 100644 --- a/platform/config.h +++ b/platform/config.h @@ -30,6 +30,11 @@ struct nusec_config { wchar_t billing_pub[MAX_PATH]; }; +struct pcbid_config { + bool enable; + wchar_t serial_no[17]; +}; + struct vfs_config { bool enable; wchar_t amfs[MAX_PATH]; @@ -49,4 +54,5 @@ void amvideo_config_load(struct amvideo_config *cfg, const wchar_t *filename); void hwmon_config_load(struct hwmon_config *cfg, const wchar_t *filename); void misc_config_load(struct misc_config *cfg, const wchar_t *filename); void nusec_config_load(struct nusec_config *cfg, const wchar_t *filename); +void pcbid_config_load(struct pcbid_config *cfg, const wchar_t *filename); void vfs_config_load(struct vfs_config *cfg, const wchar_t *filename);