libnx  v4.8.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 is_primary, const BtdrvGattId *serv_id, const BtdrvGattId *char_id, u8 auth_req)
 LeClientReadCharacteristic. More...
 
Result btLeClientReadDescriptor (u32 connection_handle, bool is_primary, const BtdrvGattId *serv_id, const BtdrvGattId *char_id, const BtdrvGattId *desc_id, u8 auth_req)
 LeClientReadDescriptor. More...
 
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)
 LeClientWriteCharacteristic. More...
 
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)
 LeClientWriteDescriptor. More...
 
Result btLeClientRegisterNotification (u32 connection_handle, bool is_primary, const BtdrvGattId *serv_id, const BtdrvGattId *char_id)
 LeClientRegisterNotification. More...
 
Result btLeClientDeregisterNotification (u32 connection_handle, bool is_primary, const BtdrvGattId *serv_id, const BtdrvGattId *char_id)
 LeClientDeregisterNotification. More...
 
Result btSetLeResponse (u8 server_if, const BtdrvGattAttributeUuid *serv_uuid, const BtdrvGattAttributeUuid *char_uuid, const void *buffer, size_t size)
 SetLeResponse. More...
 
Result btLeSendIndication (u8 server_if, const BtdrvGattAttributeUuid *serv_uuid, const BtdrvGattAttributeUuid *char_uuid, const void *buffer, size_t size, bool noconfirm)
 LeSendIndication. More...
 
Result btGetLeEventInfo (void *buffer, size_t size, BtdrvBleEventType *type)
 GetLeEventInfo. More...
 
Result btRegisterBleEvent (Event *out_event)
 RegisterBleEvent. More...
 

Detailed Description

Bluetooth user (bt) service IPC wrapper.

Note
See also btdev.
Author
yellows8, ndeadly

Function Documentation

◆ btGetLeEventInfo()

Result btGetLeEventInfo ( void *  buffer,
size_t  size,
BtdrvBleEventType 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 BtdrvBleEventType.

◆ btLeClientDeregisterNotification()

Result btLeClientDeregisterNotification ( u32  connection_handle,
bool  is_primary,
const BtdrvGattId serv_id,
const BtdrvGattId char_id 
)

LeClientDeregisterNotification.

Note
This is essentially the same as btdrvUnregisterGattNotification.
Parameters
[in]connection_handleConnectionHandle
[in]is_primaryIs a primary service or not
[in]serv_idService GATT ID BtdrvGattId
[in]char_idCharacteristic GATT ID BtdrvGattId

◆ btLeClientReadCharacteristic()

Result btLeClientReadCharacteristic ( u32  connection_handle,
bool  is_primary,
const BtdrvGattId serv_id,
const BtdrvGattId char_id,
u8  auth_req 
)

LeClientReadCharacteristic.

Note
This is essentially the same as btdrvReadGattCharacteristic.
Parameters
[in]connection_handleConnectionHandle
[in]is_primaryIs a primary service or not
[in]serv_idService GATT ID BtdrvGattId
[in]char_idCharacteristic GATT ID BtdrvGattId
[in]auth_reqBtdrvGattAuthReqType

◆ btLeClientReadDescriptor()

Result btLeClientReadDescriptor ( u32  connection_handle,
bool  is_primary,
const BtdrvGattId serv_id,
const BtdrvGattId char_id,
const BtdrvGattId desc_id,
u8  auth_req 
)

LeClientReadDescriptor.

Note
This is essentially the same as btdrvReadGattDescriptor.
Parameters
[in]connection_handleConnectionHandle
[in]is_primaryIs a primary service or not
[in]serv_idService GATT ID BtdrvGattId
[in]char_idCharacteristic GATT ID BtdrvGattId
[in]desc_idDescriptor GATT ID BtdrvGattId
[in]auth_reqBtdrvGattAuthReqType

◆ btLeClientRegisterNotification()

Result btLeClientRegisterNotification ( u32  connection_handle,
bool  is_primary,
const BtdrvGattId serv_id,
const BtdrvGattId char_id 
)

LeClientRegisterNotification.

Note
This is essentially the same as btdrvRegisterGattNotification.
Parameters
[in]connection_handleConnectionHandle
[in]is_primaryIs a primary service or not
[in]serv_idService GATT ID BtdrvGattId
[in]char_idCharacteristic GATT ID BtdrvGattId

◆ btLeClientWriteCharacteristic()

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 
)

LeClientWriteCharacteristic.

Note
This is essentially the same as btdrvWriteGattCharacteristic.
Parameters
[in]connection_handleConnectionHandle
[in]is_primaryIs a primary service or not
[in]serv_idService GATT ID BtdrvGattId
[in]char_idCharacteristic GATT ID BtdrvGattId
[in]bufferInput buffer.
[in]sizeInput buffer size, must be <=0x258.
[in]auth_reqBtdrvGattAuthReqType
[in]with_responseWhether to use Write-With-Response write type or not

◆ btLeClientWriteDescriptor()

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 
)

LeClientWriteDescriptor.

Note
This is essentially the same as btdrvWriteGattDescriptor.
Parameters
[in]connection_handleConnectionHandle
[in]is_primaryIs a primary service or not
[in]serv_idService GATT ID BtdrvGattId
[in]char_idCharacteristic GATT ID BtdrvGattId
[in]desc_idDescriptor GATT ID BtdrvGattId
[in]bufferInput buffer.
[in]sizeInput buffer size, must be <=0x258.
[in]auth_reqBtdrvGattAuthReqType

◆ btLeSendIndication()

Result btLeSendIndication ( u8  server_if,
const BtdrvGattAttributeUuid serv_uuid,
const BtdrvGattAttributeUuid char_uuid,
const void *  buffer,
size_t  size,
bool  noconfirm 
)

LeSendIndication.

Parameters
[in]server_ifServer interface ID
[in]serv_uuidService UUID BtdrvGattAttributeUuid
[in]char_uuidCharacteristic UUID BtdrvGattAttributeUuid
[in]bufferInput buffer.
[in]sizeInput buffer size, clamped to max size 0x258.
[in]noconfirmWhether no confirmation is required (notification) or not (indication)

◆ 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  server_if,
const BtdrvGattAttributeUuid serv_uuid,
const BtdrvGattAttributeUuid char_uuid,
const void *  buffer,
size_t  size 
)

SetLeResponse.

Parameters
[in]server_ifServer interface ID
[in]serv_uuidService UUID BtdrvGattAttributeUuid
[in]char_uuidCharacteristic UUID BtdrvGattAttributeUuid
[in]bufferInput buffer.
[in]sizeInput buffer size, must be <=0x258.