Diffstat (limited to 'noncore/net/opietooth/lib/bt-serial.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/opietooth/lib/bt-serial.h | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/noncore/net/opietooth/lib/bt-serial.h b/noncore/net/opietooth/lib/bt-serial.h new file mode 100644 index 0000000..737e2a0 --- a/dev/null +++ b/noncore/net/opietooth/lib/bt-serial.h | |||
@@ -0,0 +1,57 @@ | |||
1 | /* $Id$ | ||
2 | *Bluetooth serial forwarder functions declaration | ||
3 | * | ||
4 | *(c) Copyright 2006 GPL | ||
5 | * | ||
6 | *This software is provided under the GNU public license, incorporated | ||
7 | *herein by reference. The software is provided without warranty or | ||
8 | *support. | ||
9 | */ | ||
10 | #ifndef _BT_SERIAL_H_ | ||
11 | #define _BT_SERIAL_H_ | ||
12 | #ifdef __cplusplus | ||
13 | extern "C" { | ||
14 | #endif | ||
15 | |||
16 | typedef struct //bt-serial connection handler | ||
17 | { | ||
18 | int bt_handler; //Bluetooth connection handler | ||
19 | int ser_handler; //serial port handler | ||
20 | } BTSerialConn; | ||
21 | |||
22 | /* | ||
23 | * bt_serialStart | ||
24 | * Function starts bt-serial service | ||
25 | * return 0 success -1 on error | ||
26 | */ | ||
27 | int bt_serialStart(void); | ||
28 | |||
29 | /* | ||
30 | * bt_serialForward | ||
31 | * Function forwards data received from bt-connection to serial and backward | ||
32 | * conn - connection handler | ||
33 | * portName - name of the port to connect | ||
34 | * return 0 success -1 on error | ||
35 | */ | ||
36 | int bt_serialForward(BTSerialConn* conn, const char* portName); | ||
37 | |||
38 | /* | ||
39 | * bt_serialStop | ||
40 | * Function stops bt-serial service | ||
41 | * return device handler on success -1 on error | ||
42 | */ | ||
43 | int bt_serialStop(void); | ||
44 | |||
45 | /* | ||
46 | * Function opens and configures serial port | ||
47 | * portName - name of the serial port | ||
48 | * return 0 on success, -1 on error | ||
49 | */ | ||
50 | int openSerial(const char* portName); | ||
51 | |||
52 | #ifdef __cplusplus | ||
53 | } | ||
54 | #endif | ||
55 | |||
56 | #endif | ||
57 | //eof | ||