# xbpacket.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 XBPACKET_H
    00019 #define XBPACKET_H
    00020
    00021 #include <QtCore/QCoreApplication>
    00022 #include <QDataStream>
    00023 #include "xbitems.h"
    00024
    00025 // -----------------------------------------------------------------------------
    00026
    00031 class XbPacket
    00032 {
    00033 public:
    00034     XbPacket(quint8 frameType = 0);
    00035     ~XbPacket();
    00036
    00037     quint8 frameType();
    00038
    00039     QByteArray frameData();
    00040     bool parseFrameData(QByteArray &data);
    00041
    00042     static quint8 checksum(QByteArray data);
    00043     static bool valid(QByteArray data);
    00044
    00045 protected:
    00046     quint8 mFrameType;
    00047     QList<XbStreamItem*> mItems;
    00048 };
    00049 // -----------------------------------------------------------------------------
    00050
    00051 #endif // XBPACKET_H

All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends