Fix for x86_64 build fail
[platform/upstream/connectedhomeip.git] / third_party / ot-br-posix / repo / src / dbus / client / thread_api_dbus.hpp
1 /*
2  *    Copyright (c) 2020, The OpenThread Authors.
3  *    All rights reserved.
4  *
5  *    Redistribution and use in source and binary forms, with or without
6  *    modification, are permitted provided that the following conditions are met:
7  *    1. Redistributions of source code must retain the above copyright
8  *       notice, this list of conditions and the following disclaimer.
9  *    2. Redistributions in binary form must reproduce the above copyright
10  *       notice, this list of conditions and the following disclaimer in the
11  *       documentation and/or other materials provided with the distribution.
12  *    3. Neither the name of the copyright holder nor the
13  *       names of its contributors may be used to endorse or promote products
14  *       derived from this software without specific prior written permission.
15  *
16  *    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17  *    AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18  *    IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19  *    ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
20  *    LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21  *    CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22  *    SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23  *    INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24  *    CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25  *    ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26  *    POSSIBILITY OF SUCH DAMAGE.
27  */
28
29 /**
30  * @file
31  * This file includes definitions for d-bus client API.
32  */
33
34 #ifndef OTBR_THREAD_API_DBUS_HPP_
35 #define OTBR_THREAD_API_DBUS_HPP_
36
37 #include <functional>
38
39 #include <dbus/dbus.h>
40
41 #include "common/types.hpp"
42 #include "dbus/common/constants.hpp"
43 #include "dbus/common/error.hpp"
44 #include "dbus/common/types.hpp"
45
46 namespace otbr {
47 namespace DBus {
48
49 bool IsThreadActive(DeviceRole aRole);
50
51 class ThreadApiDBus
52 {
53 public:
54     using DeviceRoleHandler = std::function<void(DeviceRole)>;
55     using ScanHandler       = std::function<void(const std::vector<ActiveScanResult> &)>;
56     using OtResultHandler   = std::function<void(ClientError)>;
57
58     /**
59      * The constructor of a d-bus object.
60      *
61      * Will use the default interfacename
62      *
63      * @param[in]   aConnection     The dbus connection.
64      *
65      */
66     ThreadApiDBus(DBusConnection *aConnection);
67
68     /**
69      * The constructor of a d-bus object.
70      *
71      * @param[in]   aConnection     The dbus connection.
72      * @param[in]   aInterfaceName  The network interface name.
73      *
74      */
75     ThreadApiDBus(DBusConnection *aConnection, const std::string &aInterfaceName);
76
77     /**
78      * This method adds a callback for device role change.
79      *
80      * @param[in]   aHandler  The device role handler.
81      *
82      */
83     void AddDeviceRoleHandler(const DeviceRoleHandler &aHandler);
84
85     /**
86      * This method permits unsecure join on port.
87      *
88      * @param[in]   aPort     The port number.
89      * @param[in]   aSeconds  The timeout to close the port, 0 for never close.
90      *
91      * @retval ERROR_NONE successfully performed the dbus function call
92      * @retval ERROR_DBUS dbus encode/decode error
93      * @retval ...        OpenThread defined error value otherwise
94      *
95      */
96     ClientError PermitUnsecureJoin(uint16_t aPort, uint32_t aSeconds);
97
98     /**
99      * This method performs a Thread network scan.
100      *
101      * @param[in]   aHandler  The scan result handler.
102      *
103      * @retval ERROR_NONE successfully performed the dbus function call
104      * @retval ERROR_DBUS dbus encode/decode error
105      * @retval ...        OpenThread defined error value otherwise
106      *
107      */
108     ClientError Scan(const ScanHandler &aHandler);
109
110     /**
111      * This method attaches the device to the Thread network.
112      * @param[in]   aNetworkName    The network name.
113      * @param[in]   aPanId          The pan id, UINT16_MAX for random.
114      * @param[in]   aExtPanId       The extended pan id, UINT64_MAX for random.
115      * @param[in]   aMasterKey      The master key, empty for random.
116      * @param[in]   aPSKc           The pre-shared commissioner key, empty for random.
117      * @param[in]   aChannelMask    A bitmask for valid channels, will random select one.
118      * @param[in]   aHandler        The attach result handler.
119      *
120      * @retval ERROR_NONE successfully performed the dbus function call
121      * @retval ERROR_DBUS dbus encode/decode error
122      * @retval ...        OpenThread defined error value otherwise
123      *
124      */
125     ClientError Attach(const std::string &         aNetworkName,
126                        uint16_t                    aPanId,
127                        uint64_t                    aExtPanId,
128                        const std::vector<uint8_t> &aMasterKey,
129                        const std::vector<uint8_t> &aPSKc,
130                        uint32_t                    aChannelMask,
131                        const OtResultHandler &     aHandler);
132
133     /**
134      * This method attaches the device to the Thread network.
135      *
136      * The network parameters will be set with the active dataset under this
137      * circumstance.
138      *
139      * @param[in]   aHandler        The attach result handler.
140      *
141      * @retval ERROR_NONE successfully performed the dbus function call
142      * @retval ERROR_DBUS dbus encode/decode error
143      * @retval ...        OpenThread defined error value otherwise
144      *
145      */
146     ClientError Attach(const OtResultHandler &aHandler);
147
148     /**
149      * This method performs a factory reset.
150      *
151      * @param[in]   aHandler        The reset result handler.
152      *
153      * @retval ERROR_NONE successfully performed the dbus function call
154      * @retval ERROR_DBUS dbus encode/decode error
155      * @retval ...        OpenThread defined error value otherwise
156      *
157      */
158     ClientError FactoryReset(const OtResultHandler &aHandler);
159
160     /**
161      * This method performs a soft reset.
162      *
163      * @retval ERROR_NONE successfully performed the dbus function call
164      * @retval ERROR_DBUS dbus encode/decode error
165      * @retval ...        OpenThread defined error value otherwise
166      *
167      */
168     ClientError Reset(void);
169
170     /**
171      * This method triggers a thread join process.
172      *
173      * @note The joiner start and the attach proccesses are exclusive
174      *
175      * @param[in]   aPskd             The pre-shared key for device.
176      * @param[in]   aProvisioningUrl  The provision url.
177      * @param[in]   aVendorName       The vendor name.
178      * @param[in]   aVendorModel      The vendor model.
179      * @param[in]   aVendorSwVersion  The vendor software version.
180      * @param[in]   aVendorData       The vendor custom data.
181      * @param[in]   aHandler          The join result handler.
182      *
183      * @retval ERROR_NONE successfully performed the dbus function call
184      * @retval ERROR_DBUS dbus encode/decode error
185      * @retval ...        OpenThread defined error value otherwise
186      *
187      */
188     ClientError JoinerStart(const std::string &    aPskd,
189                             const std::string &    aProvisioningUrl,
190                             const std::string &    aVendorName,
191                             const std::string &    aVendorModel,
192                             const std::string &    aVendorSwVersion,
193                             const std::string &    aVendorData,
194                             const OtResultHandler &aHandler);
195
196     /**
197      * This method stops the joiner process
198      *
199      * @retval ERROR_NONE successfully performed the dbus function call
200      * @retval ERROR_DBUS dbus encode/decode error
201      * @retval ...        OpenThread defined error value otherwise
202      *
203      */
204     ClientError JoinerStop(void);
205
206     /**
207      * This method adds a on-mesh address prefix.
208      *
209      * @param[in]   aPrefix     The address prefix.
210      *
211      * @retval ERROR_NONE successfully performed the dbus function call
212      * @retval ERROR_DBUS dbus encode/decode error
213      * @retval ...        OpenThread defined error value otherwise
214      *
215      */
216     ClientError AddOnMeshPrefix(const OnMeshPrefix &aPrefix);
217
218     /**
219      * This method removes a on-mesh address prefix.
220      *
221      * @param[in]   aPrefix     The address prefix.
222      *
223      * @retval ERROR_NONE successfully performed the dbus function call
224      * @retval ERROR_DBUS dbus encode/decode error
225      * @retval ...        OpenThread defined error value otherwise
226      *
227      */
228     ClientError RemoveOnMeshPrefix(const Ip6Prefix &aPrefix);
229
230     /**
231      * This method adds an external route.
232      *
233      * @param[in]   aExternalroute  The external route config
234      *
235      * @retval ERROR_NONE successfully performed the dbus function call
236      * @retval ERROR_DBUS dbus encode/decode error
237      * @retval ...        OpenThread defined error value otherwise
238      *
239      */
240     ClientError AddExternalRoute(const ExternalRoute &aExternalRoute);
241
242     /**
243      * This method removes an external route.
244      *
245      * @param[in]   aPrefix         The route prefix.
246      *
247      * @retval ERROR_NONE successfully performed the dbus function call
248      * @retval ERROR_DBUS dbus encode/decode error
249      * @retval ...        OpenThread defined error value otherwise
250      *
251      */
252     ClientError RemoveExternalRoute(const Ip6Prefix &aPrefix);
253
254     /**
255      * This method sets the mesh-local prefix.
256      *
257      * @param[in]   aPrefix     The address prefix.
258      *
259      * @retval ERROR_NONE successfully performed the dbus function call
260      * @retval ERROR_DBUS dbus encode/decode error
261      * @retval ...        OpenThread defined error value otherwise
262      *
263      */
264     ClientError SetMeshLocalPrefix(const std::array<uint8_t, OTBR_IP6_PREFIX_SIZE> &aPrefix);
265
266     /**
267      * This method sets the legacy prefix of ConnectIP.
268      *
269      * @param[in]   aPrefix     The address prefix.
270      *
271      * @retval ERROR_NONE successfully performed the dbus function call
272      * @retval ERROR_DBUS dbus encode/decode error
273      * @retval ...        OpenThread defined error value otherwise
274      *
275      */
276     ClientError SetLegacyUlaPrefix(const std::array<uint8_t, OTBR_IP6_PREFIX_SIZE> &aPrefix);
277
278     /**
279      * This method sets the active operational dataset.
280      *
281      * @param[out]  aDataset    The active operational dataset
282      *
283      * @retval ERROR_NONE successfully performed the dbus function call
284      * @retval ERROR_DBUS dbus encode/decode error
285      * @retval ...        OpenThread defined error value otherwise
286      *
287      */
288     ClientError SetActiveDatasetTlvs(const std::vector<uint8_t> &aDataset);
289
290     /**
291      * This method sets the link operating mode.
292      *
293      * @param[in]   aConfig   The operating mode config.
294      *
295      * @retval ERROR_NONE successfully performed the dbus function call
296      * @retval ERROR_DBUS dbus encode/decode error
297      * @retval ...        OpenThread defined error value otherwise
298      *
299      */
300     ClientError SetLinkMode(const LinkModeConfig &aConfig);
301
302     /**
303      * This method sets the radio region.
304      *
305      * @param[in]   aRadioRegion  The radio region.
306      *
307      * @retval ERROR_NONE successfully performed the dbus function call
308      * @retval ERROR_DBUS dbus encode/decode error
309      * @retval ...        OpenThread defined error value otherwise
310      *
311      */
312     ClientError SetRadioRegion(const std::string &aRadioRegion);
313
314     /**
315      * This method gets the link operating mode.
316      *
317      * @param[out]  aConfig   The operating mode config.
318      *
319      * @retval ERROR_NONE successfully performed the dbus function call
320      * @retval ERROR_DBUS dbus encode/decode error
321      * @retval ...        OpenThread defined error value otherwise
322      *
323      */
324     ClientError GetLinkMode(LinkModeConfig &aConfig);
325
326     /**
327      * This method gets the current device role.
328      *
329      * @param[out]  aDeviceRole   The device role
330      *
331      * @retval ERROR_NONE successfully performed the dbus function call
332      * @retval ERROR_DBUS dbus encode/decode error
333      * @retval ...        OpenThread defined error value otherwise
334      *
335      */
336     ClientError GetDeviceRole(DeviceRole &aDeviceRole);
337
338     /**
339      * This method gets the network name.
340      *
341      * @param[out]  aName   The network name.
342      *
343      * @retval ERROR_NONE successfully performed the dbus function call
344      * @retval ERROR_DBUS dbus encode/decode error
345      * @retval ...        OpenThread defined error value otherwise
346      *
347      */
348     ClientError GetNetworkName(std::string &aName);
349
350     /**
351      * This method gets the network pan id.
352      *
353      * @param[out]  aPanId  The pan id.
354      *
355      * @retval ERROR_NONE successfully performed the dbus function call
356      * @retval ERROR_DBUS dbus encode/decode error
357      * @retval ...        OpenThread defined error value otherwise
358      *
359      */
360     ClientError GetPanId(uint16_t &aPanId);
361
362     /**
363      * This method gets the extended pan id.
364      *
365      * @param[out]  aExtPanId   The extended pan id.
366      *
367      * @retval ERROR_NONE successfully performed the dbus function call
368      * @retval ERROR_DBUS dbus encode/decode error
369      * @retval ...        OpenThread defined error value otherwise
370      *
371      */
372     ClientError GetExtPanId(uint64_t &aExtPanId);
373
374     /**
375      * This method gets the extended pan id.
376      *
377      * @param[out]  aChannel   The extended pan id.
378      *
379      * @retval ERROR_NONE successfully performed the dbus function call
380      * @retval ERROR_DBUS dbus encode/decode error
381      * @retval ...        OpenThread defined error value otherwise
382      *
383      */
384     ClientError GetChannel(uint16_t &aChannel);
385
386     /**
387      * This method gets the network master key.
388      *
389      * @param[out]  aMasterKey   The network master key.
390      *
391      * @retval ERROR_NONE successfully performed the dbus function call
392      * @retval ERROR_DBUS dbus encode/decode error
393      * @retval ...        OpenThread defined error value otherwise
394      *
395      */
396     ClientError GetMasterKey(std::vector<uint8_t> &aMasterKey);
397
398     /**
399      * This method gets the Clear Channel Assessment failure rate.
400      *
401      * @param[out]  aFailureRate   The failure rate.
402      *
403      * @retval ERROR_NONE successfully performed the dbus function call
404      * @retval ERROR_DBUS dbus encode/decode error
405      * @retval ...        OpenThread defined error value otherwise
406      *
407      */
408     ClientError GetCcaFailureRate(uint16_t &aFailureRate);
409
410     /**
411      * This method gets the mac level statistics counters.
412      *
413      * @param[out]  aCounters    The statistic counters.
414      *
415      * @retval ERROR_NONE successfully performed the dbus function call
416      * @retval ERROR_DBUS dbus encode/decode error
417      * @retval ...        OpenThread defined error value otherwise
418      *
419      */
420     ClientError GetLinkCounters(MacCounters &aCounters); // For telemetry
421
422     /**
423      * This method gets the ip level statistics counters.
424      *
425      * @param[out]  aCounters    The statistic counters.
426      *
427      * @retval ERROR_NONE successfully performed the dbus function call
428      * @retval ERROR_DBUS dbus encode/decode error
429      * @retval ...        OpenThread defined error value otherwise
430      *
431      */
432     ClientError GetIp6Counters(IpCounters &aCounters); // For telemetry
433
434     /**
435      * This method gets the supported channel mask.
436      *
437      * @param[out]  aChannelMask   The channel mask.
438      *
439      * @retval ERROR_NONE successfully performed the dbus function call
440      * @retval ERROR_DBUS dbus encode/decode error
441      * @retval ...        OpenThread defined error value otherwise
442      *
443      */
444     ClientError GetSupportedChannelMask(uint32_t &aChannelMask);
445
446     /**
447      * This method gets the Thread routing locator
448      *
449      * @param[out]  aRloc16   The routing locator
450      *
451      * @retval ERROR_NONE successfully performed the dbus function call
452      * @retval ERROR_DBUS dbus encode/decode error
453      * @retval ...        OpenThread defined error value otherwise
454      *
455      */
456     ClientError GetRloc16(uint16_t &aRloc16);
457
458     /**
459      * This method gets 802.15.4 extended address
460      *
461      * @param[out]  aExtendedAddress    The extended address
462      *
463      * @retval ERROR_NONE successfully performed the dbus function call
464      * @retval ERROR_DBUS dbus encode/decode error
465      * @retval ...        OpenThread defined error value otherwise
466      *
467      */
468     ClientError GetExtendedAddress(uint64_t &aExtendedAddress);
469
470     /**
471      * This method gets the node's router id.
472      *
473      * @param[out]  aRouterId     The router id.
474      *
475      * @retval ERROR_NONE            Successfully performed the dbus function call.
476      * @retval ERROR_DBUS            dbus encode/decode error
477      * @retval OT_ERROR_INVALID_STATE     The node is not a router.
478      * @retval ...        OpenThread defined error value otherwise
479      *
480      */
481     ClientError GetRouterId(uint8_t &aRouterId);
482
483     /**
484      * This method gets the network's leader data.
485      *
486      * @param[out]  aLeaderData   The leader data.
487      *
488      * @retval ERROR_NONE successfully performed the dbus function call
489      * @retval ERROR_DBUS dbus encode/decode error
490      * @retval ...        OpenThread defined error value otherwise
491      *
492      */
493     ClientError GetLeaderData(LeaderData &aLeaderData);
494
495     /**
496      * This method gets the network data.
497      *
498      * @param[out]  aNetworkData   The network data.
499      *
500      * @retval ERROR_NONE successfully performed the dbus function call
501      * @retval ERROR_DBUS dbus encode/decode error
502      * @retval ...        OpenThread defined error value otherwise
503      *
504      */
505     ClientError GetNetworkData(std::vector<uint8_t> &aNetworkData);
506
507     /**
508      * This method gets the stable network data.
509      *
510      * @param[out]  aNetworkData   The stable network data.
511      *
512      * @retval ERROR_NONE successfully performed the dbus function call
513      * @retval ERROR_DBUS dbus encode/decode error
514      * @retval ...        OpenThread defined error value otherwise
515      *
516      */
517     ClientError GetStableNetworkData(std::vector<uint8_t> &aNetworkData);
518
519     /**
520      * This method gets the node's local leader weight.
521      *
522      * @param[out]  aWeight     The local leader weight.
523      *
524      * @retval ERROR_NONE successfully performed the dbus function call
525      * @retval ERROR_DBUS dbus encode/decode error
526      * @retval ...        OpenThread defined error value otherwise
527      *
528      */
529     ClientError GetLocalLeaderWeight(uint8_t &aWeight);
530
531     /**
532      * This method gets the channel monitor sample count.
533      *
534      * @param[out]  aSampleCount     The channel monitor sample count.
535      *
536      * @retval ERROR_NONE successfully performed the dbus function call
537      * @retval ERROR_DBUS dbus encode/decode error
538      * @retval ...        OpenThread defined error value otherwise
539      *
540      */
541     ClientError GetChannelMonitorSampleCount(uint32_t &aSampleCount);
542
543     /**
544      * This method gets the channel qualities
545      *
546      * @param[out]  aChannelQualities     The channel qualities.
547      *
548      * @retval ERROR_NONE successfully performed the dbus function call
549      * @retval ERROR_DBUS dbus encode/decode error
550      * @retval ...        OpenThread defined error value otherwise
551      *
552      */
553     ClientError GetChannelMonitorAllChannelQualities(std::vector<ChannelQuality> &aChannelQualities);
554
555     /**
556      * This method gets the child table.
557      *
558      * @param[out]  aChildTable     The child table.
559      *
560      * @retval ERROR_NONE successfully performed the dbus function call
561      * @retval ERROR_DBUS dbus encode/decode error
562      * @retval ...        OpenThread defined error value otherwise
563      *
564      */
565     ClientError GetChildTable(std::vector<ChildInfo> &aChildTable);
566
567     /**
568      * This method gets the neighbor table.
569      *
570      * @param[out]  aNeighborTable     The neighbor table.
571      *
572      * @retval ERROR_NONE successfully performed the dbus function call
573      * @retval ERROR_DBUS dbus encode/decode error
574      * @retval ...        OpenThread defined error value otherwise
575      *
576      */
577     ClientError GetNeighborTable(std::vector<NeighborInfo> &aNeighborTable);
578
579     /**
580      * This method gets the network's parition id.
581      *
582      * @param[out]  aPartitionId      The partition id.
583      *
584      * @retval ERROR_NONE successfully performed the dbus function call
585      * @retval ERROR_DBUS dbus encode/decode error
586      * @retval ...        OpenThread defined error value otherwise
587      *
588      */
589     ClientError GetPartitionId(uint32_t &aPartitionId);
590
591     /**
592      * This method gets the rssi of the latest packet.
593      *
594      * @param[out]  aRssi      The rssi of the latest packet.
595      *
596      * @retval ERROR_NONE successfully performed the dbus function call
597      * @retval ERROR_DBUS dbus encode/decode error
598      * @retval ...        OpenThread defined error value otherwise
599      *
600      */
601     ClientError GetInstantRssi(int8_t &aRssi);
602
603     /**
604      * This method gets the radio transmit power.
605      *
606      * @param[out]  aTxPower    The radio transmit power.
607      *
608      * @retval ERROR_NONE successfully performed the dbus function call
609      * @retval ERROR_DBUS dbus encode/decode error
610      * @retval ...        OpenThread defined error value otherwise
611      *
612      */
613     ClientError GetRadioTxPower(int8_t &aTxPower);
614
615     /**
616      * This method gets the external route table
617      *
618      * @param[out]  aExternalRoutes   The external route table
619      *
620      * @retval ERROR_NONE successfully performed the dbus function call
621      * @retval ERROR_DBUS dbus encode/decode error
622      * @retval ...        OpenThread defined error value otherwise
623      *
624      */
625     ClientError GetExternalRoutes(std::vector<ExternalRoute> &aExternalRoutes);
626
627     /**
628      * This method gets the active operational dataset
629      *
630      * @param[out]  aDataset    The active operational dataset
631      *
632      * @retval ERROR_NONE successfully performed the dbus function call
633      * @retval ERROR_DBUS dbus encode/decode error
634      * @retval ...        OpenThread defined error value otherwise
635      *
636      */
637     ClientError GetActiveDatasetTlvs(std::vector<uint8_t> &aDataset);
638
639     /**
640      * This method gets the radio region.
641      *
642      * @param[out]  aRadioRegion  The radio region.
643      *
644      * @retval ERROR_NONE successfully performed the dbus function call
645      * @retval ERROR_DBUS dbus encode/decode error
646      * @retval ...        OpenThread defined error value otherwise
647      *
648      */
649     ClientError GetRadioRegion(std::string &aRadioRegion);
650
651     /**
652      * This method returns the network interface name the client is bound to.
653      *
654      * @returns The network interface name.
655      *
656      */
657     std::string GetInterfaceName(void);
658
659 private:
660     ClientError CallDBusMethodSync(const std::string &aMethodName);
661     ClientError CallDBusMethodAsync(const std::string &aMethodName, DBusPendingCallNotifyFunction aFunction);
662
663     template <typename ArgType> ClientError CallDBusMethodSync(const std::string &aMethodName, const ArgType &aArgs);
664
665     template <typename ArgType>
666     ClientError CallDBusMethodAsync(const std::string &           aMethodName,
667                                     const ArgType &               aArgs,
668                                     DBusPendingCallNotifyFunction aFunction);
669
670     template <typename ValType> ClientError SetProperty(const std::string &aPropertyName, const ValType &aValue);
671
672     template <typename ValType> ClientError GetProperty(const std::string &aPropertyName, ValType &aValue);
673
674     ClientError              SubscribeDeviceRoleSignal(void);
675     static DBusHandlerResult sDBusMessageFilter(DBusConnection *aConnection, DBusMessage *aMessage, void *aData);
676     DBusHandlerResult        DBusMessageFilter(DBusConnection *aConnection, DBusMessage *aMessage);
677
678     template <void (ThreadApiDBus::*Handler)(DBusPendingCall *aPending)>
679     static void sHandleDBusPendingCall(DBusPendingCall *aPending, void *aThreadApiDBus);
680
681     void        AttachPendingCallHandler(DBusPendingCall *aPending);
682     void        FactoryResetPendingCallHandler(DBusPendingCall *aPending);
683     void        JoinerStartPendingCallHandler(DBusPendingCall *aPending);
684     static void sScanPendingCallHandler(DBusPendingCall *aPending, void *aThreadApiDBus);
685     void        ScanPendingCallHandler(DBusPendingCall *aPending);
686
687     static void EmptyFree(void *) {}
688
689     std::string mInterfaceName;
690
691     DBusConnection *mConnection;
692
693     ScanHandler     mScanHandler;
694     OtResultHandler mAttachHandler;
695     OtResultHandler mFactoryResetHandler;
696     OtResultHandler mJoinerHandler;
697
698     std::vector<DeviceRoleHandler> mDeviceRoleHandlers;
699 };
700
701 } // namespace DBus
702 } // namespace otbr
703
704 #endif // OTBR_THREAD_API_DBUS_HPP_