summaryrefslogtreecommitdiff
path: root/noncore/net/opietooth/lib/bt-serial.h
blob: 737e2a0ccab9f1123cab7c8773aab99f9c6772e8 (plain)
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
/* $Id$
 *	Bluetooth serial forwarder functions declaration
 *
 *	(c) Copyright 2006 GPL
 *
 *	This software is provided under the GNU public license, incorporated
 *	herein by reference. The software is provided without warranty or 
 *	support.
 */
#ifndef _BT_SERIAL_H_
#define _BT_SERIAL_H_
#ifdef __cplusplus
extern "C" {
#endif

typedef struct //bt-serial connection handler
{
    int bt_handler; //Bluetooth connection handler
    int ser_handler; //serial port handler
} BTSerialConn;

/*
 * bt_serialStart 
 * Function starts bt-serial service
 * return 0 success -1 on error
 */
int bt_serialStart(void);

/*
 * bt_serialForward
 * Function forwards data received from bt-connection to serial and backward
 * conn - connection handler
 * portName - name of the port to connect
 * return 0 success -1 on error
 */
int bt_serialForward(BTSerialConn* conn, const char* portName);

/*
 * bt_serialStop
 * Function stops bt-serial service
 * return device handler on success -1 on error
 */
int bt_serialStop(void);

/*
 * Function opens and configures serial port
 * portName - name of the serial port
 * return 0 on success, -1 on error
 */
int openSerial(const char* portName);

#ifdef __cplusplus
}
#endif

#endif
//eof