nl
Weave-specific nlassert.h Overrides.
Summary
Enumerations |
|
---|---|
@357
|
enum |
@358
|
enum |
@359
|
enum |
@360
|
enum |
@361
|
enum |
SerializedFieldType{
|
enum A list of TLV types to write with a TLV field. |
SerializedFieldTypeBits
|
enum Bitfield of SerializedFieldType. |
SerializedFieldTypeMasks
|
enum Masks for accessing bits of SerializedFieldType. |
Typedefs |
|
---|---|
Base64CharToValFunct)(uint8_t c)
|
typedefuint8_t(*
|
Base64ValToCharFunct)(uint8_t val)
|
typedefchar(*
|
MemoryAllocate)(size_t size)
|
typedefvoid *(*
Memory allocate/free function pointers. |
MemoryFree)(void *ptr)
|
typedefvoid(*
|
MemoryReallocate)(void *ptr, size_t size)
|
typedefvoid *(*
|
Variables |
|
---|---|
sASN1ErrorFormatter =
{
nl::Weave::ASN1::FormatASN1Error,
NULL
}
|
const ErrorFormatter
|
sElementSize =
{
sizeof(bool),
sizeof(uint8_t),
sizeof(uint16_t),
sizeof(uint32_t),
sizeof(uint64_t),
sizeof(int8_t),
sizeof(int16_t),
sizeof(int32_t),
sizeof(int64_t),
sizeof(float),
sizeof(double),
sizeof(char *),
sizeof(SerializedByteString),
sizeof(void *),
sizeof(void *)
}[]
|
const uint8_t
|
sErrorFormatterList = &sWeaveErrorFormatter
|
const ErrorFormatter *
Linked-list of error formatter functions.
|
sErrorStr[WEAVE_CONFIG_ERROR_STR_SIZE]
|
char
Static buffer to store the formatted error string.
|
sErrorStr[1024]
|
char
This routine returns a human-readable NULL-terminated C string describing the provided status code associated with the specfied profile.
|
sWeaveErrorFormatter =
{
nl::Weave::FormatWeaveError,
&sASN1ErrorFormatter
}
|
const ErrorFormatter
|
Functions |
|
---|---|
AdjustCalendarDate(uint16_t & year, uint8_t & month, uint8_t & dayOfMonth, int32_t relativeDays)
|
void
|
Base64CharToVal(uint8_t c)
|
uint8_t
|
Base64Decode(const char *in, uint16_t inLen, uint8_t *out, Base64CharToValFunct charToValFunct)
|
uint16_t
|
Base64Decode(const char *in, uint16_t inLen, uint8_t *out)
|
uint16_t
|
Base64Decode32(const char *in, uint32_t inLen, uint8_t *out, Base64CharToValFunct charToValFunct)
|
uint32_t
|
Base64Decode32(const char *in, uint32_t inLen, uint8_t *out)
|
uint32_t
|
Base64Encode(const uint8_t *in, uint16_t inLen, char *out, Base64ValToCharFunct valToCharFunct)
|
uint16_t
|
Base64Encode(const uint8_t *in, uint16_t inLen, char *out)
|
uint16_t
|
Base64Encode32(const uint8_t *in, uint32_t inLen, char *out, Base64ValToCharFunct valToCharFunct)
|
uint32_t
|
Base64Encode32(const uint8_t *in, uint32_t inLen, char *out)
|
uint32_t
|
Base64URLCharToVal(uint8_t c)
|
uint8_t
|
Base64URLDecode(const char *in, uint16_t inLen, uint8_t *out)
|
uint16_t
|
Base64URLEncode(const uint8_t *in, uint16_t inLen, char *out)
|
uint16_t
|
Base64URLValToChar(uint8_t val)
|
char
|
Base64ValToChar(uint8_t val)
|
char
|
CalendarDateToDaysSinceEpoch(uint16_t year, uint8_t month, uint8_t dayOfMonth, uint32_t & daysSinceEpoch)
|
bool
|
CalendarDateToOrdinalDate(uint16_t year, uint8_t month, uint8_t dayOfMonth, uint16_t & dayOfYear)
|
void
|
CalendarTimeToSecondsSinceEpoch(uint16_t year, uint8_t month, uint8_t dayOfMonth, uint8_t hour, uint8_t minute, uint8_t second, uint32_t & secondsSinceEpoch)
|
bool
|
ClearFlag(FlagsT & inFlags, const FlagT inFlag)
|
void
|
DateToManufacturingWeek(uint16_t year, uint8_t month, uint8_t day, uint16_t & mfgYear, uint8_t & mfgWeek)
|
void
|
DaysInMonth(uint16_t year, uint8_t month)
|
uint8_t
|
DaysSinceEpochToCalendarDate(uint32_t daysSinceEpoch, uint16_t & year, uint8_t & month, uint8_t & dayOfMonth)
|
void
|
DaysToMarch1(uint16_t year)
|
uint8_t
|
DeallocateDeserializedStructure(void *aStructureData, const SchemaFieldDescriptor *aFieldDescriptors, SerializationContext *aContext)
|
|
ErrorStr(int32_t err)
|
NL_DLL_EXPORT const char *
This routine returns a human-readable NULL-terminated C string describing the provided error.
|
ExtractManufacturingDateFromSerialNumber(const char *serialNum, uint16_t & year, uint8_t & month, uint8_t & day)
|
|
FindNullifiedFieldsArray(void *aStructureData, const SchemaFieldDescriptor *aSchemaDescriptor, uint8_t *& aNullifiedFields)
|
A helper function to find the location of the nullified fields array located at the end of the C struct.
|
FindStatusReportStr(uint32_t inProfileId, uint16_t inStatusCode)
|
const char *
|
FirstWeekdayOfYear(uint16_t year)
|
uint8_t
|
FormatError(char *buf, uint16_t bufSize, const char *subsys, int32_t err, const char *desc)
|
void
Generates a human-readable NULL-terminated C string describing the provided error.
|
GetArrayElementSize(uint32_t & aOutSize, const FieldDescriptor *aFieldPtr, SerializedFieldType aType)
|
|
GetFlag(const FlagsT & inFlags, const FlagT inFlag)
|
bool
|
IsBase34NoIOChar(char ch)
|
bool
|
IsLeapYear(uint16_t year)
|
bool
|
IsValidFieldType(SerializedFieldType aType)
|
bool
|
IsValidSerialNumber(const char *serialNum)
|
bool
|
LogEvent(TEvent *aEvent)
|
nl::Weave::Profiles::DataManagement::event_id_t
|
LogEvent(TEvent *aEvent, const nl::Weave::Profiles::DataManagement::EventOptions & aOptions)
|
nl::Weave::Profiles::DataManagement::event_id_t
|
ManufacturingWeekToDate(uint16_t mfgYear, uint8_t mfgWeek, uint16_t & year, uint8_t & month, uint8_t & day)
|
void
|
MarchBasedDayOfYearToMonth(uint16_t dayOfYear)
|
uint8_t
|
MarchBasedMonthToDayOfYear(uint8_t month)
|
uint16_t
|
NullifyAllEventFields(TEvent *aEvent)
|
void
|
OrdinalDateToCalendarDate(uint16_t year, uint16_t dayOfYear, uint8_t & month, uint8_t & dayOfMonth)
|
void
|
ReadDataForType(TLVReader & aReader, void *aStructureData, const FieldDescriptor *& aFieldPtr, SerializedFieldType aType, bool aInArray, SerializationContext *aContext)
|
A reader function to read a specific entry from the TLV based on structure data.
|
ReadNullableDataForType(TLVReader & aReader, void *aStructureData, const FieldDescriptor *& aFieldPtr, SerializedFieldType aType, bool & aIsNullified, SerializationContext *aContext)
|
A reader function to check whether data is nullable/nullified before reading from the TLV.
|
RegisterErrorFormatter(ErrorFormatter *errFormatter)
|
NL_DLL_EXPORT void
Add a new error formatter function to the global list of error formatters.
|
SecondsSinceEpochToCalendarTime(uint32_t secondsSinceEpoch, uint16_t & year, uint8_t & month, uint8_t & dayOfMonth, uint8_t & hour, uint8_t & minute, uint8_t & second)
|
void
|
SerializedDataToTLVWriter(TLVWriter & aWriter, void *aStructureData, const SchemaFieldDescriptor *aFieldDescriptors)
|
A writer function to convert a data structure into a TLV structure.
|
SerializedDataToTLVWriterHelper(TLVWriter & aWriter, uint8_t aDataTag, void *aAppData)
|
A wrapper writer function that surrounds the SerializedDataToTLVWriter with a container.
|
SetFlag(FlagsT & inFlags, const FlagT inFlag)
|
void
|
SetFlag(FlagsT & inFlags, const FlagT inFlag, const bool inValue)
|
void
|
StatusReportStr(uint32_t profileId, uint16_t statusCode)
|
const char *
|
TLVReaderToDeserializedData(nl::Weave::TLV::TLVReader & aReader, void *aStructureData, const SchemaFieldDescriptor *aFieldDescriptors, SerializationContext *aContext)
|
A reader function to convert TLV into a C-struct.
|
TLVReaderToDeserializedDataHelper(nl::Weave::TLV::TLVReader & aReader, uint8_t aDataTag, void *aAppData, SerializationContext *aContext)
|
A helper function that deserializes a single TLV data element.
|
WriteArrayData(TLVWriter & aWriter, void *aStructureData, const FieldDescriptor *aFieldPtr)
|
A writer function that writes an array structure.
|
WriteDataForType(TLVWriter & aWriter, void *aStructureData, const FieldDescriptor *& aFieldPtr, SerializedFieldType aType, bool aInArray)
|
A writer function write a specific entry into the TLV based on structure data.
|
WriteNullableDataForType(TLVWriter & aWriter, void *aStructureData, const FieldDescriptor *& aFieldPtr, SerializedFieldType aType, bool aIsNullified)
|
A writer function to check whether data is nullable/nullified before writing to the TLV.
|
secondsToMilliseconds(uint32_t seconds)
|
uint32_t
|
Namespaces |
|
---|---|
nl:: |
|
nl:: |
This namespace includes all interfaces within Weave for Bluetooth Low Energy (BLE), also known as Bluetooth Smart. |
nl:: |
|
nl:: |
This namespace includes global symbols for Nest Weave public key infrastructure (PKI) certificates. |
nl:: |
|
nl:: |
|
nl:: |
Enumerations
@357
@357
@358
@358
@359
@359
@360
@360
@361
@361
SerializedFieldType
SerializedFieldType
A list of TLV types to write with a TLV field.
SerializedFieldTypeBits
SerializedFieldTypeBits
Bitfield of SerializedFieldType.
SerializedFieldTypeMasks
SerializedFieldTypeMasks
Masks for accessing bits of SerializedFieldType.
Typedefs
Base64CharToValFunct
uint8_t(* Base64CharToValFunct)(uint8_t c)
Base64ValToCharFunct
char(* Base64ValToCharFunct)(uint8_t val)
MemoryAllocate
void *(* MemoryAllocate)(size_t size)
Memory allocate/free function pointers.
MemoryFree
void(* MemoryFree)(void *ptr)
MemoryReallocate
void *(* MemoryReallocate)(void *ptr, size_t size)
Variables
sASN1ErrorFormatter
const ErrorFormatter sASN1ErrorFormatter = { nl::Weave::ASN1::FormatASN1Error, NULL }
sElementSize
const uint8_t sElementSize[] = { sizeof(bool), sizeof(uint8_t), sizeof(uint16_t), sizeof(uint32_t), sizeof(uint64_t), sizeof(int8_t), sizeof(int16_t), sizeof(int32_t), sizeof(int64_t), sizeof(float), sizeof(double), sizeof(char *), sizeof(SerializedByteString), sizeof(void *), sizeof(void *) }
sErrorFormatterList
const ErrorFormatter * sErrorFormatterList = &sWeaveErrorFormatter
Linked-list of error formatter functions.
sErrorStr
char sErrorStr[WEAVE_CONFIG_ERROR_STR_SIZE]
Static buffer to store the formatted error string.
sErrorStr
char sErrorStr[1024]
This routine returns a human-readable NULL-terminated C string describing the provided status code associated with the specfied profile.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Returns |
A pointer to a NULL-terminated C string describing the provided status code within the specfied profile.
|
WEAVE_CONFIG_SHORT_ERROR_STR
sWeaveErrorFormatter
const ErrorFormatter sWeaveErrorFormatter = { nl::Weave::FormatWeaveError, &sASN1ErrorFormatter }
Functions
AdjustCalendarDate
void AdjustCalendarDate( uint16_t & year, uint8_t & month, uint8_t & dayOfMonth, int32_t relativeDays )
Base64CharToVal
uint8_t Base64CharToVal( uint8_t c )
Base64Decode
uint16_t Base64Decode( const char *in, uint16_t inLen, uint8_t *out, Base64CharToValFunct charToValFunct )
Base64Decode
uint16_t Base64Decode( const char *in, uint16_t inLen, uint8_t *out )
Base64Decode32
uint32_t Base64Decode32( const char *in, uint32_t inLen, uint8_t *out, Base64CharToValFunct charToValFunct )
Base64Decode32
uint32_t Base64Decode32( const char *in, uint32_t inLen, uint8_t *out )
Base64Encode
uint16_t Base64Encode( const uint8_t *in, uint16_t inLen, char *out, Base64ValToCharFunct valToCharFunct )
Base64Encode
uint16_t Base64Encode( const uint8_t *in, uint16_t inLen, char *out )
Base64Encode32
uint32_t Base64Encode32( const uint8_t *in, uint32_t inLen, char *out, Base64ValToCharFunct valToCharFunct )
Base64Encode32
uint32_t Base64Encode32( const uint8_t *in, uint32_t inLen, char *out )
Base64URLCharToVal
uint8_t Base64URLCharToVal( uint8_t c )
Base64URLDecode
uint16_t Base64URLDecode( const char *in, uint16_t inLen, uint8_t *out )
Base64URLEncode
uint16_t Base64URLEncode( const uint8_t *in, uint16_t inLen, char *out )
Base64URLValToChar
char Base64URLValToChar( uint8_t val )
Base64ValToChar
char Base64ValToChar( uint8_t val )
CalendarDateToDaysSinceEpoch
bool CalendarDateToDaysSinceEpoch( uint16_t year, uint8_t month, uint8_t dayOfMonth, uint32_t & daysSinceEpoch )
CalendarDateToOrdinalDate
void CalendarDateToOrdinalDate( uint16_t year, uint8_t month, uint8_t dayOfMonth, uint16_t & dayOfYear )
CalendarTimeToSecondsSinceEpoch
bool CalendarTimeToSecondsSinceEpoch( uint16_t year, uint8_t month, uint8_t dayOfMonth, uint8_t hour, uint8_t minute, uint8_t second, uint32_t & secondsSinceEpoch )
ClearFlag
void ClearFlag( FlagsT & inFlags, const FlagT inFlag )
DateToManufacturingWeek
void DateToManufacturingWeek( uint16_t year, uint8_t month, uint8_t day, uint16_t & mfgYear, uint8_t & mfgWeek )
DaysInMonth
uint8_t DaysInMonth( uint16_t year, uint8_t month )
DaysSinceEpochToCalendarDate
void DaysSinceEpochToCalendarDate( uint32_t daysSinceEpoch, uint16_t & year, uint8_t & month, uint8_t & dayOfMonth )
DaysToMarch1
uint8_t DaysToMarch1( uint16_t year )
DeallocateDeserializedStructure
WEAVE_ERROR DeallocateDeserializedStructure( void *aStructureData, const SchemaFieldDescriptor *aFieldDescriptors, SerializationContext *aContext )
ErrorStr
NL_DLL_EXPORT const char * ErrorStr( int32_t err )
This routine returns a human-readable NULL-terminated C string describing the provided error.
Details | |||
---|---|---|---|
Parameters |
|
||
Returns |
A pointer to a NULL-terminated C string describing the provided error.
|
ExtractManufacturingDateFromSerialNumber
WEAVE_ERROR ExtractManufacturingDateFromSerialNumber( const char *serialNum, uint16_t & year, uint8_t & month, uint8_t & day )
FindNullifiedFieldsArray
WEAVE_ERROR FindNullifiedFieldsArray( void *aStructureData, const SchemaFieldDescriptor *aSchemaDescriptor, uint8_t *& aNullifiedFields )
A helper function to find the location of the nullified fields array located at the end of the C struct.
The nullified_fields member of the C struct is expected to be located directly after the last member described by the array of FieldDescriptors. It is not in the list of field descriptors, as it's meant to be a hidden utility for creators and consumers of nullable events. This struct member does not exist for events with no nullable fields, however by construction of setters and getters, no out of bounds accesses should occur.
Details | |||||||
---|---|---|---|---|---|---|---|
Parameters |
|
||||||
Return Values |
|
FindStatusReportStr
const char * FindStatusReportStr( uint32_t inProfileId, uint16_t inStatusCode )
FirstWeekdayOfYear
uint8_t FirstWeekdayOfYear( uint16_t year )
FormatError
void FormatError( char *buf, uint16_t bufSize, const char *subsys, int32_t err, const char *desc )
Generates a human-readable NULL-terminated C string describing the provided error.
Details | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Parameters |
|
GetArrayElementSize
WEAVE_ERROR GetArrayElementSize( uint32_t & aOutSize, const FieldDescriptor *aFieldPtr, SerializedFieldType aType )
GetFlag
bool GetFlag( const FlagsT & inFlags, const FlagT inFlag )
IsBase34NoIOChar
bool IsBase34NoIOChar( char ch )
IsLeapYear
bool IsLeapYear( uint16_t year )
IsValidFieldType
bool IsValidFieldType( SerializedFieldType aType )
IsValidSerialNumber
bool IsValidSerialNumber( const char *serialNum )
LogEvent
nl::Weave::Profiles::DataManagement::event_id_t LogEvent( TEvent *aEvent )
LogEvent
nl::Weave::Profiles::DataManagement::event_id_t LogEvent( TEvent *aEvent, const nl::Weave::Profiles::DataManagement::EventOptions & aOptions )
ManufacturingWeekToDate
void ManufacturingWeekToDate( uint16_t mfgYear, uint8_t mfgWeek, uint16_t & year, uint8_t & month, uint8_t & day )
MarchBasedDayOfYearToMonth
uint8_t MarchBasedDayOfYearToMonth( uint16_t dayOfYear )
MarchBasedMonthToDayOfYear
uint16_t MarchBasedMonthToDayOfYear( uint8_t month )
NullifyAllEventFields
void NullifyAllEventFields( TEvent *aEvent )
OrdinalDateToCalendarDate
void OrdinalDateToCalendarDate( uint16_t year, uint16_t dayOfYear, uint8_t & month, uint8_t & dayOfMonth )
ReadDataForType
WEAVE_ERROR ReadDataForType( TLVReader & aReader, void *aStructureData, const FieldDescriptor *& aFieldPtr, SerializedFieldType aType, bool aInArray, SerializationContext *aContext )
A reader function to read a specific entry from the TLV based on structure data.
Details | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Parameters |
|
||||||||||||
Return Values |
|
ReadNullableDataForType
WEAVE_ERROR ReadNullableDataForType( TLVReader & aReader, void *aStructureData, const FieldDescriptor *& aFieldPtr, SerializedFieldType aType, bool & aIsNullified, SerializationContext *aContext )
A reader function to check whether data is nullable/nullified before reading from the TLV.
Details | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Parameters |
|
||||||||||||
Return Values |
|
RegisterErrorFormatter
NL_DLL_EXPORT void RegisterErrorFormatter( ErrorFormatter *errFormatter )
Add a new error formatter function to the global list of error formatters.
Details | |||
---|---|---|---|
Parameters |
|
SecondsSinceEpochToCalendarTime
void SecondsSinceEpochToCalendarTime( uint32_t secondsSinceEpoch, uint16_t & year, uint8_t & month, uint8_t & dayOfMonth, uint8_t & hour, uint8_t & minute, uint8_t & second )
SerializedDataToTLVWriter
WEAVE_ERROR SerializedDataToTLVWriter( TLVWriter & aWriter, void *aStructureData, const SchemaFieldDescriptor *aFieldDescriptors )
A writer function to convert a data structure into a TLV structure.
Uses a SchemaFieldDescriptor to interpret the data structure and write to the TLV.
Details | |||||||
---|---|---|---|---|---|---|---|
Parameters |
|
||||||
Return Values |
|
SerializedDataToTLVWriterHelper
WEAVE_ERROR SerializedDataToTLVWriterHelper( TLVWriter & aWriter, uint8_t aDataTag, void *aAppData )
A wrapper writer function that surrounds the SerializedDataToTLVWriter with a container.
Also splits up an StructureSchemaPointerPair into structure data and descriptors to pass through.
Details | |||||||
---|---|---|---|---|---|---|---|
Parameters |
|
||||||
Return Values |
|
SetFlag
void SetFlag( FlagsT & inFlags, const FlagT inFlag )
SetFlag
void SetFlag( FlagsT & inFlags, const FlagT inFlag, const bool inValue )
StatusReportStr
const char * StatusReportStr( uint32_t profileId, uint16_t statusCode )
TLVReaderToDeserializedData
WEAVE_ERROR TLVReaderToDeserializedData( nl::Weave::TLV::TLVReader & aReader, void *aStructureData, const SchemaFieldDescriptor *aFieldDescriptors, SerializationContext *aContext )
A reader function to convert TLV into a C-struct.
Uses a SchemaFieldDescriptor to interpret the data structure.
It must be robust both to encoutering unknown fields and to not encountering an expected field.
Details | |||||||||
---|---|---|---|---|---|---|---|---|---|
Parameters |
|
||||||||
Return Values |
|
TLVReaderToDeserializedDataHelper
WEAVE_ERROR TLVReaderToDeserializedDataHelper( nl::Weave::TLV::TLVReader & aReader, uint8_t aDataTag, void *aAppData, SerializationContext *aContext )
A helper function that deserializes a single TLV data element.
The function splits StructureSchemaPointerPair into structure data and descriptors to pass through to ReadDataForType.
Details | |||||||||
---|---|---|---|---|---|---|---|---|---|
Parameters |
|
||||||||
Return Values |
|
WriteArrayData
WEAVE_ERROR WriteArrayData( TLVWriter & aWriter, void *aStructureData, const FieldDescriptor *aFieldPtr )
A writer function that writes an array structure.
Details | |||||||
---|---|---|---|---|---|---|---|
Parameters |
|
||||||
Return Values |
|
WriteDataForType
WEAVE_ERROR WriteDataForType( TLVWriter & aWriter, void *aStructureData, const FieldDescriptor *& aFieldPtr, SerializedFieldType aType, bool aInArray )
A writer function write a specific entry into the TLV based on structure data.
Details | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Parameters |
|
||||||||||
Return Values |
|
WriteNullableDataForType
WEAVE_ERROR WriteNullableDataForType( TLVWriter & aWriter, void *aStructureData, const FieldDescriptor *& aFieldPtr, SerializedFieldType aType, bool aIsNullified )
A writer function to check whether data is nullable/nullified before writing to the TLV.
Details | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Parameters |
|
||||||||||
Return Values |
|
secondsToMilliseconds
uint32_t secondsToMilliseconds( uint32_t seconds )