# xbinterface.h

Go to the documentation of this file.

    00001 /*
    00002  * SmartHome server: Plug-in xbee
    00003  *
    00004  * Copyright (C) 2010 Daniel Pisi <dan.pisi@gmail.com>
    00005  *
    00006  * This program is free software; you can redistribute it and/or modify it
    00007  * under the terms of version 2 of the GNU General Public License
    00008  * as published by the Free Software Foundation.
    00009  *
    00010  */
    00011
    00018 #ifndef XBINTERFACE_H
    00019 #define XBINTERFACE_H
    00020
    00021 #include <QObject>
    00022 #include "qextserialport.h"
    00023 #include "xbpacket.h"
    00024
    00025 // -----------------------------------------------------------------------------
    00026
    00031 class XbInterface : public QObject
    00032 {
    00033     Q_OBJECT
    00034
    00035 public:
    00036     XbInterface(QString param, QObject *parent = 0);
    00037
    00038     void sendPacket(XbPacket &packet);
    00039
    00040 signals:
    00041     void newPacketReceived(QByteArray data);
    00042
    00043 private slots:
    00044     void onReadyRead();
    00045
    00046 private:
    00047     QextSerialPort *mXbeePort;
    00048
    00049     char mBuffer[100];
    00050     int mState;
    00051     int mSize;
    00052     int mIndex;
    00053 };
    00054 // -----------------------------------------------------------------------------
    00055
    00056 #endif // XBINTERFACE_H

All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends