graphlcd-base/glcddrivers/network.h
changeset 4 df6a40031aa5
equal deleted inserted replaced
3:d0e62fc47285 4:df6a40031aa5
       
     1 /*
       
     2  * GraphLCD driver library
       
     3  *
       
     4  * network.h  -  Network output device
       
     5  *               Output goes to a network client.
       
     6  *
       
     7  * This file is released under the GNU General Public License. Refer
       
     8  * to the COPYING file distributed with this package.
       
     9  *
       
    10  * (c) 2004 Andreas Regel <andreas.regel AT powarman.de>
       
    11  */
       
    12 
       
    13 #ifndef _GLCDDRIVERS_NETWORK_H_
       
    14 #define _GLCDDRIVERS_NETWORK_H_
       
    15 
       
    16 #include <pthread.h>
       
    17 
       
    18 #include "driver.h"
       
    19 
       
    20 
       
    21 namespace GLCD
       
    22 {
       
    23 
       
    24 class cDriverConfig;
       
    25 
       
    26 class cDriverNetwork : public cDriver
       
    27 {
       
    28 private:
       
    29     unsigned char * newLCD;
       
    30     unsigned char * oldLCD;
       
    31     cDriverConfig * config;
       
    32     cDriverConfig * oldConfig;
       
    33     int lineSize;
       
    34     bool running;
       
    35     pthread_t childTid;
       
    36     int clientSocket;
       
    37     bool clientConnected;
       
    38 
       
    39     int CheckSetup();
       
    40     static void * ServerThread(cDriverNetwork * Driver);
       
    41 
       
    42 public:
       
    43     cDriverNetwork(cDriverConfig * config);
       
    44     virtual ~cDriverNetwork();
       
    45 
       
    46     virtual int Init();
       
    47     virtual int DeInit();
       
    48 
       
    49     virtual void Clear();
       
    50     virtual void Set8Pixels(int x, int y, unsigned char data);
       
    51     virtual void Refresh(bool refreshAll = false);
       
    52 };
       
    53 
       
    54 } // end of namespace
       
    55 
       
    56 #endif