Go to the documentation of this file.
11 #include "../kernel/event.h"
12 #include "../services/btdrv_types.h"
Result btdevRegisterGattOperationNotification(const BtdrvGattAttributeUuid *uuid)
Wrapper for btmuRegisterBleGattDataPath.
Result btdevGetBleScanResult(BtdrvBleScanResult *results, u8 count, u8 *total_out)
Wrapper for btmuGetBleScanResultsForGeneral and btmuGetBleScanResultsForSmartDevice.
Result btdevGetBleMtu(u32 connection_handle, u16 *out)
Wrapper for btmuGetBleMtu.
Result btdevAcquireBlePairingEvent(Event *out_event)
Wrapper for btmuAcquireBlePairingEvent.
static u8 btdevGattAttributeGetType(BtdevGattAttribute *a)
Gets the Type.
Definition: btdev.h:224
Result btdevGetBleScanParameter2(u16 parameter_id, BtdrvGattAttributeUuid *out)
Wrapper for btmuGetBleScanFilterParameter2.
static u16 btdevGattCharacteristicGetInstanceId(BtdevGattCharacteristic *c)
Gets the InstanceId.
Definition: btdev.h:341
BleClientGattOperationInfo.
Definition: btdrv_types.h:325
void btdevGattServiceCreate(BtdevGattService *s, const BtdrvGattAttributeUuid *uuid, u16 handle, u32 connection_handle, u16 instance_id, u16 end_group_handle, bool primary_service)
Creates a BtdevGattService object.
Result btdevGattServiceGetCharacteristic(BtdevGattService *s, const BtdrvGattAttributeUuid *uuid, BtdevGattCharacteristic *characteristic, bool *flag)
Same as btdevGattServiceGetCharacteristics except this only returns the BtdevGattCharacteristic which...
uint8_t u8
8-bit unsigned integer.
Definition: types.h:19
u16 handle
Handle.
Definition: btdev.h:18
#define NX_CONSTEXPR
Flags a function as constexpr in C++14 and above; or as (always) inline otherwise.
Definition: types.h:88
Result btdevDisconnectFromGattServer(u32 connection_handle)
Wrapper for btmuBleDisconnect.
BtdevGattAttribute attr
BtdevGattAttribute
Definition: btdev.h:32
u8 properties
Properties.
Definition: btdev.h:34
void btdevGattDescriptorSetValue(BtdevGattDescriptor *d, const void *buffer, size_t size)
Sets the Value in the object.
u8 type
Type.
Definition: btdev.h:16
Kernel-mode event structure.
Definition: event.h:13
Result btdevStartBleScanSmartDevice(const BtdrvGattAttributeUuid *uuid)
Wrapper for btmuStartBleScanForSmartDevice.
static u16 btdevGattServiceGetEndGroupHandle(BtdevGattService *s)
Gets the EndGroupHandle.
Definition: btdev.h:282
Result btdevInitialize(void)
Initialize bt/btmu.
Result btdevStopBleScanSmartDevice(void)
Wrapper for btmuStopBleScanForSmartDevice.
Result btdevGetGattService(u32 connection_handle, const BtdrvGattAttributeUuid *uuid, BtdevGattService *service, bool *flag)
Wrapper for btmuGetGattService.
Result btdevGattServiceGetCharacteristics(BtdevGattService *s, BtdevGattCharacteristic *characteristics, u8 count, u8 *total_out)
Wrapper for btmuGetGattCharacteristics.
Result btdevDisableBleAutoConnection(void)
Wrapper for btmuStopBleScanForPaired.
Result btdevWriteGattDescriptor(BtdevGattDescriptor *d)
Wrapper for btLeClientWriteDescriptor.
u16 instance_id
InstanceId.
Definition: btdev.h:25
static u16 btdevGattAttributeGetHandle(BtdevGattAttribute *a)
Gets the Handle.
Definition: btdev.h:241
bool btdevGattAttributeUuidIsSame(const BtdrvGattAttributeUuid *a, const BtdrvGattAttributeUuid *b)
Compares two BtdrvGattAttributeUuid, returning whether these match.
static u32 btdevGattAttributeGetConnectionHandle(BtdevGattAttribute *a)
Gets the ConnectionHandle.
Definition: btdev.h:249
Result btdevGattDescriptorGetCharacteristic(BtdevGattDescriptor *d, BtdevGattCharacteristic *characteristic)
Wrapper for btmuGetGattCharacteristics.
Result btdevGetGattOperationResult(BtdrvBleClientGattOperationInfo *out)
Wrapper for btGetLeEventInfo.
Result btdevGattCharacteristicGetDescriptors(BtdevGattCharacteristic *c, BtdevGattDescriptor *descriptors, u8 count, u8 *total_out)
Wrapper for btmuGetGattDescriptors.
Result btdevGattServiceGetIncludedServices(BtdevGattService *s, BtdevGattService *services, u8 count, u8 *total_out)
Wrapper for btmuGetGattIncludedServices.
Result btdevStopBleScanGeneral(void)
Wrapper for btmuStopBleScanForGeneral.
Result btdevUnregisterGattOperationNotification(const BtdrvGattAttributeUuid *uuid)
Wrapper for btmuUnregisterBleGattDataPath.
Result btdevGetPairedGattServerAddress(BtdrvBleAdvertisePacketParameter param, BtdrvAddress *addrs, u8 count, u8 *total_out)
Wrapper for btmuBleGetPairedDevices.
uint32_t u32
32-bit unsigned integer.
Definition: types.h:21
u64 btdevGattDescriptorGetValue(BtdevGattDescriptor *d, void *buffer, size_t size)
Gets the Value in the object, returns the copied value size.
u32 connection_handle
ConnectionHandle.
Definition: btdev.h:19
Result btdevReadGattCharacteristic(BtdevGattCharacteristic *c)
Wrapper for btLeClientReadCharacteristic.
Result btdevGetGattServices(u32 connection_handle, BtdevGattService *services, u8 count, u8 *total_out)
Wrapper for btmuGetGattServices.
void btdevGattAttributeCreate(BtdevGattAttribute *a, const BtdrvGattAttributeUuid *uuid, u16 handle, u32 connection_handle)
Creates a BtdevGattAttribute object.
Result btdevPairGattServer(u32 connection_handle, BtdrvBleAdvertisePacketParameter param)
Wrapper for btmuBlePairDevice.
uint64_t u64
64-bit unsigned integer.
Definition: types.h:22
u64 value_size
Size of value.
Definition: btdev.h:35
Result btdevAcquireBleScanEvent(Event *out_event)
Wrapper for btmuAcquireBleScanEvent.
u64 value_size
Size of value.
Definition: btdev.h:42
GattCharacteristic.
Definition: btdev.h:31
GattDescriptor.
Definition: btdev.h:40
Result btdevConfigureBleMtu(u32 connection_handle, u16 mtu)
Wrapper for btmuConfigureBleMtu.
BtdevGattAttribute attr
BtdevGattAttribute
Definition: btdev.h:41
void btdevGattDescriptorCreate(BtdevGattDescriptor *d, const BtdrvGattAttributeUuid *uuid, u16 handle, u32 connection_handle)
Creates a BtdevGattDescriptor object.
u32 Result
Function error code result type.
Definition: types.h:44
void btdevGattCharacteristicSetValue(BtdevGattCharacteristic *c, const void *buffer, size_t size)
Sets the Value in the object.
BtdrvGattAttributeUuid uuid
BtdrvGattAttributeUuid
Definition: btdev.h:17
Result btdevGattCharacteristicGetService(BtdevGattCharacteristic *c, BtdevGattService *service)
Wrapper for btmuGetBelongingGattService.
GattAttributeUuid.
Definition: btdrv_types.h:299
GattAttribute.
Definition: btdev.h:15
BtdevGattAttribute attr
BtdevGattAttribute
Definition: btdev.h:24
u16 end_group_handle
EndGroupHandle.
Definition: btdev.h:26
BleConnectionInfo.
Definition: btdrv_types.h:292
Result btdevUnpairGattServer(u32 connection_handle, BtdrvBleAdvertisePacketParameter param)
Wrapper for btmuBleUnPairDevice.
GattService.
Definition: btdev.h:23
Result btdevGattDescriptorGetService(BtdevGattDescriptor *d, BtdevGattService *service)
Wrapper for btmuGetBelongingGattService.
Result btdevUnpairGattServer2(BtdrvAddress addr, BtdrvBleAdvertisePacketParameter param)
Wrapper for btmuBleUnPairDevice2.
Result btdevReadGattDescriptor(BtdevGattDescriptor *d)
Wrapper for btLeClientReadDescriptor.
Result btdevGetBleConnectionInfoList(BtdrvBleConnectionInfo *info, u8 count, u8 *total_out)
Wrapper for btmuBleGetConnectionState.
Result btdevAcquireBleMtuConfigEvent(Event *out_event)
Wrapper for btmuAcquireBleMtuConfigEvent.
void btdevGattCharacteristicCreate(BtdevGattCharacteristic *c, const BtdrvGattAttributeUuid *uuid, u16 handle, u32 connection_handle, u16 instance_id, u8 properties)
Creates a BtdevGattCharacteristic object.
void btdevExit(void)
Exit bt/btmu.
Address.
Definition: btdrv_types.h:161
Result btdevEnableGattCharacteristicNotification(BtdevGattCharacteristic *c, bool flag)
Wrapper for btLeClientRegisterNotification / btLeClientDeregisterNotification.
Result btdevWriteGattCharacteristic(BtdevGattCharacteristic *c)
Wrapper for btLeClientWriteCharacteristic.
static u8 btdevGattCharacteristicGetProperties(BtdevGattCharacteristic *c)
Gets the Properties.
Definition: btdev.h:349
Result btdevGattCharacteristicGetDescriptor(BtdevGattCharacteristic *c, const BtdrvGattAttributeUuid *uuid, BtdevGattDescriptor *descriptor, bool *flag)
Same as btdevGattCharacteristicGetDescriptors except this only returns a BtdevGattDescriptor which co...
u64 btdevGattCharacteristicGetValue(BtdevGattCharacteristic *c, void *buffer, size_t size)
Gets the Value in the object, returns the copied value size.
BleScanResult.
Definition: btdrv_types.h:283
static u16 btdevGattServiceGetInstanceId(BtdevGattService *s)
Gets the InstanceId.
Definition: btdev.h:274
Result btdevAcquireBleConnectionStateChangedEvent(Event *out_event)
Wrapper for btmuAcquireBleConnectionEvent.
Result btdevStartBleScanGeneral(BtdrvBleAdvertisePacketParameter param)
Wrapper for btdevStartBleScanGeneral.
bool primary_service
PrimaryService.
Definition: btdev.h:27
Result btdevAcquireBleGattOperationEvent(Event *out_event)
Wrapper for btRegisterBleEvent.
u16 instance_id
InstanceId.
Definition: btdev.h:33
BleAdvertisePacketParameter.
Definition: btdrv_types.h:278
static u16 btdevGattServiceIsPrimaryService(BtdevGattService *s)
Gets whether this is the PrimaryService.
Definition: btdev.h:290
Result btdevGetBleScanParameter(u16 parameter_id, BtdrvBleAdvertisePacketParameter *out)
Wrapper for btmuGetBleScanFilterParameter.
Result btdevConnectToGattServer(BtdrvAddress addr)
Wrapper for btmuBleConnect.
uint16_t u16
16-bit unsigned integer.
Definition: types.h:20
Result btdevEnableBleAutoConnection(BtdrvBleAdvertisePacketParameter param)
Wrapper for btmuStartBleScanForPaired.
static void btdevGattAttributeGetUuid(BtdevGattAttribute *a, BtdrvGattAttributeUuid *out)
Gets the Uuid.
Definition: btdev.h:233
Result btdevAcquireBleServiceDiscoveryEvent(Event *out_event)
Wrapper for btmuAcquireBleServiceDiscoveryEvent.