00001 #ifndef PHPLAYERCLIENT_H 00002 #define PHPLAYERCLIENT_H 00003 00004 #include <stdio.h> 00005 #include <stdint.h> 00006 00007 #include <phThread.h> 00008 #include <phObjectList.h> 00009 00010 /* ------------------------------------------------------------------------ */ 00011 #define phDATAMODE_PUSH_ALL 0 00012 #define phDATAMODE_PULL_ALL 1 00013 #define phDATAMODE_PUSH_NEW 2 00014 #define phDATAMODE_PULL_NEW 3 00015 #define phDATAMODE_PUSH_ASYNC 4 00016 00017 #define phMODE_READ 0 00018 #define phMODE_WRITE 1 00019 #define phMODE_ALL 2 00020 #define phMODE_CLOSE 3 00021 #define phMODE_ERROR 4 00022 00023 /* ------------------------------------------------------------------------ */ 00024 typedef struct ph_player_client_t *ph_player_client; 00025 00026 /* ------------------------------------------------------------------------ */ 00027 class phPlayerClient : public phThread 00028 { 00029 private: 00030 ph_player_client m_client; 00031 int m_is_connected; 00032 00033 phObjectList m_devices; 00034 00035 protected: 00036 int run(); 00037 00038 public: 00039 phPlayerClient(); 00040 phPlayerClient(char *host, uint16_t port); 00041 ~phPlayerClient(); 00042 00043 int set(char *host,uint16_t port); 00044 00045 int connect(char *host = NULL, uint16_t port = 0); 00046 int disconnect(); 00047 00048 int datamode(int mode); 00049 int requestdata(); 00050 00051 int datafreq(int freq); 00052 00053 int getDevList(); 00054 00055 int peek( int timeout ); 00056 void *read( ); 00057 00058 int subscribeDevice ( phObject *device ); 00059 int unsubscribeDevice( phObject *device ); 00060 00061 void *getClientPtr(); 00062 }; 00063 00064 00065 00066 #endif /* PHPLAYERCLIENT_H */
Copyright (C) 2002 - 2007 |
Philip D.S. Thoren ( pthoren@users.sourceforge.net ) University Of Massachusetts at Lowell Robotics Lab |