avctpcon.h
2.86 KB
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
/****************************************************************************
*
* File:
* $Workfile:avctpcon.h$ for XTNDAccess Blue SDK, Version 2.0
* $Revision:7$
*
* Description: This file contains the header file for the L2CAP/ACL
* connection state machine for AVCTP connections.
*
* Created: Mar 31, 2004
*
* Copyright 2004 - 2005 Extended Systems, Inc. ALL RIGHTS RESERVED.
*
* Unpublished Confidential Information of Extended Systems, Inc.
* Do Not Disclose.
*
* No part of this work may be used or reproduced in any form or by any means,
* or stored in a database or retrieval system, without prior written
* permission of Extended Systems, Inc.
*
* Use of this work is governed by a license granted by Extended Systems, Inc.
* This work contains confidential and proprietary information of Extended
* Systems, Inc. which is protected by copyright, trade secret, trademark and
* other intellectual property rights.
*
****************************************************************************/
#ifndef __AVCTPCON_H_
#define __AVCTPCON_H_
#include "l2cap_adp.h"
#include "xatypes.h"
#include "me_adp.h"
#include "bttypes.h"
/* Connection Flags */
#define AVCTP_FLAG_LINK_ACL 0x01
/* Conn Events */
#define AVCTP_CONN_EVENT_CONNECT 1
#define AVCTP_CONN_EVENT_CONNECT_IND 2
#define AVCTP_CONN_EVENT_DISCONNECT 3
#define AVCTP_CONN_EVENT_DATA_SENT 4
#define AVCTP_CONN_EVENT_DATA_IND 5
/* Connection States */
#define AVCTP_CONN_NUM_STATES 6
#define AVCTP_STATE_DISCONNECTED 0
#define AVCTP_STATE_CONN_PENDING 1
#define AVCTP_STATE_CONN_INCOMING 2
#define AVCTP_STATE_DISC_PENDING 3
#define AVCTP_STATE_DISC_INCOMING 4
#define AVCTP_STATE_CONNECTED 5
/* Forward references */
typedef struct _AvctpConnCallbackParms AvctpConnCallbackParms;
typedef struct _AvctpConn AvctpConn;
/* State machine function prototype */
typedef void (*AvctpConnState) (AvctpConn *Conn, L2capCallbackParms *Parms);
/* Conn callback function */
typedef void (*AvctpConnCallback) (AvctpConn *Conn, AvctpConnCallbackParms *Parms);
/* Conn calback parameters */
struct _AvctpConnCallbackParms
{
U8 event;
U16 dataLen;
union
{
BtRemoteDevice *remDev;
U8 *data;
} ptrs;
};
/* Connection State */
struct _AvctpConn
{
L2capChannelId l2ChannelId;
U8 state;
AvctpConnCallback callback;
BtRemoteDevice *remDev;
};
/* State machine functions */
void AvctpConnInitStateMachine(void);
void AvctpL2Callback(L2capChannelId l2ChannelId, L2capCallbackParms *parms);
/* Function Prototypes */
void AvctpInitConn(AvctpConn *conn, AvctpConnCallback callback);
BtStatus AvctpConnect(AvctpConn *conn, BtRemoteDevice *RemDev);
BtStatus AvctpConnectRsp(AvctpConn *Conn, BOOL Accept);
BtStatus AvctpDisconnect(AvctpConn *conn);
BOOL AvctpIsConnected(AvctpConn *conn);
#endif /* __AVCTPCON_H_ */