ecco il file .h =>
#ifndef _LGU81X0_H_
#define _LGU81X0_H_
#ifdef __cplusplus
extern "C" {
#endif
#ifndef WIN32
#define __stdcall
#endif
typedef void (__stdcall *progressCallback)(int);
/*
Register a progress callback
p: callback function;
The callback function is passed numbers between 0 and 100 to indicate
the progress of a function call. Pass NULL to disable
*/
void lgProgressCallback(progressCallback p);
/*
Connects to device on com port specified by string,
eg "//./COM4" or "/dev/tty8"
comport: port to connect on
returns 1 on success
-1 on failing to open com port
-2 on failing to get com port state
-3 on failing to set a new com port state
-4 on failing to get IMEI
-5 on failing OBEX connection sequence
-6 on failing directory list request, phone info request or other
*/
int lgConnect(const char *comport);
/*
Disconnects from device. Has no error checking nor does it check
to see if we are actually connected
*/
void lgDisconnect(void);
/*
Get a localised directory name for use with
lgSomething(., dir,..) operations
*/
const char *lgAUDIOS(void);
const char *lgVIDEOS(void);
const char *lgIMAGES(void);
const char *lgDirectories(void);
/*
Returns true if we are connected
*/
int lgIsConnected(void);
/*
Gets a file from device in directory
filename: name file has on device
dirname: directory file is in
&filesize: output file size
returns file data or NULL on file not found
*/
unsigned char *lgGetFile(const char *filename, const char *dirname,
unsigned int *filesize);
/*
Puts a file on the device into directory
filename: name file will have on device
directory: directory to put file in
filesize: filesize as number of bytes
data: file data
returns true on success
*/
int lgPutFile(const char *filename, const char *dirname,
unsigned int filesize, unsigned char *data);
/*
Rename a file within a directory
directory: directory the file is in
oldFilename: filename on the device
newFilename: filename to rename to
returns true on success
*/
int lgRenameFile(const char *directory, const char *oldFilename,
const char *newFilename);
/*
Delete file from directory
directory: directory to delete from
filename: name of file to delete
returns true on success
*/
int lgDeleteFile(const char *directory, const char *filename);
/*
Get a list of files in a specific directory
directory: directoy to list
returns colon ':' separated file names, NULL if failed
*/
const char *lgFileList(const char *directory);
/*
Force a keepalive message to be send. These are usually autmoatically
taken care of but you may need to end a file transfer with one of
these for it to work properly.
*/
void lgKeepAlive(void);
/*
Get IMEI number from phone. Only available after connection
*/
const unsigned char *lgGetIMEI(void);
/*
Cancel a file upload or download
*/
void lgBreakOperation(void);
#ifdef __cplusplus
}
#endif
#endif

Rispondi quotando