Lines Matching refs:error

394     otError      error  = OT_ERROR_NONE;  in HandleReceive()  local
433 error = HandleCommand(header); in HandleReceive()
435 if (error != OT_ERROR_NONE) in HandleReceive()
437 IgnoreError(PrepareLastStatusResponse(header, ThreadErrorToSpinelStatus(error))); in HandleReceive()
546 otError error = OT_ERROR_NONE; in StreamWrite() local
559 VerifyOrExit(!mDisableStreamWrite, error = OT_ERROR_INVALID_STATE); in StreamWrite()
560 … VerifyOrExit(!mChangedPropsSet.IsPropertyFiltered(streamPropKey), error = OT_ERROR_INVALID_STATE); in StreamWrite()
566 VerifyOrExit(IsResponseQueueEmpty(), error = OT_ERROR_NO_BUFS); in StreamWrite()
568 SuccessOrExit(error = mEncoder.BeginFrame(header, SPINEL_CMD_PROP_VALUE_IS, streamPropKey)); in StreamWrite()
569 SuccessOrExit(error = mEncoder.WriteData(aDataPtr, static_cast<uint16_t>(aDataLen))); in StreamWrite()
570 SuccessOrExit(error = mEncoder.EndFrame()); in StreamWrite()
574 if (error == OT_ERROR_NO_BUFS) in StreamWrite()
580 return error; in StreamWrite()
721 otError error = OT_ERROR_NONE; in Log() local
724 VerifyOrExit(!mDisableStreamWrite, error = OT_ERROR_INVALID_STATE); in Log()
731 VerifyOrExit(IsResponseQueueEmpty(), error = OT_ERROR_NO_BUFS); in Log()
733 …SuccessOrExit(error = mEncoder.BeginFrame(header, SPINEL_CMD_PROP_VALUE_IS, SPINEL_PROP_STREAM_LOG… in Log()
734 SuccessOrExit(error = mEncoder.WriteUtf8(aLogString)); in Log()
735 SuccessOrExit(error = mEncoder.WriteUint8(ConvertLogLevel(aLogLevel))); in Log()
736 SuccessOrExit(error = mEncoder.WriteUintPacked(ConvertLogRegion(aLogRegion))); in Log()
737 SuccessOrExit(error = mEncoder.WriteUint64(mLogTimestampBase + otPlatAlarmMilliGetNow())); in Log()
738 SuccessOrExit(error = mEncoder.EndFrame()); in Log()
742 if (error == OT_ERROR_NO_BUFS) in Log()
776 otError error = OT_ERROR_NONE; in EnqueueResponse() local
803 ExitNow(error = OT_ERROR_NO_BUFS); in EnqueueResponse()
840 return error; in EnqueueResponse()
845 otError error = OT_ERROR_NONE; in SendQueuedResponses() local
861 SuccessOrExit(error = WriteLastStatusFrame(header, status)); in SendQueuedResponses()
868 SuccessOrExit(error = WritePropertyValueIsFrame(header, propKey, isGetResponse)); in SendQueuedResponses()
892 return error; in SendQueuedResponses()
958 otError error = OT_ERROR_NONE; in HandleCommand() local
961 SuccessOrExit(error = mDecoder.ReadUintPacked(command)); in HandleCommand()
966 error = CommandHandler_NOOP(aHeader); in HandleCommand()
970 error = CommandHandler_RESET(aHeader); in HandleCommand()
977 error = CommandHandler_PROP_VALUE_update(aHeader, command); in HandleCommand()
982 error = CommandHandler_PEEK(aHeader); in HandleCommand()
986 error = CommandHandler_POKE(aHeader); in HandleCommand()
993 error = OT_ERROR_NOT_IMPLEMENTED; in HandleCommand()
997 error = CommandHandler_NET_CLEAR(aHeader); in HandleCommand()
1006 error = VendorCommandHandler(aHeader, command); in HandleCommand()
1011 error = PrepareLastStatusResponse(aHeader, SPINEL_STATUS_INVALID_COMMAND); in HandleCommand()
1016 return error; in HandleCommand()
1066 otError error = OT_ERROR_NONE; in HandleCommandPropertySet() local
1072 error = (this->*handler)(); in HandleCommandPropertySet()
1080 bool didHandle = HandlePropertySetForSpecialProperties(aHeader, aKey, error); in HandleCommandPropertySet()
1088 error = VendorSetPropertyHandler(aKey); in HandleCommandPropertySet()
1097 didHandle = (error != OT_ERROR_NOT_FOUND); in HandleCommandPropertySet()
1101 … VerifyOrExit(didHandle, error = PrepareLastStatusResponse(aHeader, SPINEL_STATUS_PROP_NOT_FOUND)); in HandleCommandPropertySet()
1104 if (error == OT_ERROR_NONE) in HandleCommandPropertySet()
1106 error = PrepareSetResponse(aHeader, aKey); in HandleCommandPropertySet()
1110 error = PrepareLastStatusResponse(aHeader, ThreadErrorToSpinelStatus(error)); in HandleCommandPropertySet()
1114 return error; in HandleCommandPropertySet()
1119 otError error = OT_ERROR_NONE; in HandleCommandPropertyInsertRemove() local
1141 …VerifyOrExit(handler != nullptr, error = PrepareLastStatusResponse(aHeader, SPINEL_STATUS_PROP_NOT… in HandleCommandPropertyInsertRemove()
1154 error = (this->*handler)(); in HandleCommandPropertyInsertRemove()
1158 …VerifyOrExit(error == OT_ERROR_NONE, error = PrepareLastStatusResponse(aHeader, ThreadErrorToSpine… in HandleCommandPropertyInsertRemove()
1160error = WritePropertyValueInsertedRemovedFrame(aHeader, responseCommand, aKey, valuePtr, valueLen); in HandleCommandPropertyInsertRemove()
1165 if (error != OT_ERROR_NONE) in HandleCommandPropertyInsertRemove()
1167 error = PrepareLastStatusResponse(aHeader, SPINEL_STATUS_OK); in HandleCommandPropertyInsertRemove()
1171 return error; in HandleCommandPropertyInsertRemove()
1180 otError error = OT_ERROR_NONE; in WriteLastStatusFrame() local
1187 …SuccessOrExit(error = mEncoder.BeginFrame(aHeader, SPINEL_CMD_PROP_VALUE_IS, SPINEL_PROP_LAST_STAT… in WriteLastStatusFrame()
1188 SuccessOrExit(error = mEncoder.WriteUintPacked(aLastStatus)); in WriteLastStatusFrame()
1189 SuccessOrExit(error = mEncoder.EndFrame()); in WriteLastStatusFrame()
1192 return error; in WriteLastStatusFrame()
1197 otError error = OT_ERROR_NONE; in WritePropertyValueIsFrame() local
1202 SuccessOrExit(error = mEncoder.BeginFrame(aHeader, SPINEL_CMD_PROP_VALUE_IS, aPropKey)); in WritePropertyValueIsFrame()
1203 SuccessOrExit(error = (this->*handler)()); in WritePropertyValueIsFrame()
1204 ExitNow(error = mEncoder.EndFrame()); in WritePropertyValueIsFrame()
1210 SuccessOrExit(error = mEncoder.BeginFrame(aHeader, SPINEL_CMD_PROP_VALUE_IS, aPropKey)); in WritePropertyValueIsFrame()
1212 error = VendorGetPropertyHandler(aPropKey); in WritePropertyValueIsFrame()
1218 if (error != OT_ERROR_NOT_FOUND) in WritePropertyValueIsFrame()
1220 SuccessOrExit(error); in WritePropertyValueIsFrame()
1221 ExitNow(error = mEncoder.EndFrame()); in WritePropertyValueIsFrame()
1228 SuccessOrExit(error = WriteLastStatusFrame(aHeader, SPINEL_STATUS_PROP_NOT_FOUND)); in WritePropertyValueIsFrame()
1235 SuccessOrExit(error = WriteLastStatusFrame(aHeader, SPINEL_STATUS_OK)); in WritePropertyValueIsFrame()
1239 return error; in WritePropertyValueIsFrame()
1248 otError error = OT_ERROR_NONE; in WritePropertyValueInsertedRemovedFrame() local
1250 SuccessOrExit(error = mEncoder.BeginFrame(aHeader, aResponseCommand, aPropKey)); in WritePropertyValueInsertedRemovedFrame()
1251 SuccessOrExit(error = mEncoder.WriteData(aValuePtr, aValueLen)); in WritePropertyValueInsertedRemovedFrame()
1252 SuccessOrExit(error = mEncoder.EndFrame()); in WritePropertyValueInsertedRemovedFrame()
1255 return error; in WritePropertyValueInsertedRemovedFrame()
1268 otError error = OT_ERROR_NONE; in CommandHandler_RESET() local
1273 SuccessOrAssert(error = mDecoder.ReadUint8(reset_type)); in CommandHandler_RESET()
1288 …SuccessOrAssert(error = WriteLastStatusFrame(SPINEL_HEADER_FLAG | SPINEL_HEADER_TX_NOTIFICATION_II… in CommandHandler_RESET()
1296 error = otInstanceResetToBootloader(mInstance); in CommandHandler_RESET()
1317 return error; in CommandHandler_RESET()
1322 otError error = OT_ERROR_NONE; in CommandHandler_PROP_VALUE_update() local
1325 error = mDecoder.ReadUintPacked(propKey); in CommandHandler_PROP_VALUE_update()
1327 …VerifyOrExit(error == OT_ERROR_NONE, error = PrepareLastStatusResponse(aHeader, ThreadErrorToSpine… in CommandHandler_PROP_VALUE_update()
1332 error = PrepareGetResponse(aHeader, static_cast<spinel_prop_key_t>(propKey)); in CommandHandler_PROP_VALUE_update()
1336 error = HandleCommandPropertySet(aHeader, static_cast<spinel_prop_key_t>(propKey)); in CommandHandler_PROP_VALUE_update()
1341error = HandleCommandPropertyInsertRemove(aHeader, static_cast<spinel_prop_key_t>(propKey), aComma… in CommandHandler_PROP_VALUE_update()
1349 return error; in CommandHandler_PROP_VALUE_update()
1424 otError error = OT_ERROR_NONE; in HandlePropertySet_SPINEL_PROP_NEST_STREAM_MFG() local
1426 error = mDecoder.ReadUtf8(string); in HandlePropertySet_SPINEL_PROP_NEST_STREAM_MFG()
1428 …VerifyOrExit(error == OT_ERROR_NONE, error = WriteLastStatusFrame(aHeader, ThreadErrorToSpinelStat… in HandlePropertySet_SPINEL_PROP_NEST_STREAM_MFG()
1439 SuccessOrExit(error = otDiagProcessCmdLine(mInstance, string, output, sizeof(output))); in HandlePropertySet_SPINEL_PROP_NEST_STREAM_MFG()
1442 …SuccessOrExit(error = mEncoder.BeginFrame(aHeader, SPINEL_CMD_PROP_VALUE_IS, SPINEL_PROP_NEST_STRE… in HandlePropertySet_SPINEL_PROP_NEST_STREAM_MFG()
1443 SuccessOrExit(error = mEncoder.WriteUtf8(output)); in HandlePropertySet_SPINEL_PROP_NEST_STREAM_MFG()
1444 SuccessOrExit(error = mEncoder.EndFrame()); in HandlePropertySet_SPINEL_PROP_NEST_STREAM_MFG()
1447 return error; in HandlePropertySet_SPINEL_PROP_NEST_STREAM_MFG()
1469 otError error = OT_ERROR_NONE; in HandlePropertySet() local
1471 SuccessOrExit(error = mDecoder.ReadUintPacked(channel)); in HandlePropertySet()
1473 error = otLinkSetChannel(mInstance, static_cast<uint8_t>(channel)); in HandlePropertySet()
1477 SuccessOrExit(error); in HandlePropertySet()
1483 error = otLinkRawReceive(mInstance); in HandlePropertySet()
1489 return error; in HandlePropertySet()
1508 otError error = OT_ERROR_NONE; in HandlePropertySet() local
1510 SuccessOrExit(error = mDecoder.ReadUint8(mode)); in HandlePropertySet()
1516 error = otLinkRawSetPromiscuous(mInstance, false); in HandlePropertySet()
1518 error = otLinkSetPromiscuous(mInstance, false); in HandlePropertySet()
1525 error = otLinkRawSetPromiscuous(mInstance, true); in HandlePropertySet()
1527 error = otLinkSetPromiscuous(mInstance, true); in HandlePropertySet()
1532 error = OT_ERROR_INVALID_ARGS; in HandlePropertySet()
1537 return error; in HandlePropertySet()
1543 otError error = OT_ERROR_NONE; in HandlePropertySet() local
1545 SuccessOrExit(error = mDecoder.ReadBool(enabled)); in HandlePropertySet()
1549 return error; in HandlePropertySet()
1560 otError error = OT_ERROR_NONE; in HandlePropertySet() local
1562 SuccessOrExit(error = mDecoder.ReadUint16(panid)); in HandlePropertySet()
1564 error = otLinkSetPanId(mInstance, panid); in HandlePropertySet()
1567 return error; in HandlePropertySet()
1578 otError error = OT_ERROR_NONE; in HandlePropertySet() local
1580 SuccessOrExit(error = mDecoder.ReadEui64(extAddress)); in HandlePropertySet()
1582 error = otLinkSetExtendedAddress(mInstance, extAddress); in HandlePropertySet()
1585 return error; in HandlePropertySet()
1601 otError error = OT_ERROR_NONE; in HandlePropertySet() local
1603 SuccessOrExit(error = mDecoder.ReadBool(enabled)); in HandlePropertySet()
1611 error = otLinkRawReceive(mInstance); in HandlePropertySet()
1615 error = otLinkRawSleep(mInstance); in HandlePropertySet()
1624 return error; in HandlePropertySet()
1643 otError error = OT_ERROR_NONE; in EncodeChannelMask() local
1649 SuccessOrExit(error = mEncoder.WriteUint8(i)); in EncodeChannelMask()
1654 return error; in EncodeChannelMask()
1659 otError error = OT_ERROR_NONE; in DecodeChannelMask() local
1666 SuccessOrExit(error = mDecoder.ReadUint8(channel)); in DecodeChannelMask()
1667 VerifyOrExit(channel <= 31, error = OT_ERROR_INVALID_ARGS); in DecodeChannelMask()
1672 return error; in DecodeChannelMask()
1683 otError error = OT_ERROR_NONE; in HandlePropertySet() local
1685 SuccessOrExit(error = DecodeChannelMask(newMask)); in HandlePropertySet()
1689 return error; in HandlePropertySet()
1744 otError error = OT_ERROR_NONE; in HandlePropertySet() local
1746 SuccessOrExit(error = mDecoder.ReadUint8(state)); in HandlePropertySet()
1751 error = OT_ERROR_NONE; in HandlePropertySet()
1756error = otLinkActiveScan(mInstance, mScanChannelMask, mScanPeriod, &HandleActiveScanResult_Jump, t… in HandlePropertySet()
1757 SuccessOrExit(error); in HandlePropertySet()
1769 …VerifyOrExit(mCurScanChannel[mCurCommandIid] == kInvalidScanChannel, error = OT_ERROR_INVALID_STAT… in HandlePropertySet()
1770 VerifyOrExit(HasOnly1BitSet(mScanChannelMask), error = OT_ERROR_INVALID_ARGS); in HandlePropertySet()
1775 error = otLinkRawEnergyScan(mInstance, scanChannel, mScanPeriod, LinkRawEnergyScanDone); in HandlePropertySet()
1781error = otLinkEnergyScan(mInstance, mScanChannelMask, mScanPeriod, &HandleEnergyScanResult_Jump, t… in HandlePropertySet()
1785 SuccessOrExit(error); in HandlePropertySet()
1790error = otThreadDiscover(mInstance, mScanChannelMask, mDiscoveryScanPanId, mDiscoveryScanJoinerFla… in HandlePropertySet()
1793 SuccessOrExit(error); in HandlePropertySet()
1798 error = OT_ERROR_NOT_IMPLEMENTED; in HandlePropertySet()
1803 return error; in HandlePropertySet()
1808 otError error = OT_ERROR_NONE; in HandlePropertyGet() local
1818 SuccessOrExit(error = mEncoder.WriteUintPacked(entry->mPropKey)); in HandlePropertyGet()
1823 return error; in HandlePropertyGet()
1829 otError error = OT_ERROR_NONE; in HandlePropertySet() local
1836 SuccessOrExit(error = mDecoder.ReadUintPacked(propKey)); in HandlePropertySet()
1847 if (error != OT_ERROR_NONE) in HandlePropertySet()
1853 return error; in HandlePropertySet()
1858 otError error = OT_ERROR_NONE; in HandlePropertyInsert() local
1861 SuccessOrExit(error = mDecoder.ReadUintPacked(propKey)); in HandlePropertyInsert()
1863 error = mChangedPropsSet.EnablePropertyFilter(static_cast<spinel_prop_key_t>(propKey), true); in HandlePropertyInsert()
1866 return error; in HandlePropertyInsert()
1871 otError error = OT_ERROR_NONE; in HandlePropertyRemove() local
1874 SuccessOrExit(error = mDecoder.ReadUintPacked(propKey)); in HandlePropertyRemove()
1876 error = mChangedPropsSet.EnablePropertyFilter(static_cast<spinel_prop_key_t>(propKey), false); in HandlePropertyRemove()
1879 return error; in HandlePropertyRemove()
1889 otError error = OT_ERROR_NONE; in HandlePropertyGet() local
1891 SuccessOrExit(error = mEncoder.WriteUintPacked(SPINEL_PROTOCOL_VERSION_THREAD_MAJOR)); in HandlePropertyGet()
1892 SuccessOrExit(error = mEncoder.WriteUintPacked(SPINEL_PROTOCOL_VERSION_THREAD_MINOR)); in HandlePropertyGet()
1895 return error; in HandlePropertyGet()
1910 otError error = OT_ERROR_NONE; in HandlePropertyGet() local
1912 SuccessOrExit(error = mEncoder.WriteUintPacked(SPINEL_CAP_COUNTERS)); in HandlePropertyGet()
1913 SuccessOrExit(error = mEncoder.WriteUintPacked(SPINEL_CAP_UNSOL_UPDATE_FILTER)); in HandlePropertyGet()
1916 SuccessOrExit(error = mEncoder.WriteUintPacked(SPINEL_CAP_MCU_POWER_STATE)); in HandlePropertyGet()
1920 SuccessOrExit(error = mEncoder.WriteUintPacked(SPINEL_CAP_802_15_4_2450MHZ_OQPSK)); in HandlePropertyGet()
1924 SuccessOrExit(error = mEncoder.WriteUintPacked(SPINEL_CAP_802_15_4_915MHZ_OQPSK)); in HandlePropertyGet()
1928 SuccessOrExit(error = mEncoder.WriteUintPacked(SPINEL_CAP_CONFIG_FTD)); in HandlePropertyGet()
1930 SuccessOrExit(error = mEncoder.WriteUintPacked(SPINEL_CAP_CONFIG_MTD)); in HandlePropertyGet()
1932 SuccessOrExit(error = mEncoder.WriteUintPacked(SPINEL_CAP_CONFIG_RADIO)); in HandlePropertyGet()
1936 SuccessOrExit(error = mEncoder.WriteUintPacked(SPINEL_CAP_MAC_RAW)); in HandlePropertyGet()
1940 SuccessOrExit(error = mEncoder.WriteUintPacked(SPINEL_CAP_RCP_API_VERSION)); in HandlePropertyGet()
1941 SuccessOrExit(error = mEncoder.WriteUintPacked(SPINEL_CAP_RCP_MIN_HOST_API_VERSION)); in HandlePropertyGet()
1945 SuccessOrExit(error = mEncoder.WriteUintPacked(SPINEL_CAP_RCP_RESET_TO_BOOTLOADER)); in HandlePropertyGet()
1949 SuccessOrExit(error = mEncoder.WriteUintPacked(SPINEL_CAP_POSIX)); in HandlePropertyGet()
1953 SuccessOrExit(error = mEncoder.WriteUintPacked(SPINEL_CAP_OPENTHREAD_LOG_METADATA)); in HandlePropertyGet()
1958 SuccessOrExit(error = mEncoder.WriteUintPacked(SPINEL_CAP_NET_THREAD_1_1)); in HandlePropertyGet()
1961 SuccessOrExit(error = mEncoder.WriteUintPacked(SPINEL_CAP_NET_THREAD_1_2)); in HandlePropertyGet()
1964 SuccessOrExit(error = mEncoder.WriteUintPacked(SPINEL_CAP_PCAP)); in HandlePropertyGet()
1967 SuccessOrExit(error = mEncoder.WriteUintPacked(SPINEL_CAP_MAC_ALLOWLIST)); in HandlePropertyGet()
1971 SuccessOrExit(error = mEncoder.WriteUintPacked(SPINEL_CAP_JAM_DETECT)); in HandlePropertyGet()
1974 SuccessOrExit(error = mEncoder.WriteUintPacked(SPINEL_CAP_CHILD_SUPERVISION)); in HandlePropertyGet()
1977 SuccessOrExit(error = mEncoder.WriteUintPacked(SPINEL_CAP_CHANNEL_MONITOR)); in HandlePropertyGet()
1981 SuccessOrExit(error = mEncoder.WriteUintPacked(SPINEL_CAP_CHANNEL_MANAGER)); in HandlePropertyGet()
1985 SuccessOrExit(error = mEncoder.WriteUintPacked(SPINEL_CAP_TIME_SYNC)); in HandlePropertyGet()
1988 SuccessOrExit(error = mEncoder.WriteUintPacked(SPINEL_CAP_ERROR_RATE_TRACKING)); in HandlePropertyGet()
1991 SuccessOrExit(error = mEncoder.WriteUintPacked(SPINEL_CAP_OOB_STEERING_DATA)); in HandlePropertyGet()
1995 SuccessOrExit(error = mEncoder.WriteUintPacked(SPINEL_CAP_SLAAC)); in HandlePropertyGet()
1999 SuccessOrExit(error = mEncoder.WriteUintPacked(SPINEL_CAP_RADIO_COEX)); in HandlePropertyGet()
2003 SuccessOrExit(error = mEncoder.WriteUintPacked(SPINEL_CAP_MAC_RETRY_HISTOGRAM)); in HandlePropertyGet()
2007 SuccessOrExit(error = mEncoder.WriteUintPacked(SPINEL_CAP_PEEK_POKE)); in HandlePropertyGet()
2011 SuccessOrExit(error = mEncoder.WriteUintPacked(SPINEL_CAP_ROLE_ROUTER)); in HandlePropertyGet()
2014 SuccessOrExit(error = mEncoder.WriteUintPacked(SPINEL_CAP_ROLE_SLEEPY)); in HandlePropertyGet()
2017 SuccessOrExit(error = mEncoder.WriteUintPacked(SPINEL_CAP_THREAD_COMMISSIONER)); in HandlePropertyGet()
2021 SuccessOrExit(error = mEncoder.WriteUintPacked(SPINEL_CAP_THREAD_JOINER)); in HandlePropertyGet()
2025 SuccessOrExit(error = mEncoder.WriteUintPacked(SPINEL_CAP_THREAD_BORDER_ROUTER)); in HandlePropertyGet()
2029 SuccessOrExit(error = mEncoder.WriteUintPacked(SPINEL_CAP_THREAD_UDP_FORWARD)); in HandlePropertyGet()
2033 SuccessOrExit(error = mEncoder.WriteUintPacked(SPINEL_CAP_THREAD_SERVICE)); in HandlePropertyGet()
2037 SuccessOrExit(error = mEncoder.WriteUintPacked(SPINEL_CAP_THREAD_CSL_RECEIVER)); in HandlePropertyGet()
2041 SuccessOrExit(error = mEncoder.WriteUintPacked(SPINEL_CAP_MULTI_RADIO)); in HandlePropertyGet()
2045 SuccessOrExit(error = mEncoder.WriteUintPacked(SPINEL_CAP_SRP_CLIENT)); in HandlePropertyGet()
2049 SuccessOrExit(error = mEncoder.WriteUintPacked(SPINEL_CAP_THREAD_LINK_METRICS)); in HandlePropertyGet()
2053 SuccessOrExit(error = mEncoder.WriteUintPacked(SPINEL_CAP_DUA)); in HandlePropertyGet()
2057 SuccessOrExit(error = mEncoder.WriteUintPacked(SPINEL_CAP_REFERENCE_DEVICE)); in HandlePropertyGet()
2061 SuccessOrExit(error = mEncoder.WriteUintPacked(SPINEL_CAP_THREAD_BACKBONE_ROUTER)); in HandlePropertyGet()
2067 return error; in HandlePropertyGet()
2118 otError error = OT_ERROR_NONE; in HandlePropertySet() local
2122 SuccessOrExit(error = mDecoder.ReadUint8(state)); in HandlePropertySet()
2139 ExitNow(error = OT_ERROR_INVALID_ARGS); in HandlePropertySet()
2142 SuccessOrExit(error = otPlatSetMcuPowerState(mInstance, powerState)); in HandlePropertySet()
2165 return error; in HandlePropertySet()
2213 otError error = OT_ERROR_NONE; in HandlePropertySet_SPINEL_PROP_HOST_POWER_STATE() local
2215 error = mDecoder.ReadUint8(powerState); in HandlePropertySet_SPINEL_PROP_HOST_POWER_STATE()
2217 if (error == OT_ERROR_NONE) in HandlePropertySet_SPINEL_PROP_HOST_POWER_STATE()
2242 error = WritePropertyValueIsFrame(aHeader, SPINEL_PROP_HOST_POWER_STATE); in HandlePropertySet_SPINEL_PROP_HOST_POWER_STATE()
2246 if (error == OT_ERROR_NONE) in HandlePropertySet_SPINEL_PROP_HOST_POWER_STATE()
2258 if (error != OT_ERROR_NONE) in HandlePropertySet_SPINEL_PROP_HOST_POWER_STATE()
2266 error = OT_ERROR_NONE; in HandlePropertySet_SPINEL_PROP_HOST_POWER_STATE()
2271 error = WriteLastStatusFrame(aHeader, ThreadErrorToSpinelStatus(error)); in HandlePropertySet_SPINEL_PROP_HOST_POWER_STATE()
2274 return error; in HandlePropertySet_SPINEL_PROP_HOST_POWER_STATE()
2279 otError error = OT_ERROR_NONE; in HandlePropertyGet() local
2289 SuccessOrExit(error = mEncoder.WriteUintPacked(entry->mPropKey)); in HandlePropertyGet()
2294 return error; in HandlePropertyGet()
2331 otError error = OT_ERROR_NONE; in HandlePropertyGet() local
2333 error = otPlatRadioGetCcaEnergyDetectThreshold(mInstance, &threshold); in HandlePropertyGet()
2335 if (error == OT_ERROR_NONE) in HandlePropertyGet()
2337 error = mEncoder.WriteInt8(threshold); in HandlePropertyGet()
2341 error = mEncoder.OverwriteWithLastStatusError(ThreadErrorToSpinelStatus(error)); in HandlePropertyGet()
2344 return error; in HandlePropertyGet()
2350 otError error = OT_ERROR_NONE; in HandlePropertySet() local
2352 SuccessOrExit(error = mDecoder.ReadInt8(threshold)); in HandlePropertySet()
2353 error = otPlatRadioSetCcaEnergyDetectThreshold(mInstance, threshold); in HandlePropertySet()
2356 return error; in HandlePropertySet()
2362 otError error; in HandlePropertyGet() local
2364 error = otPlatRadioGetTransmitPower(mInstance, &power); in HandlePropertyGet()
2366 if (error == OT_ERROR_NONE) in HandlePropertyGet()
2368 error = mEncoder.WriteInt8(power); in HandlePropertyGet()
2372 error = mEncoder.OverwriteWithLastStatusError(ThreadErrorToSpinelStatus(error)); in HandlePropertyGet()
2375 return error; in HandlePropertyGet()
2381 otError error = OT_ERROR_NONE; in HandlePropertySet() local
2383 SuccessOrExit(error = mDecoder.ReadInt8(txPower)); in HandlePropertySet()
2384 error = otPlatRadioSetTransmitPower(mInstance, txPower); in HandlePropertySet()
2387 return error; in HandlePropertySet()
2393 otError error = OT_ERROR_NONE; in HandlePropertyGet() local
2395 error = otPlatRadioGetFemLnaGain(mInstance, &gain); in HandlePropertyGet()
2397 if (error == OT_ERROR_NONE) in HandlePropertyGet()
2399 error = mEncoder.WriteInt8(gain); in HandlePropertyGet()
2403 error = mEncoder.OverwriteWithLastStatusError(ThreadErrorToSpinelStatus(error)); in HandlePropertyGet()
2406 return error; in HandlePropertyGet()
2412 otError error = OT_ERROR_NONE; in HandlePropertySet() local
2414 SuccessOrExit(error = mDecoder.ReadInt8(gain)); in HandlePropertySet()
2415 error = otPlatRadioSetFemLnaGain(mInstance, gain); in HandlePropertySet()
2418 return error; in HandlePropertySet()
2425 otError error = OT_ERROR_NONE; in HandlePropertySet() local
2427 SuccessOrExit(error = mDecoder.ReadUint8(channel)); in HandlePropertySet()
2428 SuccessOrExit(error = mDecoder.ReadInt8(maxPower)); in HandlePropertySet()
2429 error = otPlatRadioSetChannelMaxTransmitPower(mInstance, channel, maxPower); in HandlePropertySet()
2432 return error; in HandlePropertySet()
2438 otError error = OT_ERROR_NONE; in HandlePropertyGet() local
2440 error = otPlatRadioGetRegion(mInstance, &regionCode); in HandlePropertyGet()
2441 if (error == OT_ERROR_NONE) in HandlePropertyGet()
2443 error = mEncoder.WriteUint16(regionCode); in HandlePropertyGet()
2447 error = mEncoder.OverwriteWithLastStatusError(ThreadErrorToSpinelStatus(error)); in HandlePropertyGet()
2450 return error; in HandlePropertyGet()
2456 otError error = OT_ERROR_NONE; in HandlePropertySet() local
2458 SuccessOrExit(error = mDecoder.ReadUint16(regionCode)); in HandlePropertySet()
2459 error = otPlatRadioSetRegion(mInstance, regionCode); in HandlePropertySet()
2462 return error; in HandlePropertySet()
2497 otError error; in HandlePropertySet() local
2501 SuccessOrExit(error = mDecoder.ReadUint8(spinelNcpLogLevel)); in HandlePropertySet()
2532 ExitNow(error = OT_ERROR_INVALID_ARGS); in HandlePropertySet()
2538 return error; in HandlePropertySet()
2545 otError error = OT_ERROR_NONE; in HandlePropertySet() local
2548 SuccessOrExit(error = mDecoder.ReadUint64(timestampBase)); in HandlePropertySet()
2549 VerifyOrExit(timestampBase >= currentTime, error = OT_ERROR_INVALID_ARGS); in HandlePropertySet()
2554 return error; in HandlePropertySet()
2580 otError error = OT_ERROR_NONE; in HandlePropertySet() local
2582 SuccessOrExit(error = mDecoder.ReadBool(enabled)); in HandlePropertySet()
2583 error = otPlatRadioSetCoexEnabled(mInstance, enabled); in HandlePropertySet()
2586 return error; in HandlePropertySet()
2597 otError error = otPlatRadioGetCoexMetrics(mInstance, &coexMetrics); in HandlePropertyGet() local
2599 if (error != OT_ERROR_NONE) in HandlePropertyGet()
2601 error = mEncoder.OverwriteWithLastStatusError(ThreadErrorToSpinelStatus(error)); in HandlePropertyGet()
2606 SuccessOrExit(error = mEncoder.OpenStruct()); in HandlePropertyGet()
2607 SuccessOrExit(error = mEncoder.WriteUint32(coexMetrics.mNumTxRequest)); in HandlePropertyGet()
2608 SuccessOrExit(error = mEncoder.WriteUint32(coexMetrics.mNumTxGrantImmediate)); in HandlePropertyGet()
2609 SuccessOrExit(error = mEncoder.WriteUint32(coexMetrics.mNumTxGrantWait)); in HandlePropertyGet()
2610 SuccessOrExit(error = mEncoder.WriteUint32(coexMetrics.mNumTxGrantWaitActivated)); in HandlePropertyGet()
2611 SuccessOrExit(error = mEncoder.WriteUint32(coexMetrics.mNumTxGrantWaitTimeout)); in HandlePropertyGet()
2612 SuccessOrExit(error = mEncoder.WriteUint32(coexMetrics.mNumTxGrantDeactivatedDuringRequest)); in HandlePropertyGet()
2613 SuccessOrExit(error = mEncoder.WriteUint32(coexMetrics.mNumTxDelayedGrant)); in HandlePropertyGet()
2614 SuccessOrExit(error = mEncoder.WriteUint32(coexMetrics.mAvgTxRequestToGrantTime)); in HandlePropertyGet()
2615 SuccessOrExit(error = mEncoder.CloseStruct()); in HandlePropertyGet()
2618 SuccessOrExit(error = mEncoder.OpenStruct()); in HandlePropertyGet()
2619 SuccessOrExit(error = mEncoder.WriteUint32(coexMetrics.mNumRxRequest)); in HandlePropertyGet()
2620 SuccessOrExit(error = mEncoder.WriteUint32(coexMetrics.mNumRxGrantImmediate)); in HandlePropertyGet()
2621 SuccessOrExit(error = mEncoder.WriteUint32(coexMetrics.mNumRxGrantWait)); in HandlePropertyGet()
2622 SuccessOrExit(error = mEncoder.WriteUint32(coexMetrics.mNumRxGrantWaitActivated)); in HandlePropertyGet()
2623 SuccessOrExit(error = mEncoder.WriteUint32(coexMetrics.mNumRxGrantWaitTimeout)); in HandlePropertyGet()
2624 SuccessOrExit(error = mEncoder.WriteUint32(coexMetrics.mNumRxGrantDeactivatedDuringRequest)); in HandlePropertyGet()
2625 SuccessOrExit(error = mEncoder.WriteUint32(coexMetrics.mNumRxDelayedGrant)); in HandlePropertyGet()
2626 SuccessOrExit(error = mEncoder.WriteUint32(coexMetrics.mAvgRxRequestToGrantTime)); in HandlePropertyGet()
2627 SuccessOrExit(error = mEncoder.WriteUint32(coexMetrics.mNumRxGrantNone)); in HandlePropertyGet()
2628 SuccessOrExit(error = mEncoder.CloseStruct()); in HandlePropertyGet()
2631 SuccessOrExit(error = mEncoder.WriteBool(coexMetrics.mStopped)); in HandlePropertyGet()
2632 SuccessOrExit(error = mEncoder.WriteUint32(coexMetrics.mNumGrantGlitch)); in HandlePropertyGet()
2635 return error; in HandlePropertyGet()
2642 otError error = OT_ERROR_NONE; in DecodeLinkMetrics() local
2645 SuccessOrExit(error = mDecoder.ReadUint8(metrics)); in DecodeLinkMetrics()
2649 VerifyOrExit(aAllowPduCount, error = OT_ERROR_INVALID_ARGS); in DecodeLinkMetrics()
2669 return error; in DecodeLinkMetrics()
2676 otError error; in HandlePropertySet() local
2680 SuccessOrExit(error = mDecoder.ReadUint8(channel)); in HandlePropertySet()
2681 SuccessOrExit(error = mDecoder.ReadInt16(targetPower)); in HandlePropertySet()
2682 error = otPlatRadioSetChannelTargetPower(mInstance, channel, targetPower); in HandlePropertySet()
2685 return error; in HandlePropertySet()
2690 otError error; in HandlePropertyInsert() local
2696 SuccessOrExit(error = mDecoder.ReadUint8(channel)); in HandlePropertyInsert()
2697 SuccessOrExit(error = mDecoder.ReadInt16(actualPower)); in HandlePropertyInsert()
2698 SuccessOrExit(error = mDecoder.ReadDataWithLen(dataPtr, dataLen)); in HandlePropertyInsert()
2699 error = otPlatRadioAddCalibratedPower(mInstance, channel, actualPower, dataPtr, dataLen); in HandlePropertyInsert()
2702 return error; in HandlePropertyInsert()
2736 otError error = OT_ERROR_INVALID_STATE; in otNcpStreamWrite() local
2741 error = ncp->StreamWrite(aStreamId, aDataPtr, aDataLen); in otNcpStreamWrite()
2744 return error; in otNcpStreamWrite()