Lines Matching refs:length

199         uint16_t length;  in otPlatSettingsInit()  local
205 rval = read(sSettingsFd, &length, sizeof(length)); in otPlatSettingsInit()
206 VerifyOrExit(rval == sizeof(length), error = OT_ERROR_PARSE); in otPlatSettingsInit()
208 offset += sizeof(key) + sizeof(length) + length; in otPlatSettingsInit()
209 VerifyOrExit(offset == lseek(sSettingsFd, length, SEEK_CUR), error = OT_ERROR_PARSE); in otPlatSettingsInit()
346 uint16_t length; in PlatformSettingsGet() local
352 rval = read(sSettingsFd, &length, sizeof(length)); in PlatformSettingsGet()
353 VerifyOrExit(rval == sizeof(length), error = OT_ERROR_PARSE); in PlatformSettingsGet()
365 uint16_t readLength = (length <= *aValueLength ? length : *aValueLength); in PlatformSettingsGet()
370 *aValueLength = length; in PlatformSettingsGet()
381 offset += sizeof(key) + sizeof(length) + length; in PlatformSettingsGet()
382 VerifyOrExit(offset == lseek(sSettingsFd, length, SEEK_CUR), error = OT_ERROR_PARSE); in PlatformSettingsGet()
445 uint16_t length; in PlatformSettingsDelete() local
451 rval = read(sSettingsFd, &length, sizeof(length)); in PlatformSettingsDelete()
452 VerifyOrExit(rval == sizeof(length), error = OT_ERROR_FAILED); in PlatformSettingsDelete()
454 offset += sizeof(key) + sizeof(length) + length; in PlatformSettingsDelete()
460 … VerifyOrExit(offset == lseek(sSettingsFd, length, SEEK_CUR), error = OT_ERROR_FAILED); in PlatformSettingsDelete()
467 … VerifyOrExit(offset == lseek(sSettingsFd, length, SEEK_CUR), error = OT_ERROR_FAILED); in PlatformSettingsDelete()
480 rval = write(swapFd, &length, sizeof(length)); in PlatformSettingsDelete()
481 VerifyOrExit(rval == sizeof(length), error = OT_ERROR_FAILED); in PlatformSettingsDelete()
483 swapWrite(aInstance, swapFd, length); in PlatformSettingsDelete()
564 uint16_t length = sizeof(value); in main() local
566 assert(otPlatSettingsGet(instance, 0, 0, value, &length) == OT_ERROR_NOT_FOUND); in main()
575 uint16_t length = sizeof(value); in main() local
578 assert(otPlatSettingsGet(instance, 0, 0, nullptr, &length) == OT_ERROR_NONE); in main()
579 assert(length == sizeof(data) / 2); in main()
581 length = sizeof(value); in main()
582 assert(otPlatSettingsGet(instance, 0, 0, value, &length) == OT_ERROR_NONE); in main()
583 assert(length == sizeof(data) / 2); in main()
584 assert(0 == memcmp(value, data, length)); in main()
587 length -= 1; in main()
588 value[length] = 0; in main()
589 assert(otPlatSettingsGet(instance, 0, 0, value, &length) == OT_ERROR_NONE); in main()
591 assert(length == sizeof(data) / 2); in main()
593 assert(value[length] == 0); in main()
607 uint16_t length = sizeof(value); in main() local
609 assert(otPlatSettingsGet(instance, 0, 1, value, &length) == OT_ERROR_NONE); in main()
610 assert(length == sizeof(data) / 2); in main()
611 assert(0 == memcmp(value, data, length)); in main()
613 length = sizeof(value); in main()
614 assert(otPlatSettingsGet(instance, 0, 0, value, &length) == OT_ERROR_NONE); in main()
615 assert(length == sizeof(data)); in main()
616 assert(0 == memcmp(value, data, length)); in main()
625 uint16_t length = sizeof(value); in main() local
627 assert(otPlatSettingsGet(instance, 1, 0, value, &length) == OT_ERROR_NONE); in main()
628 assert(length == sizeof(data) / 2); in main()
629 assert(0 == memcmp(value, data, length)); in main()
631 length = sizeof(value); in main()
632 assert(otPlatSettingsGet(instance, 0, 0, value, &length) == OT_ERROR_NONE); in main()
633 assert(length == sizeof(data)); in main()
634 assert(0 == memcmp(value, data, length)); in main()
644 uint16_t length = sizeof(value); in main() local
655 assert(otPlatSettingsGet(instance, 0, 1, value, &length) == OT_ERROR_NONE); in main()
656 assert(length == sizeof(data) / 3); in main()
657 assert(0 == memcmp(value, data, length)); in main()
671 uint16_t length = sizeof(value); in main() local
674 assert(otPlatSettingsGet(instance, 0, 0, value, &length) == OT_ERROR_NOT_FOUND); in main()
675 assert(otPlatSettingsGet(instance, 1, 0, value, &length) == OT_ERROR_NONE); in main()
676 assert(length == sizeof(data) / 2); in main()
677 assert(0 == memcmp(value, data, length)); in main()