/openthread-latest/tests/unit/ |
D | test_tcat.cpp | 120 Instance *instance = testInitInstance(); in TestTcat() local 124 …otBleSecureSetCertificate(instance, reinterpret_cast<const uint8_t *>(OT_TCAT_X509_CERT), sizeof(O… in TestTcat() 127 …otBleSecureSetCaCertificateChain(instance, reinterpret_cast<const uint8_t *>(OT_TCAT_TRUSTED_ROOT_… in TestTcat() 130 otBleSecureSetSslAuthMode(instance, true); in TestTcat() 133 SuccessOrQuit(otBleSecureSetTcatVendorInfo(instance, &vendorInfo)); in TestTcat() 134 VerifyOrQuit(otBleSecureTcatStart(instance, nullptr) == kErrorInvalidState); in TestTcat() 135 SuccessOrQuit(otBleSecureStart(instance, HandleBleSecureConnect, nullptr, true, &ble)); in TestTcat() 136 …VerifyOrQuit(otBleSecureStart(instance, HandleBleSecureConnect, nullptr, true, nullptr) == kErrorA… in TestTcat() 137 SuccessOrQuit(otBleSecureTcatStart(instance, nullptr)); in TestTcat() 140 VerifyOrQuit(!otBleSecureIsConnected(instance)); in TestTcat() [all …]
|
D | test_power_calibration.cpp | 40 otInstance *instance; in TestPowerCalibration() local 58 instance = static_cast<otInstance *>(testInitInstance()); in TestPowerCalibration() 59 VerifyOrQuit(instance != nullptr, "Null OpenThread instance"); in TestPowerCalibration() 63 …SuccessOrQuit(otPlatRadioAddCalibratedPower(instance, calibratedPower.mChannel, calibratedPower.mA… in TestPowerCalibration() 68 SuccessOrQuit(otPlatRadioSetChannelTargetPower(instance, 11, 4999)); in TestPowerCalibration() 70 …SuccessOrQuit(otPlatRadioGetRawPowerSetting(instance, 11, rawPowerSetting, &rawPowerSettingLength)… in TestPowerCalibration() 74 SuccessOrQuit(otPlatRadioSetChannelTargetPower(instance, 11, 5000)); in TestPowerCalibration() 76 …SuccessOrQuit(otPlatRadioGetRawPowerSetting(instance, 11, rawPowerSetting, &rawPowerSettingLength)… in TestPowerCalibration() 80 SuccessOrQuit(otPlatRadioSetChannelTargetPower(instance, 11, 9999)); in TestPowerCalibration() 82 …SuccessOrQuit(otPlatRadioGetRawPowerSetting(instance, 11, rawPowerSetting, &rawPowerSettingLength)… in TestPowerCalibration() [all …]
|
D | test_mle.cpp | 43 Instance *instance; in TestDefaultDeviceProperties() local 47 instance = static_cast<Instance *>(testInitInstance()); in TestDefaultDeviceProperties() 48 VerifyOrQuit(instance != nullptr); in TestDefaultDeviceProperties() 50 props = otThreadGetDeviceProperties(instance); in TestDefaultDeviceProperties() 81 VerifyOrQuit(otThreadGetLocalLeaderWeight(instance) == weight); in TestDefaultDeviceProperties() 158 Instance *instance; in TestLeaderWeightCalculation() local 160 instance = static_cast<Instance *>(testInitInstance()); in TestLeaderWeightCalculation() 161 VerifyOrQuit(instance != nullptr); in TestLeaderWeightCalculation() 165 otThreadSetDeviceProperties(instance, &testCase.mDeviceProperties); in TestLeaderWeightCalculation() 166 … CompareDevicePropertiess(testCase.mDeviceProperties, *otThreadGetDeviceProperties(instance)); in TestLeaderWeightCalculation() [all …]
|
D | test_timer.cpp | 141 Instance *instance = testInitInstance(); in TestOneTimer() local 142 TestTimer<TimerType> timer(*instance); in TestOneTimer() 146 TestTimer<TimerType>::RemoveAll(*instance); in TestOneTimer() 163 AlarmFired<TimerType>(instance); in TestOneTimer() 187 AlarmFired<TimerType>(instance); in TestOneTimer() 211 AlarmFired<TimerType>(instance); in TestOneTimer() 235 AlarmFired<TimerType>(instance); in TestOneTimer() 245 AlarmFired<TimerType>(instance); in TestOneTimer() 255 testFreeInstance(instance); in TestOneTimer() 267 Instance *instance = testInitInstance(); in TestTwoTimers() local [all …]
|
D | test_ncp_srp_server.cpp | 68 Instance *instance = static_cast<Instance *>(testInitInstance()); in TestNcpSrpServerSetEnabled() local 69 Ncp::NcpBase ncpBase(instance); in TestNcpSrpServerSetEnabled() 75 state = otSrpServerGetState(instance); in TestNcpSrpServerSetEnabled() 80 state = otSrpServerGetState(instance); in TestNcpSrpServerSetEnabled() 85 state = otSrpServerGetState(instance); in TestNcpSrpServerSetEnabled() 94 Instance *instance = static_cast<Instance *>(testInitInstance()); in TestNcpSrpServerSetAutoEnableMode() local 95 Ncp::NcpBase ncpBase(instance); in TestNcpSrpServerSetAutoEnableMode() 101 isAutoEnableMode = otSrpServerIsAutoEnableMode(instance); in TestNcpSrpServerSetAutoEnableMode() 106 isAutoEnableMode = otSrpServerIsAutoEnableMode(instance); in TestNcpSrpServerSetAutoEnableMode() 111 isAutoEnableMode = otSrpServerIsAutoEnableMode(instance); in TestNcpSrpServerSetAutoEnableMode()
|
D | test_ncp_dnssd.cpp | 99 Instance *instance = static_cast<Instance *>(testInitInstance()); in TestNcpDnssdGetState() local 100 Ncp::NcpBase ncpBase(instance); in TestNcpDnssdGetState() 106 dnssdState = otPlatDnssdGetState(instance); in TestNcpDnssdGetState() 111 dnssdState = otPlatDnssdGetState(instance); in TestNcpDnssdGetState() 117 Instance *instance = static_cast<Instance *>(testInitInstance()); in TestNcpDnssdRegistrations() local 118 Ncp::NcpBase ncpBase(instance); in TestNcpDnssdRegistrations() 131 … otPlatDnssdRegisterHost(instance, &dnssdHost, 1 /* aRequestId */, TestPlatDnssdRegisterCallback); in TestNcpDnssdRegistrations() 139 …otPlatDnssdUnregisterHost(instance, &dnssdHost, 2 /* aRequestId */, TestPlatDnssdRegisterCallback); in TestNcpDnssdRegistrations() 151 …otPlatDnssdRegisterService(instance, &dnssdService, 3 /* aRequestId */, TestPlatDnssdRegisterCallb… in TestNcpDnssdRegistrations() 159 …otPlatDnssdUnregisterService(instance, &dnssdService, 3 /* aRequestId */, TestPlatDnssdRegisterCal… in TestNcpDnssdRegistrations() [all …]
|
D | test_pskc.cpp | 50 Instance *instance = testInitInstance(); in TestMinimumPassphrase() local 56 testFreeInstance(instance); in TestMinimumPassphrase() 84 Instance *instance = testInitInstance(); in TestMaximumPassphrase() local 90 testFreeInstance(instance); in TestMaximumPassphrase() 102 Instance *instance = testInitInstance(); in TestExampleInSpec() local 108 testFreeInstance(instance); in TestExampleInSpec()
|
D | test_aes.cpp | 60 otInstance *instance = testInitInstance(); in TestMacBeaconFrame() local 70 VerifyOrQuit(instance != nullptr); in TestMacBeaconFrame() 87 testFreeInstance(instance); in TestMacBeaconFrame() 127 Instance *instance = testInitInstance(); in TestMacCommandFrame() local 131 VerifyOrQuit(instance != nullptr); in TestMacCommandFrame() 151 message = instance->Get<MessagePool>().Allocate(Message::kTypeIp6); in TestMacCommandFrame() 174 testFreeInstance(instance); in TestMacCommandFrame() 199 Instance *instance = testInitInstance(); in TestInPlaceAesCcmProcessing() local 203 VerifyOrQuit(instance != nullptr); in TestInPlaceAesCcmProcessing() 205 message = instance->Get<MessagePool>().Allocate(Message::kTypeIp6); in TestInPlaceAesCcmProcessing() [all …]
|
D | test_network_data.cpp | 110 Instance *instance; in TestNetworkDataIterator() local 116 instance = testInitInstance(); in TestNetworkDataIterator() 117 VerifyOrQuit(instance != nullptr); in TestNetworkDataIterator() 157 NetworkData netData(*instance, kNetworkData, sizeof(kNetworkData)); in TestNetworkDataIterator() 279 NetworkData netData(*instance, kNetworkData, sizeof(kNetworkData)); in TestNetworkDataIterator() 447 NetworkData netData(*instance, kNetworkData, sizeof(kNetworkData)); in TestNetworkDataIterator() 502 testFreeInstance(instance); in TestNetworkDataIterator() 597 Instance *instance; in TestNetworkDataFindNextService() local 602 instance = testInitInstance(); in TestNetworkDataFindNextService() 603 VerifyOrQuit(instance != nullptr); in TestNetworkDataFindNextService() [all …]
|
D | test_trickle_timer.cpp | 109 Instance *instance = testInitInstance(); in TestTrickleTimerPlainMode() local 110 TrickleTimerTester timer(*instance); in TestTrickleTimerPlainMode() 113 sInstance = instance; in TestTrickleTimerPlainMode() 114 TrickleTimerTester::RemoveAll(*instance); in TestTrickleTimerPlainMode() 147 testFreeInstance(instance); in TestTrickleTimerPlainMode() 155 Instance *instance = testInitInstance(); in TestTrickleTimerTrickleMode() local 156 TrickleTimerTester timer(*instance); in TestTrickleTimerTrickleMode() 160 sInstance = instance; in TestTrickleTimerTrickleMode() 161 TrickleTimerTester::RemoveAll(*instance); in TestTrickleTimerTrickleMode() 233 testFreeInstance(instance); in TestTrickleTimerTrickleMode() [all …]
|
D | test_ncp_infra_if.cpp | 79 Instance *instance = static_cast<Instance *>(testInitInstance()); in TestNcpInfraIfSetUp() local 80 Ncp::NcpBase ncpBase(instance); in TestNcpInfraIfSetUp() 90 VerifyOrQuit(otBorderRoutingGetState(instance) == OT_BORDER_ROUTING_STATE_UNINITIALIZED); in TestNcpInfraIfSetUp() 96 VerifyOrQuit(otBorderRoutingGetState(instance) == OT_BORDER_ROUTING_STATE_STOPPED); in TestNcpInfraIfSetUp() 103 VerifyOrQuit(otBorderRoutingGetState(instance) == OT_BORDER_ROUTING_STATE_STOPPED); in TestNcpInfraIfSetUp() 111 Instance *instance = static_cast<Instance *>(testInitInstance()); in TestNcpInfraIfUpdate() local 112 Ncp::NcpBase ncpBase(instance); in TestNcpInfraIfUpdate()
|
D | test_hmac_sha256.cpp | 88 Instance *instance = testInitInstance(); in TestSha256() local 94 VerifyOrQuit(instance != nullptr); in TestSha256() 96 messagePool = &instance->Get<MessagePool>(); in TestSha256() 137 testFreeInstance(instance); in TestSha256() 229 Instance *instance = testInitInstance(); in TestHmacSha256() local 237 VerifyOrQuit(instance != nullptr); in TestHmacSha256() 239 messagePool = &instance->Get<MessagePool>(); in TestHmacSha256() 282 testFreeInstance(instance); in TestHmacSha256()
|
/openthread-latest/src/posix/platform/ |
D | settings.cpp | 276 otInstance *instance = nullptr; in main() local 284 otPlatSettingsInit(instance, nullptr, 0); in main() 287 otPlatSettingsWipe(instance); in main() 292 assert(otPlatSettingsGet(instance, 0, 0, value, &length) == OT_ERROR_NOT_FOUND); in main() 293 assert(otPlatSettingsDelete(instance, 0, 0) == OT_ERROR_NOT_FOUND); in main() 294 assert(otPlatSettingsDelete(instance, 0, -1) == OT_ERROR_NOT_FOUND); in main() 298 assert(otPlatSettingsSet(instance, 0, data, sizeof(data) / 2) == OT_ERROR_NONE); in main() 303 assert(otPlatSettingsGet(instance, 0, 0, nullptr, nullptr) == OT_ERROR_NONE); in main() 304 assert(otPlatSettingsGet(instance, 0, 0, nullptr, &length) == OT_ERROR_NONE); in main() 308 assert(otPlatSettingsGet(instance, 0, 0, value, &length) == OT_ERROR_NONE); in main() [all …]
|
/openthread-latest/tests/fuzz/ |
D | ip6_send.cpp | 64 otInstance *instance = nullptr; in LLVMFuzzerTestOneInput() local 73 instance = otInstanceInitSingle(); in LLVMFuzzerTestOneInput() 74 IgnoreError(otLinkSetPanId(instance, panId)); in LLVMFuzzerTestOneInput() 75 IgnoreError(otIp6SetEnabled(instance, true)); in LLVMFuzzerTestOneInput() 76 IgnoreError(otThreadSetEnabled(instance, true)); in LLVMFuzzerTestOneInput() 77 otSrpServerSetEnabled(instance, true); in LLVMFuzzerTestOneInput() 78 IgnoreError(otThreadBecomeLeader(instance)); in LLVMFuzzerTestOneInput() 80 AdvanceTime(instance, 10000); in LLVMFuzzerTestOneInput() 85 message = otIp6NewMessage(instance, &settings); in LLVMFuzzerTestOneInput() 91 error = otIp6Send(instance, message); in LLVMFuzzerTestOneInput() [all …]
|
D | ncp_hdlc_received.cpp | 73 otInstance *instance = nullptr; in LLVMFuzzerTestOneInput() local 80 instance = otInstanceInitSingle(); in LLVMFuzzerTestOneInput() 81 otNcpHdlcInit(instance, HdlcSend); in LLVMFuzzerTestOneInput() 82 IgnoreError(otLinkSetPanId(instance, panId)); in LLVMFuzzerTestOneInput() 83 IgnoreError(otIp6SetEnabled(instance, true)); in LLVMFuzzerTestOneInput() 84 IgnoreError(otThreadSetEnabled(instance, true)); in LLVMFuzzerTestOneInput() 85 otSrpServerSetEnabled(instance, true); in LLVMFuzzerTestOneInput() 86 IgnoreError(otThreadBecomeLeader(instance)); in LLVMFuzzerTestOneInput() 88 AdvanceTime(instance, 10000); in LLVMFuzzerTestOneInput() 96 AdvanceTime(instance, 10000); in LLVMFuzzerTestOneInput() [all …]
|
D | radio_receive_done.cpp | 64 otInstance *instance = nullptr; in LLVMFuzzerTestOneInput() local 72 instance = otInstanceInitSingle(); in LLVMFuzzerTestOneInput() 73 IgnoreError(otLinkSetPanId(instance, panId)); in LLVMFuzzerTestOneInput() 74 IgnoreError(otIp6SetEnabled(instance, true)); in LLVMFuzzerTestOneInput() 75 IgnoreError(otThreadSetEnabled(instance, true)); in LLVMFuzzerTestOneInput() 76 IgnoreError(otThreadBecomeLeader(instance)); in LLVMFuzzerTestOneInput() 78 AdvanceTime(instance, 10000); in LLVMFuzzerTestOneInput() 87 otPlatRadioReceiveDone(instance, &frame, OT_ERROR_NONE); in LLVMFuzzerTestOneInput() 91 AdvanceTime(instance, 10000); in LLVMFuzzerTestOneInput() 100 if (instance != nullptr) in LLVMFuzzerTestOneInput() [all …]
|
D | cli_received.cpp | 75 otInstance *instance = nullptr; in LLVMFuzzerTestOneInput() local 82 instance = otInstanceInitSingle(); in LLVMFuzzerTestOneInput() 83 otCliInit(instance, CliOutput, nullptr); in LLVMFuzzerTestOneInput() 84 IgnoreError(otLinkSetPanId(instance, panId)); in LLVMFuzzerTestOneInput() 85 IgnoreError(otIp6SetEnabled(instance, true)); in LLVMFuzzerTestOneInput() 86 IgnoreError(otThreadSetEnabled(instance, true)); in LLVMFuzzerTestOneInput() 87 IgnoreError(otThreadBecomeLeader(instance)); in LLVMFuzzerTestOneInput() 89 AdvanceTime(instance, 10000); in LLVMFuzzerTestOneInput() 99 AdvanceTime(instance, 10000); in LLVMFuzzerTestOneInput() 108 if (instance != nullptr) in LLVMFuzzerTestOneInput() [all …]
|
/openthread-latest/src/core/api/ |
D | link_raw_api.cpp | 66 Instance &instance = AsCoreType(aInstance); in otLinkRawSetPromiscuous() local 68 VerifyOrExit(instance.Get<Mac::LinkRaw>().IsEnabled(), error = kErrorInvalidState); in otLinkRawSetPromiscuous() 69 instance.Get<Radio>().SetPromiscuous(aEnable); in otLinkRawSetPromiscuous() 78 Instance &instance = AsCoreType(aInstance); in otLinkRawSleep() local 80 VerifyOrExit(instance.Get<Mac::LinkRaw>().IsEnabled(), error = kErrorInvalidState); in otLinkRawSleep() 82 error = instance.Get<Radio>().Sleep(); in otLinkRawSleep() 115 Instance &instance = AsCoreType(aInstance); in otLinkRawSrcMatchEnable() local 117 VerifyOrExit(instance.Get<Mac::LinkRaw>().IsEnabled(), error = kErrorInvalidState); in otLinkRawSrcMatchEnable() 119 instance.Get<Radio>().EnableSrcMatch(aEnable); in otLinkRawSrcMatchEnable() 128 Instance &instance = AsCoreType(aInstance); in otLinkRawSrcMatchAddShortEntry() local [all …]
|
D | link_api.cpp | 42 Instance &instance = AsCoreType(aInstance); in otLinkGetChannel() local 46 if (instance.Get<Mac::LinkRaw>().IsEnabled()) in otLinkGetChannel() 48 channel = instance.Get<Mac::LinkRaw>().GetChannel(); in otLinkGetChannel() 53 channel = instance.Get<Mac::Mac>().GetPanChannel(); in otLinkGetChannel() 62 Instance &instance = AsCoreType(aInstance); in otLinkSetChannel() local 65 if (instance.Get<Mac::LinkRaw>().IsEnabled()) in otLinkSetChannel() 67 error = instance.Get<Mac::LinkRaw>().SetChannel(aChannel); in otLinkSetChannel() 72 VerifyOrExit(instance.Get<Mle::MleRouter>().IsDisabled(), error = kErrorInvalidState); in otLinkSetChannel() 74 SuccessOrExit(error = instance.Get<Mac::Mac>().SetPanChannel(aChannel)); in otLinkSetChannel() 75 instance.Get<MeshCoP::ActiveDatasetManager>().Clear(); in otLinkSetChannel() [all …]
|
/openthread-latest/examples/apps/ncp/ |
D | main.c | 71 otInstance *instance; in main() local 99 instance = instances[0]; in main() 110 instance = otInstanceInit(otInstanceBuffer, &otInstanceBufferLength); in main() 112 instance = otInstanceInitSingle(); in main() 114 assert(instance); in main() 119 otAppNcpInit(instance); in main() 124 otTaskletsProcess(instance); in main() 125 otSysProcessDrivers(instance); in main() 128 otInstanceFinalize(instance); in main()
|
/openthread-latest/examples/apps/cli/ |
D | main.c | 107 otInstance *instance; in main() local 135 instance = otInstanceInit(otInstanceBuffer, &otInstanceBufferLength); in main() 137 instance = otInstanceInitSingle(); in main() 139 assert(instance); in main() 141 otAppCliInit(instance); in main() 144 IgnoreError(otCliSetUserCommands(kCommands, OT_ARRAY_LENGTH(kCommands), instance)); in main() 153 otTaskletsProcess(instance); in main() 154 otSysProcessDrivers(instance); in main() 157 otInstanceFinalize(instance); in main()
|
/openthread-latest/src/core/instance/ |
D | instance.cpp | 308 Instance *instance = &Get(); in InitSingle() local 310 VerifyOrExit(!instance->mIsInitialized); in InitSingle() 312 instance = new (&gInstanceRaw) Instance(); in InitSingle() 314 instance->AfterInit(); in InitSingle() 317 return *instance; in InitSingle() 322 void *instance = &gInstanceRaw; in Get() local 324 return *static_cast<Instance *>(instance); in Get() 334 Instance *instance = reinterpret_cast<Instance *>(instanceBuffer); in InitMultiple() local 337 VerifyOrExit(!instance->mIsInitialized); in InitMultiple() 340 instance = Instance::Init(instanceBuffer, &bufferSize); in InitMultiple() [all …]
|
/openthread-latest/src/core/radio/ |
D | radio_platform.cpp | 48 Instance &instance = AsCoreType(aInstance); in otPlatRadioReceiveDone() local 51 VerifyOrExit(instance.IsInitialized()); in otPlatRadioReceiveDone() 60 instance.Get<Radio::Callbacks>().HandleReceiveDone(rxFrame, aError); in otPlatRadioReceiveDone() 68 Instance &instance = AsCoreType(aInstance); in otPlatRadioTxStarted() local 71 VerifyOrExit(instance.IsInitialized()); in otPlatRadioTxStarted() 77 instance.Get<Radio::Callbacks>().HandleTransmitStarted(txFrame); in otPlatRadioTxStarted() 85 Instance &instance = AsCoreType(aInstance); in otPlatRadioTxDone() local 89 VerifyOrExit(instance.IsInitialized()); in otPlatRadioTxDone() 100 instance.Get<Radio::Callbacks>().HandleTransmitDone(txFrame, ackFrame, aError); in otPlatRadioTxDone() 108 Instance &instance = AsCoreType(aInstance); in otPlatRadioEnergyScanDone() local [all …]
|
/openthread-latest/src/posix/ |
D | main.c | 285 otInstance *instance = NULL; in InitInstance() local 291 instance = otSysInit(&aConfig->mPlatformConfig); in InitInstance() 292 VerifyOrDie(instance != NULL, OT_EXIT_FAILURE); in InitInstance() 303 printf("%s\n", otPlatRadioGetVersionString(instance)); in InitInstance() 307 syslog(LOG_INFO, "RCP version: %s", otPlatRadioGetVersionString(instance)); in InitInstance() 315 return instance; in InitInstance() 363 otInstance *instance; in main() local 378 instance = InitInstance(&config); in main() 381 otAppCliInit(instance); in main() 385 IgnoreError(otCliSetUserCommands(kCommands, OT_ARRAY_LENGTH(kCommands), instance)); in main() [all …]
|
/openthread-latest/tests/scripts/thread-cert/ |
D | test_dnssd.py | 212 def _assert_service_instance_equal(self, instance, info): argument 213 self.assertEqual(instance['host'].lower(), info['host'].lower(), instance) 215 self.assertEqual(instance[f], info[f], instance) 220 …self.assertIn(ipaddress.IPv6Address(instance['address']), map(ipaddress.IPv6Address, verify_addres… 221 instance) 228 self.assertTrue(check_ttl(instance[ttl_f]), instance)
|