Qt 4.8
Public Functions | Private Functions | Properties | List of all members
QOstDevicePrivate Class Reference
Inheritance diagram for QOstDevicePrivate:

Public Functions

TInt & AoFlags ()
 
 QOstDevicePrivate ()
 
 ~QOstDevicePrivate ()
 

Private Functions

void DoCancel ()
 
void RunL ()
 

Properties

QByteArray dataBuf
 
TBool inReadyRead
 
RUsbOstComm ost
 
QOstDeviceq_ptr
 
TBuf8< 4096 > readBuf
 

Detailed Description

Definition at line 47 of file qostdevice.cpp.

Constructors and Destructors

◆ QOstDevicePrivate()

QOstDevicePrivate::QOstDevicePrivate ( )
inline

Definition at line 53 of file qostdevice.cpp.

53  : CActive(CActive::EPriorityStandard) {
55  }

◆ ~QOstDevicePrivate()

QOstDevicePrivate::~QOstDevicePrivate ( )
inline

Definition at line 56 of file qostdevice.cpp.

56  {
57  Cancel();
58  }

Functions

◆ AoFlags()

TInt& QOstDevicePrivate::AoFlags ( )
inline

Definition at line 60 of file qostdevice.cpp.

60 { return ((TInt*)&iStatus)[1]; }

◆ DoCancel()

void QOstDevicePrivate::DoCancel ( )
private

Definition at line 133 of file qostdevice.cpp.

Referenced by AoFlags().

134 {
135  ost.ReadCancel();
136 }
RUsbOstComm ost
Definition: qostdevice.cpp:67
TInt ReadCancel()
Definition: usbostcomm.h:162

◆ RunL()

void QOstDevicePrivate::RunL ( )
private

Definition at line 110 of file qostdevice.cpp.

Referenced by AoFlags().

111 {
112  Q_Q(QOstDevice);
113  //qDebug("QOstDevice received %d bytes q=%x", readBuf.Size(), q);
114  if (iStatus == KErrNone) {
115  QByteArray data = QByteArray::fromRawData((const char*)readBuf.Ptr(), readBuf.Size());
116  dataBuf.append(data);
117 
118  readBuf.Zero();
119  ost.ReadMessage(iStatus, readBuf);
120  SetActive();
121 
122  if (!inReadyRead) {
123  inReadyRead = true;
124  emit q->readyRead();
125  inReadyRead = false;
126  }
127  } else {
128  q->setErrorString(QString("Error %1 from RUsbOstComm::ReadMessage()").arg(iStatus.Int()));
129  }
130  //qDebug("-QOstDevicePrivate RunL");
131 }
QByteArray & append(char c)
Appends the character ch to this byte array.
The QByteArray class provides an array of bytes.
Definition: qbytearray.h:135
The QString class provides a Unicode character string.
Definition: qstring.h:83
#define Q_Q(Class)
Definition: qglobal.h:2483
QByteArray dataBuf
Definition: qostdevice.cpp:69
#define emit
Definition: qobjectdefs.h:76
static QByteArray fromRawData(const char *, int size)
Constructs a QByteArray that uses the first size bytes of the data array.
static const char * data(const QByteArray &arr)
RUsbOstComm ost
Definition: qostdevice.cpp:67
void ReadMessage(TRequestStatus &aStatus, TDes8 &aDes)
Definition: usbostcomm.h:156
TBuf8< 4096 > readBuf
Definition: qostdevice.cpp:68

Properties

◆ dataBuf

QByteArray QOstDevicePrivate::dataBuf
private

Definition at line 69 of file qostdevice.cpp.

◆ inReadyRead

TBool QOstDevicePrivate::inReadyRead
private

Definition at line 70 of file qostdevice.cpp.

◆ ost

RUsbOstComm QOstDevicePrivate::ost
private

Definition at line 67 of file qostdevice.cpp.

◆ q_ptr

QOstDevice* QOstDevicePrivate::q_ptr
private

Definition at line 49 of file qostdevice.cpp.

Referenced by QOstDevice::QOstDevice().

◆ readBuf

TBuf8<4096> QOstDevicePrivate::readBuf
private

Definition at line 68 of file qostdevice.cpp.


The documentation for this class was generated from the following file: