libnx  v4.7.0
Functions
btmu.h File Reference

btm:u (btm user) service IPC wrapper. More...

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

Go to the source code of this file.

Functions

Result btmuInitialize (void)
 Initialize btm:u.
 
void btmuExit (void)
 Exit btm:u.
 
Result btmuGetServiceSession (Service *srv_out)
 Gets the Service object for the actual btm:u service session. This object must be closed by the user once finished using cmds with this.
 
ServicebtmuGetServiceSession_IBtmUserCore (void)
 Gets the Service object for IBtmUserCore.
 
Result btmuAcquireBleScanEvent (Event *out_event)
 AcquireBleScanEvent. More...
 
Result btmuGetBleScanFilterParameter (u16 parameter_id, BtdrvBleAdvertisePacketParameter *out)
 GetBleScanFilterParameter. More...
 
Result btmuGetBleScanFilterParameter2 (u16 parameter_id, BtdrvGattAttributeUuid *out)
 GetBleScanFilterParameter2. More...
 
Result btmuStartBleScanForGeneral (BtdrvBleAdvertisePacketParameter param)
 StartBleScanForGeneral. More...
 
Result btmuStopBleScanForGeneral (void)
 StopBleScanForGeneral. More...
 
Result btmuGetBleScanResultsForGeneral (BtdrvBleScanResult *results, u8 count, u8 *total_out)
 GetBleScanResultsForGeneral. More...
 
Result btmuStartBleScanForPaired (BtdrvBleAdvertisePacketParameter param)
 StartBleScanForPaired. More...
 
Result btmuStopBleScanForPaired (void)
 StopBleScanForPaired. More...
 
Result btmuStartBleScanForSmartDevice (const BtdrvGattAttributeUuid *uuid)
 StartBleScanForSmartDevice. More...
 
Result btmuStopBleScanForSmartDevice (void)
 StopBleScanForSmartDevice. More...
 
Result btmuGetBleScanResultsForSmartDevice (BtdrvBleScanResult *results, u8 count, u8 *total_out)
 GetBleScanResultsForSmartDevice. More...
 
Result btmuAcquireBleConnectionEvent (Event *out_event)
 AcquireBleConnectionEvent. More...
 
Result btmuBleConnect (BtdrvAddress addr)
 BleConnect. More...
 
Result btmuBleDisconnect (u32 connection_handle)
 BleDisconnect. More...
 
Result btmuBleGetConnectionState (BtdrvBleConnectionInfo *info, u8 count, u8 *total_out)
 BleGetConnectionState. More...
 
Result btmuAcquireBlePairingEvent (Event *out_event)
 AcquireBlePairingEvent. More...
 
Result btmuBlePairDevice (u32 connection_handle, BtdrvBleAdvertisePacketParameter param)
 BlePairDevice. More...
 
Result btmuBleUnPairDevice (u32 connection_handle, BtdrvBleAdvertisePacketParameter param)
 BleUnPairDevice. More...
 
Result btmuBleUnPairDevice2 (BtdrvAddress addr, BtdrvBleAdvertisePacketParameter param)
 BleUnPairDevice2. More...
 
Result btmuBleGetPairedDevices (BtdrvBleAdvertisePacketParameter param, BtdrvAddress *addrs, u8 count, u8 *total_out)
 BleGetPairedDevices. More...
 
Result btmuAcquireBleServiceDiscoveryEvent (Event *out_event)
 AcquireBleServiceDiscoveryEvent. More...
 
Result btmuGetGattServices (u32 connection_handle, BtmGattService *services, u8 count, u8 *total_out)
 GetGattServices. More...
 
Result btmuGetGattService (u32 connection_handle, const BtdrvGattAttributeUuid *uuid, BtmGattService *service, bool *flag)
 Same as btmuGetGattServices except this only returns the BtmGattService which matches the input BtdrvGattAttributeUuid. More...
 
Result btmuGetGattIncludedServices (u32 connection_handle, u16 service_handle, BtmGattService *services, u8 count, u8 *out)
 Same as btmuGetGattServices except this only returns BtmGattService entries where various checks pass with u16 fields. More...
 
Result btmuGetBelongingGattService (u32 connection_handle, u16 attribute_handle, BtmGattService *service, bool *flag)
 This is similar to btmuGetGattIncludedServices except this only returns 1 BtmGattService. More...
 
Result btmuGetGattCharacteristics (u32 connection_handle, u16 service_handle, BtmGattCharacteristic *characteristics, u8 count, u8 *total_out)
 GetGattCharacteristics. More...
 
Result btmuGetGattDescriptors (u32 connection_handle, u16 char_handle, BtmGattDescriptor *descriptors, u8 count, u8 *total_out)
 GetGattDescriptors. More...
 
Result btmuAcquireBleMtuConfigEvent (Event *out_event)
 AcquireBleMtuConfigEvent. More...
 
Result btmuConfigureBleMtu (u32 connection_handle, u16 mtu)
 ConfigureBleMtu. More...
 
Result btmuGetBleMtu (u32 connection_handle, u16 *out)
 GetBleMtu. More...
 
Result btmuRegisterBleGattDataPath (const BtmBleDataPath *path)
 RegisterBleGattDataPath. More...
 
Result btmuUnregisterBleGattDataPath (const BtmBleDataPath *path)
 UnregisterBleGattDataPath. More...
 

Detailed Description

btm:u (btm user) service IPC wrapper.

Note
Only available on [5.0.0+].
See also btdev.
See also: https://switchbrew.org/wiki/BTM_services
Author
yellows8

Function Documentation

◆ btmuAcquireBleConnectionEvent()

Result btmuAcquireBleConnectionEvent ( Event out_event)

AcquireBleConnectionEvent.

Note
This is similar to btmAcquireBleConnectionEvent.
The Event must be closed by the user once finished with it.
Parameters
[out]out_eventOutput Event with autoclear=true.

◆ btmuAcquireBleMtuConfigEvent()

Result btmuAcquireBleMtuConfigEvent ( Event out_event)

AcquireBleMtuConfigEvent.

Note
This is similar to btmAcquireBleMtuConfigEvent.
The Event must be closed by the user once finished with it.
Parameters
[out]out_eventOutput Event with autoclear=true.

◆ btmuAcquireBlePairingEvent()

Result btmuAcquireBlePairingEvent ( Event out_event)

AcquireBlePairingEvent.

Note
This is similar to btmAcquireBlePairingEvent.
The Event must be closed by the user once finished with it.
Parameters
[out]out_eventOutput Event with autoclear=true.

◆ btmuAcquireBleScanEvent()

Result btmuAcquireBleScanEvent ( Event out_event)

AcquireBleScanEvent.

Note
This is similar to btmAcquireBleScanEvent.
The Event must be closed by the user once finished with it.
Parameters
[out]out_eventOutput Event with autoclear=true.

◆ btmuAcquireBleServiceDiscoveryEvent()

Result btmuAcquireBleServiceDiscoveryEvent ( Event out_event)

AcquireBleServiceDiscoveryEvent.

Note
This is similar to btmAcquireBleServiceDiscoveryEvent.
The Event must be closed by the user once finished with it.
Parameters
[out]out_eventOutput Event with autoclear=true.

◆ btmuBleConnect()

Result btmuBleConnect ( BtdrvAddress  addr)

BleConnect.

Note
This is similar to btmBleConnect.
Parameters
[in]addrBtdrvAddress

◆ btmuBleDisconnect()

Result btmuBleDisconnect ( u32  connection_handle)

BleDisconnect.

Note
This is similar to btmBleDisconnect.
Parameters
[in]connection_handleThis must match a BtdrvBleConnectionInfo::connection_handle from btmuBleGetConnectionState. [5.1.0+] 0xFFFFFFFF is invalid.

◆ btmuBleGetConnectionState()

Result btmuBleGetConnectionState ( BtdrvBleConnectionInfo info,
u8  count,
u8 total_out 
)

BleGetConnectionState.

Note
This is similar to btmBleGetConnectionState.
Parameters
[out]infoOutput array of BtdrvBleConnectionInfo.
[in]countSize of the info array in entries. Other cmds which use this internally use count=4.
[out]total_outTotal output entries.

◆ btmuBleGetPairedDevices()

Result btmuBleGetPairedDevices ( BtdrvBleAdvertisePacketParameter  param,
BtdrvAddress addrs,
u8  count,
u8 total_out 
)

BleGetPairedDevices.

Note
This is similar to btmBleGetPairedAddresses.
Parameters
[in]paramBtdrvBleAdvertisePacketParameter
[out]addrsOutput array of BtdrvAddress.
[in]countSize of the addrs array in entries.
[out]total_outTotal output entries. The max is 10.

◆ btmuBlePairDevice()

Result btmuBlePairDevice ( u32  connection_handle,
BtdrvBleAdvertisePacketParameter  param 
)

BlePairDevice.

Note
This is similar to btmBlePairDevice.
Parameters
[in]connection_handleSame as btmuBleDisconnect.
[in]paramBtdrvBleAdvertisePacketParameter

◆ btmuBleUnPairDevice()

Result btmuBleUnPairDevice ( u32  connection_handle,
BtdrvBleAdvertisePacketParameter  param 
)

BleUnPairDevice.

Note
This is similar to btmBleUnpairDeviceOnBoth.
Parameters
[in]connection_handleSame as btmuBleDisconnect.
[in]paramBtdrvBleAdvertisePacketParameter

◆ btmuBleUnPairDevice2()

Result btmuBleUnPairDevice2 ( BtdrvAddress  addr,
BtdrvBleAdvertisePacketParameter  param 
)

BleUnPairDevice2.

Note
This is similar to btmBleUnPairDevice.
Parameters
[in]addrBtdrvAddress
[in]paramBtdrvBleAdvertisePacketParameter

◆ btmuConfigureBleMtu()

Result btmuConfigureBleMtu ( u32  connection_handle,
u16  mtu 
)

ConfigureBleMtu.

Note
This is similar to btmConfigureBleMtu.
Parameters
[in]connection_handleSame as btmuBleDisconnect.
[in]mtuMTU

◆ btmuGetBelongingGattService()

Result btmuGetBelongingGattService ( u32  connection_handle,
u16  attribute_handle,
BtmGattService service,
bool *  flag 
)

This is similar to btmuGetGattIncludedServices except this only returns 1 BtmGattService.

Note
This is similar to btmGetBelongingService.
Parameters
[in]connection_handleSame as btmuBleDisconnect.
[in]attribute_handleAttributeHandle
[out]serviceBtmGattService
[out]flagWhether a BtmGattService was returned.

◆ btmuGetBleMtu()

Result btmuGetBleMtu ( u32  connection_handle,
u16 out 
)

GetBleMtu.

Note
This is similar to btmGetBleMtu.
Parameters
[in]connection_handleSame as btmuBleDisconnect.
[out]outOutput MTU.

◆ btmuGetBleScanFilterParameter()

Result btmuGetBleScanFilterParameter ( u16  parameter_id,
BtdrvBleAdvertisePacketParameter out 
)

GetBleScanFilterParameter.

Note
This is the same as btmGetBleScanParameterGeneral.
Parameters
[in]parameter_idMust be value 0x1 or 0xFFFF.
[out]outBtdrvBleAdvertisePacketParameter

◆ btmuGetBleScanFilterParameter2()

Result btmuGetBleScanFilterParameter2 ( u16  parameter_id,
BtdrvGattAttributeUuid out 
)

GetBleScanFilterParameter2.

Note
This is the same as btmGetBleScanParameterSmartDevice.
Parameters
[in]parameter_idMust be value 0x2.
[out]outBtdrvGattAttributeUuid. The first 4-bytes is always 0.

◆ btmuGetBleScanResultsForGeneral()

Result btmuGetBleScanResultsForGeneral ( BtdrvBleScanResult results,
u8  count,
u8 total_out 
)

GetBleScanResultsForGeneral.

Note
This is similar to btmGetBleScanResultsForGeneral.
Parameters
[out]resultsOutput array of BtdrvBleScanResult.
[in]countSize of the results array in entries. The max is 10.
[out]total_outTotal output entries.

◆ btmuGetBleScanResultsForSmartDevice()

Result btmuGetBleScanResultsForSmartDevice ( BtdrvBleScanResult results,
u8  count,
u8 total_out 
)

GetBleScanResultsForSmartDevice.

Note
This is similar to btmGetBleScanResultsForSmartDevice.
Parameters
[out]resultsOutput array of BtdrvBleScanResult.
[in]countSize of the results array in entries. The max is 10.
[out]total_outTotal output entries.

◆ btmuGetGattCharacteristics()

Result btmuGetGattCharacteristics ( u32  connection_handle,
u16  service_handle,
BtmGattCharacteristic characteristics,
u8  count,
u8 total_out 
)

GetGattCharacteristics.

Note
This is similar to btmGetGattCharacteristics.
Parameters
[in]connection_handleSame as btmuBleDisconnect.
[in]service_handleThis controls which BtmGattCharacteristic entries to return.
[out]characteristicsBtmGattCharacteristic
[in]countSize of the characteristics array in entries. The max is 100.
[out]total_outTotal output entries.

◆ btmuGetGattDescriptors()

Result btmuGetGattDescriptors ( u32  connection_handle,
u16  char_handle,
BtmGattDescriptor descriptors,
u8  count,
u8 total_out 
)

GetGattDescriptors.

Note
This is similar to btmGetGattDescriptors.
Parameters
[in]connection_handleSame as btmuBleDisconnect.
[in]char_handleCharacteristic handle. This controls which BtmGattDescriptor entries to return.
[out]descriptorsBtmGattDescriptor
[in]countSize of the descriptors array in entries. The max is 100.
[out]total_outTotal output entries.

◆ btmuGetGattIncludedServices()

Result btmuGetGattIncludedServices ( u32  connection_handle,
u16  service_handle,
BtmGattService services,
u8  count,
u8 out 
)

Same as btmuGetGattServices except this only returns BtmGattService entries where various checks pass with u16 fields.

Note
This is similar to btmGetGattIncludedServices.
Parameters
[in]connection_handleSame as btmuBleDisconnect.
[in]service_handleServiceHandle
[out]servicesBtmGattService
[in]countSize of the services array in entries. The max is 100.
[out]outOutput value.

◆ btmuGetGattService()

Result btmuGetGattService ( u32  connection_handle,
const BtdrvGattAttributeUuid uuid,
BtmGattService service,
bool *  flag 
)

Same as btmuGetGattServices except this only returns the BtmGattService which matches the input BtdrvGattAttributeUuid.

Note
This is similar to btmGetGattService.
Parameters
[in]connection_handleSame as btmuBleDisconnect.
[in]uuidBtdrvGattAttributeUuid
[out]serviceBtmGattService
[out]flagWhether a BtmGattService was returned.

◆ btmuGetGattServices()

Result btmuGetGattServices ( u32  connection_handle,
BtmGattService services,
u8  count,
u8 total_out 
)

GetGattServices.

Note
This is similar to btmGetGattServices.
Parameters
[in]connection_handleSame as btmuBleDisconnect.
[out]servicesOutput array of BtmGattService.
[in]countSize of the services array in entries. The max is 100.
[out]total_outTotal output entries.

◆ btmuRegisterBleGattDataPath()

Result btmuRegisterBleGattDataPath ( const BtmBleDataPath path)

RegisterBleGattDataPath.

Note
This is similar to btmRegisterBleGattDataPath.
Parameters
[in]pathBtmBleDataPath

◆ btmuStartBleScanForGeneral()

Result btmuStartBleScanForGeneral ( BtdrvBleAdvertisePacketParameter  param)

StartBleScanForGeneral.

Note
This is similar to btmStartBleScanForGeneral.
Parameters
[in]paramBtdrvBleAdvertisePacketParameter

◆ btmuStartBleScanForPaired()

Result btmuStartBleScanForPaired ( BtdrvBleAdvertisePacketParameter  param)

StartBleScanForPaired.

Note
This is similar to btmStartBleScanForPaired.
Parameters
[in]paramBtdrvBleAdvertisePacketParameter

◆ btmuStartBleScanForSmartDevice()

Result btmuStartBleScanForSmartDevice ( const BtdrvGattAttributeUuid uuid)

StartBleScanForSmartDevice.

Note
This is similar to btmStartBleScanForSmartDevice.
Parameters
[in]uuidBtdrvGattAttributeUuid

◆ btmuStopBleScanForGeneral()

Result btmuStopBleScanForGeneral ( void  )

StopBleScanForGeneral.

Note
This is similar to btmStopBleScanForGeneral.

◆ btmuStopBleScanForPaired()

Result btmuStopBleScanForPaired ( void  )

StopBleScanForPaired.

Note
This is similar to btmStopBleScanForPaired.

◆ btmuStopBleScanForSmartDevice()

Result btmuStopBleScanForSmartDevice ( void  )

StopBleScanForSmartDevice.

Note
This is similar to btmStopBleScanForSmartDevice.

◆ btmuUnregisterBleGattDataPath()

Result btmuUnregisterBleGattDataPath ( const BtmBleDataPath path)

UnregisterBleGattDataPath.

Note
This is similar to btmUnregisterBleGattDataPath.
Parameters
[in]pathBtmBleDataPath