nl :: Tecer:: DeviceLayer :: Interno:: NRF5Config
#include <src/adaptations/device-layer/include/Weave/DeviceLayer/nRF5/nRF5Config.h>
Fornece funções e definições para acessar a configuração de dispositivo persistente em plataformas baseadas no Nordic nRF5 SDK.
Resumo
Essa implementação usa a biblioteca Nordic Flash Data Storage (FDS) como a camada de armazenamento subjacente.
NOTA: Esta classe foi projetada para ser combinada com a subclasse concreta do modelo GenericConfigurationManagerImpl <>. Quando usada dessa forma, a classe naturalmente fornece implementações para os membros delegados referenciados pela classe de modelo (por exemplo, o método ReadConfigValue ()).
Herança
Subclasses diretamente conhecidas:nl :: Weave :: DeviceLayer :: ConfigurationManagerImpl
nl :: Weave :: DeviceLayer :: Internal :: GroupKeyStoreImpl
Tipos públicos | |
---|---|
Key | usandouint32_t |
Tipos protegidos | |
---|---|
ForEachRecordFunct | usandostd::function< WEAVE_ERROR (const fds_flash_record_t &rec, bool &deleteRec)> |
Atributos estáticos públicos | |
---|---|
kConfigKey_FabricId = NRF5ConfigKey(kFileId_WeaveConfig, 0x0007) | constexpr Key |
kConfigKey_FabricSecret = NRF5ConfigKey(kFileId_WeaveConfig, 0x000B) | constexpr Key |
kConfigKey_FailSafeArmed = NRF5ConfigKey(kFileId_WeaveConfig, 0x000D) | constexpr Key |
kConfigKey_GroupKey = NRF5ConfigKey(kFileId_WeaveConfig, 0x000E) | constexpr Key |
kConfigKey_LastUsedEpochKeyId = NRF5ConfigKey(kFileId_WeaveConfig, 0x000C) | constexpr Key |
kConfigKey_ManufacturingDate = NRF5ConfigKey(kFileId_WeaveFactory, 0x0005) | constexpr Key |
kConfigKey_MfrDeviceCert = NRF5ConfigKey(kFileId_WeaveFactory, 0x0003) | constexpr Key |
kConfigKey_MfrDeviceICACerts = NRF5ConfigKey(kFileId_WeaveFactory, 0x0010) | constexpr Key |
kConfigKey_MfrDeviceId = NRF5ConfigKey(kFileId_WeaveFactory, 0x0002) | constexpr Key |
kConfigKey_MfrDevicePrivateKey = NRF5ConfigKey(kFileId_WeaveFactory, 0x0004) | constexpr Key |
kConfigKey_OperationalDeviceCert = NRF5ConfigKey(kFileId_WeaveConfig, 0x0012) | constexpr Key |
kConfigKey_OperationalDeviceICACerts = NRF5ConfigKey(kFileId_WeaveConfig, 0x0013) | constexpr Key |
kConfigKey_OperationalDeviceId = NRF5ConfigKey(kFileId_WeaveConfig, 0x0011) | constexpr Key |
kConfigKey_OperationalDevicePrivateKey = NRF5ConfigKey(kFileId_WeaveConfig, 0x0014) | constexpr Key |
kConfigKey_PairedAccountId = NRF5ConfigKey(kFileId_WeaveConfig, 0x0009) | constexpr Key |
kConfigKey_PairingCode = NRF5ConfigKey(kFileId_WeaveFactory, 0x0006) | constexpr Key |
kConfigKey_ProductRevision = NRF5ConfigKey(kFileId_WeaveFactory, 0x000F) | constexpr Key |
kConfigKey_SerialNum = NRF5ConfigKey(kFileId_WeaveFactory, 0x0001) | constexpr Key |
kConfigKey_ServiceConfig = NRF5ConfigKey(kFileId_WeaveConfig, 0x0008) | constexpr Key |
kConfigKey_ServiceId = NRF5ConfigKey(kFileId_WeaveConfig, 0x000A) | constexpr Key |
kFDSFileIdMax = 0xBFFF | constexpr uint16_t Valor máximo que pode ser usado para uma id de arquivo FDS (por Nordic SDK) |
kFDSFileIdMin = 0x0000 | constexpr uint16_t Valor mínimo que pode ser usado para uma id de arquivo FDS (por Nordic SDK) |
kFDSRecordKeyMax = 0xBFFF | constexpr uint16_t Valor máximo que pode ser usado para uma chave de registro FDS (por Nordic SDK) |
kFDSRecordKeyMin = 0x0001 | constexpr uint16_t Valor mínimo que pode ser usado para uma chave de registro FDS (por Nordic SDK) |
kFileId_WeaveConfig = 0x235B | constexpr uint16_t Arquivo FDS contendo valores de configuração dinâmica definidos em tempo de execução. |
kFileId_WeaveCounter = 0x235C | constexpr uint16_t Arquivo FDS contendo valores de contador dinâmico definidos em tempo de execução. |
kFileId_WeaveFactory = 0x235A | constexpr uint16_t Arquivo FDS contendo valores de configuração persistentes definidos no momento da fabricação. |
kPersistedCounterRecordKeyBase = kFDSRecordKeyMin | constexpr uint16_t Chave de registro básico para registros que contêm valores de contador persistentes do Weave. |
kPersistedCounterRecordKeyMax = kFDSRecordKeyMax | constexpr uint16_t Chave de registro máxima para registros que contêm valores de contador persistentes do Weave. |
Atributos estáticos protegidos | |
---|---|
kFDSWordSize = 4 | constexpr uint16_t |
sActiveAsyncOp | FDSAsyncOp *volatile |
sAsyncOpCompletionSem | SemaphoreHandle_t |
Funções estáticas públicas | |
---|---|
ClearConfigValue (Key key) | |
ConfigValueExists (Key key) | bool |
FactoryResetConfig (void) | |
Init (void) | |
ReadConfigValue (Key key, bool & val) | |
ReadConfigValue (Key key, uint32_t & val) | |
ReadConfigValue (Key key, uint64_t & val) | |
ReadConfigValueBin (Key key, uint8_t *buf, size_t bufSize, size_t & outLen) | |
ReadConfigValueStr (Key key, char *buf, size_t bufSize, size_t & outLen) | |
RunConfigUnitTest (void) | void |
WriteConfigValue (Key key, bool val) | |
WriteConfigValue (Key key, uint32_t val) | |
WriteConfigValue (Key key, uint64_t val) | |
WriteConfigValueBin (Key key, const uint8_t *data, size_t dataLen) | |
WriteConfigValueStr (Key key, const char *str) | |
WriteConfigValueStr (Key key, const char *str, size_t strLen) |
Funções estáticas protegidas | |
---|---|
DoAsyncFDSOp ( FDSAsyncOp & asyncOp) | |
FDSWords (size_t s) | constexpr uint16_t Número de palavras FDS necessárias para conter um determinado objeto de tamanho. |
ForEachRecord (uint16_t fileId, uint16_t recordKey, ForEachRecordFunct funct) | |
GetFileId (uint32_t key) | constexpr uint16_t Extraia um ID de arquivo FDS de um valor de chave. |
GetRecordKey (uint32_t key) | constexpr uint16_t Extraia uma chave de registro FDS de um valor de chave. |
OpenRecord (NRF5Config::Key key, fds_record_desc_t & recDesc, fds_flash_record_t & rec) |
Tipos públicos
Chave
uint32_t Key
Tipos protegidos
ForEachRecordFunct
std::function< WEAVE_ERROR(const fds_flash_record_t &rec, bool &deleteRec)> ForEachRecordFunct
Atributos estáticos públicos
kConfigKey_FabricId
constexpr Key kConfigKey_FabricId = NRF5ConfigKey(kFileId_WeaveConfig, 0x0007)
kConfigKey_FabricSecret
constexpr Key kConfigKey_FabricSecret = NRF5ConfigKey(kFileId_WeaveConfig, 0x000B)
kConfigKey_FailSafeArmed
constexpr Key kConfigKey_FailSafeArmed = NRF5ConfigKey(kFileId_WeaveConfig, 0x000D)
kConfigKey_GroupKey
constexpr Key kConfigKey_GroupKey = NRF5ConfigKey(kFileId_WeaveConfig, 0x000E)
kConfigKey_LastUsedEpochKeyId
constexpr Key kConfigKey_LastUsedEpochKeyId = NRF5ConfigKey(kFileId_WeaveConfig, 0x000C)
kConfigKey_ManufacturingDate
constexpr Key kConfigKey_ManufacturingDate = NRF5ConfigKey(kFileId_WeaveFactory, 0x0005)
kConfigKey_MfrDeviceCert
constexpr Key kConfigKey_MfrDeviceCert = NRF5ConfigKey(kFileId_WeaveFactory, 0x0003)
kConfigKey_MfrDeviceICACerts
constexpr Key kConfigKey_MfrDeviceICACerts = NRF5ConfigKey(kFileId_WeaveFactory, 0x0010)
kConfigKey_MfrDeviceId
constexpr Key kConfigKey_MfrDeviceId = NRF5ConfigKey(kFileId_WeaveFactory, 0x0002)
kConfigKey_MfrDevicePrivateKey
constexpr Key kConfigKey_MfrDevicePrivateKey = NRF5ConfigKey(kFileId_WeaveFactory, 0x0004)
kConfigKey_OperationalDeviceCert
constexpr Key kConfigKey_OperationalDeviceCert = NRF5ConfigKey(kFileId_WeaveConfig, 0x0012)
kConfigKey_OperationalDeviceICACerts
constexpr Key kConfigKey_OperationalDeviceICACerts = NRF5ConfigKey(kFileId_WeaveConfig, 0x0013)
kConfigKey_OperationalDeviceId
constexpr Key kConfigKey_OperationalDeviceId = NRF5ConfigKey(kFileId_WeaveConfig, 0x0011)
kConfigKey_OperationalDevicePrivateKey
constexpr Key kConfigKey_OperationalDevicePrivateKey = NRF5ConfigKey(kFileId_WeaveConfig, 0x0014)
kConfigKey_PairedAccountId
constexpr Key kConfigKey_PairedAccountId = NRF5ConfigKey(kFileId_WeaveConfig, 0x0009)
kConfigKey_PairingCode
constexpr Key kConfigKey_PairingCode = NRF5ConfigKey(kFileId_WeaveFactory, 0x0006)
kConfigKey_ProductRevision
constexpr Key kConfigKey_ProductRevision = NRF5ConfigKey(kFileId_WeaveFactory, 0x000F)
kConfigKey_SerialNum
constexpr Key kConfigKey_SerialNum = NRF5ConfigKey(kFileId_WeaveFactory, 0x0001)
kConfigKey_ServiceConfig
constexpr Key kConfigKey_ServiceConfig = NRF5ConfigKey(kFileId_WeaveConfig, 0x0008)
kConfigKey_ServiceId
constexpr Key kConfigKey_ServiceId = NRF5ConfigKey(kFileId_WeaveConfig, 0x000A)
kFDSFileIdMax
constexpr uint16_t kFDSFileIdMax = 0xBFFF
Valor máximo que pode ser usado para uma id de arquivo FDS (por Nordic SDK)
kFDSFileIdMin
constexpr uint16_t kFDSFileIdMin = 0x0000
Valor mínimo que pode ser usado para uma id de arquivo FDS (por Nordic SDK)
kFDSRecordKeyMax
constexpr uint16_t kFDSRecordKeyMax = 0xBFFF
Valor máximo que pode ser usado para uma chave de registro FDS (por Nordic SDK)
kFDSRecordKeyMin
constexpr uint16_t kFDSRecordKeyMin = 0x0001
Valor mínimo que pode ser usado para uma chave de registro FDS (por Nordic SDK)
kFileId_WeaveConfig
constexpr uint16_t kFileId_WeaveConfig = 0x235B
Arquivo FDS contendo valores de configuração dinâmica definidos em tempo de execução.
Apagado durante a redefinição de fábrica.
kFileId_WeaveCounter
constexpr uint16_t kFileId_WeaveCounter = 0x235C
Arquivo FDS contendo valores de contador dinâmico definidos em tempo de execução.
Retido durante a redefinição de fábrica.
kFileId_WeaveFactory
constexpr uint16_t kFileId_WeaveFactory = 0x235A
Arquivo FDS contendo valores de configuração persistentes definidos no momento da fabricação.
Retido durante a redefinição de fábrica.
kPersistedCounterRecordKeyBase
constexpr uint16_t kPersistedCounterRecordKeyBase = kFDSRecordKeyMin
Chave de registro básico para registros que contêm valores de contador persistentes do Weave.
O ID do contador Weave é adicionado a este valor para formar a chave de registro FDS.
kPersistedCounterRecordKeyMax
constexpr uint16_t kPersistedCounterRecordKeyMax = kFDSRecordKeyMax
Chave de registro máxima para registros que contêm valores de contador persistentes do Weave.
Atributos estáticos protegidos
kFDSWordSize
constexpr uint16_t kFDSWordSize = 4
sActiveAsyncOp
FDSAsyncOp *volatile sActiveAsyncOp
sAsyncOpCompletionSem
SemaphoreHandle_t sAsyncOpCompletionSem
Funções estáticas públicas
ClearConfigValue
WEAVE_ERROR ClearConfigValue( Key key )
ConfigValueExists
bool ConfigValueExists( Key key )
FactoryResetConfig
WEAVE_ERROR FactoryResetConfig( void )
Iniciar
WEAVE_ERROR Init( void )
ReadConfigValue
WEAVE_ERROR ReadConfigValue( Key key, bool & val )
ReadConfigValue
WEAVE_ERROR ReadConfigValue( Key key, uint32_t & val )
ReadConfigValue
WEAVE_ERROR ReadConfigValue( Key key, uint64_t & val )
ReadConfigValueBin
WEAVE_ERROR ReadConfigValueBin( Key key, uint8_t *buf, size_t bufSize, size_t & outLen )
ReadConfigValueStr
WEAVE_ERROR ReadConfigValueStr( Key key, char *buf, size_t bufSize, size_t & outLen )
RunConfigUnitTest
void RunConfigUnitTest( void )
WriteConfigValue
WEAVE_ERROR WriteConfigValue( Key key, bool val )
WriteConfigValue
WEAVE_ERROR WriteConfigValue( Key key, uint32_t val )
WriteConfigValue
WEAVE_ERROR WriteConfigValue( Key key, uint64_t val )
WriteConfigValueBin
WEAVE_ERROR WriteConfigValueBin( Key key, const uint8_t *data, size_t dataLen )
WriteConfigValueStr
WEAVE_ERROR WriteConfigValueStr( Key key, const char *str )
WriteConfigValueStr
WEAVE_ERROR WriteConfigValueStr( Key key, const char *str, size_t strLen )
Funções estáticas protegidas
DoAsyncFDSOp
WEAVE_ERROR DoAsyncFDSOp( FDSAsyncOp & asyncOp )
FDSWords
constexpr uint16_t FDSWords( size_t s )
Número de palavras FDS necessárias para conter um determinado objeto de tamanho.
ForEachRecord
WEAVE_ERROR ForEachRecord( uint16_t fileId, uint16_t recordKey, ForEachRecordFunct funct )
GetFileId
constexpr uint16_t GetFileId( uint32_t key )
Extraia um ID de arquivo FDS de um valor de chave.
GetRecordKey
constexpr uint16_t GetRecordKey( uint32_t key )
Extraia uma chave de registro FDS de um valor de chave.
OpenRecord
WEAVE_ERROR OpenRecord( NRF5Config::Key key, fds_record_desc_t & recDesc, fds_flash_record_t & rec )