You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

56 lines
1004 B

/*
* FritzBox Smart Home - C++ interface class
*/
#ifndef _FBSH_H_
#define _FBSH_H_
#include <string>
#include <list>
#include <libxml/xmlmemory.h>
#include <libxml/parser.h>
#include "tcp.h"
std::string generateMD5 (char* input, int size);
#define FB_BUFFER (4*1024*1024)
struct {
std::string id;
std::string name;
std::string product;
std::string vendor;
int present;
std::string attributes;
} typedef FBSmartHomeDevice;
class FBSmartHome {
private:
char inbuffer[FB_BUFFER];
char outbuffer[FB_BUFFER];
std::string SID;
FILE *fsidfile;
std::string hostname;
TCP tcp;
int XMLPrepare(char *buffer, int len, xmlDocPtr *xmldoc, xmlNodePtr *xmlnode);
public:
FBSmartHome ();
~FBSmartHome ();
std::string GetSID() { return SID; };
int UseSIDFile (std::string fn);
int CloseSIDFile ();
int Connect(std::string host); // return 0 on success
int Connect(std::string host, std::string username, std::string password);
std::list<FBSmartHomeDevice> *GetDevices();
};
#endif