Home
last modified time | relevance | path

Searched refs:instance (Results 1 – 25 of 83) sorted by relevance

1234

/openthread-latest/tests/unit/
Dtest_tcat.cpp120 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 …]
Dtest_power_calibration.cpp40 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 …]
Dtest_mle.cpp43 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 …]
Dtest_timer.cpp141 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 …]
Dtest_pskc.cpp50 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()
Dtest_aes.cpp60 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()
200 Instance *instance = testInitInstance(); in TestInPlaceAesCcmProcessing() local
204 VerifyOrQuit(instance != nullptr); in TestInPlaceAesCcmProcessing()
206 message = instance->Get<MessagePool>().Allocate(Message::kTypeIp6); in TestInPlaceAesCcmProcessing()
[all …]
Dtest_network_data.cpp110 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 …]
Dtest_trickle_timer.cpp109 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 …]
Dtest_hmac_sha256.cpp88 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()
Dtest_ecdsa.cpp78 Instance *instance = testInitInstance(); in TestEcdsaVector() local
86 VerifyOrQuit(instance != nullptr, "Null OpenThread instance"); in TestEcdsaVector()
129 testFreeInstance(instance); in TestEcdsaVector()
134 Instance *instance = testInitInstance(); in TestEcdsaKeyGenerationSignAndVerify() local
144 VerifyOrQuit(instance != nullptr, "Null OpenThread instance"); in TestEcdsaKeyGenerationSignAndVerify()
178 testFreeInstance(instance); in TestEcdsaKeyGenerationSignAndVerify()
/openthread-latest/tests/fuzz/
Dip6_send.cpp64 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 …]
Dncp_hdlc_received.cpp73 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 …]
Dradio_receive_done.cpp64 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 …]
Dcli_received.cpp75 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/
Dlink_raw_api.cpp69 Instance &instance = AsCoreType(aInstance); in otLinkRawSetPromiscuous() local
71 VerifyOrExit(instance.Get<Mac::LinkRaw>().IsEnabled(), error = kErrorInvalidState); in otLinkRawSetPromiscuous()
72 instance.Get<Radio>().SetPromiscuous(aEnable); in otLinkRawSetPromiscuous()
81 Instance &instance = AsCoreType(aInstance); in otLinkRawSleep() local
83 VerifyOrExit(instance.Get<Mac::LinkRaw>().IsEnabled(), error = kErrorInvalidState); in otLinkRawSleep()
85 error = instance.Get<Radio>().Sleep(); in otLinkRawSleep()
118 Instance &instance = AsCoreType(aInstance); in otLinkRawSrcMatchEnable() local
120 VerifyOrExit(instance.Get<Mac::LinkRaw>().IsEnabled(), error = kErrorInvalidState); in otLinkRawSrcMatchEnable()
122 instance.Get<Radio>().EnableSrcMatch(aEnable); in otLinkRawSrcMatchEnable()
131 Instance &instance = AsCoreType(aInstance); in otLinkRawSrcMatchAddShortEntry() local
[all …]
Dlink_api.cpp47 Instance &instance = AsCoreType(aInstance); in otLinkGetChannel() local
51 if (instance.Get<Mac::LinkRaw>().IsEnabled()) in otLinkGetChannel()
53 channel = instance.Get<Mac::LinkRaw>().GetChannel(); in otLinkGetChannel()
58 channel = instance.Get<Mac::Mac>().GetPanChannel(); in otLinkGetChannel()
67 Instance &instance = AsCoreType(aInstance); in otLinkSetChannel() local
70 if (instance.Get<Mac::LinkRaw>().IsEnabled()) in otLinkSetChannel()
72 error = instance.Get<Mac::LinkRaw>().SetChannel(aChannel); in otLinkSetChannel()
77 VerifyOrExit(instance.Get<Mle::MleRouter>().IsDisabled(), error = kErrorInvalidState); in otLinkSetChannel()
79 SuccessOrExit(error = instance.Get<Mac::Mac>().SetPanChannel(aChannel)); in otLinkSetChannel()
80 instance.Get<MeshCoP::ActiveDatasetManager>().Clear(); in otLinkSetChannel()
[all …]
Dinstance_api.cpp64 Instance *instance; in otInstanceInitMultiple() local
66 instance = Instance::InitMultiple(aIdx); in otInstanceInitMultiple()
68 return instance; in otInstanceInitMultiple()
73 Instance *instance; in otInstanceInit() local
75 instance = Instance::Init(aInstanceBuffer, aInstanceBufferSize); in otInstanceInit()
77 return instance; in otInstanceInit()
Dthread_api.cpp66 Instance &instance = AsCoreType(aInstance); in otThreadSetExtendedPanId() local
69 VerifyOrExit(instance.Get<Mle::MleRouter>().IsDisabled(), error = kErrorInvalidState); in otThreadSetExtendedPanId()
71 instance.Get<MeshCoP::ExtendedPanIdManager>().SetExtPanId(extPanId); in otThreadSetExtendedPanId()
73 instance.Get<MeshCoP::ActiveDatasetManager>().Clear(); in otThreadSetExtendedPanId()
74 instance.Get<MeshCoP::PendingDatasetManager>().Clear(); in otThreadSetExtendedPanId()
120 Instance &instance = AsCoreType(aInstance); in otThreadSetNetworkKey() local
122 VerifyOrExit(instance.Get<Mle::MleRouter>().IsDisabled(), error = kErrorInvalidState); in otThreadSetNetworkKey()
124 instance.Get<KeyManager>().SetNetworkKey(AsCoreType(aKey)); in otThreadSetNetworkKey()
126 instance.Get<MeshCoP::ActiveDatasetManager>().Clear(); in otThreadSetNetworkKey()
127 instance.Get<MeshCoP::PendingDatasetManager>().Clear(); in otThreadSetNetworkKey()
[all …]
/openthread-latest/src/posix/platform/
Dsettings.cpp550 otInstance *instance = nullptr; in main() local
558 otPlatSettingsInit(instance, nullptr, 0); in main()
561 otPlatSettingsWipe(instance); in main()
566 assert(otPlatSettingsGet(instance, 0, 0, value, &length) == OT_ERROR_NOT_FOUND); in main()
567 assert(otPlatSettingsDelete(instance, 0, 0) == OT_ERROR_NOT_FOUND); in main()
568 assert(otPlatSettingsDelete(instance, 0, -1) == OT_ERROR_NOT_FOUND); in main()
572 assert(otPlatSettingsSet(instance, 0, data, sizeof(data) / 2) == OT_ERROR_NONE); in main()
577 assert(otPlatSettingsGet(instance, 0, 0, nullptr, nullptr) == OT_ERROR_NONE); in main()
578 assert(otPlatSettingsGet(instance, 0, 0, nullptr, &length) == OT_ERROR_NONE); in main()
582 assert(otPlatSettingsGet(instance, 0, 0, value, &length) == OT_ERROR_NONE); in main()
[all …]
/openthread-latest/examples/apps/ncp/
Dmain.c74 otInstance *instance; in main() local
102 instance = instances[0]; in main()
113 instance = otInstanceInit(otInstanceBuffer, &otInstanceBufferLength); in main()
115 instance = otInstanceInitSingle(); in main()
117 assert(instance); in main()
122 otAppNcpInit(instance); in main()
127 otTaskletsProcess(instance); in main()
128 otSysProcessDrivers(instance); in main()
131 otInstanceFinalize(instance); in main()
/openthread-latest/examples/apps/cli/
Dmain.c104 otInstance *instance; in main() local
132 instance = otInstanceInit(otInstanceBuffer, &otInstanceBufferLength); in main()
134 instance = otInstanceInitSingle(); in main()
136 assert(instance); in main()
138 otAppCliInit(instance); in main()
141 IgnoreError(otCliSetUserCommands(kCommands, OT_ARRAY_LENGTH(kCommands), instance)); in main()
150 otTaskletsProcess(instance); in main()
151 otSysProcessDrivers(instance); in main()
154 otInstanceFinalize(instance); in main()
/openthread-latest/src/core/radio/
Dradio_platform.cpp50 Instance &instance = AsCoreType(aInstance); in otPlatRadioReceiveDone() local
53 VerifyOrExit(instance.IsInitialized()); in otPlatRadioReceiveDone()
62 instance.Get<Radio::Callbacks>().HandleReceiveDone(rxFrame, aError); in otPlatRadioReceiveDone()
70 Instance &instance = AsCoreType(aInstance); in otPlatRadioTxStarted() local
73 VerifyOrExit(instance.IsInitialized()); in otPlatRadioTxStarted()
79 instance.Get<Radio::Callbacks>().HandleTransmitStarted(txFrame); in otPlatRadioTxStarted()
87 Instance &instance = AsCoreType(aInstance); in otPlatRadioTxDone() local
91 VerifyOrExit(instance.IsInitialized()); in otPlatRadioTxDone()
102 instance.Get<Radio::Callbacks>().HandleTransmitDone(txFrame, ackFrame, aError); in otPlatRadioTxDone()
110 Instance &instance = AsCoreType(aInstance); in otPlatRadioEnergyScanDone() local
[all …]
/openthread-latest/src/core/instance/
Dinstance.cpp298 Instance *instance = &Get(); in InitSingle() local
300 VerifyOrExit(!instance->mIsInitialized); in InitSingle()
302 instance = new (&gInstanceRaw) Instance(); in InitSingle()
304 instance->AfterInit(); in InitSingle()
307 return *instance; in InitSingle()
312 void *instance = &gInstanceRaw; in Get() local
314 return *static_cast<Instance *>(instance); in Get()
324 Instance *instance = reinterpret_cast<Instance *>(instanceBuffer); in InitMultiple() local
327 VerifyOrExit(!instance->mIsInitialized); in InitMultiple()
330 instance = Instance::Init(instanceBuffer, &bufferSize); in InitMultiple()
[all …]
/openthread-latest/src/posix/
Dmain.c293 otInstance *instance = NULL; in InitInstance() local
299 instance = otSysInit(&aConfig->mPlatformConfig); in InitInstance()
300 VerifyOrDie(instance != NULL, OT_EXIT_FAILURE); in InitInstance()
311 printf("%s\n", otPlatRadioGetVersionString(instance)); in InitInstance()
315 syslog(LOG_INFO, "RCP version: %s", otPlatRadioGetVersionString(instance)); in InitInstance()
323 return instance; in InitInstance()
371 otInstance *instance; in main() local
386 instance = InitInstance(&config); in main()
389 otAppCliInit(instance); in main()
393 IgnoreError(otCliSetUserCommands(kCommands, OT_ARRAY_LENGTH(kCommands), instance)); in main()
[all …]
/openthread-latest/tests/scripts/thread-cert/
Dtest_dnssd.py212 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)

1234