Home
last modified time | relevance | path

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

1234

/openthread-3.4.0/tests/unit/
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 …VerifyOrQuit(otPlatRadioGetRawPowerSetting(instance, 11, rawPowerSetting, &rawPowerSettingLength) … in TestPowerCalibration()
73 SuccessOrQuit(otPlatRadioSetChannelTargetPower(instance, 11, 5000)); in TestPowerCalibration()
75 …SuccessOrQuit(otPlatRadioGetRawPowerSetting(instance, 11, rawPowerSetting, &rawPowerSettingLength)… in TestPowerCalibration()
79 SuccessOrQuit(otPlatRadioSetChannelTargetPower(instance, 11, 9999)); in TestPowerCalibration()
81 …SuccessOrQuit(otPlatRadioGetRawPowerSetting(instance, 11, rawPowerSetting, &rawPowerSettingLength)… in TestPowerCalibration()
[all …]
Dtest_mle.cpp42 Instance *instance; in TestDefaultDeviceProperties() local
46 instance = static_cast<Instance *>(testInitInstance()); in TestDefaultDeviceProperties()
47 VerifyOrQuit(instance != nullptr); in TestDefaultDeviceProperties()
49 props = otThreadGetDeviceProperties(instance); in TestDefaultDeviceProperties()
80 VerifyOrQuit(otThreadGetLocalLeaderWeight(instance) == weight); in TestDefaultDeviceProperties()
157 Instance *instance; in TestLeaderWeightCalculation() local
159 instance = static_cast<Instance *>(testInitInstance()); in TestLeaderWeightCalculation()
160 VerifyOrQuit(instance != nullptr); in TestLeaderWeightCalculation()
164 otThreadSetDeviceProperties(instance, &testCase.mDeviceProperties); in TestLeaderWeightCalculation()
165 … CompareDevicePropertiess(testCase.mDeviceProperties, *otThreadGetDeviceProperties(instance)); in TestLeaderWeightCalculation()
[all …]
Dtest_timer.cpp138 ot::Instance *instance = testInitInstance(); in TestOneTimer() local
139 TestTimer<TimerType> timer(*instance); in TestOneTimer()
143 TestTimer<TimerType>::RemoveAll(*instance); in TestOneTimer()
160 AlarmFired<TimerType>(instance); in TestOneTimer()
184 AlarmFired<TimerType>(instance); in TestOneTimer()
208 AlarmFired<TimerType>(instance); in TestOneTimer()
232 AlarmFired<TimerType>(instance); in TestOneTimer()
242 AlarmFired<TimerType>(instance); in TestOneTimer()
252 testFreeInstance(instance); in TestOneTimer()
264 ot::Instance *instance = testInitInstance(); in TestTwoTimers() local
[all …]
Dtest_pskc.cpp45 otInstance *instance = testInitInstance(); in TestMinimumPassphrase() local
50 testFreeInstance(instance); in TestMinimumPassphrase()
76 otInstance *instance = testInitInstance(); in TestMaximumPassphrase() local
81 testFreeInstance(instance); in TestMaximumPassphrase()
92 otInstance *instance = testInitInstance(); in TestExampleInSpec() local
97 testFreeInstance(instance); in TestExampleInSpec()
Dtest_aes.cpp58 otInstance *instance = testInitInstance(); in TestMacBeaconFrame() local
68 VerifyOrQuit(instance != nullptr); in TestMacBeaconFrame()
85 testFreeInstance(instance); in TestMacBeaconFrame()
125 ot::Instance *instance = testInitInstance(); in TestMacCommandFrame() local
129 VerifyOrQuit(instance != nullptr); in TestMacCommandFrame()
149 message = instance->Get<ot::MessagePool>().Allocate(ot::Message::kTypeIp6); in TestMacCommandFrame()
172 testFreeInstance(instance); in TestMacCommandFrame()
198 ot::Instance *instance = testInitInstance(); in TestInPlaceAesCcmProcessing() local
202 VerifyOrQuit(instance != nullptr); in TestInPlaceAesCcmProcessing()
204 message = instance->Get<ot::MessagePool>().Allocate(ot::Message::kTypeIp6); in TestInPlaceAesCcmProcessing()
[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_network_data.cpp109 ot::Instance *instance; in TestNetworkDataIterator() local
116 instance = testInitInstance(); in TestNetworkDataIterator()
117 VerifyOrQuit(instance != nullptr); in TestNetworkDataIterator()
155 NetworkData netData(*instance, kNetworkData, sizeof(kNetworkData)); in TestNetworkDataIterator()
271 NetworkData netData(*instance, kNetworkData, sizeof(kNetworkData)); in TestNetworkDataIterator()
440 NetworkData netData(*instance, kNetworkData, sizeof(kNetworkData)); in TestNetworkDataIterator()
489 testFreeInstance(instance); in TestNetworkDataIterator()
584 ot::Instance *instance; in TestNetworkDataFindNextService() local
589 instance = testInitInstance(); in TestNetworkDataFindNextService()
590 VerifyOrQuit(instance != nullptr); in TestNetworkDataFindNextService()
[all …]
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()
Dtest_checksum.cpp178 Instance *instance = static_cast<Instance *>(testInitInstance()); in TestUdpMessageChecksum() local
180 VerifyOrQuit(instance != nullptr); in TestUdpMessageChecksum()
184 Message *message = instance->Get<Ip6::Ip6>().NewMessage(sizeof(Ip6::Udp::Header)); in TestUdpMessageChecksum()
246 Instance *instance = static_cast<Instance *>(testInitInstance()); in TestIcmp6MessageChecksum() local
248 VerifyOrQuit(instance != nullptr, "Null OpenThread instance\n"); in TestIcmp6MessageChecksum()
252 Message *message = instance->Get<Ip6::Ip6>().NewMessage(sizeof(Ip6::Icmp::Header)); in TestIcmp6MessageChecksum()
318 Instance *instance = static_cast<Instance *>(testInitInstance()); in TestTcp4MessageChecksum() local
320 VerifyOrQuit(instance != nullptr); in TestTcp4MessageChecksum()
327 Message *message = instance->Get<Ip6::Ip6>().NewMessage(sizeof(Ip4::Tcp::Header)); in TestTcp4MessageChecksum()
373 Instance *instance = static_cast<Instance *>(testInitInstance()); in TestUdp4MessageChecksum() local
[all …]
/openthread-3.4.0/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-3.4.0/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 …]
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()
114 Instance &instance = AsCoreType(aInstance); in otThreadSetNetworkKey() local
116 VerifyOrExit(instance.Get<Mle::MleRouter>().IsDisabled(), error = kErrorInvalidState); in otThreadSetNetworkKey()
118 instance.Get<KeyManager>().SetNetworkKey(AsCoreType(aKey)); in otThreadSetNetworkKey()
120 instance.Get<MeshCoP::ActiveDatasetManager>().Clear(); in otThreadSetNetworkKey()
121 instance.Get<MeshCoP::PendingDatasetManager>().Clear(); in otThreadSetNetworkKey()
[all …]
Dip6_api.cpp50 Instance &instance = AsCoreType(aInstance); in otIp6SetEnabled() local
53 VerifyOrExit(!instance.Get<Mac::LinkRaw>().IsEnabled(), error = kErrorInvalidState); in otIp6SetEnabled()
58 instance.Get<ThreadNetif>().Up(); in otIp6SetEnabled()
62 instance.Get<ThreadNetif>().Down(); in otIp6SetEnabled()
252 Instance &instance = AsCoreType(aInstance); in otIp6SetSlaacEnabled() local
256 instance.Get<Utils::Slaac>().Enable(); in otIp6SetSlaacEnabled()
260 instance.Get<Utils::Slaac>().Disable(); in otIp6SetSlaacEnabled()
/openthread-3.4.0/src/posix/platform/
Dsettings.cpp548 otInstance *instance = nullptr; in main() local
556 otPlatSettingsInit(instance, nullptr, 0); in main()
559 otPlatSettingsWipe(instance); in main()
564 assert(otPlatSettingsGet(instance, 0, 0, value, &length) == OT_ERROR_NOT_FOUND); in main()
565 assert(otPlatSettingsDelete(instance, 0, 0) == OT_ERROR_NOT_FOUND); in main()
566 assert(otPlatSettingsDelete(instance, 0, -1) == OT_ERROR_NOT_FOUND); in main()
570 assert(otPlatSettingsSet(instance, 0, data, sizeof(data) / 2) == OT_ERROR_NONE); in main()
575 assert(otPlatSettingsGet(instance, 0, 0, nullptr, nullptr) == OT_ERROR_NONE); in main()
576 assert(otPlatSettingsGet(instance, 0, 0, nullptr, &length) == OT_ERROR_NONE); in main()
580 assert(otPlatSettingsGet(instance, 0, 0, value, &length) == OT_ERROR_NONE); in main()
[all …]
/openthread-3.4.0/examples/apps/ncp/
Dmain.c58 otInstance *instance; in main() local
80 instance = otInstanceInit(otInstanceBuffer, &otInstanceBufferLength); in main()
82 instance = otInstanceInitSingle(); in main()
84 assert(instance); in main()
86 otAppNcpInit(instance); in main()
90 otTaskletsProcess(instance); in main()
91 otSysProcessDrivers(instance); in main()
94 otInstanceFinalize(instance); in main()
/openthread-3.4.0/examples/apps/cli/
Dmain.c98 otInstance *instance; in main() local
120 instance = otInstanceInit(otInstanceBuffer, &otInstanceBufferLength); in main()
122 instance = otInstanceInitSingle(); in main()
124 assert(instance); in main()
126 otAppCliInit(instance); in main()
129 IgnoreError(otCliSetUserCommands(kCommands, OT_ARRAY_LENGTH(kCommands), instance)); in main()
134 otTaskletsProcess(instance); in main()
135 otSysProcessDrivers(instance); in main()
138 otInstanceFinalize(instance); in main()
/openthread-3.4.0/src/posix/
Dmain.c291 otInstance *instance = NULL; in InitInstance() local
297 instance = otSysInit(&aConfig->mPlatformConfig); in InitInstance()
298 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()
383 IgnoreError(otCliSetUserCommands(kCommands, OT_ARRAY_LENGTH(kCommands), instance)); in main()
[all …]
/openthread-3.4.0/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-3.4.0/src/core/common/
Dinstance.cpp267 Instance *instance = &Get(); in InitSingle() local
269 VerifyOrExit(!instance->mIsInitialized); in InitSingle()
271 instance = new (&gInstanceRaw) Instance(); in InitSingle()
273 instance->AfterInit(); in InitSingle()
276 return *instance; in InitSingle()
281 void *instance = &gInstanceRaw; in Get() local
283 return *static_cast<Instance *>(instance); in Get()
290 Instance *instance = nullptr; in Init() local
299 instance = new (aBuffer) Instance(); in Init()
301 instance->AfterInit(); in Init()
[all …]
/openthread-3.4.0/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)
/openthread-3.4.0/third_party/tcplp/
Dtcplp.h69 otMessage * tcplp_sys_new_message(otInstance *instance);
70 void tcplp_sys_free_message(otInstance *instance, otMessage *pkt);
71 void tcplp_sys_send_message(otInstance *instance, otMessage *pkt, otMessageInfo *info);

1234