00001 #ifdef WIN32
00002
00003 #include <winsock2.h>
00004 #include <windows.h>
00005
00006 #endif
00007
00008 #ifdef LINUX
00009
00010 #include <sys/types.h>
00011 #include <sys/socket.h>
00012 #include <netinet/in.h>
00013 #include <sys/un.h>
00014 #include <arpa/inet.h>
00015 #include <sys/stat.h>
00016 #include <errno.h>
00017 #include <netdb.h>
00018 #include <signal.h>
00019 #define closesocket close
00020
00021 #endif
00022
00023
00024 #include <stdio.h>
00025
00026 #include "remote.h"
00027 #include "network.h"
00028 #include "errcode.h"
00029
00030
00031 #ifdef WIN32
00032
00033 #ifdef IRTRANSDLL_EXPORTS
00034 #define IRTRANSDLL_API __declspec(dllexport)
00035 #else
00036 #ifdef __cplusplus
00037 #define IRTRANSDLL_API extern "C" __declspec(dllimport)
00038 #else
00039 #define IRTRANSDLL_API __declspec(dllimport)
00040 #endif
00041 #endif
00042
00043 #else
00044
00045 #define IRTRANSDLL_API
00046
00047 #endif
00048
00049
00050 IRTRANSDLL_API int ConnectIRTransServer (char host[],SOCKET *sock);
00051 IRTRANSDLL_API void DisconnectIRTransServer (SOCKET serv);
00052 IRTRANSDLL_API NETWORKSTATUS *LearnIRCode (SOCKET serv, char rem[],char com[],unsigned short timeout);
00053 IRTRANSDLL_API NETWORKSTATUS *LearnRepeatIRCode (SOCKET serv, char rem[],char com[],unsigned short timeout);
00054 IRTRANSDLL_API NETWORKSTATUS *SendRemoteCommand (SOCKET serv, char rem[],char com[],int mask,int LEDSel,int bus);
00055 IRTRANSDLL_API NETWORKRECV *ReceiveIR (SOCKET serv);
00056 IRTRANSDLL_API NETWORKSTATUS *ReloadIRDatabase (SOCKET serv);
00057 IRTRANSDLL_API int GetDeviceStatus (SOCKET serv, void *result);
00058 IRTRANSDLL_API int GetDeviceStatusExN (SOCKET serv, int offset,void *result);
00059 IRTRANSDLL_API NETWORKSTATUS *SendRemoteCommandEx (SOCKET serv, char rem[],char com[],word mask,byte LEDSel,byte bus);
00060 IRTRANSDLL_API NETWORKSTATUS *SendCCFCommand (SOCKET serv, char ccfstr[],byte repeat,word mask,byte LEDSel,byte bus);
00061 IRTRANSDLL_API NETWORKSTATUS *SendCCFCommandLong (SOCKET serv, char ccfstr[],byte repeat,word mask,byte LEDSel,byte bus);
00062 IRTRANSDLL_API int GetRemotes (SOCKET serv,int16_t offset,REMOTEBUFFER *rem);
00063 IRTRANSDLL_API int GetCommands (SOCKET serv,char rem[],int16_t offset,COMMANDBUFFER *com);
00064
00065
00066 IRTRANSDLL_API NETWORKSTATUS *SetTimerEntry (SOCKET serv,byte num,byte mode,byte year,byte month,byte day,byte weekday,byte hour,byte min,
00067 byte ledsel,word targetmask,byte remote[],byte command[],byte bus);
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104 #define WD_SUNDAY 0
00105 #define WD_MONDAY 1
00106 #define WD_TUESDAY 2
00107 #define WD_WEDNESDAY 3
00108 #define WD_THURSDAY 4
00109 #define WD_FRIDAY 5
00110 #define WD_SATURDAY 6
00111
00112 #define TIMER_UNUSED 0xff
00113 #define SEND_ACTION 128
00114 #define TIMER_OFF 1
00115 #define TIMER_ONCE 2
00116 #define TIMER_REPEAT 4