Add GATT driver placeholder

This commit is contained in:
2026-04-11 08:36:18 +08:00
parent f60aaba08c
commit 61d826363b
2 changed files with 73 additions and 0 deletions

View File

@@ -0,0 +1,49 @@
#include "DRI/GATT/Dri_Gatt.h"
QVector<Dri_Gatt_Struct_PortInfo> Dri_Gatt_Enum()
{
return {};
}
void Dri_Gatt_Deinit(Dri_Gatt_Struct_Port* p_Port)
{
if (p_Port == nullptr)
{
return;
}
*p_Port = Dri_Gatt_Struct_Port();
}
bool Dri_Gatt_Init(Dri_Gatt_Struct_Port* p_Port)
{
if (p_Port == nullptr)
{
return false;
}
Dri_Gatt_Deinit(p_Port);
return false;
}
bool Dri_Gatt_Read(Dri_Gatt_Struct_Port* p_Port, QByteArray& ByteArray)
{
ByteArray.clear();
if ((p_Port == nullptr) || !p_Port->IsOpened)
{
return false;
}
return false;
}
bool Dri_Gatt_Write(Dri_Gatt_Struct_Port* p_Port, const QByteArray& ByteArray)
{
if ((p_Port == nullptr) || !p_Port->IsOpened)
{
return false;
}
return !ByteArray.isEmpty();
}

View File

@@ -0,0 +1,24 @@
#pragma once
#include <QtCore/QByteArray>
#include <QtCore/QString>
#include <QtCore/QVector>
struct Dri_Gatt_Struct_PortInfo
{
QString DeviceName;
QString DeviceAddress;
};
struct Dri_Gatt_Struct_Port
{
bool IsOpened = false;
QString DeviceAddress;
QByteArray ReadBuffer;
};
QVector<Dri_Gatt_Struct_PortInfo> Dri_Gatt_Enum();
void Dri_Gatt_Deinit(Dri_Gatt_Struct_Port* p_Port);
bool Dri_Gatt_Init(Dri_Gatt_Struct_Port* p_Port);
bool Dri_Gatt_Read(Dri_Gatt_Struct_Port* p_Port, QByteArray& ByteArray);
bool Dri_Gatt_Write(Dri_Gatt_Struct_Port* p_Port, const QByteArray& ByteArray);