//
//  bt_l2cap_channel_manager.h
//
//  Bluetooth Protocol Stack - L2CAP Channel Manager
//  Copyright (C) 2013-2018 Toyohiko Togashi tog001@nifty.com
//
//
//  This program is free software; you can redistribute it and/or modify it under the terms of the
//  GNU General Public License as published by the Free Software Foundation; either version 3
//  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 General Public License for more details.
//
//  You should have received a copy of the GNU General Public License along with this program.
//  If not, see <http://www.gnu.org/licenses/>
//
//
//  Summary:
//      Create logical channel path
//      Message and task switcher
//
//  Reference:
//      Bluetooth SIG (www.bluetooth.com)
//          BLUETOOTH SPECIFICATION Version 4.0
//          [Vol 3] Core System Package [Host volume]
//          Part A: Logical Link Control and Adaptation Protocol Specification
//
//  Update history
//  ---------- ----- -------------------------------------------
//  2013.01.21 v0.0  First cording
//  2013.04.21 v0.1  Commit
//  2017.01.03 v0.3e argument handle -> cb_link
//  2018.11.06 v0.4c Supported a notification to server APP
//
#ifndef BT_L2CAP_CHANNEL_MANAGER_H_
#define BT_L2CAP_CHANNEL_MANAGER_H_

#include "bt_l2cap_cb_link.h"           // ADD 2017.01.03

#define BT_L2CAP_CM_inDataSize_IDLE         0	// ADD 2018.11.06  inBuff==NULL is notification
#define BT_L2CAP_CM_inDataSize_CONNECT      1   // ADD 2018.11.06  inBuff==NULL is notification
#define BT_L2CAP_CM_inDataSize_DISCONNECT	2   // ADD 2018.11.06  inBuff==NULL is notification

//
//  API
//
extern size_t bt_l2capChannelManager(
//      unsigned short      handle,     // DEL 2017.01.03
        struct bt_l2capLink *link,      // ADD 2017.01.03
        unsigned char       *inBuff,
        size_t              inDataSize,
        unsigned char       *outBuff,
        size_t              outBuffSize
);

#endif /* BT_L2CAP_CHANNEL_MANAGER_H_ */
