File: bfb_io.h

package info (click to toggle)
obexftp 0.24-5
  • links: PTS, VCS
  • area: main
  • in suites: buster, stretch
  • size: 680 kB
  • ctags: 620
  • sloc: ansic: 7,132; ruby: 229; sh: 89; perl: 43; makefile: 27; python: 16
file content (63 lines) | stat: -rwxr-xr-x 1,859 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/**
	\file bfb/bfb_io.h
	BFB protocol IO layer.
	ObexFTP library - language bindings for OBEX file transfer.

	Copyright (c) 2002 Christian W. Zuckschwerdt <zany@triq.net>

	ObexFTP is free software; you can redistribute it and/or modify
	it under the terms of the GNU Lesser General Public License as
	published by the Free Software Foundation; either version 2 of
	the License, or (at your option) any later version.

	This program is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
	GNU Lesser General Public License for more details.

	You should have received a copy of the GNU Lesser General Public
	License along with ObexFTP. If not, see <http://www.gnu.org/>.
 */

#ifndef BFB_IO_H
#define BFB_IO_H

#include <inttypes.h>

enum trans_type
{
        TT_BFB,			/* use a bfb transport */
        TT_ERICSSON,		/* just custom init and teardown */
        TT_SIEMENS,		/* new siemens, like ericsson above */
        TT_MOTOROLA,		/* experimental motorola support */
        TT_GENERIC		/* should work on most phones */
};

#ifdef __cplusplus
extern "C" {
#endif

/* Write out a BFB buffer */
int	bfb_io_write(fd_t fd, const void *buffer, int length);

/* Read in a BFB answer */
int	bfb_io_read(fd_t fd, void *buffer, int length, int timeout);

/* Send an BFB init command an check for a valid answer frame */
int	bfb_io_init(fd_t fd);

/* Send an AT-command an expect 1 line back as answer */
int	do_at_cmd(fd_t fd, const char *cmd, char *rspbuf, int rspbuflen);

/* close the connection */
void	bfb_io_close(fd_t fd, int force);

/* Init the phone and set it in BFB-mode */
/* Returns fd or -1 on failure */
fd_t	bfb_io_open(const char *ttyname, enum trans_type *typeinfo);

#ifdef __cplusplus
}
#endif

#endif /* BFB_IO_H */