AusweisApp2
BluetoothReader.h
gehe zur Dokumentation dieser Datei
1 
7 #pragma once
8 
9 
10 #include "CyberJackWaveDevice.h"
11 #include "Reader.h"
12 
13 #include <QBluetoothDeviceInfo>
14 #include <QLowEnergyController>
15 
16 
17 namespace governikus
18 {
19 
21  : public ConnectableReader
22 {
23  Q_OBJECT
24 
25  private:
26  QSharedPointer<CyberJackWaveDevice> mDevice;
27  CardEvent mLastCardEvent;
28  QScopedPointer<Card> mCard;
29 
30  virtual CardEvent updateCard() override;
31  void onCardRemoved();
32 
33  private Q_SLOTS:
34  void onInitialized(const QBluetoothDeviceInfo& pInfo);
35  void onDisconnected(const QBluetoothDeviceInfo& pInfo);
36  void onError(QLowEnergyController::Error pError);
37  void onStatusCharacteristicChanged(const QByteArray& pValue);
38 
39  Q_SIGNALS:
40  void fireReaderConnected(const QString& pReaderName);
41  void fireReaderConnectionFailed(const QString& pReaderName);
42 
43  public:
44  explicit BluetoothReader(const QSharedPointer<CyberJackWaveDevice>& pDevice);
45 
46  Card* getCard() const override;
47 
48  void connectReader() override;
49  void disconnectReader(const QString& pError = QString()) override;
50 };
51 
52 } // namespace governikus
governikus::Card
Definition: Card.h:24
governikus::Reader::CardEvent
CardEvent
Definition: Reader.h:24
governikus::SynchronousBtCall::send
QSharedPointer< const BluetoothMessage > send(const BluetoothMessage &pRequest, BluetoothMsgId pResponseType, quint8 pTimeoutSeconds=20)
Definition: SynchronousBtCall.cpp:25
governikus::BluetoothCard
Definition: BluetoothCard.h:19
governikus::BluetoothReader::fireReaderConnectionFailed
void fireReaderConnectionFailed(const QString &pReaderName)
governikus::BluetoothMessageParser
Definition: BluetoothMessageParser.h:15
governikus::Reader::update
void update()
Periodically called to perform an update of the readers and cards state.
Definition: Reader.cpp:69
BluetoothReader.h
governikus::BluetoothMessageCreator::createSetTransportProtocolRequest
static BluetoothMessageSetTransportProtocolRequest createSetTransportProtocolRequest(BluetoothTransportProtocol pProtocol)
Definition: BluetoothMessageCreator.cpp:68
governikus::CyberJackWaveDevice::fireError
void fireError(QLowEnergyController::Error pError)
governikus::BluetoothMessageParser::getMessages
const QVector< QSharedPointer< const BluetoothMessage > > & getMessages() const
Definition: BluetoothMessageParser.cpp:106
governikus::Reader::CardEvent::CARD_INSERTED
@ CARD_INSERTED
CyberJackWaveDevice.h
name
const char * name
Definition: http_parser.cpp:470
governikus::ConnectableReader
Definition: Reader.h:93
governikus::BluetoothMessageSetTransportProtocolResponse
Definition: BluetoothMessageSetTransportProtocolResponse.h:16
BluetoothMessageParser.h
governikus::BluetoothReader::getCard
Card * getCard() const override
Definition: BluetoothReader.cpp:39
governikus::ReaderInfo::isConnected
bool isConnected() const
Definition: ReaderInfo.h:119
governikus::CyberJackWaveDevice::fireDisconnected
void fireDisconnected(const QBluetoothDeviceInfo &pInfo)
governikus::CyberJackWaveDevice::fireInitialized
void fireInitialized(const QBluetoothDeviceInfo &pInfo)
governikus::CardInfo
Holds smart card informations.
Definition: CardInfo.h:28
governikus::BluetoothReader::fireReaderConnected
void fireReaderConnected(const QString &pReaderName)
BluetoothMessageCreator.h
governikus::SynchronousBtCall
Definition: SynchronousBtCall.h:22
governikus::BluetoothReader::disconnectReader
void disconnectReader(const QString &pError=QString()) override
Definition: BluetoothReader.cpp:90
governikus::ReaderInfo::setBasicReader
void setBasicReader(bool pIsBasicReader)
Definition: ReaderInfo.h:107
governikus::Reader::getName
const QString & getName() const
Definition: Reader.h:56
governikus
Implementation of ActivationContext for Intent based activation on Android systems.
Definition: ActivationContext.h:15
BluetoothMessageStatusInd.h
governikus::GlobalStatus::Code::Workflow_Bluetooth_Reader_Connection_Error
@ Workflow_Bluetooth_Reader_Connection_Error
governikus::BluetoothReader
Definition: BluetoothReader.h:22
governikus::ReaderInfo::setCardInfo
void setCardInfo(const CardInfo &pCardInfo)
Definition: ReaderInfo.h:95
governikus::CyberJackWaveDevice::fireStatusCharacteristicChanged
void fireStatusCharacteristicChanged(const QByteArray &pValue)
governikus::Reader::fireReaderDeviceError
void fireReaderDeviceError(GlobalStatus::Code pErrorCode)
Definition: moc_Reader.cpp:208
governikus::BluetoothReader::BluetoothReader
BluetoothReader(const QSharedPointer< CyberJackWaveDevice > &pDevice)
Definition: BluetoothReader.cpp:23
governikus::Reader::CardEvent::CARD_REMOVED
@ CARD_REMOVED
governikus::BluetoothMessageStatusInd
Definition: BluetoothMessageStatusInd.h:18
BluetoothMessageSetTransportProtocolResponse.h
BluetoothDebug.h
governikus::ReaderInfo::setConnected
void setConnected(bool pConnected)
Definition: ReaderInfo.h:125
governikus::ReaderInfo::getName
const QString & getName() const
Definition: ReaderInfo.h:101
governikus::Reader::createCardConnectionWorker
QSharedPointer< CardConnectionWorker > createCardConnectionWorker()
Creates a new CardConnectionWorker if and only if there is a card in the reader which is not already ...
Definition: Reader.cpp:35
BluetoothCard.h
Reader.h
SynchronousBtCall.h
governikus::Reader::mTimerId
int mTimerId
Definition: Reader.h:30
governikus::CardInfoFactory::create
static bool create(const QSharedPointer< CardConnectionWorker > &pCardConnectionWorker, ReaderInfo &pReaderInfo)
In order to create a CardInfo instance a connection is established to the smart card and data is read...
Definition: CardInfo.cpp:112
governikus::Reader::mReaderInfo
ReaderInfo mReaderInfo
Definition: Reader.h:29
governikus::BluetoothReader::connectReader
void connectReader() override
Definition: BluetoothReader.cpp:50
governikus::Reader::CardEvent::NONE
@ NONE