@@ -24,50 +24,50 @@ Service* btGetServiceSession(void) {
24
24
return & g_btSrv ;
25
25
}
26
26
27
- Result btLeClientReadCharacteristic (u32 connection_handle , bool primary_service , const BtdrvGattId * id0 , const BtdrvGattId * id1 , u8 unk ) {
27
+ Result btLeClientReadCharacteristic (u32 connection_handle , bool is_primary , const BtdrvGattId * serv_id , const BtdrvGattId * char_id , u8 auth_req ) {
28
28
const struct {
29
- u8 primary_service ;
30
- u8 unk ;
29
+ u8 is_primary ;
30
+ u8 auth_req ;
31
31
u8 pad [2 ];
32
32
u32 connection_handle ;
33
- BtdrvGattId id0 ;
34
- BtdrvGattId id1 ;
33
+ BtdrvGattId serv_id ;
34
+ BtdrvGattId char_id ;
35
35
u64 AppletResourceUserId ;
36
- } in = { primary_service != 0 , unk , {0 }, connection_handle , * id0 , * id1 , appletGetAppletResourceUserId () };
36
+ } in = { is_primary != 0 , auth_req , {0 }, connection_handle , * serv_id , * char_id , appletGetAppletResourceUserId () };
37
37
38
38
return serviceDispatchIn (& g_btSrv , 0 , in ,
39
39
.in_send_pid = true,
40
40
);
41
41
}
42
42
43
- Result btLeClientReadDescriptor (u32 connection_handle , bool primary_service , const BtdrvGattId * id0 , const BtdrvGattId * id1 , const BtdrvGattId * id2 , u8 unk ) {
43
+ Result btLeClientReadDescriptor (u32 connection_handle , bool is_primary , const BtdrvGattId * serv_id , const BtdrvGattId * char_id , const BtdrvGattId * desc_id , u8 auth_req ) {
44
44
const struct {
45
- u8 primary_service ;
46
- u8 unk ;
45
+ u8 is_primary ;
46
+ u8 auth_req ;
47
47
u8 pad [2 ];
48
48
u32 connection_handle ;
49
- BtdrvGattId id0 ;
50
- BtdrvGattId id1 ;
51
- BtdrvGattId id2 ;
49
+ BtdrvGattId serv_id ;
50
+ BtdrvGattId char_id ;
51
+ BtdrvGattId desc_id ;
52
52
u64 AppletResourceUserId ;
53
- } in = { primary_service != 0 , unk , {0 }, connection_handle , * id0 , * id1 , * id2 , appletGetAppletResourceUserId () };
53
+ } in = { is_primary != 0 , auth_req , {0 }, connection_handle , * serv_id , * char_id , * desc_id , appletGetAppletResourceUserId () };
54
54
55
55
return serviceDispatchIn (& g_btSrv , 1 , in ,
56
56
.in_send_pid = true,
57
57
);
58
58
}
59
59
60
- Result btLeClientWriteCharacteristic (u32 connection_handle , bool primary_service , const BtdrvGattId * id0 , const BtdrvGattId * id1 , const void * buffer , size_t size , u8 unk , bool flag ) {
60
+ Result btLeClientWriteCharacteristic (u32 connection_handle , bool is_primary , const BtdrvGattId * serv_id , const BtdrvGattId * char_id , const void * buffer , size_t size , u8 auth_req , bool with_response ) {
61
61
const struct {
62
- u8 primary_service ;
63
- u8 unk ;
64
- u8 flag ;
62
+ u8 is_primary ;
63
+ u8 auth_req ;
64
+ u8 with_response ;
65
65
u8 pad ;
66
66
u32 connection_handle ;
67
- BtdrvGattId id0 ;
68
- BtdrvGattId id1 ;
67
+ BtdrvGattId serv_id ;
68
+ BtdrvGattId char_id ;
69
69
u64 AppletResourceUserId ;
70
- } in = { primary_service != 0 , unk , flag != 0 , 0 , connection_handle , * id0 , * id1 , appletGetAppletResourceUserId () };
70
+ } in = { is_primary != 0 , auth_req , with_response != 0 , 0 , connection_handle , * serv_id , * char_id , appletGetAppletResourceUserId () };
71
71
72
72
return serviceDispatchIn (& g_btSrv , 2 , in ,
73
73
.buffer_attrs = { SfBufferAttr_HipcPointer | SfBufferAttr_In },
@@ -76,17 +76,17 @@ Result btLeClientWriteCharacteristic(u32 connection_handle, bool primary_service
76
76
);
77
77
}
78
78
79
- Result btLeClientWriteDescriptor (u32 connection_handle , bool primary_service , const BtdrvGattId * id0 , const BtdrvGattId * id1 , const BtdrvGattId * id2 , const void * buffer , size_t size , u8 unk ) {
79
+ Result btLeClientWriteDescriptor (u32 connection_handle , bool is_primary , const BtdrvGattId * serv_id , const BtdrvGattId * char_id , const BtdrvGattId * desc_id , const void * buffer , size_t size , u8 auth_req ) {
80
80
const struct {
81
- u8 primary_service ;
82
- u8 unk ;
81
+ u8 is_primary ;
82
+ u8 auth_req ;
83
83
u8 pad [2 ];
84
84
u32 connection_handle ;
85
- BtdrvGattId id0 ;
86
- BtdrvGattId id1 ;
87
- BtdrvGattId id2 ;
85
+ BtdrvGattId serv_id ;
86
+ BtdrvGattId char_id ;
87
+ BtdrvGattId desc_id ;
88
88
u64 AppletResourceUserId ;
89
- } in = { primary_service != 0 , unk , {0 }, connection_handle , * id0 , * id1 , * id2 , appletGetAppletResourceUserId () };
89
+ } in = { is_primary != 0 , auth_req , {0 }, connection_handle , * serv_id , * char_id , * desc_id , appletGetAppletResourceUserId () };
90
90
91
91
return serviceDispatchIn (& g_btSrv , 3 , in ,
92
92
.buffer_attrs = { SfBufferAttr_HipcPointer | SfBufferAttr_In },
@@ -95,38 +95,38 @@ Result btLeClientWriteDescriptor(u32 connection_handle, bool primary_service, co
95
95
);
96
96
}
97
97
98
- static Result _btLeClientNotification (u32 connection_handle , bool primary_service , const BtdrvGattId * id0 , const BtdrvGattId * id1 , u32 cmd_id ) {
98
+ static Result _btLeClientNotification (u32 connection_handle , bool is_primary , const BtdrvGattId * serv_id , const BtdrvGattId * char_id , u32 cmd_id ) {
99
99
const struct {
100
- u8 primary_service ;
100
+ u8 is_primary ;
101
101
u8 pad [3 ];
102
102
u32 connection_handle ;
103
- BtdrvGattId id0 ;
104
- BtdrvGattId id1 ;
103
+ BtdrvGattId serv_id ;
104
+ BtdrvGattId char_id ;
105
105
u64 AppletResourceUserId ;
106
- } in = { primary_service != 0 , {0 }, connection_handle , * id0 , * id1 , appletGetAppletResourceUserId () };
106
+ } in = { is_primary != 0 , {0 }, connection_handle , * serv_id , * char_id , appletGetAppletResourceUserId () };
107
107
108
108
return serviceDispatchIn (& g_btSrv , cmd_id , in ,
109
109
.in_send_pid = true,
110
110
);
111
111
}
112
112
113
- Result btLeClientRegisterNotification (u32 connection_handle , bool primary_service , const BtdrvGattId * id0 , const BtdrvGattId * id1 ) {
114
- return _btLeClientNotification (connection_handle , primary_service , id0 , id1 , 4 );
113
+ Result btLeClientRegisterNotification (u32 connection_handle , bool is_primary , const BtdrvGattId * serv_id , const BtdrvGattId * char_id ) {
114
+ return _btLeClientNotification (connection_handle , is_primary , serv_id , char_id , 4 );
115
115
}
116
116
117
- Result btLeClientDeregisterNotification (u32 connection_handle , bool primary_service , const BtdrvGattId * id0 , const BtdrvGattId * id1 ) {
118
- return _btLeClientNotification (connection_handle , primary_service , id0 , id1 , 5 );
117
+ Result btLeClientDeregisterNotification (u32 connection_handle , bool is_primary , const BtdrvGattId * serv_id , const BtdrvGattId * char_id ) {
118
+ return _btLeClientNotification (connection_handle , is_primary , serv_id , char_id , 5 );
119
119
}
120
120
121
- Result btSetLeResponse (u8 unk , const BtdrvGattAttributeUuid * uuid0 , const BtdrvGattAttributeUuid * uuid1 , const void * buffer , size_t size ) {
121
+ Result btSetLeResponse (u8 server_if , const BtdrvGattAttributeUuid * serv_uuid , const BtdrvGattAttributeUuid * char_uuid , const void * buffer , size_t size ) {
122
122
const struct {
123
- u8 unk ;
123
+ u8 server_if ;
124
124
u8 pad [3 ];
125
- BtdrvGattAttributeUuid uuid0 ;
126
- BtdrvGattAttributeUuid uuid1 ;
125
+ BtdrvGattAttributeUuid serv_uuid ;
126
+ BtdrvGattAttributeUuid char_uuid ;
127
127
u8 pad2 [4 ];
128
128
u64 AppletResourceUserId ;
129
- } in = { unk , {0 }, * uuid0 , * uuid1 , {0 }, appletGetAppletResourceUserId () };
129
+ } in = { server_if , {0 }, * serv_uuid , * char_uuid , {0 }, appletGetAppletResourceUserId () };
130
130
131
131
return serviceDispatchIn (& g_btSrv , 6 , in ,
132
132
.buffer_attrs = { SfBufferAttr_HipcPointer | SfBufferAttr_In },
@@ -135,16 +135,16 @@ Result btSetLeResponse(u8 unk, const BtdrvGattAttributeUuid *uuid0, const BtdrvG
135
135
);
136
136
}
137
137
138
- Result btLeSendIndication (u8 unk , const BtdrvGattAttributeUuid * uuid0 , const BtdrvGattAttributeUuid * uuid1 , const void * buffer , size_t size , bool flag ) {
138
+ Result btLeSendIndication (u8 server_if , const BtdrvGattAttributeUuid * serv_uuid , const BtdrvGattAttributeUuid * char_uuid , const void * buffer , size_t size , bool noconfirm ) {
139
139
const struct {
140
- u8 unk ;
141
- u8 flag ;
140
+ u8 server_if ;
141
+ u8 noconfirm ;
142
142
u8 pad [2 ];
143
- BtdrvGattAttributeUuid uuid0 ;
144
- BtdrvGattAttributeUuid uuid1 ;
143
+ BtdrvGattAttributeUuid serv_uuid ;
144
+ BtdrvGattAttributeUuid char_uuid ;
145
145
u8 pad2 [4 ];
146
146
u64 AppletResourceUserId ;
147
- } in = { unk , flag != 0 , {0 }, * uuid0 , * uuid1 , {0 }, appletGetAppletResourceUserId () };
147
+ } in = { server_if , noconfirm != 0 , {0 }, * serv_uuid , * char_uuid , {0 }, appletGetAppletResourceUserId () };
148
148
149
149
return serviceDispatchIn (& g_btSrv , 7 , in ,
150
150
.buffer_attrs = { SfBufferAttr_HipcPointer | SfBufferAttr_In },
@@ -153,7 +153,7 @@ Result btLeSendIndication(u8 unk, const BtdrvGattAttributeUuid *uuid0, const Btd
153
153
);
154
154
}
155
155
156
- Result btGetLeEventInfo (void * buffer , size_t size , u32 * type ) {
156
+ Result btGetLeEventInfo (void * buffer , size_t size , BtdrvBleEventType * type ) {
157
157
u64 AppletResourceUserId = appletGetAppletResourceUserId ();
158
158
return serviceDispatchInOut (& g_btSrv , 8 , AppletResourceUserId , * type ,
159
159
.buffer_attrs = { SfBufferAttr_HipcPointer | SfBufferAttr_Out },
0 commit comments