Add GATT driver placeholder
This commit is contained in:
49
KeyBorad/KeyBorad/DRI/GATT/Dri_Gatt.cpp
Normal file
49
KeyBorad/KeyBorad/DRI/GATT/Dri_Gatt.cpp
Normal 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();
|
||||||
|
}
|
||||||
24
KeyBorad/KeyBorad/DRI/GATT/Dri_Gatt.h
Normal file
24
KeyBorad/KeyBorad/DRI/GATT/Dri_Gatt.h
Normal 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);
|
||||||
Reference in New Issue
Block a user