libnx  v4.6.0
Functions
bt.h File Reference

Bluetooth user (bt) service IPC wrapper. More...

#include "../types.h"
#include "../kernel/event.h"
#include "../services/btdrv.h"
#include "../sf/service.h"

Go to the source code of this file.

Functions

Result btInitialize (void)
 Initialize bt. Only available on [5.0.0+].
 
void btExit (void)
 Exit bt.
 
ServicebtGetServiceSession (void)
 Gets the Service object for the actual bt service session.
 
Result btLeClientReadCharacteristic (u32 connection_handle, bool primary_service, const BtdrvGattId *id0, const BtdrvGattId *id1, u8 unk)
 LeClientReadCharacteristic. More...
 
Result btLeClientReadDescriptor (u32 connection_handle, bool primary_service, const BtdrvGattId *id0, const BtdrvGattId *id1, const BtdrvGattId *id2, u8 unk)
 LeClientReadDescriptor. More...
 
Result btLeClientWriteCharacteristic (u32 connection_handle, bool primary_service, const BtdrvGattId *id0, const BtdrvGattId *id1, const void *buffer, size_t size, u8 unk, bool flag)
 LeClientWriteCharacteristic. More...
 
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)
 LeClientWriteDescriptor. More...
 
Result btLeClientRegisterNotification (u32 connection_handle, bool primary_service, const BtdrvGattId *id0, const BtdrvGattId *id1)
 LeClientRegisterNotification. More...
 
Result btLeClientDeregisterNotification (u32 connection_handle, bool primary_service, const BtdrvGattId *id0, const BtdrvGattId *id1)
 LeClientDeregisterNotification. More...
 
Result btSetLeResponse (u8 unk, const BtdrvGattAttributeUuid *uuid0, const BtdrvGattAttributeUuid *uuid1, const void *buffer, size_t size)
 SetLeResponse. More...
 
Result btLeSendIndication (u8 unk, const BtdrvGattAttributeUuid *uuid0, const BtdrvGattAttributeUuid *uuid1, const void *buffer, size_t size, bool flag)
 LeSendIndication. More...
 
Result btGetLeEventInfo (void *buffer, size_t size, u32 *type)
 GetLeEventInfo. More...
 
Result btRegisterBleEvent (Event *out_event)
 RegisterBleEvent. More...
 

Detailed Description

Bluetooth user (bt) service IPC wrapper.

Note
See also btdev.
Author
yellows8

Function Documentation

◆ btGetLeEventInfo()

Result btGetLeEventInfo ( void *  buffer,
size_t  size,
u32 type 
)

GetLeEventInfo.

Note
This is identical to btdrvGetLeHidEventInfo except different state is used.
The state used by this is reset after writing the data to output.
Parameters
[in]bufferOutput buffer. 0x400-bytes from state is written here. See BtdrvLeEventInfo.
[in]sizeOutput buffer size.
[out]typeOutput BleEventType.

◆ btLeClientDeregisterNotification()

Result btLeClientDeregisterNotification ( u32  connection_handle,
bool  primary_service,
const BtdrvGattId id0,
const BtdrvGattId id1 
)

LeClientDeregisterNotification.

Note
This is essentially the same as btdrvUnregisterGattNotification.
Parameters
[in]connection_handleConnectionHandle
[in]primary_servicePrimaryService
[in]id0BtdrvGattId
[in]id1BtdrvGattId

◆ btLeClientReadCharacteristic()

Result btLeClientReadCharacteristic ( u32  connection_handle,
bool  primary_service,
const BtdrvGattId id0,
const BtdrvGattId id1,
u8  unk 
)

LeClientReadCharacteristic.

Note
This is essentially the same as btdrvReadGattCharacteristic.
Parameters
[in]connection_handleConnectionHandle
[in]primary_servicePrimaryService
[in]id0BtdrvGattId
[in]id1BtdrvGattId
[in]unkUnknown

◆ btLeClientReadDescriptor()

Result btLeClientReadDescriptor ( u32  connection_handle,
bool  primary_service,
const BtdrvGattId id0,
const BtdrvGattId id1,
const BtdrvGattId id2,
u8  unk 
)

LeClientReadDescriptor.

Note
This is essentially the same as btdrvReadGattDescriptor.
Parameters
[in]connection_handleConnectionHandle
[in]primary_servicePrimaryService
[in]id0BtdrvGattId
[in]id1BtdrvGattId
[in]id2BtdrvGattId
[in]unkUnknown

◆ btLeClientRegisterNotification()

Result btLeClientRegisterNotification ( u32  connection_handle,
bool  primary_service,
const BtdrvGattId id0,
const BtdrvGattId id1 
)

LeClientRegisterNotification.

Note
This is essentially the same as btdrvRegisterGattNotification.
Parameters
[in]connection_handleConnectionHandle
[in]primary_servicePrimaryService
[in]id0BtdrvGattId
[in]id1BtdrvGattId

◆ btLeClientWriteCharacteristic()

Result btLeClientWriteCharacteristic ( u32  connection_handle,
bool  primary_service,
const BtdrvGattId id0,
const BtdrvGattId id1,
const void *  buffer,
size_t  size,
u8  unk,
bool  flag 
)

LeClientWriteCharacteristic.

Note
This is essentially the same as btdrvWriteGattCharacteristic.
Parameters
[in]connection_handleConnectionHandle
[in]primary_servicePrimaryService
[in]id0BtdrvGattId
[in]id1BtdrvGattId
[in]bufferInput buffer.
[in]sizeInput buffer size, must be <=0x258.
[in]unkUnknown
[in]flagFlag

◆ btLeClientWriteDescriptor()

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 
)

LeClientWriteDescriptor.

Note
This is essentially the same as btdrvWriteGattDescriptor.
Parameters
[in]connection_handleConnectionHandle
[in]primary_servicePrimaryService
[in]id0BtdrvGattId
[in]id1BtdrvGattId
[in]id2BtdrvGattId
[in]bufferInput buffer.
[in]sizeInput buffer size, must be <=0x258.
[in]unkUnknown

◆ btLeSendIndication()

Result btLeSendIndication ( u8  unk,
const BtdrvGattAttributeUuid uuid0,
const BtdrvGattAttributeUuid uuid1,
const void *  buffer,
size_t  size,
bool  flag 
)

LeSendIndication.

Parameters
[in]unkUnknown
[in]uuid0BtdrvGattAttributeUuid
[in]uuid1BtdrvGattAttributeUuid
[in]bufferInput buffer.
[in]sizeInput buffer size, clamped to max size 0x258.
[in]flagFlag

◆ btRegisterBleEvent()

Result btRegisterBleEvent ( Event out_event)

RegisterBleEvent.

Note
This is identical to btdrvRegisterBleHidEvent except different state is used.
The Event must be closed by the user once finished with it.
Parameters
[out]out_eventOutput Event with autoclear=true.

◆ btSetLeResponse()

Result btSetLeResponse ( u8  unk,
const BtdrvGattAttributeUuid uuid0,
const BtdrvGattAttributeUuid uuid1,
const void *  buffer,
size_t  size 
)

SetLeResponse.

Parameters
[in]unkUnknown
[in]uuid0BtdrvGattAttributeUuid
[in]uuid1BtdrvGattAttributeUuid
[in]bufferInput buffer.
[in]sizeInput buffer size, must be <=0x258.