xref: /aosp_15_r20/external/openthread/tests/unit/test_platform.cpp (revision cfb92d1480a9e65faed56933e9c12405f45898b4)
1*cfb92d14SAndroid Build Coastguard Worker /*
2*cfb92d14SAndroid Build Coastguard Worker  *  Copyright (c) 2016, The OpenThread Authors.
3*cfb92d14SAndroid Build Coastguard Worker  *  All rights reserved.
4*cfb92d14SAndroid Build Coastguard Worker  *
5*cfb92d14SAndroid Build Coastguard Worker  *  Redistribution and use in source and binary forms, with or without
6*cfb92d14SAndroid Build Coastguard Worker  *  modification, are permitted provided that the following conditions are met:
7*cfb92d14SAndroid Build Coastguard Worker  *  1. Redistributions of source code must retain the above copyright
8*cfb92d14SAndroid Build Coastguard Worker  *     notice, this list of conditions and the following disclaimer.
9*cfb92d14SAndroid Build Coastguard Worker  *  2. Redistributions in binary form must reproduce the above copyright
10*cfb92d14SAndroid Build Coastguard Worker  *     notice, this list of conditions and the following disclaimer in the
11*cfb92d14SAndroid Build Coastguard Worker  *     documentation and/or other materials provided with the distribution.
12*cfb92d14SAndroid Build Coastguard Worker  *  3. Neither the name of the copyright holder nor the
13*cfb92d14SAndroid Build Coastguard Worker  *     names of its contributors may be used to endorse or promote products
14*cfb92d14SAndroid Build Coastguard Worker  *     derived from this software without specific prior written permission.
15*cfb92d14SAndroid Build Coastguard Worker  *
16*cfb92d14SAndroid Build Coastguard Worker  *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17*cfb92d14SAndroid Build Coastguard Worker  *  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18*cfb92d14SAndroid Build Coastguard Worker  *  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19*cfb92d14SAndroid Build Coastguard Worker  *  ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
20*cfb92d14SAndroid Build Coastguard Worker  *  LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21*cfb92d14SAndroid Build Coastguard Worker  *  CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22*cfb92d14SAndroid Build Coastguard Worker  *  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23*cfb92d14SAndroid Build Coastguard Worker  *  INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24*cfb92d14SAndroid Build Coastguard Worker  *  CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25*cfb92d14SAndroid Build Coastguard Worker  *  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26*cfb92d14SAndroid Build Coastguard Worker  *  POSSIBILITY OF SUCH DAMAGE.
27*cfb92d14SAndroid Build Coastguard Worker  */
28*cfb92d14SAndroid Build Coastguard Worker 
29*cfb92d14SAndroid Build Coastguard Worker // Disable OpenThread's own new implementation to avoid duplicate definition
30*cfb92d14SAndroid Build Coastguard Worker #define OT_CORE_COMMON_NEW_HPP_
31*cfb92d14SAndroid Build Coastguard Worker #include "test_platform.h"
32*cfb92d14SAndroid Build Coastguard Worker 
33*cfb92d14SAndroid Build Coastguard Worker #include <map>
34*cfb92d14SAndroid Build Coastguard Worker #include <vector>
35*cfb92d14SAndroid Build Coastguard Worker 
36*cfb92d14SAndroid Build Coastguard Worker #include <stdio.h>
37*cfb92d14SAndroid Build Coastguard Worker #include <sys/time.h>
38*cfb92d14SAndroid Build Coastguard Worker #ifdef OPENTHREAD_CONFIG_BLE_TCAT_ENABLE
39*cfb92d14SAndroid Build Coastguard Worker #include <openthread/tcat.h>
40*cfb92d14SAndroid Build Coastguard Worker #include <openthread/platform/ble.h>
41*cfb92d14SAndroid Build Coastguard Worker #endif
42*cfb92d14SAndroid Build Coastguard Worker 
43*cfb92d14SAndroid Build Coastguard Worker enum
44*cfb92d14SAndroid Build Coastguard Worker {
45*cfb92d14SAndroid Build Coastguard Worker     FLASH_SWAP_SIZE = 2048,
46*cfb92d14SAndroid Build Coastguard Worker     FLASH_SWAP_NUM  = 2,
47*cfb92d14SAndroid Build Coastguard Worker };
48*cfb92d14SAndroid Build Coastguard Worker 
49*cfb92d14SAndroid Build Coastguard Worker std::map<uint32_t, std::vector<std::vector<uint8_t>>> settings;
50*cfb92d14SAndroid Build Coastguard Worker 
testInitInstance(void)51*cfb92d14SAndroid Build Coastguard Worker ot::Instance *testInitInstance(void)
52*cfb92d14SAndroid Build Coastguard Worker {
53*cfb92d14SAndroid Build Coastguard Worker     otInstance *instance = nullptr;
54*cfb92d14SAndroid Build Coastguard Worker 
55*cfb92d14SAndroid Build Coastguard Worker #if OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_ENABLE
56*cfb92d14SAndroid Build Coastguard Worker #if OPENTHREAD_CONFIG_MULTIPLE_STATIC_INSTANCE_ENABLE
57*cfb92d14SAndroid Build Coastguard Worker     instance = otInstanceInitMultiple(0);
58*cfb92d14SAndroid Build Coastguard Worker #else
59*cfb92d14SAndroid Build Coastguard Worker     size_t   instanceBufferLength = 0;
60*cfb92d14SAndroid Build Coastguard Worker     uint8_t *instanceBuffer       = nullptr;
61*cfb92d14SAndroid Build Coastguard Worker 
62*cfb92d14SAndroid Build Coastguard Worker     // Call to query the buffer size
63*cfb92d14SAndroid Build Coastguard Worker     (void)otInstanceInit(nullptr, &instanceBufferLength);
64*cfb92d14SAndroid Build Coastguard Worker 
65*cfb92d14SAndroid Build Coastguard Worker     // Call to allocate the buffer
66*cfb92d14SAndroid Build Coastguard Worker     instanceBuffer = (uint8_t *)malloc(instanceBufferLength);
67*cfb92d14SAndroid Build Coastguard Worker     VerifyOrQuit(instanceBuffer != nullptr, "Failed to allocate otInstance");
68*cfb92d14SAndroid Build Coastguard Worker     memset(instanceBuffer, 0, instanceBufferLength);
69*cfb92d14SAndroid Build Coastguard Worker 
70*cfb92d14SAndroid Build Coastguard Worker     // Initialize OpenThread with the buffer
71*cfb92d14SAndroid Build Coastguard Worker     instance = otInstanceInit(instanceBuffer, &instanceBufferLength);
72*cfb92d14SAndroid Build Coastguard Worker #endif
73*cfb92d14SAndroid Build Coastguard Worker #else
74*cfb92d14SAndroid Build Coastguard Worker     instance = otInstanceInitSingle();
75*cfb92d14SAndroid Build Coastguard Worker #endif
76*cfb92d14SAndroid Build Coastguard Worker 
77*cfb92d14SAndroid Build Coastguard Worker     return static_cast<ot::Instance *>(instance);
78*cfb92d14SAndroid Build Coastguard Worker }
79*cfb92d14SAndroid Build Coastguard Worker 
80*cfb92d14SAndroid Build Coastguard Worker #if OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_ENABLE && OPENTHREAD_CONFIG_MULTIPLE_STATIC_INSTANCE_ENABLE
testInitAdditionalInstance(uint8_t id)81*cfb92d14SAndroid Build Coastguard Worker ot::Instance *testInitAdditionalInstance(uint8_t id)
82*cfb92d14SAndroid Build Coastguard Worker {
83*cfb92d14SAndroid Build Coastguard Worker     otInstance *instance = nullptr;
84*cfb92d14SAndroid Build Coastguard Worker 
85*cfb92d14SAndroid Build Coastguard Worker     instance = otInstanceInitMultiple(id);
86*cfb92d14SAndroid Build Coastguard Worker 
87*cfb92d14SAndroid Build Coastguard Worker     return static_cast<ot::Instance *>(instance);
88*cfb92d14SAndroid Build Coastguard Worker }
89*cfb92d14SAndroid Build Coastguard Worker #endif
90*cfb92d14SAndroid Build Coastguard Worker 
testFreeInstance(otInstance * aInstance)91*cfb92d14SAndroid Build Coastguard Worker void testFreeInstance(otInstance *aInstance)
92*cfb92d14SAndroid Build Coastguard Worker {
93*cfb92d14SAndroid Build Coastguard Worker     otInstanceFinalize(aInstance);
94*cfb92d14SAndroid Build Coastguard Worker 
95*cfb92d14SAndroid Build Coastguard Worker #if OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_ENABLE && !OPENTHREAD_CONFIG_MULTIPLE_STATIC_INSTANCE_ENABLE
96*cfb92d14SAndroid Build Coastguard Worker     free(aInstance);
97*cfb92d14SAndroid Build Coastguard Worker #endif
98*cfb92d14SAndroid Build Coastguard Worker }
99*cfb92d14SAndroid Build Coastguard Worker 
100*cfb92d14SAndroid Build Coastguard Worker bool sDiagMode = false;
101*cfb92d14SAndroid Build Coastguard Worker 
102*cfb92d14SAndroid Build Coastguard Worker static otPlatDiagOutputCallback sOutputCallback        = nullptr;
103*cfb92d14SAndroid Build Coastguard Worker static void                    *sOutputCallbackContext = nullptr;
104*cfb92d14SAndroid Build Coastguard Worker 
105*cfb92d14SAndroid Build Coastguard Worker extern "C" {
106*cfb92d14SAndroid Build Coastguard Worker 
107*cfb92d14SAndroid Build Coastguard Worker #if OPENTHREAD_CONFIG_HEAP_EXTERNAL_ENABLE
otPlatCAlloc(size_t aNum,size_t aSize)108*cfb92d14SAndroid Build Coastguard Worker OT_TOOL_WEAK void *otPlatCAlloc(size_t aNum, size_t aSize) { return calloc(aNum, aSize); }
109*cfb92d14SAndroid Build Coastguard Worker 
otPlatFree(void * aPtr)110*cfb92d14SAndroid Build Coastguard Worker OT_TOOL_WEAK void otPlatFree(void *aPtr) { free(aPtr); }
111*cfb92d14SAndroid Build Coastguard Worker #endif
112*cfb92d14SAndroid Build Coastguard Worker 
otTaskletsSignalPending(otInstance *)113*cfb92d14SAndroid Build Coastguard Worker OT_TOOL_WEAK void otTaskletsSignalPending(otInstance *) {}
114*cfb92d14SAndroid Build Coastguard Worker 
otPlatAlarmMilliStop(otInstance *)115*cfb92d14SAndroid Build Coastguard Worker OT_TOOL_WEAK void otPlatAlarmMilliStop(otInstance *) {}
116*cfb92d14SAndroid Build Coastguard Worker 
otPlatAlarmMilliStartAt(otInstance *,uint32_t,uint32_t)117*cfb92d14SAndroid Build Coastguard Worker OT_TOOL_WEAK void otPlatAlarmMilliStartAt(otInstance *, uint32_t, uint32_t) {}
118*cfb92d14SAndroid Build Coastguard Worker 
otPlatAlarmMilliGetNow(void)119*cfb92d14SAndroid Build Coastguard Worker OT_TOOL_WEAK uint32_t otPlatAlarmMilliGetNow(void)
120*cfb92d14SAndroid Build Coastguard Worker {
121*cfb92d14SAndroid Build Coastguard Worker     struct timeval tv;
122*cfb92d14SAndroid Build Coastguard Worker 
123*cfb92d14SAndroid Build Coastguard Worker     gettimeofday(&tv, nullptr);
124*cfb92d14SAndroid Build Coastguard Worker 
125*cfb92d14SAndroid Build Coastguard Worker     return (uint32_t)((tv.tv_sec * 1000) + (tv.tv_usec / 1000) + 123456);
126*cfb92d14SAndroid Build Coastguard Worker }
127*cfb92d14SAndroid Build Coastguard Worker 
otPlatAlarmMicroStop(otInstance *)128*cfb92d14SAndroid Build Coastguard Worker OT_TOOL_WEAK void otPlatAlarmMicroStop(otInstance *) {}
129*cfb92d14SAndroid Build Coastguard Worker 
otPlatAlarmMicroStartAt(otInstance *,uint32_t,uint32_t)130*cfb92d14SAndroid Build Coastguard Worker OT_TOOL_WEAK void otPlatAlarmMicroStartAt(otInstance *, uint32_t, uint32_t) {}
131*cfb92d14SAndroid Build Coastguard Worker 
otPlatAlarmMicroGetNow(void)132*cfb92d14SAndroid Build Coastguard Worker OT_TOOL_WEAK uint32_t otPlatAlarmMicroGetNow(void)
133*cfb92d14SAndroid Build Coastguard Worker {
134*cfb92d14SAndroid Build Coastguard Worker     struct timeval tv;
135*cfb92d14SAndroid Build Coastguard Worker 
136*cfb92d14SAndroid Build Coastguard Worker     gettimeofday(&tv, nullptr);
137*cfb92d14SAndroid Build Coastguard Worker 
138*cfb92d14SAndroid Build Coastguard Worker     return (uint32_t)((tv.tv_sec * 1000000) + tv.tv_usec + 123456);
139*cfb92d14SAndroid Build Coastguard Worker }
140*cfb92d14SAndroid Build Coastguard Worker 
otPlatMultipanGetActiveInstance(otInstance **)141*cfb92d14SAndroid Build Coastguard Worker OT_TOOL_WEAK otError otPlatMultipanGetActiveInstance(otInstance **) { return OT_ERROR_NOT_IMPLEMENTED; }
142*cfb92d14SAndroid Build Coastguard Worker 
otPlatMultipanSetActiveInstance(otInstance *,bool)143*cfb92d14SAndroid Build Coastguard Worker OT_TOOL_WEAK otError otPlatMultipanSetActiveInstance(otInstance *, bool) { return OT_ERROR_NOT_IMPLEMENTED; }
144*cfb92d14SAndroid Build Coastguard Worker 
otPlatRadioGetIeeeEui64(otInstance *,uint8_t *)145*cfb92d14SAndroid Build Coastguard Worker OT_TOOL_WEAK void otPlatRadioGetIeeeEui64(otInstance *, uint8_t *) {}
146*cfb92d14SAndroid Build Coastguard Worker 
otPlatRadioSetPanId(otInstance *,uint16_t)147*cfb92d14SAndroid Build Coastguard Worker OT_TOOL_WEAK void otPlatRadioSetPanId(otInstance *, uint16_t) {}
148*cfb92d14SAndroid Build Coastguard Worker 
otPlatRadioSetExtendedAddress(otInstance *,const otExtAddress *)149*cfb92d14SAndroid Build Coastguard Worker OT_TOOL_WEAK void otPlatRadioSetExtendedAddress(otInstance *, const otExtAddress *) {}
150*cfb92d14SAndroid Build Coastguard Worker 
otPlatRadioSetShortAddress(otInstance *,uint16_t)151*cfb92d14SAndroid Build Coastguard Worker OT_TOOL_WEAK void otPlatRadioSetShortAddress(otInstance *, uint16_t) {}
152*cfb92d14SAndroid Build Coastguard Worker 
otPlatRadioSetPromiscuous(otInstance *,bool)153*cfb92d14SAndroid Build Coastguard Worker OT_TOOL_WEAK void otPlatRadioSetPromiscuous(otInstance *, bool) {}
154*cfb92d14SAndroid Build Coastguard Worker 
otPlatRadioSetRxOnWhenIdle(otInstance *,bool)155*cfb92d14SAndroid Build Coastguard Worker OT_TOOL_WEAK void otPlatRadioSetRxOnWhenIdle(otInstance *, bool) {}
156*cfb92d14SAndroid Build Coastguard Worker 
otPlatRadioIsEnabled(otInstance *)157*cfb92d14SAndroid Build Coastguard Worker OT_TOOL_WEAK bool otPlatRadioIsEnabled(otInstance *) { return true; }
158*cfb92d14SAndroid Build Coastguard Worker 
otPlatRadioEnable(otInstance *)159*cfb92d14SAndroid Build Coastguard Worker OT_TOOL_WEAK otError otPlatRadioEnable(otInstance *) { return OT_ERROR_NONE; }
160*cfb92d14SAndroid Build Coastguard Worker 
otPlatRadioDisable(otInstance *)161*cfb92d14SAndroid Build Coastguard Worker OT_TOOL_WEAK otError otPlatRadioDisable(otInstance *) { return OT_ERROR_NONE; }
162*cfb92d14SAndroid Build Coastguard Worker 
otPlatRadioSleep(otInstance *)163*cfb92d14SAndroid Build Coastguard Worker OT_TOOL_WEAK otError otPlatRadioSleep(otInstance *) { return OT_ERROR_NONE; }
164*cfb92d14SAndroid Build Coastguard Worker 
otPlatRadioReceive(otInstance *,uint8_t)165*cfb92d14SAndroid Build Coastguard Worker OT_TOOL_WEAK otError otPlatRadioReceive(otInstance *, uint8_t) { return OT_ERROR_NONE; }
166*cfb92d14SAndroid Build Coastguard Worker 
otPlatRadioTransmit(otInstance *,otRadioFrame *)167*cfb92d14SAndroid Build Coastguard Worker OT_TOOL_WEAK otError otPlatRadioTransmit(otInstance *, otRadioFrame *) { return OT_ERROR_NONE; }
168*cfb92d14SAndroid Build Coastguard Worker 
otPlatRadioGetTransmitBuffer(otInstance *)169*cfb92d14SAndroid Build Coastguard Worker OT_TOOL_WEAK otRadioFrame *otPlatRadioGetTransmitBuffer(otInstance *) { return nullptr; }
170*cfb92d14SAndroid Build Coastguard Worker 
otPlatRadioGetRssi(otInstance *)171*cfb92d14SAndroid Build Coastguard Worker OT_TOOL_WEAK int8_t otPlatRadioGetRssi(otInstance *) { return 0; }
172*cfb92d14SAndroid Build Coastguard Worker 
otPlatRadioGetCaps(otInstance *)173*cfb92d14SAndroid Build Coastguard Worker OT_TOOL_WEAK otRadioCaps otPlatRadioGetCaps(otInstance *) { return OT_RADIO_CAPS_NONE; }
174*cfb92d14SAndroid Build Coastguard Worker 
otPlatRadioGetPromiscuous(otInstance *)175*cfb92d14SAndroid Build Coastguard Worker OT_TOOL_WEAK bool otPlatRadioGetPromiscuous(otInstance *) { return false; }
176*cfb92d14SAndroid Build Coastguard Worker 
otPlatRadioEnableSrcMatch(otInstance *,bool)177*cfb92d14SAndroid Build Coastguard Worker OT_TOOL_WEAK void otPlatRadioEnableSrcMatch(otInstance *, bool) {}
178*cfb92d14SAndroid Build Coastguard Worker 
otPlatRadioAddSrcMatchShortEntry(otInstance *,uint16_t)179*cfb92d14SAndroid Build Coastguard Worker OT_TOOL_WEAK otError otPlatRadioAddSrcMatchShortEntry(otInstance *, uint16_t) { return OT_ERROR_NONE; }
180*cfb92d14SAndroid Build Coastguard Worker 
otPlatRadioAddSrcMatchExtEntry(otInstance *,const otExtAddress *)181*cfb92d14SAndroid Build Coastguard Worker OT_TOOL_WEAK otError otPlatRadioAddSrcMatchExtEntry(otInstance *, const otExtAddress *) { return OT_ERROR_NONE; }
182*cfb92d14SAndroid Build Coastguard Worker 
otPlatRadioClearSrcMatchShortEntry(otInstance *,uint16_t)183*cfb92d14SAndroid Build Coastguard Worker OT_TOOL_WEAK otError otPlatRadioClearSrcMatchShortEntry(otInstance *, uint16_t) { return OT_ERROR_NONE; }
184*cfb92d14SAndroid Build Coastguard Worker 
otPlatRadioClearSrcMatchExtEntry(otInstance *,const otExtAddress *)185*cfb92d14SAndroid Build Coastguard Worker OT_TOOL_WEAK otError otPlatRadioClearSrcMatchExtEntry(otInstance *, const otExtAddress *) { return OT_ERROR_NONE; }
186*cfb92d14SAndroid Build Coastguard Worker 
otPlatRadioClearSrcMatchShortEntries(otInstance *)187*cfb92d14SAndroid Build Coastguard Worker OT_TOOL_WEAK void otPlatRadioClearSrcMatchShortEntries(otInstance *) {}
188*cfb92d14SAndroid Build Coastguard Worker 
otPlatRadioClearSrcMatchExtEntries(otInstance *)189*cfb92d14SAndroid Build Coastguard Worker OT_TOOL_WEAK void otPlatRadioClearSrcMatchExtEntries(otInstance *) {}
190*cfb92d14SAndroid Build Coastguard Worker 
otPlatRadioEnergyScan(otInstance *,uint8_t,uint16_t)191*cfb92d14SAndroid Build Coastguard Worker OT_TOOL_WEAK otError otPlatRadioEnergyScan(otInstance *, uint8_t, uint16_t) { return OT_ERROR_NOT_IMPLEMENTED; }
192*cfb92d14SAndroid Build Coastguard Worker 
otPlatRadioSetTransmitPower(otInstance *,int8_t)193*cfb92d14SAndroid Build Coastguard Worker OT_TOOL_WEAK otError otPlatRadioSetTransmitPower(otInstance *, int8_t) { return OT_ERROR_NOT_IMPLEMENTED; }
194*cfb92d14SAndroid Build Coastguard Worker 
otPlatRadioGetReceiveSensitivity(otInstance *)195*cfb92d14SAndroid Build Coastguard Worker OT_TOOL_WEAK int8_t otPlatRadioGetReceiveSensitivity(otInstance *) { return -100; }
196*cfb92d14SAndroid Build Coastguard Worker 
otPlatEntropyGet(uint8_t * aOutput,uint16_t aOutputLength)197*cfb92d14SAndroid Build Coastguard Worker OT_TOOL_WEAK otError otPlatEntropyGet(uint8_t *aOutput, uint16_t aOutputLength)
198*cfb92d14SAndroid Build Coastguard Worker {
199*cfb92d14SAndroid Build Coastguard Worker     otError error = OT_ERROR_NONE;
200*cfb92d14SAndroid Build Coastguard Worker 
201*cfb92d14SAndroid Build Coastguard Worker     VerifyOrExit(aOutput, error = OT_ERROR_INVALID_ARGS);
202*cfb92d14SAndroid Build Coastguard Worker 
203*cfb92d14SAndroid Build Coastguard Worker #if __SANITIZE_ADDRESS__ == 0
204*cfb92d14SAndroid Build Coastguard Worker     {
205*cfb92d14SAndroid Build Coastguard Worker         FILE  *file = nullptr;
206*cfb92d14SAndroid Build Coastguard Worker         size_t readLength;
207*cfb92d14SAndroid Build Coastguard Worker 
208*cfb92d14SAndroid Build Coastguard Worker         file = fopen("/dev/urandom", "rb");
209*cfb92d14SAndroid Build Coastguard Worker         VerifyOrExit(file != nullptr, error = OT_ERROR_FAILED);
210*cfb92d14SAndroid Build Coastguard Worker 
211*cfb92d14SAndroid Build Coastguard Worker         readLength = fread(aOutput, 1, aOutputLength, file);
212*cfb92d14SAndroid Build Coastguard Worker 
213*cfb92d14SAndroid Build Coastguard Worker         if (readLength != aOutputLength)
214*cfb92d14SAndroid Build Coastguard Worker         {
215*cfb92d14SAndroid Build Coastguard Worker             error = OT_ERROR_FAILED;
216*cfb92d14SAndroid Build Coastguard Worker         }
217*cfb92d14SAndroid Build Coastguard Worker 
218*cfb92d14SAndroid Build Coastguard Worker         fclose(file);
219*cfb92d14SAndroid Build Coastguard Worker     }
220*cfb92d14SAndroid Build Coastguard Worker #else
221*cfb92d14SAndroid Build Coastguard Worker     for (uint16_t length = 0; length < aOutputLength; length++)
222*cfb92d14SAndroid Build Coastguard Worker     {
223*cfb92d14SAndroid Build Coastguard Worker         aOutput[length] = (uint8_t)rand();
224*cfb92d14SAndroid Build Coastguard Worker     }
225*cfb92d14SAndroid Build Coastguard Worker #endif
226*cfb92d14SAndroid Build Coastguard Worker 
227*cfb92d14SAndroid Build Coastguard Worker exit:
228*cfb92d14SAndroid Build Coastguard Worker     return error;
229*cfb92d14SAndroid Build Coastguard Worker }
230*cfb92d14SAndroid Build Coastguard Worker 
DiagOutput(const char * aFormat,...)231*cfb92d14SAndroid Build Coastguard Worker static void DiagOutput(const char *aFormat, ...)
232*cfb92d14SAndroid Build Coastguard Worker {
233*cfb92d14SAndroid Build Coastguard Worker     va_list args;
234*cfb92d14SAndroid Build Coastguard Worker 
235*cfb92d14SAndroid Build Coastguard Worker     va_start(args, aFormat);
236*cfb92d14SAndroid Build Coastguard Worker 
237*cfb92d14SAndroid Build Coastguard Worker     if (sOutputCallback != nullptr)
238*cfb92d14SAndroid Build Coastguard Worker     {
239*cfb92d14SAndroid Build Coastguard Worker         sOutputCallback(aFormat, args, sOutputCallbackContext);
240*cfb92d14SAndroid Build Coastguard Worker     }
241*cfb92d14SAndroid Build Coastguard Worker 
242*cfb92d14SAndroid Build Coastguard Worker     va_end(args);
243*cfb92d14SAndroid Build Coastguard Worker }
244*cfb92d14SAndroid Build Coastguard Worker 
otPlatDiagSetOutputCallback(otInstance * aInstance,otPlatDiagOutputCallback aCallback,void * aContext)245*cfb92d14SAndroid Build Coastguard Worker OT_TOOL_WEAK void otPlatDiagSetOutputCallback(otInstance *aInstance, otPlatDiagOutputCallback aCallback, void *aContext)
246*cfb92d14SAndroid Build Coastguard Worker {
247*cfb92d14SAndroid Build Coastguard Worker     sOutputCallback        = aCallback;
248*cfb92d14SAndroid Build Coastguard Worker     sOutputCallbackContext = aContext;
249*cfb92d14SAndroid Build Coastguard Worker }
250*cfb92d14SAndroid Build Coastguard Worker 
otPlatDiagProcess(otInstance *,uint8_t,char * aArgs[])251*cfb92d14SAndroid Build Coastguard Worker OT_TOOL_WEAK otError otPlatDiagProcess(otInstance *, uint8_t, char *aArgs[])
252*cfb92d14SAndroid Build Coastguard Worker {
253*cfb92d14SAndroid Build Coastguard Worker     DiagOutput("diag feature '%s' is not supported\r\n", aArgs[0]);
254*cfb92d14SAndroid Build Coastguard Worker     return OT_ERROR_NONE;
255*cfb92d14SAndroid Build Coastguard Worker }
256*cfb92d14SAndroid Build Coastguard Worker 
otPlatDiagModeSet(bool aMode)257*cfb92d14SAndroid Build Coastguard Worker OT_TOOL_WEAK void otPlatDiagModeSet(bool aMode) { sDiagMode = aMode; }
258*cfb92d14SAndroid Build Coastguard Worker 
otPlatDiagModeGet()259*cfb92d14SAndroid Build Coastguard Worker OT_TOOL_WEAK bool otPlatDiagModeGet() { return sDiagMode; }
260*cfb92d14SAndroid Build Coastguard Worker 
otPlatDiagChannelSet(uint8_t)261*cfb92d14SAndroid Build Coastguard Worker OT_TOOL_WEAK void otPlatDiagChannelSet(uint8_t) {}
262*cfb92d14SAndroid Build Coastguard Worker 
otPlatDiagTxPowerSet(int8_t)263*cfb92d14SAndroid Build Coastguard Worker OT_TOOL_WEAK void otPlatDiagTxPowerSet(int8_t) {}
264*cfb92d14SAndroid Build Coastguard Worker 
otPlatDiagRadioReceived(otInstance *,otRadioFrame *,otError)265*cfb92d14SAndroid Build Coastguard Worker OT_TOOL_WEAK void otPlatDiagRadioReceived(otInstance *, otRadioFrame *, otError) {}
266*cfb92d14SAndroid Build Coastguard Worker 
otPlatDiagAlarmCallback(otInstance *)267*cfb92d14SAndroid Build Coastguard Worker OT_TOOL_WEAK void otPlatDiagAlarmCallback(otInstance *) {}
268*cfb92d14SAndroid Build Coastguard Worker 
otPlatUartSendDone(void)269*cfb92d14SAndroid Build Coastguard Worker OT_TOOL_WEAK void otPlatUartSendDone(void) {}
270*cfb92d14SAndroid Build Coastguard Worker 
otPlatUartReceived(const uint8_t *,uint16_t)271*cfb92d14SAndroid Build Coastguard Worker OT_TOOL_WEAK void otPlatUartReceived(const uint8_t *, uint16_t) {}
272*cfb92d14SAndroid Build Coastguard Worker 
otPlatReset(otInstance *)273*cfb92d14SAndroid Build Coastguard Worker OT_TOOL_WEAK void otPlatReset(otInstance *) {}
274*cfb92d14SAndroid Build Coastguard Worker 
otPlatResetToBootloader(otInstance *)275*cfb92d14SAndroid Build Coastguard Worker OT_TOOL_WEAK otError otPlatResetToBootloader(otInstance *) { return OT_ERROR_NOT_CAPABLE; }
276*cfb92d14SAndroid Build Coastguard Worker 
otPlatGetResetReason(otInstance *)277*cfb92d14SAndroid Build Coastguard Worker OT_TOOL_WEAK otPlatResetReason otPlatGetResetReason(otInstance *) { return OT_PLAT_RESET_REASON_POWER_ON; }
278*cfb92d14SAndroid Build Coastguard Worker 
otPlatWakeHost(void)279*cfb92d14SAndroid Build Coastguard Worker OT_TOOL_WEAK void otPlatWakeHost(void) {}
280*cfb92d14SAndroid Build Coastguard Worker 
otPlatLog(otLogLevel,otLogRegion,const char *,...)281*cfb92d14SAndroid Build Coastguard Worker OT_TOOL_WEAK void otPlatLog(otLogLevel, otLogRegion, const char *, ...) {}
282*cfb92d14SAndroid Build Coastguard Worker 
otPlatSettingsInit(otInstance *,const uint16_t *,uint16_t)283*cfb92d14SAndroid Build Coastguard Worker OT_TOOL_WEAK void otPlatSettingsInit(otInstance *, const uint16_t *, uint16_t) {}
284*cfb92d14SAndroid Build Coastguard Worker 
otPlatSettingsDeinit(otInstance *)285*cfb92d14SAndroid Build Coastguard Worker OT_TOOL_WEAK void otPlatSettingsDeinit(otInstance *) {}
286*cfb92d14SAndroid Build Coastguard Worker 
otPlatSettingsGet(otInstance *,uint16_t aKey,int aIndex,uint8_t * aValue,uint16_t * aValueLength)287*cfb92d14SAndroid Build Coastguard Worker OT_TOOL_WEAK otError otPlatSettingsGet(otInstance *, uint16_t aKey, int aIndex, uint8_t *aValue, uint16_t *aValueLength)
288*cfb92d14SAndroid Build Coastguard Worker {
289*cfb92d14SAndroid Build Coastguard Worker     auto setting = settings.find(aKey);
290*cfb92d14SAndroid Build Coastguard Worker 
291*cfb92d14SAndroid Build Coastguard Worker     if (setting == settings.end())
292*cfb92d14SAndroid Build Coastguard Worker     {
293*cfb92d14SAndroid Build Coastguard Worker         return OT_ERROR_NOT_FOUND;
294*cfb92d14SAndroid Build Coastguard Worker     }
295*cfb92d14SAndroid Build Coastguard Worker 
296*cfb92d14SAndroid Build Coastguard Worker     if (aIndex > setting->second.size())
297*cfb92d14SAndroid Build Coastguard Worker     {
298*cfb92d14SAndroid Build Coastguard Worker         return OT_ERROR_NOT_FOUND;
299*cfb92d14SAndroid Build Coastguard Worker     }
300*cfb92d14SAndroid Build Coastguard Worker 
301*cfb92d14SAndroid Build Coastguard Worker     if (aValueLength == nullptr)
302*cfb92d14SAndroid Build Coastguard Worker     {
303*cfb92d14SAndroid Build Coastguard Worker         return OT_ERROR_NONE;
304*cfb92d14SAndroid Build Coastguard Worker     }
305*cfb92d14SAndroid Build Coastguard Worker 
306*cfb92d14SAndroid Build Coastguard Worker     const auto &data = setting->second[aIndex];
307*cfb92d14SAndroid Build Coastguard Worker 
308*cfb92d14SAndroid Build Coastguard Worker     if (aValue == nullptr)
309*cfb92d14SAndroid Build Coastguard Worker     {
310*cfb92d14SAndroid Build Coastguard Worker         *aValueLength = data.size();
311*cfb92d14SAndroid Build Coastguard Worker         return OT_ERROR_NONE;
312*cfb92d14SAndroid Build Coastguard Worker     }
313*cfb92d14SAndroid Build Coastguard Worker 
314*cfb92d14SAndroid Build Coastguard Worker     if (*aValueLength >= data.size())
315*cfb92d14SAndroid Build Coastguard Worker     {
316*cfb92d14SAndroid Build Coastguard Worker         *aValueLength = data.size();
317*cfb92d14SAndroid Build Coastguard Worker     }
318*cfb92d14SAndroid Build Coastguard Worker 
319*cfb92d14SAndroid Build Coastguard Worker     memcpy(aValue, &data[0], *aValueLength);
320*cfb92d14SAndroid Build Coastguard Worker 
321*cfb92d14SAndroid Build Coastguard Worker     return OT_ERROR_NONE;
322*cfb92d14SAndroid Build Coastguard Worker }
323*cfb92d14SAndroid Build Coastguard Worker 
otPlatSettingsSet(otInstance *,uint16_t aKey,const uint8_t * aValue,uint16_t aValueLength)324*cfb92d14SAndroid Build Coastguard Worker OT_TOOL_WEAK otError otPlatSettingsSet(otInstance *, uint16_t aKey, const uint8_t *aValue, uint16_t aValueLength)
325*cfb92d14SAndroid Build Coastguard Worker {
326*cfb92d14SAndroid Build Coastguard Worker     auto setting = std::vector<uint8_t>(aValue, aValue + aValueLength);
327*cfb92d14SAndroid Build Coastguard Worker 
328*cfb92d14SAndroid Build Coastguard Worker     settings[aKey].clear();
329*cfb92d14SAndroid Build Coastguard Worker     settings[aKey].push_back(setting);
330*cfb92d14SAndroid Build Coastguard Worker 
331*cfb92d14SAndroid Build Coastguard Worker     return OT_ERROR_NONE;
332*cfb92d14SAndroid Build Coastguard Worker }
333*cfb92d14SAndroid Build Coastguard Worker 
otPlatSettingsAdd(otInstance *,uint16_t aKey,const uint8_t * aValue,uint16_t aValueLength)334*cfb92d14SAndroid Build Coastguard Worker OT_TOOL_WEAK otError otPlatSettingsAdd(otInstance *, uint16_t aKey, const uint8_t *aValue, uint16_t aValueLength)
335*cfb92d14SAndroid Build Coastguard Worker {
336*cfb92d14SAndroid Build Coastguard Worker     auto setting = std::vector<uint8_t>(aValue, aValue + aValueLength);
337*cfb92d14SAndroid Build Coastguard Worker     settings[aKey].push_back(setting);
338*cfb92d14SAndroid Build Coastguard Worker 
339*cfb92d14SAndroid Build Coastguard Worker     return OT_ERROR_NONE;
340*cfb92d14SAndroid Build Coastguard Worker }
341*cfb92d14SAndroid Build Coastguard Worker 
otPlatSettingsDelete(otInstance *,uint16_t aKey,int aIndex)342*cfb92d14SAndroid Build Coastguard Worker OT_TOOL_WEAK otError otPlatSettingsDelete(otInstance *, uint16_t aKey, int aIndex)
343*cfb92d14SAndroid Build Coastguard Worker {
344*cfb92d14SAndroid Build Coastguard Worker     auto setting = settings.find(aKey);
345*cfb92d14SAndroid Build Coastguard Worker     if (setting == settings.end())
346*cfb92d14SAndroid Build Coastguard Worker     {
347*cfb92d14SAndroid Build Coastguard Worker         return OT_ERROR_NOT_FOUND;
348*cfb92d14SAndroid Build Coastguard Worker     }
349*cfb92d14SAndroid Build Coastguard Worker 
350*cfb92d14SAndroid Build Coastguard Worker     if (aIndex >= setting->second.size())
351*cfb92d14SAndroid Build Coastguard Worker     {
352*cfb92d14SAndroid Build Coastguard Worker         return OT_ERROR_NOT_FOUND;
353*cfb92d14SAndroid Build Coastguard Worker     }
354*cfb92d14SAndroid Build Coastguard Worker     setting->second.erase(setting->second.begin() + aIndex);
355*cfb92d14SAndroid Build Coastguard Worker     return OT_ERROR_NONE;
356*cfb92d14SAndroid Build Coastguard Worker }
357*cfb92d14SAndroid Build Coastguard Worker 
otPlatSettingsWipe(otInstance *)358*cfb92d14SAndroid Build Coastguard Worker OT_TOOL_WEAK void otPlatSettingsWipe(otInstance *) { settings.clear(); }
359*cfb92d14SAndroid Build Coastguard Worker 
GetFlash(void)360*cfb92d14SAndroid Build Coastguard Worker uint8_t *GetFlash(void)
361*cfb92d14SAndroid Build Coastguard Worker {
362*cfb92d14SAndroid Build Coastguard Worker     static uint8_t sFlash[FLASH_SWAP_SIZE * FLASH_SWAP_NUM];
363*cfb92d14SAndroid Build Coastguard Worker     static bool    sInitialized;
364*cfb92d14SAndroid Build Coastguard Worker 
365*cfb92d14SAndroid Build Coastguard Worker     if (!sInitialized)
366*cfb92d14SAndroid Build Coastguard Worker     {
367*cfb92d14SAndroid Build Coastguard Worker         memset(sFlash, 0xff, sizeof(sFlash));
368*cfb92d14SAndroid Build Coastguard Worker         sInitialized = true;
369*cfb92d14SAndroid Build Coastguard Worker     }
370*cfb92d14SAndroid Build Coastguard Worker 
371*cfb92d14SAndroid Build Coastguard Worker     return sFlash;
372*cfb92d14SAndroid Build Coastguard Worker }
373*cfb92d14SAndroid Build Coastguard Worker 
otPlatFlashInit(otInstance *)374*cfb92d14SAndroid Build Coastguard Worker OT_TOOL_WEAK void otPlatFlashInit(otInstance *) {}
375*cfb92d14SAndroid Build Coastguard Worker 
otPlatFlashGetSwapSize(otInstance *)376*cfb92d14SAndroid Build Coastguard Worker OT_TOOL_WEAK uint32_t otPlatFlashGetSwapSize(otInstance *) { return FLASH_SWAP_SIZE; }
377*cfb92d14SAndroid Build Coastguard Worker 
otPlatFlashErase(otInstance *,uint8_t aSwapIndex)378*cfb92d14SAndroid Build Coastguard Worker OT_TOOL_WEAK void otPlatFlashErase(otInstance *, uint8_t aSwapIndex)
379*cfb92d14SAndroid Build Coastguard Worker {
380*cfb92d14SAndroid Build Coastguard Worker     uint32_t address;
381*cfb92d14SAndroid Build Coastguard Worker 
382*cfb92d14SAndroid Build Coastguard Worker     VerifyOrQuit(aSwapIndex < FLASH_SWAP_NUM, "aSwapIndex invalid");
383*cfb92d14SAndroid Build Coastguard Worker 
384*cfb92d14SAndroid Build Coastguard Worker     address = aSwapIndex ? FLASH_SWAP_SIZE : 0;
385*cfb92d14SAndroid Build Coastguard Worker 
386*cfb92d14SAndroid Build Coastguard Worker     memset(GetFlash() + address, 0xff, FLASH_SWAP_SIZE);
387*cfb92d14SAndroid Build Coastguard Worker }
388*cfb92d14SAndroid Build Coastguard Worker 
otPlatFlashRead(otInstance *,uint8_t aSwapIndex,uint32_t aOffset,void * aData,uint32_t aSize)389*cfb92d14SAndroid Build Coastguard Worker OT_TOOL_WEAK void otPlatFlashRead(otInstance *, uint8_t aSwapIndex, uint32_t aOffset, void *aData, uint32_t aSize)
390*cfb92d14SAndroid Build Coastguard Worker {
391*cfb92d14SAndroid Build Coastguard Worker     uint32_t address;
392*cfb92d14SAndroid Build Coastguard Worker 
393*cfb92d14SAndroid Build Coastguard Worker     VerifyOrQuit(aSwapIndex < FLASH_SWAP_NUM, "aSwapIndex invalid");
394*cfb92d14SAndroid Build Coastguard Worker     VerifyOrQuit(aSize <= FLASH_SWAP_SIZE, "aSize invalid");
395*cfb92d14SAndroid Build Coastguard Worker     VerifyOrQuit(aOffset <= (FLASH_SWAP_SIZE - aSize), "aOffset + aSize invalid");
396*cfb92d14SAndroid Build Coastguard Worker 
397*cfb92d14SAndroid Build Coastguard Worker     address = aSwapIndex ? FLASH_SWAP_SIZE : 0;
398*cfb92d14SAndroid Build Coastguard Worker 
399*cfb92d14SAndroid Build Coastguard Worker     memcpy(aData, GetFlash() + address + aOffset, aSize);
400*cfb92d14SAndroid Build Coastguard Worker }
401*cfb92d14SAndroid Build Coastguard Worker 
otPlatFlashWrite(otInstance *,uint8_t aSwapIndex,uint32_t aOffset,const void * aData,uint32_t aSize)402*cfb92d14SAndroid Build Coastguard Worker OT_TOOL_WEAK void otPlatFlashWrite(otInstance *,
403*cfb92d14SAndroid Build Coastguard Worker                                    uint8_t     aSwapIndex,
404*cfb92d14SAndroid Build Coastguard Worker                                    uint32_t    aOffset,
405*cfb92d14SAndroid Build Coastguard Worker                                    const void *aData,
406*cfb92d14SAndroid Build Coastguard Worker                                    uint32_t    aSize)
407*cfb92d14SAndroid Build Coastguard Worker {
408*cfb92d14SAndroid Build Coastguard Worker     uint32_t address;
409*cfb92d14SAndroid Build Coastguard Worker 
410*cfb92d14SAndroid Build Coastguard Worker     VerifyOrQuit(aSwapIndex < FLASH_SWAP_NUM, "aSwapIndex invalid");
411*cfb92d14SAndroid Build Coastguard Worker     VerifyOrQuit(aSize <= FLASH_SWAP_SIZE, "aSize invalid");
412*cfb92d14SAndroid Build Coastguard Worker     VerifyOrQuit(aOffset <= (FLASH_SWAP_SIZE - aSize), "aOffset + aSize invalid");
413*cfb92d14SAndroid Build Coastguard Worker 
414*cfb92d14SAndroid Build Coastguard Worker     address = aSwapIndex ? FLASH_SWAP_SIZE : 0;
415*cfb92d14SAndroid Build Coastguard Worker 
416*cfb92d14SAndroid Build Coastguard Worker     for (uint32_t index = 0; index < aSize; index++)
417*cfb92d14SAndroid Build Coastguard Worker     {
418*cfb92d14SAndroid Build Coastguard Worker         GetFlash()[address + aOffset + index] &= ((uint8_t *)aData)[index];
419*cfb92d14SAndroid Build Coastguard Worker     }
420*cfb92d14SAndroid Build Coastguard Worker }
421*cfb92d14SAndroid Build Coastguard Worker 
422*cfb92d14SAndroid Build Coastguard Worker #if OPENTHREAD_CONFIG_TIME_SYNC_ENABLE || OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE
otPlatTimeGetXtalAccuracy(void)423*cfb92d14SAndroid Build Coastguard Worker OT_TOOL_WEAK uint16_t otPlatTimeGetXtalAccuracy(void) { return 0; }
424*cfb92d14SAndroid Build Coastguard Worker #endif
425*cfb92d14SAndroid Build Coastguard Worker 
426*cfb92d14SAndroid Build Coastguard Worker #if OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE
otPlatRadioEnableCsl(otInstance *,uint32_t,otShortAddress,const otExtAddress *)427*cfb92d14SAndroid Build Coastguard Worker OT_TOOL_WEAK otError otPlatRadioEnableCsl(otInstance *, uint32_t, otShortAddress, const otExtAddress *)
428*cfb92d14SAndroid Build Coastguard Worker {
429*cfb92d14SAndroid Build Coastguard Worker     return OT_ERROR_NONE;
430*cfb92d14SAndroid Build Coastguard Worker }
431*cfb92d14SAndroid Build Coastguard Worker 
otPlatRadioResetCsl(otInstance *)432*cfb92d14SAndroid Build Coastguard Worker OT_TOOL_WEAK otError otPlatRadioResetCsl(otInstance *) { return OT_ERROR_NONE; }
433*cfb92d14SAndroid Build Coastguard Worker 
otPlatRadioUpdateCslSampleTime(otInstance *,uint32_t)434*cfb92d14SAndroid Build Coastguard Worker OT_TOOL_WEAK void otPlatRadioUpdateCslSampleTime(otInstance *, uint32_t) {}
435*cfb92d14SAndroid Build Coastguard Worker 
otPlatRadioGetCslAccuracy(otInstance *)436*cfb92d14SAndroid Build Coastguard Worker OT_TOOL_WEAK uint8_t otPlatRadioGetCslAccuracy(otInstance *)
437*cfb92d14SAndroid Build Coastguard Worker {
438*cfb92d14SAndroid Build Coastguard Worker     return static_cast<uint8_t>(otPlatTimeGetXtalAccuracy() / 2);
439*cfb92d14SAndroid Build Coastguard Worker }
440*cfb92d14SAndroid Build Coastguard Worker #endif
441*cfb92d14SAndroid Build Coastguard Worker 
442*cfb92d14SAndroid Build Coastguard Worker #if OPENTHREAD_CONFIG_OTNS_ENABLE
otPlatOtnsStatus(const char *)443*cfb92d14SAndroid Build Coastguard Worker OT_TOOL_WEAK void otPlatOtnsStatus(const char *) {}
444*cfb92d14SAndroid Build Coastguard Worker #endif
445*cfb92d14SAndroid Build Coastguard Worker 
446*cfb92d14SAndroid Build Coastguard Worker #if OPENTHREAD_CONFIG_RADIO_LINK_TREL_ENABLE
otPlatTrelEnable(otInstance *,uint16_t *)447*cfb92d14SAndroid Build Coastguard Worker OT_TOOL_WEAK void otPlatTrelEnable(otInstance *, uint16_t *) {}
448*cfb92d14SAndroid Build Coastguard Worker 
otPlatTrelDisable(otInstance *)449*cfb92d14SAndroid Build Coastguard Worker OT_TOOL_WEAK void otPlatTrelDisable(otInstance *) {}
450*cfb92d14SAndroid Build Coastguard Worker 
otPlatTrelSend(otInstance *,const uint8_t *,uint16_t,const otSockAddr *)451*cfb92d14SAndroid Build Coastguard Worker OT_TOOL_WEAK void otPlatTrelSend(otInstance *, const uint8_t *, uint16_t, const otSockAddr *) {}
452*cfb92d14SAndroid Build Coastguard Worker 
otPlatTrelRegisterService(otInstance *,uint16_t,const uint8_t *,uint8_t)453*cfb92d14SAndroid Build Coastguard Worker OT_TOOL_WEAK void otPlatTrelRegisterService(otInstance *, uint16_t, const uint8_t *, uint8_t) {}
454*cfb92d14SAndroid Build Coastguard Worker 
otPlatTrelGetCounters(otInstance *)455*cfb92d14SAndroid Build Coastguard Worker OT_TOOL_WEAK const otPlatTrelCounters *otPlatTrelGetCounters(otInstance *) { return nullptr; }
456*cfb92d14SAndroid Build Coastguard Worker 
otPlatTrelResetCounters(otInstance *)457*cfb92d14SAndroid Build Coastguard Worker OT_TOOL_WEAK void otPlatTrelResetCounters(otInstance *) {}
458*cfb92d14SAndroid Build Coastguard Worker #endif
459*cfb92d14SAndroid Build Coastguard Worker 
460*cfb92d14SAndroid Build Coastguard Worker #if OPENTHREAD_CONFIG_MLE_LINK_METRICS_SUBJECT_ENABLE
otPlatRadioConfigureEnhAckProbing(otInstance *,otLinkMetrics,const otShortAddress,const otExtAddress *)461*cfb92d14SAndroid Build Coastguard Worker OT_TOOL_WEAK otError otPlatRadioConfigureEnhAckProbing(otInstance *,
462*cfb92d14SAndroid Build Coastguard Worker                                                        otLinkMetrics,
463*cfb92d14SAndroid Build Coastguard Worker                                                        const otShortAddress,
464*cfb92d14SAndroid Build Coastguard Worker                                                        const otExtAddress *)
465*cfb92d14SAndroid Build Coastguard Worker {
466*cfb92d14SAndroid Build Coastguard Worker     return OT_ERROR_NONE;
467*cfb92d14SAndroid Build Coastguard Worker }
468*cfb92d14SAndroid Build Coastguard Worker 
otPlatRadioGetEnhAckProbingMetrics(otInstance *,const otShortAddress)469*cfb92d14SAndroid Build Coastguard Worker OT_TOOL_WEAK otLinkMetrics otPlatRadioGetEnhAckProbingMetrics(otInstance *, const otShortAddress)
470*cfb92d14SAndroid Build Coastguard Worker {
471*cfb92d14SAndroid Build Coastguard Worker     otLinkMetrics metrics;
472*cfb92d14SAndroid Build Coastguard Worker 
473*cfb92d14SAndroid Build Coastguard Worker     memset(&metrics, 0, sizeof(metrics));
474*cfb92d14SAndroid Build Coastguard Worker 
475*cfb92d14SAndroid Build Coastguard Worker     return metrics;
476*cfb92d14SAndroid Build Coastguard Worker }
477*cfb92d14SAndroid Build Coastguard Worker #endif
478*cfb92d14SAndroid Build Coastguard Worker 
479*cfb92d14SAndroid Build Coastguard Worker #if OPENTHREAD_CONFIG_BORDER_ROUTING_ENABLE
otPlatInfraIfHasAddress(uint32_t,const otIp6Address *)480*cfb92d14SAndroid Build Coastguard Worker OT_TOOL_WEAK bool otPlatInfraIfHasAddress(uint32_t, const otIp6Address *) { return false; }
481*cfb92d14SAndroid Build Coastguard Worker 
otPlatInfraIfSendIcmp6Nd(uint32_t,const otIp6Address *,const uint8_t *,uint16_t)482*cfb92d14SAndroid Build Coastguard Worker OT_TOOL_WEAK otError otPlatInfraIfSendIcmp6Nd(uint32_t, const otIp6Address *, const uint8_t *, uint16_t)
483*cfb92d14SAndroid Build Coastguard Worker {
484*cfb92d14SAndroid Build Coastguard Worker     return OT_ERROR_FAILED;
485*cfb92d14SAndroid Build Coastguard Worker }
486*cfb92d14SAndroid Build Coastguard Worker 
otPlatInfraIfDiscoverNat64Prefix(uint32_t)487*cfb92d14SAndroid Build Coastguard Worker OT_TOOL_WEAK otError otPlatInfraIfDiscoverNat64Prefix(uint32_t) { return OT_ERROR_FAILED; }
488*cfb92d14SAndroid Build Coastguard Worker #endif
489*cfb92d14SAndroid Build Coastguard Worker 
490*cfb92d14SAndroid Build Coastguard Worker #if OPENTHREAD_CONFIG_PLATFORM_KEY_REFERENCES_ENABLE
491*cfb92d14SAndroid Build Coastguard Worker 
otPlatCryptoImportKey(otCryptoKeyRef * aKeyRef,otCryptoKeyType aKeyType,otCryptoKeyAlgorithm aKeyAlgorithm,int aKeyUsage,otCryptoKeyStorage aKeyPersistence,const uint8_t * aKey,size_t aKeyLen)492*cfb92d14SAndroid Build Coastguard Worker otError otPlatCryptoImportKey(otCryptoKeyRef      *aKeyRef,
493*cfb92d14SAndroid Build Coastguard Worker                               otCryptoKeyType      aKeyType,
494*cfb92d14SAndroid Build Coastguard Worker                               otCryptoKeyAlgorithm aKeyAlgorithm,
495*cfb92d14SAndroid Build Coastguard Worker                               int                  aKeyUsage,
496*cfb92d14SAndroid Build Coastguard Worker                               otCryptoKeyStorage   aKeyPersistence,
497*cfb92d14SAndroid Build Coastguard Worker                               const uint8_t       *aKey,
498*cfb92d14SAndroid Build Coastguard Worker                               size_t               aKeyLen)
499*cfb92d14SAndroid Build Coastguard Worker {
500*cfb92d14SAndroid Build Coastguard Worker     OT_UNUSED_VARIABLE(aKeyRef);
501*cfb92d14SAndroid Build Coastguard Worker     OT_UNUSED_VARIABLE(aKeyType);
502*cfb92d14SAndroid Build Coastguard Worker     OT_UNUSED_VARIABLE(aKeyAlgorithm);
503*cfb92d14SAndroid Build Coastguard Worker     OT_UNUSED_VARIABLE(aKeyUsage);
504*cfb92d14SAndroid Build Coastguard Worker     OT_UNUSED_VARIABLE(aKeyPersistence);
505*cfb92d14SAndroid Build Coastguard Worker     OT_UNUSED_VARIABLE(aKey);
506*cfb92d14SAndroid Build Coastguard Worker     OT_UNUSED_VARIABLE(aKeyLen);
507*cfb92d14SAndroid Build Coastguard Worker 
508*cfb92d14SAndroid Build Coastguard Worker     return OT_ERROR_NONE;
509*cfb92d14SAndroid Build Coastguard Worker }
510*cfb92d14SAndroid Build Coastguard Worker 
otPlatCryptoExportKey(otCryptoKeyRef aKeyRef,uint8_t * aBuffer,size_t aBufferLen,size_t * aKeyLen)511*cfb92d14SAndroid Build Coastguard Worker otError otPlatCryptoExportKey(otCryptoKeyRef aKeyRef, uint8_t *aBuffer, size_t aBufferLen, size_t *aKeyLen)
512*cfb92d14SAndroid Build Coastguard Worker {
513*cfb92d14SAndroid Build Coastguard Worker     OT_UNUSED_VARIABLE(aKeyRef);
514*cfb92d14SAndroid Build Coastguard Worker     OT_UNUSED_VARIABLE(aBuffer);
515*cfb92d14SAndroid Build Coastguard Worker     OT_UNUSED_VARIABLE(aBufferLen);
516*cfb92d14SAndroid Build Coastguard Worker 
517*cfb92d14SAndroid Build Coastguard Worker     *aKeyLen = 0;
518*cfb92d14SAndroid Build Coastguard Worker 
519*cfb92d14SAndroid Build Coastguard Worker     return OT_ERROR_NONE;
520*cfb92d14SAndroid Build Coastguard Worker }
521*cfb92d14SAndroid Build Coastguard Worker 
otPlatCryptoDestroyKey(otCryptoKeyRef aKeyRef)522*cfb92d14SAndroid Build Coastguard Worker otError otPlatCryptoDestroyKey(otCryptoKeyRef aKeyRef)
523*cfb92d14SAndroid Build Coastguard Worker {
524*cfb92d14SAndroid Build Coastguard Worker     OT_UNUSED_VARIABLE(aKeyRef);
525*cfb92d14SAndroid Build Coastguard Worker 
526*cfb92d14SAndroid Build Coastguard Worker     return OT_ERROR_NONE;
527*cfb92d14SAndroid Build Coastguard Worker }
528*cfb92d14SAndroid Build Coastguard Worker 
otPlatCryptoHasKey(otCryptoKeyRef aKeyRef)529*cfb92d14SAndroid Build Coastguard Worker bool otPlatCryptoHasKey(otCryptoKeyRef aKeyRef)
530*cfb92d14SAndroid Build Coastguard Worker {
531*cfb92d14SAndroid Build Coastguard Worker     OT_UNUSED_VARIABLE(aKeyRef);
532*cfb92d14SAndroid Build Coastguard Worker 
533*cfb92d14SAndroid Build Coastguard Worker     return false;
534*cfb92d14SAndroid Build Coastguard Worker }
535*cfb92d14SAndroid Build Coastguard Worker 
otPlatCryptoEcdsaGenerateAndImportKey(otCryptoKeyRef aKeyRef)536*cfb92d14SAndroid Build Coastguard Worker otError otPlatCryptoEcdsaGenerateAndImportKey(otCryptoKeyRef aKeyRef)
537*cfb92d14SAndroid Build Coastguard Worker {
538*cfb92d14SAndroid Build Coastguard Worker     OT_UNUSED_VARIABLE(aKeyRef);
539*cfb92d14SAndroid Build Coastguard Worker 
540*cfb92d14SAndroid Build Coastguard Worker     return OT_ERROR_NONE;
541*cfb92d14SAndroid Build Coastguard Worker }
542*cfb92d14SAndroid Build Coastguard Worker 
otPlatCryptoEcdsaExportPublicKey(otCryptoKeyRef aKeyRef,otPlatCryptoEcdsaPublicKey * aPublicKey)543*cfb92d14SAndroid Build Coastguard Worker otError otPlatCryptoEcdsaExportPublicKey(otCryptoKeyRef aKeyRef, otPlatCryptoEcdsaPublicKey *aPublicKey)
544*cfb92d14SAndroid Build Coastguard Worker {
545*cfb92d14SAndroid Build Coastguard Worker     OT_UNUSED_VARIABLE(aKeyRef);
546*cfb92d14SAndroid Build Coastguard Worker     OT_UNUSED_VARIABLE(aPublicKey);
547*cfb92d14SAndroid Build Coastguard Worker 
548*cfb92d14SAndroid Build Coastguard Worker     return OT_ERROR_NONE;
549*cfb92d14SAndroid Build Coastguard Worker }
550*cfb92d14SAndroid Build Coastguard Worker 
otPlatCryptoEcdsaSignUsingKeyRef(otCryptoKeyRef aKeyRef,const otPlatCryptoSha256Hash * aHash,otPlatCryptoEcdsaSignature * aSignature)551*cfb92d14SAndroid Build Coastguard Worker otError otPlatCryptoEcdsaSignUsingKeyRef(otCryptoKeyRef                aKeyRef,
552*cfb92d14SAndroid Build Coastguard Worker                                          const otPlatCryptoSha256Hash *aHash,
553*cfb92d14SAndroid Build Coastguard Worker                                          otPlatCryptoEcdsaSignature   *aSignature)
554*cfb92d14SAndroid Build Coastguard Worker {
555*cfb92d14SAndroid Build Coastguard Worker     OT_UNUSED_VARIABLE(aKeyRef);
556*cfb92d14SAndroid Build Coastguard Worker     OT_UNUSED_VARIABLE(aHash);
557*cfb92d14SAndroid Build Coastguard Worker     OT_UNUSED_VARIABLE(aSignature);
558*cfb92d14SAndroid Build Coastguard Worker 
559*cfb92d14SAndroid Build Coastguard Worker     return OT_ERROR_NONE;
560*cfb92d14SAndroid Build Coastguard Worker }
561*cfb92d14SAndroid Build Coastguard Worker 
otPlatCryptoEcdsaVerifyUsingKeyRef(otCryptoKeyRef aKeyRef,const otPlatCryptoSha256Hash * aHash,const otPlatCryptoEcdsaSignature * aSignature)562*cfb92d14SAndroid Build Coastguard Worker otError otPlatCryptoEcdsaVerifyUsingKeyRef(otCryptoKeyRef                    aKeyRef,
563*cfb92d14SAndroid Build Coastguard Worker                                            const otPlatCryptoSha256Hash     *aHash,
564*cfb92d14SAndroid Build Coastguard Worker                                            const otPlatCryptoEcdsaSignature *aSignature)
565*cfb92d14SAndroid Build Coastguard Worker {
566*cfb92d14SAndroid Build Coastguard Worker     OT_UNUSED_VARIABLE(aKeyRef);
567*cfb92d14SAndroid Build Coastguard Worker     OT_UNUSED_VARIABLE(aHash);
568*cfb92d14SAndroid Build Coastguard Worker     OT_UNUSED_VARIABLE(aSignature);
569*cfb92d14SAndroid Build Coastguard Worker 
570*cfb92d14SAndroid Build Coastguard Worker     return OT_ERROR_NONE;
571*cfb92d14SAndroid Build Coastguard Worker }
572*cfb92d14SAndroid Build Coastguard Worker 
573*cfb92d14SAndroid Build Coastguard Worker #endif // OPENTHREAD_CONFIG_PLATFORM_KEY_REFERENCES_ENABLE
574*cfb92d14SAndroid Build Coastguard Worker 
otPlatRadioSetCcaEnergyDetectThreshold(otInstance * aInstance,int8_t aThreshold)575*cfb92d14SAndroid Build Coastguard Worker otError otPlatRadioSetCcaEnergyDetectThreshold(otInstance *aInstance, int8_t aThreshold)
576*cfb92d14SAndroid Build Coastguard Worker {
577*cfb92d14SAndroid Build Coastguard Worker     OT_UNUSED_VARIABLE(aInstance);
578*cfb92d14SAndroid Build Coastguard Worker     OT_UNUSED_VARIABLE(aThreshold);
579*cfb92d14SAndroid Build Coastguard Worker 
580*cfb92d14SAndroid Build Coastguard Worker     return OT_ERROR_NONE;
581*cfb92d14SAndroid Build Coastguard Worker }
582*cfb92d14SAndroid Build Coastguard Worker 
583*cfb92d14SAndroid Build Coastguard Worker #if OPENTHREAD_CONFIG_MULTICAST_DNS_ENABLE
584*cfb92d14SAndroid Build Coastguard Worker 
otPlatMdnsSetListeningEnabled(otInstance * aInstance,bool aEnable,uint32_t aInfraIfIndex)585*cfb92d14SAndroid Build Coastguard Worker OT_TOOL_WEAK otError otPlatMdnsSetListeningEnabled(otInstance *aInstance, bool aEnable, uint32_t aInfraIfIndex)
586*cfb92d14SAndroid Build Coastguard Worker {
587*cfb92d14SAndroid Build Coastguard Worker     OT_UNUSED_VARIABLE(aInstance);
588*cfb92d14SAndroid Build Coastguard Worker     OT_UNUSED_VARIABLE(aEnable);
589*cfb92d14SAndroid Build Coastguard Worker     OT_UNUSED_VARIABLE(aInfraIfIndex);
590*cfb92d14SAndroid Build Coastguard Worker 
591*cfb92d14SAndroid Build Coastguard Worker     return OT_ERROR_NOT_IMPLEMENTED;
592*cfb92d14SAndroid Build Coastguard Worker }
593*cfb92d14SAndroid Build Coastguard Worker 
otPlatMdnsSendMulticast(otInstance * aInstance,otMessage * aMessage,uint32_t aInfraIfIndex)594*cfb92d14SAndroid Build Coastguard Worker OT_TOOL_WEAK void otPlatMdnsSendMulticast(otInstance *aInstance, otMessage *aMessage, uint32_t aInfraIfIndex)
595*cfb92d14SAndroid Build Coastguard Worker {
596*cfb92d14SAndroid Build Coastguard Worker     OT_UNUSED_VARIABLE(aInstance);
597*cfb92d14SAndroid Build Coastguard Worker     OT_UNUSED_VARIABLE(aMessage);
598*cfb92d14SAndroid Build Coastguard Worker     OT_UNUSED_VARIABLE(aInfraIfIndex);
599*cfb92d14SAndroid Build Coastguard Worker }
600*cfb92d14SAndroid Build Coastguard Worker 
otPlatMdnsSendUnicast(otInstance * aInstance,otMessage * aMessage,const otPlatMdnsAddressInfo * aAddress)601*cfb92d14SAndroid Build Coastguard Worker OT_TOOL_WEAK void otPlatMdnsSendUnicast(otInstance                  *aInstance,
602*cfb92d14SAndroid Build Coastguard Worker                                         otMessage                   *aMessage,
603*cfb92d14SAndroid Build Coastguard Worker                                         const otPlatMdnsAddressInfo *aAddress)
604*cfb92d14SAndroid Build Coastguard Worker {
605*cfb92d14SAndroid Build Coastguard Worker     OT_UNUSED_VARIABLE(aInstance);
606*cfb92d14SAndroid Build Coastguard Worker     OT_UNUSED_VARIABLE(aMessage);
607*cfb92d14SAndroid Build Coastguard Worker     OT_UNUSED_VARIABLE(aAddress);
608*cfb92d14SAndroid Build Coastguard Worker }
609*cfb92d14SAndroid Build Coastguard Worker 
610*cfb92d14SAndroid Build Coastguard Worker #endif // OPENTHREAD_CONFIG_MULTICAST_DNS_ENABLE
611*cfb92d14SAndroid Build Coastguard Worker 
612*cfb92d14SAndroid Build Coastguard Worker #if OPENTHREAD_CONFIG_DNS_DSO_ENABLE
613*cfb92d14SAndroid Build Coastguard Worker 
otPlatDsoEnableListening(otInstance * aInstance,bool aEnable)614*cfb92d14SAndroid Build Coastguard Worker OT_TOOL_WEAK void otPlatDsoEnableListening(otInstance *aInstance, bool aEnable)
615*cfb92d14SAndroid Build Coastguard Worker {
616*cfb92d14SAndroid Build Coastguard Worker     OT_UNUSED_VARIABLE(aInstance);
617*cfb92d14SAndroid Build Coastguard Worker     OT_UNUSED_VARIABLE(aEnable);
618*cfb92d14SAndroid Build Coastguard Worker }
619*cfb92d14SAndroid Build Coastguard Worker 
otPlatDsoConnect(otPlatDsoConnection * aConnection,const otSockAddr * aPeerSockAddr)620*cfb92d14SAndroid Build Coastguard Worker OT_TOOL_WEAK void otPlatDsoConnect(otPlatDsoConnection *aConnection, const otSockAddr *aPeerSockAddr)
621*cfb92d14SAndroid Build Coastguard Worker {
622*cfb92d14SAndroid Build Coastguard Worker     OT_UNUSED_VARIABLE(aConnection);
623*cfb92d14SAndroid Build Coastguard Worker     OT_UNUSED_VARIABLE(aPeerSockAddr);
624*cfb92d14SAndroid Build Coastguard Worker }
625*cfb92d14SAndroid Build Coastguard Worker 
otPlatDsoSend(otPlatDsoConnection * aConnection,otMessage * aMessage)626*cfb92d14SAndroid Build Coastguard Worker OT_TOOL_WEAK void otPlatDsoSend(otPlatDsoConnection *aConnection, otMessage *aMessage)
627*cfb92d14SAndroid Build Coastguard Worker {
628*cfb92d14SAndroid Build Coastguard Worker     OT_UNUSED_VARIABLE(aConnection);
629*cfb92d14SAndroid Build Coastguard Worker     OT_UNUSED_VARIABLE(aMessage);
630*cfb92d14SAndroid Build Coastguard Worker }
631*cfb92d14SAndroid Build Coastguard Worker 
otPlatDsoDisconnect(otPlatDsoConnection * aConnection,otPlatDsoDisconnectMode aMode)632*cfb92d14SAndroid Build Coastguard Worker OT_TOOL_WEAK void otPlatDsoDisconnect(otPlatDsoConnection *aConnection, otPlatDsoDisconnectMode aMode)
633*cfb92d14SAndroid Build Coastguard Worker {
634*cfb92d14SAndroid Build Coastguard Worker     OT_UNUSED_VARIABLE(aConnection);
635*cfb92d14SAndroid Build Coastguard Worker     OT_UNUSED_VARIABLE(aMode);
636*cfb92d14SAndroid Build Coastguard Worker }
637*cfb92d14SAndroid Build Coastguard Worker 
638*cfb92d14SAndroid Build Coastguard Worker #endif // #if OPENTHREAD_CONFIG_DNS_DSO_ENABLE
639*cfb92d14SAndroid Build Coastguard Worker 
640*cfb92d14SAndroid Build Coastguard Worker #if OPENTHREAD_CONFIG_PLATFORM_UDP_ENABLE
otPlatUdpSocket(otUdpSocket * aUdpSocket)641*cfb92d14SAndroid Build Coastguard Worker otError otPlatUdpSocket(otUdpSocket *aUdpSocket)
642*cfb92d14SAndroid Build Coastguard Worker {
643*cfb92d14SAndroid Build Coastguard Worker     OT_UNUSED_VARIABLE(aUdpSocket);
644*cfb92d14SAndroid Build Coastguard Worker     return OT_ERROR_NONE;
645*cfb92d14SAndroid Build Coastguard Worker }
646*cfb92d14SAndroid Build Coastguard Worker 
otPlatUdpClose(otUdpSocket * aUdpSocket)647*cfb92d14SAndroid Build Coastguard Worker otError otPlatUdpClose(otUdpSocket *aUdpSocket)
648*cfb92d14SAndroid Build Coastguard Worker {
649*cfb92d14SAndroid Build Coastguard Worker     OT_UNUSED_VARIABLE(aUdpSocket);
650*cfb92d14SAndroid Build Coastguard Worker     return OT_ERROR_NONE;
651*cfb92d14SAndroid Build Coastguard Worker }
652*cfb92d14SAndroid Build Coastguard Worker 
otPlatUdpBind(otUdpSocket * aUdpSocket)653*cfb92d14SAndroid Build Coastguard Worker otError otPlatUdpBind(otUdpSocket *aUdpSocket)
654*cfb92d14SAndroid Build Coastguard Worker {
655*cfb92d14SAndroid Build Coastguard Worker     OT_UNUSED_VARIABLE(aUdpSocket);
656*cfb92d14SAndroid Build Coastguard Worker     return OT_ERROR_NONE;
657*cfb92d14SAndroid Build Coastguard Worker }
658*cfb92d14SAndroid Build Coastguard Worker 
otPlatUdpBindToNetif(otUdpSocket * aUdpSocket,otNetifIdentifier aNetifIdentifier)659*cfb92d14SAndroid Build Coastguard Worker otError otPlatUdpBindToNetif(otUdpSocket *aUdpSocket, otNetifIdentifier aNetifIdentifier)
660*cfb92d14SAndroid Build Coastguard Worker {
661*cfb92d14SAndroid Build Coastguard Worker     OT_UNUSED_VARIABLE(aUdpSocket);
662*cfb92d14SAndroid Build Coastguard Worker     OT_UNUSED_VARIABLE(aNetifIdentifier);
663*cfb92d14SAndroid Build Coastguard Worker     return OT_ERROR_NONE;
664*cfb92d14SAndroid Build Coastguard Worker }
665*cfb92d14SAndroid Build Coastguard Worker 
otPlatUdpConnect(otUdpSocket * aUdpSocket)666*cfb92d14SAndroid Build Coastguard Worker otError otPlatUdpConnect(otUdpSocket *aUdpSocket)
667*cfb92d14SAndroid Build Coastguard Worker {
668*cfb92d14SAndroid Build Coastguard Worker     OT_UNUSED_VARIABLE(aUdpSocket);
669*cfb92d14SAndroid Build Coastguard Worker     return OT_ERROR_NONE;
670*cfb92d14SAndroid Build Coastguard Worker }
671*cfb92d14SAndroid Build Coastguard Worker 
otPlatUdpSend(otUdpSocket * aUdpSocket,otMessage * aMessage,const otMessageInfo * aMessageInfo)672*cfb92d14SAndroid Build Coastguard Worker otError otPlatUdpSend(otUdpSocket *aUdpSocket, otMessage *aMessage, const otMessageInfo *aMessageInfo)
673*cfb92d14SAndroid Build Coastguard Worker {
674*cfb92d14SAndroid Build Coastguard Worker     OT_UNUSED_VARIABLE(aUdpSocket);
675*cfb92d14SAndroid Build Coastguard Worker     OT_UNUSED_VARIABLE(aMessageInfo);
676*cfb92d14SAndroid Build Coastguard Worker     return OT_ERROR_NONE;
677*cfb92d14SAndroid Build Coastguard Worker }
678*cfb92d14SAndroid Build Coastguard Worker 
otPlatUdpJoinMulticastGroup(otUdpSocket * aUdpSocket,otNetifIdentifier aNetifIdentifier,const otIp6Address * aAddress)679*cfb92d14SAndroid Build Coastguard Worker otError otPlatUdpJoinMulticastGroup(otUdpSocket        *aUdpSocket,
680*cfb92d14SAndroid Build Coastguard Worker                                     otNetifIdentifier   aNetifIdentifier,
681*cfb92d14SAndroid Build Coastguard Worker                                     const otIp6Address *aAddress)
682*cfb92d14SAndroid Build Coastguard Worker {
683*cfb92d14SAndroid Build Coastguard Worker     OT_UNUSED_VARIABLE(aUdpSocket);
684*cfb92d14SAndroid Build Coastguard Worker     OT_UNUSED_VARIABLE(aNetifIdentifier);
685*cfb92d14SAndroid Build Coastguard Worker     OT_UNUSED_VARIABLE(aAddress);
686*cfb92d14SAndroid Build Coastguard Worker     return OT_ERROR_NONE;
687*cfb92d14SAndroid Build Coastguard Worker }
688*cfb92d14SAndroid Build Coastguard Worker 
otPlatUdpLeaveMulticastGroup(otUdpSocket * aUdpSocket,otNetifIdentifier aNetifIdentifier,const otIp6Address * aAddress)689*cfb92d14SAndroid Build Coastguard Worker otError otPlatUdpLeaveMulticastGroup(otUdpSocket        *aUdpSocket,
690*cfb92d14SAndroid Build Coastguard Worker                                      otNetifIdentifier   aNetifIdentifier,
691*cfb92d14SAndroid Build Coastguard Worker                                      const otIp6Address *aAddress)
692*cfb92d14SAndroid Build Coastguard Worker {
693*cfb92d14SAndroid Build Coastguard Worker     OT_UNUSED_VARIABLE(aUdpSocket);
694*cfb92d14SAndroid Build Coastguard Worker     OT_UNUSED_VARIABLE(aNetifIdentifier);
695*cfb92d14SAndroid Build Coastguard Worker     OT_UNUSED_VARIABLE(aAddress);
696*cfb92d14SAndroid Build Coastguard Worker     return OT_ERROR_NONE;
697*cfb92d14SAndroid Build Coastguard Worker }
698*cfb92d14SAndroid Build Coastguard Worker #endif // OPENTHREAD_CONFIG_PLATFORM_UDP_ENABLE
699*cfb92d14SAndroid Build Coastguard Worker 
700*cfb92d14SAndroid Build Coastguard Worker #if OPENTHREAD_CONFIG_DNS_UPSTREAM_QUERY_ENABLE
otPlatDnsStartUpstreamQuery(otInstance * aInstance,otPlatDnsUpstreamQuery * aTxn,const otMessage * aQuery)701*cfb92d14SAndroid Build Coastguard Worker void otPlatDnsStartUpstreamQuery(otInstance *aInstance, otPlatDnsUpstreamQuery *aTxn, const otMessage *aQuery)
702*cfb92d14SAndroid Build Coastguard Worker {
703*cfb92d14SAndroid Build Coastguard Worker     OT_UNUSED_VARIABLE(aInstance);
704*cfb92d14SAndroid Build Coastguard Worker     OT_UNUSED_VARIABLE(aTxn);
705*cfb92d14SAndroid Build Coastguard Worker     OT_UNUSED_VARIABLE(aQuery);
706*cfb92d14SAndroid Build Coastguard Worker }
707*cfb92d14SAndroid Build Coastguard Worker 
otPlatDnsCancelUpstreamQuery(otInstance * aInstance,otPlatDnsUpstreamQuery * aTxn)708*cfb92d14SAndroid Build Coastguard Worker void otPlatDnsCancelUpstreamQuery(otInstance *aInstance, otPlatDnsUpstreamQuery *aTxn)
709*cfb92d14SAndroid Build Coastguard Worker {
710*cfb92d14SAndroid Build Coastguard Worker     otPlatDnsUpstreamQueryDone(aInstance, aTxn, nullptr);
711*cfb92d14SAndroid Build Coastguard Worker }
712*cfb92d14SAndroid Build Coastguard Worker #endif
713*cfb92d14SAndroid Build Coastguard Worker 
otPlatRadioGetCcaEnergyDetectThreshold(otInstance *,int8_t *)714*cfb92d14SAndroid Build Coastguard Worker OT_TOOL_WEAK otError otPlatRadioGetCcaEnergyDetectThreshold(otInstance *, int8_t *) { return OT_ERROR_NONE; }
715*cfb92d14SAndroid Build Coastguard Worker 
otPlatRadioGetCoexMetrics(otInstance *,otRadioCoexMetrics *)716*cfb92d14SAndroid Build Coastguard Worker OT_TOOL_WEAK otError otPlatRadioGetCoexMetrics(otInstance *, otRadioCoexMetrics *) { return OT_ERROR_NONE; }
717*cfb92d14SAndroid Build Coastguard Worker 
otPlatRadioGetTransmitPower(otInstance *,int8_t *)718*cfb92d14SAndroid Build Coastguard Worker OT_TOOL_WEAK otError otPlatRadioGetTransmitPower(otInstance *, int8_t *) { return OT_ERROR_NONE; }
719*cfb92d14SAndroid Build Coastguard Worker 
otPlatRadioIsCoexEnabled(otInstance *)720*cfb92d14SAndroid Build Coastguard Worker OT_TOOL_WEAK bool otPlatRadioIsCoexEnabled(otInstance *) { return true; }
721*cfb92d14SAndroid Build Coastguard Worker 
otPlatRadioSetCoexEnabled(otInstance *,bool)722*cfb92d14SAndroid Build Coastguard Worker OT_TOOL_WEAK otError otPlatRadioSetCoexEnabled(otInstance *, bool) { return OT_ERROR_NOT_IMPLEMENTED; }
723*cfb92d14SAndroid Build Coastguard Worker 
724*cfb92d14SAndroid Build Coastguard Worker #if OPENTHREAD_CONFIG_PLATFORM_POWER_CALIBRATION_ENABLE
otPlatRadioSetChannelTargetPower(otInstance * aInstance,uint8_t aChannel,int16_t aTargetPower)725*cfb92d14SAndroid Build Coastguard Worker OT_TOOL_WEAK otError otPlatRadioSetChannelTargetPower(otInstance *aInstance, uint8_t aChannel, int16_t aTargetPower)
726*cfb92d14SAndroid Build Coastguard Worker {
727*cfb92d14SAndroid Build Coastguard Worker     return OT_ERROR_NONE;
728*cfb92d14SAndroid Build Coastguard Worker }
729*cfb92d14SAndroid Build Coastguard Worker 
otPlatRadioAddCalibratedPower(otInstance * aInstance,uint8_t aChannel,int16_t aActualPower,const uint8_t * aRawPowerSetting,uint16_t aRawPowerSettingLength)730*cfb92d14SAndroid Build Coastguard Worker OT_TOOL_WEAK otError otPlatRadioAddCalibratedPower(otInstance    *aInstance,
731*cfb92d14SAndroid Build Coastguard Worker                                                    uint8_t        aChannel,
732*cfb92d14SAndroid Build Coastguard Worker                                                    int16_t        aActualPower,
733*cfb92d14SAndroid Build Coastguard Worker                                                    const uint8_t *aRawPowerSetting,
734*cfb92d14SAndroid Build Coastguard Worker                                                    uint16_t       aRawPowerSettingLength)
735*cfb92d14SAndroid Build Coastguard Worker {
736*cfb92d14SAndroid Build Coastguard Worker     return OT_ERROR_NONE;
737*cfb92d14SAndroid Build Coastguard Worker }
738*cfb92d14SAndroid Build Coastguard Worker 
otPlatRadioClearCalibratedPowers(otInstance * aInstance)739*cfb92d14SAndroid Build Coastguard Worker OT_TOOL_WEAK otError otPlatRadioClearCalibratedPowers(otInstance *aInstance) { return OT_ERROR_NONE; }
740*cfb92d14SAndroid Build Coastguard Worker #endif // OPENTHREAD_CONFIG_PLATFORM_POWER_CALIBRATION_ENABLE
741*cfb92d14SAndroid Build Coastguard Worker 
742*cfb92d14SAndroid Build Coastguard Worker #if OPENTHREAD_CONFIG_NCP_ENABLE_MCU_POWER_STATE_CONTROL
otPlatGetMcuPowerState(otInstance * aInstance)743*cfb92d14SAndroid Build Coastguard Worker OT_TOOL_WEAK otPlatMcuPowerState otPlatGetMcuPowerState(otInstance *aInstance) { return OT_PLAT_MCU_POWER_STATE_ON; }
744*cfb92d14SAndroid Build Coastguard Worker 
otPlatSetMcuPowerState(otInstance * aInstance,otPlatMcuPowerState aState)745*cfb92d14SAndroid Build Coastguard Worker OT_TOOL_WEAK otError otPlatSetMcuPowerState(otInstance *aInstance, otPlatMcuPowerState aState) { return OT_ERROR_NONE; }
746*cfb92d14SAndroid Build Coastguard Worker #endif // OPENTHREAD_CONFIG_NCP_ENABLE_MCU_POWER_STATE_CONTROL
747*cfb92d14SAndroid Build Coastguard Worker #ifdef OPENTHREAD_CONFIG_BLE_TCAT_ENABLE
otPlatBleEnable(otInstance * aInstance)748*cfb92d14SAndroid Build Coastguard Worker otError otPlatBleEnable(otInstance *aInstance)
749*cfb92d14SAndroid Build Coastguard Worker {
750*cfb92d14SAndroid Build Coastguard Worker     OT_UNUSED_VARIABLE(aInstance);
751*cfb92d14SAndroid Build Coastguard Worker     return OT_ERROR_NONE;
752*cfb92d14SAndroid Build Coastguard Worker }
753*cfb92d14SAndroid Build Coastguard Worker 
otPlatBleDisable(otInstance * aInstance)754*cfb92d14SAndroid Build Coastguard Worker otError otPlatBleDisable(otInstance *aInstance)
755*cfb92d14SAndroid Build Coastguard Worker {
756*cfb92d14SAndroid Build Coastguard Worker     OT_UNUSED_VARIABLE(aInstance);
757*cfb92d14SAndroid Build Coastguard Worker     return OT_ERROR_NONE;
758*cfb92d14SAndroid Build Coastguard Worker }
759*cfb92d14SAndroid Build Coastguard Worker 
otPlatBleGetAdvertisementBuffer(otInstance * aInstance,uint8_t ** aAdvertisementBuffer)760*cfb92d14SAndroid Build Coastguard Worker otError otPlatBleGetAdvertisementBuffer(otInstance *aInstance, uint8_t **aAdvertisementBuffer)
761*cfb92d14SAndroid Build Coastguard Worker {
762*cfb92d14SAndroid Build Coastguard Worker     OT_UNUSED_VARIABLE(aInstance);
763*cfb92d14SAndroid Build Coastguard Worker     static uint8_t sAdvertisementBuffer[OT_TCAT_ADVERTISEMENT_MAX_LEN];
764*cfb92d14SAndroid Build Coastguard Worker 
765*cfb92d14SAndroid Build Coastguard Worker     *aAdvertisementBuffer = sAdvertisementBuffer;
766*cfb92d14SAndroid Build Coastguard Worker 
767*cfb92d14SAndroid Build Coastguard Worker     return OT_ERROR_NONE;
768*cfb92d14SAndroid Build Coastguard Worker }
769*cfb92d14SAndroid Build Coastguard Worker 
otPlatBleGapAdvStart(otInstance * aInstance,uint16_t aInterval)770*cfb92d14SAndroid Build Coastguard Worker otError otPlatBleGapAdvStart(otInstance *aInstance, uint16_t aInterval)
771*cfb92d14SAndroid Build Coastguard Worker {
772*cfb92d14SAndroid Build Coastguard Worker     OT_UNUSED_VARIABLE(aInstance);
773*cfb92d14SAndroid Build Coastguard Worker     OT_UNUSED_VARIABLE(aInterval);
774*cfb92d14SAndroid Build Coastguard Worker     return OT_ERROR_NONE;
775*cfb92d14SAndroid Build Coastguard Worker }
776*cfb92d14SAndroid Build Coastguard Worker 
otPlatBleGapAdvStop(otInstance * aInstance)777*cfb92d14SAndroid Build Coastguard Worker otError otPlatBleGapAdvStop(otInstance *aInstance)
778*cfb92d14SAndroid Build Coastguard Worker {
779*cfb92d14SAndroid Build Coastguard Worker     OT_UNUSED_VARIABLE(aInstance);
780*cfb92d14SAndroid Build Coastguard Worker     return OT_ERROR_NONE;
781*cfb92d14SAndroid Build Coastguard Worker }
782*cfb92d14SAndroid Build Coastguard Worker 
otPlatBleGapDisconnect(otInstance * aInstance)783*cfb92d14SAndroid Build Coastguard Worker otError otPlatBleGapDisconnect(otInstance *aInstance)
784*cfb92d14SAndroid Build Coastguard Worker {
785*cfb92d14SAndroid Build Coastguard Worker     OT_UNUSED_VARIABLE(aInstance);
786*cfb92d14SAndroid Build Coastguard Worker     return OT_ERROR_NONE;
787*cfb92d14SAndroid Build Coastguard Worker }
788*cfb92d14SAndroid Build Coastguard Worker 
otPlatBleGattMtuGet(otInstance * aInstance,uint16_t * aMtu)789*cfb92d14SAndroid Build Coastguard Worker otError otPlatBleGattMtuGet(otInstance *aInstance, uint16_t *aMtu)
790*cfb92d14SAndroid Build Coastguard Worker {
791*cfb92d14SAndroid Build Coastguard Worker     OT_UNUSED_VARIABLE(aInstance);
792*cfb92d14SAndroid Build Coastguard Worker     OT_UNUSED_VARIABLE(aMtu);
793*cfb92d14SAndroid Build Coastguard Worker     return OT_ERROR_NONE;
794*cfb92d14SAndroid Build Coastguard Worker }
795*cfb92d14SAndroid Build Coastguard Worker 
otPlatBleGattServerIndicate(otInstance * aInstance,uint16_t aHandle,const otBleRadioPacket * aPacket)796*cfb92d14SAndroid Build Coastguard Worker otError otPlatBleGattServerIndicate(otInstance *aInstance, uint16_t aHandle, const otBleRadioPacket *aPacket)
797*cfb92d14SAndroid Build Coastguard Worker {
798*cfb92d14SAndroid Build Coastguard Worker     OT_UNUSED_VARIABLE(aInstance);
799*cfb92d14SAndroid Build Coastguard Worker     OT_UNUSED_VARIABLE(aHandle);
800*cfb92d14SAndroid Build Coastguard Worker     OT_UNUSED_VARIABLE(aPacket);
801*cfb92d14SAndroid Build Coastguard Worker     return OT_ERROR_NONE;
802*cfb92d14SAndroid Build Coastguard Worker }
803*cfb92d14SAndroid Build Coastguard Worker 
otPlatBleGetLinkCapabilities(otInstance * aInstance,otBleLinkCapabilities * aBleLinkCapabilities)804*cfb92d14SAndroid Build Coastguard Worker void otPlatBleGetLinkCapabilities(otInstance *aInstance, otBleLinkCapabilities *aBleLinkCapabilities)
805*cfb92d14SAndroid Build Coastguard Worker {
806*cfb92d14SAndroid Build Coastguard Worker     OT_UNUSED_VARIABLE(aInstance);
807*cfb92d14SAndroid Build Coastguard Worker 
808*cfb92d14SAndroid Build Coastguard Worker     aBleLinkCapabilities->mGattNotifications = true;
809*cfb92d14SAndroid Build Coastguard Worker     aBleLinkCapabilities->mL2CapDirect       = false;
810*cfb92d14SAndroid Build Coastguard Worker     aBleLinkCapabilities->mRsv               = 0;
811*cfb92d14SAndroid Build Coastguard Worker }
812*cfb92d14SAndroid Build Coastguard Worker 
otPlatBleSupportsMultiRadio(otInstance * aInstance)813*cfb92d14SAndroid Build Coastguard Worker bool otPlatBleSupportsMultiRadio(otInstance *aInstance)
814*cfb92d14SAndroid Build Coastguard Worker {
815*cfb92d14SAndroid Build Coastguard Worker     OT_UNUSED_VARIABLE(aInstance);
816*cfb92d14SAndroid Build Coastguard Worker     return false;
817*cfb92d14SAndroid Build Coastguard Worker }
818*cfb92d14SAndroid Build Coastguard Worker 
otPlatBleGapAdvSetData(otInstance * aInstance,uint8_t * aAdvertisementData,uint16_t aAdvertisementLen)819*cfb92d14SAndroid Build Coastguard Worker otError otPlatBleGapAdvSetData(otInstance *aInstance, uint8_t *aAdvertisementData, uint16_t aAdvertisementLen)
820*cfb92d14SAndroid Build Coastguard Worker {
821*cfb92d14SAndroid Build Coastguard Worker     OT_UNUSED_VARIABLE(aInstance);
822*cfb92d14SAndroid Build Coastguard Worker     OT_UNUSED_VARIABLE(aAdvertisementData);
823*cfb92d14SAndroid Build Coastguard Worker     OT_UNUSED_VARIABLE(aAdvertisementLen);
824*cfb92d14SAndroid Build Coastguard Worker     return OT_ERROR_NONE;
825*cfb92d14SAndroid Build Coastguard Worker }
826*cfb92d14SAndroid Build Coastguard Worker 
827*cfb92d14SAndroid Build Coastguard Worker #endif // OPENTHREAD_CONFIG_BLE_TCAT_ENABLE
828*cfb92d14SAndroid Build Coastguard Worker 
829*cfb92d14SAndroid Build Coastguard Worker #if OPENTHREAD_CONFIG_PLATFORM_DNSSD_ENABLE
830*cfb92d14SAndroid Build Coastguard Worker 
otPlatDnssdGetState(otInstance * aInstance)831*cfb92d14SAndroid Build Coastguard Worker OT_TOOL_WEAK otPlatDnssdState otPlatDnssdGetState(otInstance *aInstance)
832*cfb92d14SAndroid Build Coastguard Worker {
833*cfb92d14SAndroid Build Coastguard Worker     OT_UNUSED_VARIABLE(aInstance);
834*cfb92d14SAndroid Build Coastguard Worker 
835*cfb92d14SAndroid Build Coastguard Worker     return OT_PLAT_DNSSD_STOPPED;
836*cfb92d14SAndroid Build Coastguard Worker }
837*cfb92d14SAndroid Build Coastguard Worker 
otPlatDnssdRegisterService(otInstance * aInstance,const otPlatDnssdService * aService,otPlatDnssdRequestId aRequestId,otPlatDnssdRegisterCallback aCallback)838*cfb92d14SAndroid Build Coastguard Worker OT_TOOL_WEAK void otPlatDnssdRegisterService(otInstance                 *aInstance,
839*cfb92d14SAndroid Build Coastguard Worker                                              const otPlatDnssdService   *aService,
840*cfb92d14SAndroid Build Coastguard Worker                                              otPlatDnssdRequestId        aRequestId,
841*cfb92d14SAndroid Build Coastguard Worker                                              otPlatDnssdRegisterCallback aCallback)
842*cfb92d14SAndroid Build Coastguard Worker {
843*cfb92d14SAndroid Build Coastguard Worker     OT_UNUSED_VARIABLE(aInstance);
844*cfb92d14SAndroid Build Coastguard Worker     OT_UNUSED_VARIABLE(aService);
845*cfb92d14SAndroid Build Coastguard Worker     OT_UNUSED_VARIABLE(aRequestId);
846*cfb92d14SAndroid Build Coastguard Worker     OT_UNUSED_VARIABLE(aCallback);
847*cfb92d14SAndroid Build Coastguard Worker }
848*cfb92d14SAndroid Build Coastguard Worker 
otPlatDnssdUnregisterService(otInstance * aInstance,const otPlatDnssdService * aService,otPlatDnssdRequestId aRequestId,otPlatDnssdRegisterCallback aCallback)849*cfb92d14SAndroid Build Coastguard Worker OT_TOOL_WEAK void otPlatDnssdUnregisterService(otInstance                 *aInstance,
850*cfb92d14SAndroid Build Coastguard Worker                                                const otPlatDnssdService   *aService,
851*cfb92d14SAndroid Build Coastguard Worker                                                otPlatDnssdRequestId        aRequestId,
852*cfb92d14SAndroid Build Coastguard Worker                                                otPlatDnssdRegisterCallback aCallback)
853*cfb92d14SAndroid Build Coastguard Worker {
854*cfb92d14SAndroid Build Coastguard Worker     OT_UNUSED_VARIABLE(aInstance);
855*cfb92d14SAndroid Build Coastguard Worker     OT_UNUSED_VARIABLE(aService);
856*cfb92d14SAndroid Build Coastguard Worker     OT_UNUSED_VARIABLE(aRequestId);
857*cfb92d14SAndroid Build Coastguard Worker     OT_UNUSED_VARIABLE(aCallback);
858*cfb92d14SAndroid Build Coastguard Worker }
859*cfb92d14SAndroid Build Coastguard Worker 
otPlatDnssdRegisterHost(otInstance * aInstance,const otPlatDnssdHost * aHost,otPlatDnssdRequestId aRequestId,otPlatDnssdRegisterCallback aCallback)860*cfb92d14SAndroid Build Coastguard Worker OT_TOOL_WEAK void otPlatDnssdRegisterHost(otInstance                 *aInstance,
861*cfb92d14SAndroid Build Coastguard Worker                                           const otPlatDnssdHost      *aHost,
862*cfb92d14SAndroid Build Coastguard Worker                                           otPlatDnssdRequestId        aRequestId,
863*cfb92d14SAndroid Build Coastguard Worker                                           otPlatDnssdRegisterCallback aCallback)
864*cfb92d14SAndroid Build Coastguard Worker {
865*cfb92d14SAndroid Build Coastguard Worker     OT_UNUSED_VARIABLE(aInstance);
866*cfb92d14SAndroid Build Coastguard Worker     OT_UNUSED_VARIABLE(aHost);
867*cfb92d14SAndroid Build Coastguard Worker     OT_UNUSED_VARIABLE(aRequestId);
868*cfb92d14SAndroid Build Coastguard Worker     OT_UNUSED_VARIABLE(aCallback);
869*cfb92d14SAndroid Build Coastguard Worker }
870*cfb92d14SAndroid Build Coastguard Worker 
otPlatDnssdUnregisterHost(otInstance * aInstance,const otPlatDnssdHost * aHost,otPlatDnssdRequestId aRequestId,otPlatDnssdRegisterCallback aCallback)871*cfb92d14SAndroid Build Coastguard Worker OT_TOOL_WEAK void otPlatDnssdUnregisterHost(otInstance                 *aInstance,
872*cfb92d14SAndroid Build Coastguard Worker                                             const otPlatDnssdHost      *aHost,
873*cfb92d14SAndroid Build Coastguard Worker                                             otPlatDnssdRequestId        aRequestId,
874*cfb92d14SAndroid Build Coastguard Worker                                             otPlatDnssdRegisterCallback aCallback)
875*cfb92d14SAndroid Build Coastguard Worker {
876*cfb92d14SAndroid Build Coastguard Worker     OT_UNUSED_VARIABLE(aInstance);
877*cfb92d14SAndroid Build Coastguard Worker     OT_UNUSED_VARIABLE(aHost);
878*cfb92d14SAndroid Build Coastguard Worker     OT_UNUSED_VARIABLE(aRequestId);
879*cfb92d14SAndroid Build Coastguard Worker     OT_UNUSED_VARIABLE(aCallback);
880*cfb92d14SAndroid Build Coastguard Worker }
881*cfb92d14SAndroid Build Coastguard Worker 
otPlatDnssdRegisterKey(otInstance * aInstance,const otPlatDnssdKey * aKey,otPlatDnssdRequestId aRequestId,otPlatDnssdRegisterCallback aCallback)882*cfb92d14SAndroid Build Coastguard Worker OT_TOOL_WEAK void otPlatDnssdRegisterKey(otInstance                 *aInstance,
883*cfb92d14SAndroid Build Coastguard Worker                                          const otPlatDnssdKey       *aKey,
884*cfb92d14SAndroid Build Coastguard Worker                                          otPlatDnssdRequestId        aRequestId,
885*cfb92d14SAndroid Build Coastguard Worker                                          otPlatDnssdRegisterCallback aCallback)
886*cfb92d14SAndroid Build Coastguard Worker {
887*cfb92d14SAndroid Build Coastguard Worker     OT_UNUSED_VARIABLE(aInstance);
888*cfb92d14SAndroid Build Coastguard Worker     OT_UNUSED_VARIABLE(aKey);
889*cfb92d14SAndroid Build Coastguard Worker     OT_UNUSED_VARIABLE(aRequestId);
890*cfb92d14SAndroid Build Coastguard Worker     OT_UNUSED_VARIABLE(aCallback);
891*cfb92d14SAndroid Build Coastguard Worker }
892*cfb92d14SAndroid Build Coastguard Worker 
otPlatDnssdUnregisterKey(otInstance * aInstance,const otPlatDnssdKey * aKey,otPlatDnssdRequestId aRequestId,otPlatDnssdRegisterCallback aCallback)893*cfb92d14SAndroid Build Coastguard Worker OT_TOOL_WEAK void otPlatDnssdUnregisterKey(otInstance                 *aInstance,
894*cfb92d14SAndroid Build Coastguard Worker                                            const otPlatDnssdKey       *aKey,
895*cfb92d14SAndroid Build Coastguard Worker                                            otPlatDnssdRequestId        aRequestId,
896*cfb92d14SAndroid Build Coastguard Worker                                            otPlatDnssdRegisterCallback aCallback)
897*cfb92d14SAndroid Build Coastguard Worker {
898*cfb92d14SAndroid Build Coastguard Worker     OT_UNUSED_VARIABLE(aInstance);
899*cfb92d14SAndroid Build Coastguard Worker     OT_UNUSED_VARIABLE(aKey);
900*cfb92d14SAndroid Build Coastguard Worker     OT_UNUSED_VARIABLE(aRequestId);
901*cfb92d14SAndroid Build Coastguard Worker     OT_UNUSED_VARIABLE(aCallback);
902*cfb92d14SAndroid Build Coastguard Worker }
903*cfb92d14SAndroid Build Coastguard Worker 
otPlatDnssdStartBrowser(otInstance * aInstance,const otPlatDnssdBrowser * aBrowser)904*cfb92d14SAndroid Build Coastguard Worker OT_TOOL_WEAK void otPlatDnssdStartBrowser(otInstance *aInstance, const otPlatDnssdBrowser *aBrowser)
905*cfb92d14SAndroid Build Coastguard Worker {
906*cfb92d14SAndroid Build Coastguard Worker     OT_UNUSED_VARIABLE(aInstance);
907*cfb92d14SAndroid Build Coastguard Worker     OT_UNUSED_VARIABLE(aBrowser);
908*cfb92d14SAndroid Build Coastguard Worker }
909*cfb92d14SAndroid Build Coastguard Worker 
otPlatDnssdStopBrowser(otInstance * aInstance,const otPlatDnssdBrowser * aBrowser)910*cfb92d14SAndroid Build Coastguard Worker OT_TOOL_WEAK void otPlatDnssdStopBrowser(otInstance *aInstance, const otPlatDnssdBrowser *aBrowser)
911*cfb92d14SAndroid Build Coastguard Worker {
912*cfb92d14SAndroid Build Coastguard Worker     OT_UNUSED_VARIABLE(aInstance);
913*cfb92d14SAndroid Build Coastguard Worker     OT_UNUSED_VARIABLE(aBrowser);
914*cfb92d14SAndroid Build Coastguard Worker }
915*cfb92d14SAndroid Build Coastguard Worker 
otPlatDnssdStartSrvResolver(otInstance * aInstance,const otPlatDnssdSrvResolver * aResolver)916*cfb92d14SAndroid Build Coastguard Worker OT_TOOL_WEAK void otPlatDnssdStartSrvResolver(otInstance *aInstance, const otPlatDnssdSrvResolver *aResolver)
917*cfb92d14SAndroid Build Coastguard Worker {
918*cfb92d14SAndroid Build Coastguard Worker     OT_UNUSED_VARIABLE(aInstance);
919*cfb92d14SAndroid Build Coastguard Worker     OT_UNUSED_VARIABLE(aResolver);
920*cfb92d14SAndroid Build Coastguard Worker }
921*cfb92d14SAndroid Build Coastguard Worker 
otPlatDnssdStopSrvResolver(otInstance * aInstance,const otPlatDnssdSrvResolver * aResolver)922*cfb92d14SAndroid Build Coastguard Worker OT_TOOL_WEAK void otPlatDnssdStopSrvResolver(otInstance *aInstance, const otPlatDnssdSrvResolver *aResolver)
923*cfb92d14SAndroid Build Coastguard Worker {
924*cfb92d14SAndroid Build Coastguard Worker     OT_UNUSED_VARIABLE(aInstance);
925*cfb92d14SAndroid Build Coastguard Worker     OT_UNUSED_VARIABLE(aResolver);
926*cfb92d14SAndroid Build Coastguard Worker }
927*cfb92d14SAndroid Build Coastguard Worker 
otPlatDnssdStartTxtResolver(otInstance * aInstance,const otPlatDnssdTxtResolver * aResolver)928*cfb92d14SAndroid Build Coastguard Worker OT_TOOL_WEAK void otPlatDnssdStartTxtResolver(otInstance *aInstance, const otPlatDnssdTxtResolver *aResolver)
929*cfb92d14SAndroid Build Coastguard Worker {
930*cfb92d14SAndroid Build Coastguard Worker     OT_UNUSED_VARIABLE(aInstance);
931*cfb92d14SAndroid Build Coastguard Worker     OT_UNUSED_VARIABLE(aResolver);
932*cfb92d14SAndroid Build Coastguard Worker }
933*cfb92d14SAndroid Build Coastguard Worker 
otPlatDnssdStopTxtResolver(otInstance * aInstance,const otPlatDnssdTxtResolver * aResolver)934*cfb92d14SAndroid Build Coastguard Worker OT_TOOL_WEAK void otPlatDnssdStopTxtResolver(otInstance *aInstance, const otPlatDnssdTxtResolver *aResolver)
935*cfb92d14SAndroid Build Coastguard Worker {
936*cfb92d14SAndroid Build Coastguard Worker     OT_UNUSED_VARIABLE(aInstance);
937*cfb92d14SAndroid Build Coastguard Worker     OT_UNUSED_VARIABLE(aResolver);
938*cfb92d14SAndroid Build Coastguard Worker }
939*cfb92d14SAndroid Build Coastguard Worker 
otPlatDnssdStartIp6AddressResolver(otInstance * aInstance,const otPlatDnssdAddressResolver * aResolver)940*cfb92d14SAndroid Build Coastguard Worker OT_TOOL_WEAK void otPlatDnssdStartIp6AddressResolver(otInstance *aInstance, const otPlatDnssdAddressResolver *aResolver)
941*cfb92d14SAndroid Build Coastguard Worker {
942*cfb92d14SAndroid Build Coastguard Worker     OT_UNUSED_VARIABLE(aInstance);
943*cfb92d14SAndroid Build Coastguard Worker     OT_UNUSED_VARIABLE(aResolver);
944*cfb92d14SAndroid Build Coastguard Worker }
945*cfb92d14SAndroid Build Coastguard Worker 
otPlatDnssdStopIp6AddressResolver(otInstance * aInstance,const otPlatDnssdAddressResolver * aResolver)946*cfb92d14SAndroid Build Coastguard Worker OT_TOOL_WEAK void otPlatDnssdStopIp6AddressResolver(otInstance *aInstance, const otPlatDnssdAddressResolver *aResolver)
947*cfb92d14SAndroid Build Coastguard Worker {
948*cfb92d14SAndroid Build Coastguard Worker     OT_UNUSED_VARIABLE(aInstance);
949*cfb92d14SAndroid Build Coastguard Worker     OT_UNUSED_VARIABLE(aResolver);
950*cfb92d14SAndroid Build Coastguard Worker }
951*cfb92d14SAndroid Build Coastguard Worker 
otPlatDnssdStartIp4AddressResolver(otInstance * aInstance,const otPlatDnssdAddressResolver * aResolver)952*cfb92d14SAndroid Build Coastguard Worker OT_TOOL_WEAK void otPlatDnssdStartIp4AddressResolver(otInstance *aInstance, const otPlatDnssdAddressResolver *aResolver)
953*cfb92d14SAndroid Build Coastguard Worker {
954*cfb92d14SAndroid Build Coastguard Worker     OT_UNUSED_VARIABLE(aInstance);
955*cfb92d14SAndroid Build Coastguard Worker     OT_UNUSED_VARIABLE(aResolver);
956*cfb92d14SAndroid Build Coastguard Worker }
957*cfb92d14SAndroid Build Coastguard Worker 
otPlatDnssdStopIp4AddressResolver(otInstance * aInstance,const otPlatDnssdAddressResolver * aResolver)958*cfb92d14SAndroid Build Coastguard Worker OT_TOOL_WEAK void otPlatDnssdStopIp4AddressResolver(otInstance *aInstance, const otPlatDnssdAddressResolver *aResolver)
959*cfb92d14SAndroid Build Coastguard Worker {
960*cfb92d14SAndroid Build Coastguard Worker     OT_UNUSED_VARIABLE(aInstance);
961*cfb92d14SAndroid Build Coastguard Worker     OT_UNUSED_VARIABLE(aResolver);
962*cfb92d14SAndroid Build Coastguard Worker }
963*cfb92d14SAndroid Build Coastguard Worker 
964*cfb92d14SAndroid Build Coastguard Worker #endif // OPENTHREAD_CONFIG_PLATFORM_DNSSD_ENABLE
965*cfb92d14SAndroid Build Coastguard Worker 
966*cfb92d14SAndroid Build Coastguard Worker #if OPENTHREAD_CONFIG_PLATFORM_LOG_CRASH_DUMP_ENABLE
otPlatLogCrashDump(void)967*cfb92d14SAndroid Build Coastguard Worker OT_TOOL_WEAK otError otPlatLogCrashDump(void) { return OT_ERROR_NONE; }
968*cfb92d14SAndroid Build Coastguard Worker #endif
969*cfb92d14SAndroid Build Coastguard Worker 
970*cfb92d14SAndroid Build Coastguard Worker } // extern "C"
971