Clean up error names. (#1764)

This commit is contained in:
Jonathan Hui
2017-05-23 09:34:35 -07:00
committed by GitHub
parent b3530deb76
commit 48b9299544
262 changed files with 6230 additions and 6204 deletions
+10 -10
View File
@@ -46,10 +46,10 @@ extern "C" {
/**
* Perform any initialization for flash driver.
*
* @retval ::kThreadError_None Initialize flash driver success.
* @retval ::kThreadError_Failed Initialize flash driver fail.
* @retval ::OT_ERROR_NONE Initialize flash driver success.
* @retval ::OT_ERROR_FAILED Initialize flash driver fail.
*/
ThreadError utilsFlashInit(void);
otError utilsFlashInit(void);
/**
* Get the size of flash that can be read/write by the caller.
@@ -69,11 +69,11 @@ uint32_t utilsFlashGetSize(void);
*
* @param[in] aAddress The start address of the flash to erase.
*
* @retval kThreadError_None Erase flash operation is started.
* @retval kThreadError_Failed Erase flash operation is not started.
* @retval kThreadError_InvalidArgs aAddress is out of range of flash or not aligend.
* @retval OT_ERROR_NONE Erase flash operation is started.
* @retval OT_ERROR_FAILED Erase flash operation is not started.
* @retval OT_ERROR_INVALID_ARGS aAddress is out of range of flash or not aligend.
*/
ThreadError utilsFlashErasePage(uint32_t aAddress);
otError utilsFlashErasePage(uint32_t aAddress);
/**
* Check whether flash is ready or busy.
@@ -82,10 +82,10 @@ ThreadError utilsFlashErasePage(uint32_t aAddress);
* zero indicates that it is a polling function, and returns current status of flash immediately.
* non-zero indicates that it is blocking there until the operation is done and become ready, or timeout expires.
*
* @retval kThreadError_None Flash is ready for any operation.
* @retval kThreadError_Busy Flash is busy.
* @retval OT_ERROR_NONE Flash is ready for any operation.
* @retval OT_ERROR_BUSY Flash is busy.
*/
ThreadError utilsFlashStatusWait(uint32_t aTimeout);
otError utilsFlashStatusWait(uint32_t aTimeout);
/**
* Write flash. The write operation only clears bits, but never set bits.
+19 -19
View File
@@ -216,10 +216,10 @@ exit:
return settingsSize - sSettingsUsedSize;
}
static ThreadError addSetting(otInstance *aInstance, uint16_t aKey, bool aIndex0, const uint8_t *aValue,
uint16_t aValueLength)
static otError addSetting(otInstance *aInstance, uint16_t aKey, bool aIndex0, const uint8_t *aValue,
uint16_t aValueLength)
{
ThreadError error = kThreadError_None;
otError error = OT_ERROR_NONE;
OT_TOOL_PACKED_BEGIN
struct addSettingsBlock
{
@@ -245,7 +245,7 @@ static ThreadError addSetting(otInstance *aInstance, uint16_t aKey, bool aIndex0
settingsSize)
{
otEXPECT_ACTION(swapSettingsBlock(aInstance) >= (getAlignLength(addBlock.block.length) + sizeof(struct settingsBlock)),
error = kThreadError_NoBufs);
error = OT_ERROR_NO_BUFS);
}
utilsFlashWrite(sSettingsBaseAddress + sSettingsUsedSize,
@@ -320,27 +320,27 @@ void otPlatSettingsInit(otInstance *aInstance)
}
}
ThreadError otPlatSettingsBeginChange(otInstance *aInstance)
otError otPlatSettingsBeginChange(otInstance *aInstance)
{
(void)aInstance;
return kThreadError_None;
return OT_ERROR_NONE;
}
ThreadError otPlatSettingsCommitChange(otInstance *aInstance)
otError otPlatSettingsCommitChange(otInstance *aInstance)
{
(void)aInstance;
return kThreadError_None;
return OT_ERROR_NONE;
}
ThreadError otPlatSettingsAbandonChange(otInstance *aInstance)
otError otPlatSettingsAbandonChange(otInstance *aInstance)
{
(void)aInstance;
return kThreadError_None;
return OT_ERROR_NONE;
}
ThreadError otPlatSettingsGet(otInstance *aInstance, uint16_t aKey, int aIndex, uint8_t *aValue, uint16_t *aValueLength)
otError otPlatSettingsGet(otInstance *aInstance, uint16_t aKey, int aIndex, uint8_t *aValue, uint16_t *aValueLength)
{
ThreadError error = kThreadError_NotFound;
otError error = OT_ERROR_NOT_FOUND;
uint32_t address = sSettingsBaseAddress + kSettingsFlagSize;
uint16_t valueLength = 0;
int index = 0;
@@ -379,7 +379,7 @@ ThreadError otPlatSettingsGet(otInstance *aInstance, uint16_t aKey, int aIndex,
}
valueLength = block.length;
error = kThreadError_None;
error = OT_ERROR_NONE;
}
index++;
@@ -397,23 +397,23 @@ ThreadError otPlatSettingsGet(otInstance *aInstance, uint16_t aKey, int aIndex,
return error;
}
ThreadError otPlatSettingsSet(otInstance *aInstance, uint16_t aKey, const uint8_t *aValue, uint16_t aValueLength)
otError otPlatSettingsSet(otInstance *aInstance, uint16_t aKey, const uint8_t *aValue, uint16_t aValueLength)
{
return addSetting(aInstance, aKey, true, aValue, aValueLength);
}
ThreadError otPlatSettingsAdd(otInstance *aInstance, uint16_t aKey, const uint8_t *aValue, uint16_t aValueLength)
otError otPlatSettingsAdd(otInstance *aInstance, uint16_t aKey, const uint8_t *aValue, uint16_t aValueLength)
{
uint16_t length;
bool index0;
index0 = (otPlatSettingsGet(aInstance, aKey, 0, NULL, &length) == kThreadError_NotFound ? true : false);
index0 = (otPlatSettingsGet(aInstance, aKey, 0, NULL, &length) == OT_ERROR_NOT_FOUND ? true : false);
return addSetting(aInstance, aKey, index0, aValue, aValueLength);
}
ThreadError otPlatSettingsDelete(otInstance *aInstance, uint16_t aKey, int aIndex)
otError otPlatSettingsDelete(otInstance *aInstance, uint16_t aKey, int aIndex)
{
ThreadError error = kThreadError_NotFound;
otError error = OT_ERROR_NOT_FOUND;
uint32_t address = sSettingsBaseAddress + kSettingsFlagSize;
int index = 0;
@@ -436,7 +436,7 @@ ThreadError otPlatSettingsDelete(otInstance *aInstance, uint16_t aKey, int aInde
{
if (aIndex == index || aIndex == -1)
{
error = kThreadError_None;
error = OT_ERROR_NONE;
block.flag &= (~kBlockDeleteFlag);
utilsFlashWrite(address, reinterpret_cast<uint8_t *>(&block), sizeof(block));
}