/
auto.go
959 lines (748 loc) · 28.2 KB
/
auto.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
// Code generated by "./generator ./system/org.bluez"; DO NOT EDIT.
// SPDX-FileCopyrightText: 2018 - 2023 UnionTech Software Technology Co., Ltd.
//
// SPDX-License-Identifier: GPL-3.0-or-later
package bluez
import "errors"
import "github.com/godbus/dbus/v5"
import "github.com/linuxdeepin/go-dbus-factory/object_manager"
import "github.com/linuxdeepin/go-lib/dbusutil/proxy"
import "unsafe"
type ObjectManager interface {
object_manager.ObjectManager // interface org.freedesktop.DBus.ObjectManager
proxy.Object
}
type objectObjectManager struct {
object_manager.InterfaceObjectManager // interface org.freedesktop.DBus.ObjectManager
proxy.ImplObject
}
func NewObjectManager(conn *dbus.Conn) ObjectManager {
obj := new(objectObjectManager)
obj.ImplObject.Init_(conn, "org.bluez", "/")
return obj
}
type Manager interface {
AgentManager() agentManager // interface org.bluez.AgentManager1
HealthManager() healthManager // interface org.bluez.HealthManager1
ProfileManager() profileManager // interface org.bluez.ProfileManager1
proxy.Object
}
type objectManager struct {
interfaceAgentManager // interface org.bluez.AgentManager1
interfaceHealthManager // interface org.bluez.HealthManager1
interfaceProfileManager // interface org.bluez.ProfileManager1
proxy.ImplObject
}
func NewManager(conn *dbus.Conn) Manager {
obj := new(objectManager)
obj.ImplObject.Init_(conn, "org.bluez", "/org/bluez")
return obj
}
func (obj *objectManager) AgentManager() agentManager {
return &obj.interfaceAgentManager
}
type agentManager interface {
GoRegisterAgent(flags dbus.Flags, ch chan *dbus.Call, agent dbus.ObjectPath, capability string) *dbus.Call
RegisterAgent(flags dbus.Flags, agent dbus.ObjectPath, capability string) error
GoUnregisterAgent(flags dbus.Flags, ch chan *dbus.Call, agent dbus.ObjectPath) *dbus.Call
UnregisterAgent(flags dbus.Flags, agent dbus.ObjectPath) error
GoRequestDefaultAgent(flags dbus.Flags, ch chan *dbus.Call, agent dbus.ObjectPath) *dbus.Call
RequestDefaultAgent(flags dbus.Flags, agent dbus.ObjectPath) error
}
type interfaceAgentManager struct{}
func (v *interfaceAgentManager) GetObject_() *proxy.ImplObject {
return (*proxy.ImplObject)(unsafe.Pointer(v))
}
func (*interfaceAgentManager) GetInterfaceName_() string {
return "org.bluez.AgentManager1"
}
// method RegisterAgent
func (v *interfaceAgentManager) GoRegisterAgent(flags dbus.Flags, ch chan *dbus.Call, agent dbus.ObjectPath, capability string) *dbus.Call {
return v.GetObject_().Go_(v.GetInterfaceName_()+".RegisterAgent", flags, ch, agent, capability)
}
func (v *interfaceAgentManager) RegisterAgent(flags dbus.Flags, agent dbus.ObjectPath, capability string) error {
return (<-v.GoRegisterAgent(flags, make(chan *dbus.Call, 1), agent, capability).Done).Err
}
// method UnregisterAgent
func (v *interfaceAgentManager) GoUnregisterAgent(flags dbus.Flags, ch chan *dbus.Call, agent dbus.ObjectPath) *dbus.Call {
return v.GetObject_().Go_(v.GetInterfaceName_()+".UnregisterAgent", flags, ch, agent)
}
func (v *interfaceAgentManager) UnregisterAgent(flags dbus.Flags, agent dbus.ObjectPath) error {
return (<-v.GoUnregisterAgent(flags, make(chan *dbus.Call, 1), agent).Done).Err
}
// method RequestDefaultAgent
func (v *interfaceAgentManager) GoRequestDefaultAgent(flags dbus.Flags, ch chan *dbus.Call, agent dbus.ObjectPath) *dbus.Call {
return v.GetObject_().Go_(v.GetInterfaceName_()+".RequestDefaultAgent", flags, ch, agent)
}
func (v *interfaceAgentManager) RequestDefaultAgent(flags dbus.Flags, agent dbus.ObjectPath) error {
return (<-v.GoRequestDefaultAgent(flags, make(chan *dbus.Call, 1), agent).Done).Err
}
func (obj *objectManager) HealthManager() healthManager {
return &obj.interfaceHealthManager
}
type healthManager interface {
GoCreateApplication(flags dbus.Flags, ch chan *dbus.Call, config map[string]dbus.Variant) *dbus.Call
CreateApplication(flags dbus.Flags, config map[string]dbus.Variant) (dbus.ObjectPath, error)
GoDestroyApplication(flags dbus.Flags, ch chan *dbus.Call, application dbus.ObjectPath) *dbus.Call
DestroyApplication(flags dbus.Flags, application dbus.ObjectPath) error
}
type interfaceHealthManager struct{}
func (v *interfaceHealthManager) GetObject_() *proxy.ImplObject {
return (*proxy.ImplObject)(unsafe.Pointer(v))
}
func (*interfaceHealthManager) GetInterfaceName_() string {
return "org.bluez.HealthManager1"
}
// method CreateApplication
func (v *interfaceHealthManager) GoCreateApplication(flags dbus.Flags, ch chan *dbus.Call, config map[string]dbus.Variant) *dbus.Call {
return v.GetObject_().Go_(v.GetInterfaceName_()+".CreateApplication", flags, ch, config)
}
func (*interfaceHealthManager) StoreCreateApplication(call *dbus.Call) (application dbus.ObjectPath, err error) {
err = call.Store(&application)
return
}
func (v *interfaceHealthManager) CreateApplication(flags dbus.Flags, config map[string]dbus.Variant) (dbus.ObjectPath, error) {
return v.StoreCreateApplication(
<-v.GoCreateApplication(flags, make(chan *dbus.Call, 1), config).Done)
}
// method DestroyApplication
func (v *interfaceHealthManager) GoDestroyApplication(flags dbus.Flags, ch chan *dbus.Call, application dbus.ObjectPath) *dbus.Call {
return v.GetObject_().Go_(v.GetInterfaceName_()+".DestroyApplication", flags, ch, application)
}
func (v *interfaceHealthManager) DestroyApplication(flags dbus.Flags, application dbus.ObjectPath) error {
return (<-v.GoDestroyApplication(flags, make(chan *dbus.Call, 1), application).Done).Err
}
func (obj *objectManager) ProfileManager() profileManager {
return &obj.interfaceProfileManager
}
type profileManager interface {
GoRegisterProfile(flags dbus.Flags, ch chan *dbus.Call, profile dbus.ObjectPath, UUID string, options map[string]dbus.Variant) *dbus.Call
RegisterProfile(flags dbus.Flags, profile dbus.ObjectPath, UUID string, options map[string]dbus.Variant) error
GoUnregisterProfile(flags dbus.Flags, ch chan *dbus.Call, profile dbus.ObjectPath) *dbus.Call
UnregisterProfile(flags dbus.Flags, profile dbus.ObjectPath) error
}
type interfaceProfileManager struct{}
func (v *interfaceProfileManager) GetObject_() *proxy.ImplObject {
return (*proxy.ImplObject)(unsafe.Pointer(v))
}
func (*interfaceProfileManager) GetInterfaceName_() string {
return "org.bluez.ProfileManager1"
}
// method RegisterProfile
func (v *interfaceProfileManager) GoRegisterProfile(flags dbus.Flags, ch chan *dbus.Call, profile dbus.ObjectPath, UUID string, options map[string]dbus.Variant) *dbus.Call {
return v.GetObject_().Go_(v.GetInterfaceName_()+".RegisterProfile", flags, ch, profile, UUID, options)
}
func (v *interfaceProfileManager) RegisterProfile(flags dbus.Flags, profile dbus.ObjectPath, UUID string, options map[string]dbus.Variant) error {
return (<-v.GoRegisterProfile(flags, make(chan *dbus.Call, 1), profile, UUID, options).Done).Err
}
// method UnregisterProfile
func (v *interfaceProfileManager) GoUnregisterProfile(flags dbus.Flags, ch chan *dbus.Call, profile dbus.ObjectPath) *dbus.Call {
return v.GetObject_().Go_(v.GetInterfaceName_()+".UnregisterProfile", flags, ch, profile)
}
func (v *interfaceProfileManager) UnregisterProfile(flags dbus.Flags, profile dbus.ObjectPath) error {
return (<-v.GoUnregisterProfile(flags, make(chan *dbus.Call, 1), profile).Done).Err
}
type HCI interface {
Adapter() adapter // interface org.bluez.Adapter1
GattManager() gattManager // interface org.bluez.GattManager1
Media() media // interface org.bluez.Media1
NetworkServer() networkServer // interface org.bluez.NetworkServer1
proxy.Object
}
type objectHCI struct {
interfaceAdapter // interface org.bluez.Adapter1
interfaceGattManager // interface org.bluez.GattManager1
interfaceMedia // interface org.bluez.Media1
interfaceNetworkServer // interface org.bluez.NetworkServer1
proxy.ImplObject
}
func NewHCI(conn *dbus.Conn, path dbus.ObjectPath) (HCI, error) {
if !path.IsValid() {
return nil, errors.New("path is invalid")
}
obj := new(objectHCI)
obj.ImplObject.Init_(conn, "org.bluez", path)
return obj, nil
}
func (obj *objectHCI) Adapter() adapter {
return &obj.interfaceAdapter
}
type adapter interface {
GoStartDiscovery(flags dbus.Flags, ch chan *dbus.Call) *dbus.Call
StartDiscovery(flags dbus.Flags) error
GoSetDiscoveryFilter(flags dbus.Flags, ch chan *dbus.Call, properties map[string]dbus.Variant) *dbus.Call
SetDiscoveryFilter(flags dbus.Flags, properties map[string]dbus.Variant) error
GoStopDiscovery(flags dbus.Flags, ch chan *dbus.Call) *dbus.Call
StopDiscovery(flags dbus.Flags) error
GoRemoveDevice(flags dbus.Flags, ch chan *dbus.Call, device dbus.ObjectPath) *dbus.Call
RemoveDevice(flags dbus.Flags, device dbus.ObjectPath) error
Address() proxy.PropString
Name() proxy.PropString
Alias() proxy.PropString
Class() proxy.PropUint32
Powered() proxy.PropBool
Discoverable() proxy.PropBool
DiscoverableTimeout() proxy.PropUint32
Pairable() proxy.PropBool
PairableTimeout() proxy.PropUint32
Discovering() proxy.PropBool
UUIDs() proxy.PropStringArray
Modalias() proxy.PropString
}
type interfaceAdapter struct{}
func (v *interfaceAdapter) GetObject_() *proxy.ImplObject {
return (*proxy.ImplObject)(unsafe.Pointer(v))
}
func (*interfaceAdapter) GetInterfaceName_() string {
return "org.bluez.Adapter1"
}
// method StartDiscovery
func (v *interfaceAdapter) GoStartDiscovery(flags dbus.Flags, ch chan *dbus.Call) *dbus.Call {
return v.GetObject_().Go_(v.GetInterfaceName_()+".StartDiscovery", flags, ch)
}
func (v *interfaceAdapter) StartDiscovery(flags dbus.Flags) error {
return (<-v.GoStartDiscovery(flags, make(chan *dbus.Call, 1)).Done).Err
}
// method SetDiscoveryFilter
func (v *interfaceAdapter) GoSetDiscoveryFilter(flags dbus.Flags, ch chan *dbus.Call, properties map[string]dbus.Variant) *dbus.Call {
return v.GetObject_().Go_(v.GetInterfaceName_()+".SetDiscoveryFilter", flags, ch, properties)
}
func (v *interfaceAdapter) SetDiscoveryFilter(flags dbus.Flags, properties map[string]dbus.Variant) error {
return (<-v.GoSetDiscoveryFilter(flags, make(chan *dbus.Call, 1), properties).Done).Err
}
// method StopDiscovery
func (v *interfaceAdapter) GoStopDiscovery(flags dbus.Flags, ch chan *dbus.Call) *dbus.Call {
return v.GetObject_().Go_(v.GetInterfaceName_()+".StopDiscovery", flags, ch)
}
func (v *interfaceAdapter) StopDiscovery(flags dbus.Flags) error {
return (<-v.GoStopDiscovery(flags, make(chan *dbus.Call, 1)).Done).Err
}
// method RemoveDevice
func (v *interfaceAdapter) GoRemoveDevice(flags dbus.Flags, ch chan *dbus.Call, device dbus.ObjectPath) *dbus.Call {
return v.GetObject_().Go_(v.GetInterfaceName_()+".RemoveDevice", flags, ch, device)
}
func (v *interfaceAdapter) RemoveDevice(flags dbus.Flags, device dbus.ObjectPath) error {
return (<-v.GoRemoveDevice(flags, make(chan *dbus.Call, 1), device).Done).Err
}
// property Address s
func (v *interfaceAdapter) Address() proxy.PropString {
return &proxy.ImplPropString{
Impl: v,
Name: "Address",
}
}
// property Name s
func (v *interfaceAdapter) Name() proxy.PropString {
return &proxy.ImplPropString{
Impl: v,
Name: "Name",
}
}
// property Alias s
func (v *interfaceAdapter) Alias() proxy.PropString {
return &proxy.ImplPropString{
Impl: v,
Name: "Alias",
}
}
// property Class u
func (v *interfaceAdapter) Class() proxy.PropUint32 {
return &proxy.ImplPropUint32{
Impl: v,
Name: "Class",
}
}
// property Powered b
func (v *interfaceAdapter) Powered() proxy.PropBool {
return &proxy.ImplPropBool{
Impl: v,
Name: "Powered",
}
}
// property Discoverable b
func (v *interfaceAdapter) Discoverable() proxy.PropBool {
return &proxy.ImplPropBool{
Impl: v,
Name: "Discoverable",
}
}
// property DiscoverableTimeout u
func (v *interfaceAdapter) DiscoverableTimeout() proxy.PropUint32 {
return &proxy.ImplPropUint32{
Impl: v,
Name: "DiscoverableTimeout",
}
}
// property Pairable b
func (v *interfaceAdapter) Pairable() proxy.PropBool {
return &proxy.ImplPropBool{
Impl: v,
Name: "Pairable",
}
}
// property PairableTimeout u
func (v *interfaceAdapter) PairableTimeout() proxy.PropUint32 {
return &proxy.ImplPropUint32{
Impl: v,
Name: "PairableTimeout",
}
}
// property Discovering b
func (v *interfaceAdapter) Discovering() proxy.PropBool {
return &proxy.ImplPropBool{
Impl: v,
Name: "Discovering",
}
}
// property UUIDs as
func (v *interfaceAdapter) UUIDs() proxy.PropStringArray {
return &proxy.ImplPropStringArray{
Impl: v,
Name: "UUIDs",
}
}
// property Modalias s
func (v *interfaceAdapter) Modalias() proxy.PropString {
return &proxy.ImplPropString{
Impl: v,
Name: "Modalias",
}
}
func (obj *objectHCI) GattManager() gattManager {
return &obj.interfaceGattManager
}
type gattManager interface {
GoRegisterApplication(flags dbus.Flags, ch chan *dbus.Call, application dbus.ObjectPath, options map[string]dbus.Variant) *dbus.Call
RegisterApplication(flags dbus.Flags, application dbus.ObjectPath, options map[string]dbus.Variant) error
GoUnregisterApplication(flags dbus.Flags, ch chan *dbus.Call, application dbus.ObjectPath) *dbus.Call
UnregisterApplication(flags dbus.Flags, application dbus.ObjectPath) error
}
type interfaceGattManager struct{}
func (v *interfaceGattManager) GetObject_() *proxy.ImplObject {
return (*proxy.ImplObject)(unsafe.Pointer(v))
}
func (*interfaceGattManager) GetInterfaceName_() string {
return "org.bluez.GattManager1"
}
// method RegisterApplication
func (v *interfaceGattManager) GoRegisterApplication(flags dbus.Flags, ch chan *dbus.Call, application dbus.ObjectPath, options map[string]dbus.Variant) *dbus.Call {
return v.GetObject_().Go_(v.GetInterfaceName_()+".RegisterApplication", flags, ch, application, options)
}
func (v *interfaceGattManager) RegisterApplication(flags dbus.Flags, application dbus.ObjectPath, options map[string]dbus.Variant) error {
return (<-v.GoRegisterApplication(flags, make(chan *dbus.Call, 1), application, options).Done).Err
}
// method UnregisterApplication
func (v *interfaceGattManager) GoUnregisterApplication(flags dbus.Flags, ch chan *dbus.Call, application dbus.ObjectPath) *dbus.Call {
return v.GetObject_().Go_(v.GetInterfaceName_()+".UnregisterApplication", flags, ch, application)
}
func (v *interfaceGattManager) UnregisterApplication(flags dbus.Flags, application dbus.ObjectPath) error {
return (<-v.GoUnregisterApplication(flags, make(chan *dbus.Call, 1), application).Done).Err
}
func (obj *objectHCI) Media() media {
return &obj.interfaceMedia
}
type media interface {
GoRegisterEndpoint(flags dbus.Flags, ch chan *dbus.Call, endpoint dbus.ObjectPath, properties map[string]dbus.Variant) *dbus.Call
RegisterEndpoint(flags dbus.Flags, endpoint dbus.ObjectPath, properties map[string]dbus.Variant) error
GoUnregisterEndpoint(flags dbus.Flags, ch chan *dbus.Call, endpoint dbus.ObjectPath) *dbus.Call
UnregisterEndpoint(flags dbus.Flags, endpoint dbus.ObjectPath) error
GoRegisterPlayer(flags dbus.Flags, ch chan *dbus.Call, player dbus.ObjectPath, properties map[string]dbus.Variant) *dbus.Call
RegisterPlayer(flags dbus.Flags, player dbus.ObjectPath, properties map[string]dbus.Variant) error
GoUnregisterPlayer(flags dbus.Flags, ch chan *dbus.Call, player dbus.ObjectPath) *dbus.Call
UnregisterPlayer(flags dbus.Flags, player dbus.ObjectPath) error
}
type interfaceMedia struct{}
func (v *interfaceMedia) GetObject_() *proxy.ImplObject {
return (*proxy.ImplObject)(unsafe.Pointer(v))
}
func (*interfaceMedia) GetInterfaceName_() string {
return "org.bluez.Media1"
}
// method RegisterEndpoint
func (v *interfaceMedia) GoRegisterEndpoint(flags dbus.Flags, ch chan *dbus.Call, endpoint dbus.ObjectPath, properties map[string]dbus.Variant) *dbus.Call {
return v.GetObject_().Go_(v.GetInterfaceName_()+".RegisterEndpoint", flags, ch, endpoint, properties)
}
func (v *interfaceMedia) RegisterEndpoint(flags dbus.Flags, endpoint dbus.ObjectPath, properties map[string]dbus.Variant) error {
return (<-v.GoRegisterEndpoint(flags, make(chan *dbus.Call, 1), endpoint, properties).Done).Err
}
// method UnregisterEndpoint
func (v *interfaceMedia) GoUnregisterEndpoint(flags dbus.Flags, ch chan *dbus.Call, endpoint dbus.ObjectPath) *dbus.Call {
return v.GetObject_().Go_(v.GetInterfaceName_()+".UnregisterEndpoint", flags, ch, endpoint)
}
func (v *interfaceMedia) UnregisterEndpoint(flags dbus.Flags, endpoint dbus.ObjectPath) error {
return (<-v.GoUnregisterEndpoint(flags, make(chan *dbus.Call, 1), endpoint).Done).Err
}
// method RegisterPlayer
func (v *interfaceMedia) GoRegisterPlayer(flags dbus.Flags, ch chan *dbus.Call, player dbus.ObjectPath, properties map[string]dbus.Variant) *dbus.Call {
return v.GetObject_().Go_(v.GetInterfaceName_()+".RegisterPlayer", flags, ch, player, properties)
}
func (v *interfaceMedia) RegisterPlayer(flags dbus.Flags, player dbus.ObjectPath, properties map[string]dbus.Variant) error {
return (<-v.GoRegisterPlayer(flags, make(chan *dbus.Call, 1), player, properties).Done).Err
}
// method UnregisterPlayer
func (v *interfaceMedia) GoUnregisterPlayer(flags dbus.Flags, ch chan *dbus.Call, player dbus.ObjectPath) *dbus.Call {
return v.GetObject_().Go_(v.GetInterfaceName_()+".UnregisterPlayer", flags, ch, player)
}
func (v *interfaceMedia) UnregisterPlayer(flags dbus.Flags, player dbus.ObjectPath) error {
return (<-v.GoUnregisterPlayer(flags, make(chan *dbus.Call, 1), player).Done).Err
}
func (obj *objectHCI) NetworkServer() networkServer {
return &obj.interfaceNetworkServer
}
type networkServer interface {
GoRegister(flags dbus.Flags, ch chan *dbus.Call, uuid string, bridge string) *dbus.Call
Register(flags dbus.Flags, uuid string, bridge string) error
GoUnregister(flags dbus.Flags, ch chan *dbus.Call, uuid string) *dbus.Call
Unregister(flags dbus.Flags, uuid string) error
}
type interfaceNetworkServer struct{}
func (v *interfaceNetworkServer) GetObject_() *proxy.ImplObject {
return (*proxy.ImplObject)(unsafe.Pointer(v))
}
func (*interfaceNetworkServer) GetInterfaceName_() string {
return "org.bluez.NetworkServer1"
}
// method Register
func (v *interfaceNetworkServer) GoRegister(flags dbus.Flags, ch chan *dbus.Call, uuid string, bridge string) *dbus.Call {
return v.GetObject_().Go_(v.GetInterfaceName_()+".Register", flags, ch, uuid, bridge)
}
func (v *interfaceNetworkServer) Register(flags dbus.Flags, uuid string, bridge string) error {
return (<-v.GoRegister(flags, make(chan *dbus.Call, 1), uuid, bridge).Done).Err
}
// method Unregister
func (v *interfaceNetworkServer) GoUnregister(flags dbus.Flags, ch chan *dbus.Call, uuid string) *dbus.Call {
return v.GetObject_().Go_(v.GetInterfaceName_()+".Unregister", flags, ch, uuid)
}
func (v *interfaceNetworkServer) Unregister(flags dbus.Flags, uuid string) error {
return (<-v.GoUnregister(flags, make(chan *dbus.Call, 1), uuid).Done).Err
}
type Device interface {
device // interface org.bluez.Device1
battery // interface org.bluez.Battery1
proxy.Object
}
type objectDevice struct {
interfaceDevice // interface org.bluez.Device1
interfaceBattery // interface org.bluez.Battery1
proxy.ImplObject
}
func NewDevice(conn *dbus.Conn, path dbus.ObjectPath) (Device, error) {
if !path.IsValid() {
return nil, errors.New("path is invalid")
}
obj := new(objectDevice)
obj.ImplObject.Init_(conn, "org.bluez", path)
return obj, nil
}
type device interface {
GoDisconnect(flags dbus.Flags, ch chan *dbus.Call) *dbus.Call
Disconnect(flags dbus.Flags) error
GoConnect(flags dbus.Flags, ch chan *dbus.Call) *dbus.Call
Connect(flags dbus.Flags) error
GoConnectProfile(flags dbus.Flags, ch chan *dbus.Call, UUID string) *dbus.Call
ConnectProfile(flags dbus.Flags, UUID string) error
GoDisconnectProfile(flags dbus.Flags, ch chan *dbus.Call, UUID string) *dbus.Call
DisconnectProfile(flags dbus.Flags, UUID string) error
GoPair(flags dbus.Flags, ch chan *dbus.Call) *dbus.Call
Pair(flags dbus.Flags) error
GoCancelPairing(flags dbus.Flags, ch chan *dbus.Call) *dbus.Call
CancelPairing(flags dbus.Flags) error
Address() proxy.PropString
AddressType() proxy.PropString
Name() proxy.PropString
Alias() proxy.PropString
Class() proxy.PropUint32
Appearance() proxy.PropUint16
Icon() proxy.PropString
Paired() proxy.PropBool
Trusted() proxy.PropBool
Blocked() proxy.PropBool
LegacyPairing() proxy.PropBool
RSSI() proxy.PropInt16
Connected() proxy.PropBool
UUIDs() proxy.PropStringArray
Modalias() proxy.PropString
Adapter() proxy.PropObjectPath
ManufacturerData() PropDeviceManufacturerData
ServiceData() PropDeviceServiceData
TxPower() proxy.PropInt16
ServicesResolved() proxy.PropBool
}
type interfaceDevice struct{}
func (v *interfaceDevice) GetObject_() *proxy.ImplObject {
return (*proxy.ImplObject)(unsafe.Pointer(v))
}
func (*interfaceDevice) GetInterfaceName_() string {
return "org.bluez.Device1"
}
// method Disconnect
func (v *interfaceDevice) GoDisconnect(flags dbus.Flags, ch chan *dbus.Call) *dbus.Call {
return v.GetObject_().Go_(v.GetInterfaceName_()+".Disconnect", flags, ch)
}
func (v *interfaceDevice) Disconnect(flags dbus.Flags) error {
return (<-v.GoDisconnect(flags, make(chan *dbus.Call, 1)).Done).Err
}
// method Connect
func (v *interfaceDevice) GoConnect(flags dbus.Flags, ch chan *dbus.Call) *dbus.Call {
return v.GetObject_().Go_(v.GetInterfaceName_()+".Connect", flags, ch)
}
func (v *interfaceDevice) Connect(flags dbus.Flags) error {
return (<-v.GoConnect(flags, make(chan *dbus.Call, 1)).Done).Err
}
// method ConnectProfile
func (v *interfaceDevice) GoConnectProfile(flags dbus.Flags, ch chan *dbus.Call, UUID string) *dbus.Call {
return v.GetObject_().Go_(v.GetInterfaceName_()+".ConnectProfile", flags, ch, UUID)
}
func (v *interfaceDevice) ConnectProfile(flags dbus.Flags, UUID string) error {
return (<-v.GoConnectProfile(flags, make(chan *dbus.Call, 1), UUID).Done).Err
}
// method DisconnectProfile
func (v *interfaceDevice) GoDisconnectProfile(flags dbus.Flags, ch chan *dbus.Call, UUID string) *dbus.Call {
return v.GetObject_().Go_(v.GetInterfaceName_()+".DisconnectProfile", flags, ch, UUID)
}
func (v *interfaceDevice) DisconnectProfile(flags dbus.Flags, UUID string) error {
return (<-v.GoDisconnectProfile(flags, make(chan *dbus.Call, 1), UUID).Done).Err
}
// method Pair
func (v *interfaceDevice) GoPair(flags dbus.Flags, ch chan *dbus.Call) *dbus.Call {
return v.GetObject_().Go_(v.GetInterfaceName_()+".Pair", flags, ch)
}
func (v *interfaceDevice) Pair(flags dbus.Flags) error {
return (<-v.GoPair(flags, make(chan *dbus.Call, 1)).Done).Err
}
// method CancelPairing
func (v *interfaceDevice) GoCancelPairing(flags dbus.Flags, ch chan *dbus.Call) *dbus.Call {
return v.GetObject_().Go_(v.GetInterfaceName_()+".CancelPairing", flags, ch)
}
func (v *interfaceDevice) CancelPairing(flags dbus.Flags) error {
return (<-v.GoCancelPairing(flags, make(chan *dbus.Call, 1)).Done).Err
}
// property Address s
func (v *interfaceDevice) Address() proxy.PropString {
return &proxy.ImplPropString{
Impl: v,
Name: "Address",
}
}
// property AddressType s
func (v *interfaceDevice) AddressType() proxy.PropString {
return &proxy.ImplPropString{
Impl: v,
Name: "AddressType",
}
}
// property Name s
func (v *interfaceDevice) Name() proxy.PropString {
return &proxy.ImplPropString{
Impl: v,
Name: "Name",
}
}
// property Alias s
func (v *interfaceDevice) Alias() proxy.PropString {
return &proxy.ImplPropString{
Impl: v,
Name: "Alias",
}
}
// property Class u
func (v *interfaceDevice) Class() proxy.PropUint32 {
return &proxy.ImplPropUint32{
Impl: v,
Name: "Class",
}
}
// property Appearance q
func (v *interfaceDevice) Appearance() proxy.PropUint16 {
return &proxy.ImplPropUint16{
Impl: v,
Name: "Appearance",
}
}
// property Icon s
func (v *interfaceDevice) Icon() proxy.PropString {
return &proxy.ImplPropString{
Impl: v,
Name: "Icon",
}
}
// property Paired b
func (v *interfaceDevice) Paired() proxy.PropBool {
return &proxy.ImplPropBool{
Impl: v,
Name: "Paired",
}
}
// property Trusted b
func (v *interfaceDevice) Trusted() proxy.PropBool {
return &proxy.ImplPropBool{
Impl: v,
Name: "Trusted",
}
}
// property Blocked b
func (v *interfaceDevice) Blocked() proxy.PropBool {
return &proxy.ImplPropBool{
Impl: v,
Name: "Blocked",
}
}
// property LegacyPairing b
func (v *interfaceDevice) LegacyPairing() proxy.PropBool {
return &proxy.ImplPropBool{
Impl: v,
Name: "LegacyPairing",
}
}
// property RSSI n
func (v *interfaceDevice) RSSI() proxy.PropInt16 {
return &proxy.ImplPropInt16{
Impl: v,
Name: "RSSI",
}
}
// property Connected b
func (v *interfaceDevice) Connected() proxy.PropBool {
return &proxy.ImplPropBool{
Impl: v,
Name: "Connected",
}
}
// property UUIDs as
func (v *interfaceDevice) UUIDs() proxy.PropStringArray {
return &proxy.ImplPropStringArray{
Impl: v,
Name: "UUIDs",
}
}
// property Modalias s
func (v *interfaceDevice) Modalias() proxy.PropString {
return &proxy.ImplPropString{
Impl: v,
Name: "Modalias",
}
}
// property Adapter o
func (v *interfaceDevice) Adapter() proxy.PropObjectPath {
return &proxy.ImplPropObjectPath{
Impl: v,
Name: "Adapter",
}
}
type battery interface {
Percentage() proxy.PropByte
}
type interfaceBattery struct{}
func (v *interfaceBattery) GetObject_() *proxy.ImplObject {
return (*proxy.ImplObject)(unsafe.Pointer(v))
}
func (*interfaceBattery) GetInterfaceName_() string {
return "org.bluez.Battery1"
}
// property Battery o
func (v *interfaceBattery) Percentage() proxy.PropByte {
return &proxy.ImplPropByte{
Impl: v,
Name: "Percentage",
}
}
type PropDeviceManufacturerData interface {
Get(flags dbus.Flags) (value map[uint16]dbus.Variant, err error)
Set(flags dbus.Flags, value map[uint16]dbus.Variant) error
ConnectChanged(cb func(hasValue bool, value map[uint16]dbus.Variant)) error
}
type implPropDeviceManufacturerData struct {
Impl proxy.Implementer
Name string
}
func (p implPropDeviceManufacturerData) Get(flags dbus.Flags) (value map[uint16]dbus.Variant, err error) {
err = p.Impl.GetObject_().GetProperty_(flags, p.Impl.GetInterfaceName_(),
p.Name, &value)
return
}
func (p implPropDeviceManufacturerData) Set(flags dbus.Flags, value map[uint16]dbus.Variant) error {
return p.Impl.GetObject_().SetProperty_(flags, p.Impl.GetInterfaceName_(), p.Name, value)
}
func (p implPropDeviceManufacturerData) ConnectChanged(cb func(hasValue bool, value map[uint16]dbus.Variant)) error {
if cb == nil {
return errors.New("nil callback")
}
cb0 := func(hasValue bool, value interface{}) {
if hasValue {
var v map[uint16]dbus.Variant
err := dbus.Store([]interface{}{value}, &v)
if err != nil {
return
}
cb(true, v)
} else {
cb(false, nil)
}
}
return p.Impl.GetObject_().ConnectPropertyChanged_(p.Impl.GetInterfaceName_(),
p.Name, cb0)
}
// property ManufacturerData a{qv}
func (v *interfaceDevice) ManufacturerData() PropDeviceManufacturerData {
return &implPropDeviceManufacturerData{
Impl: v,
Name: "ManufacturerData",
}
}
type PropDeviceServiceData interface {
Get(flags dbus.Flags) (value map[string]dbus.Variant, err error)
Set(flags dbus.Flags, value map[string]dbus.Variant) error
ConnectChanged(cb func(hasValue bool, value map[string]dbus.Variant)) error
}
type implPropDeviceServiceData struct {
Impl proxy.Implementer
Name string
}
func (p implPropDeviceServiceData) Get(flags dbus.Flags) (value map[string]dbus.Variant, err error) {
err = p.Impl.GetObject_().GetProperty_(flags, p.Impl.GetInterfaceName_(),
p.Name, &value)
return
}
func (p implPropDeviceServiceData) Set(flags dbus.Flags, value map[string]dbus.Variant) error {
return p.Impl.GetObject_().SetProperty_(flags, p.Impl.GetInterfaceName_(), p.Name, value)
}
func (p implPropDeviceServiceData) ConnectChanged(cb func(hasValue bool, value map[string]dbus.Variant)) error {
if cb == nil {
return errors.New("nil callback")
}
cb0 := func(hasValue bool, value interface{}) {
if hasValue {
var v map[string]dbus.Variant
err := dbus.Store([]interface{}{value}, &v)
if err != nil {
return
}
cb(true, v)
} else {
cb(false, nil)
}
}
return p.Impl.GetObject_().ConnectPropertyChanged_(p.Impl.GetInterfaceName_(),
p.Name, cb0)
}
// property ServiceData a{sv}
func (v *interfaceDevice) ServiceData() PropDeviceServiceData {
return &implPropDeviceServiceData{
Impl: v,
Name: "ServiceData",
}
}
// property TxPower n
func (v *interfaceDevice) TxPower() proxy.PropInt16 {
return &proxy.ImplPropInt16{
Impl: v,
Name: "TxPower",
}
}
// property ServicesResolved b
func (v *interfaceDevice) ServicesResolved() proxy.PropBool {
return &proxy.ImplPropBool{
Impl: v,
Name: "ServicesResolved",
}
}