Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
Path: blob/next/external/cache/sources/hcitools/monitor/l2cap.h
Views: 3959
/*1*2* BlueZ - Bluetooth protocol stack for Linux3*4* Copyright (C) 2011-2012 Intel Corporation5* Copyright (C) 2004-2010 Marcel Holtmann <[email protected]>6*7*8* This program is free software; you can redistribute it and/or modify9* it under the terms of the GNU General Public License as published by10* the Free Software Foundation; either version 2 of the License, or11* (at your option) any later version.12*13* This program is distributed in the hope that it will be useful,14* but WITHOUT ANY WARRANTY; without even the implied warranty of15* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the16* GNU General Public License for more details.17*18* You should have received a copy of the GNU General Public License19* along with this program; if not, write to the Free Software20* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA21*22*/2324#include <stdint.h>25#include <stdbool.h>2627struct l2cap_frame {28uint16_t index;29bool in;30uint16_t handle;31uint16_t cid;32const void *data;33uint16_t size;34};3536static inline void l2cap_frame_init(struct l2cap_frame *frame,37uint16_t index, bool in, uint16_t handle,38uint16_t cid, const void *data, uint16_t size)39{40frame->index = index;41frame->in = in;42frame->handle = handle;43frame->cid = cid;44frame->data = data;45frame->size = size;46}4748static inline void l2cap_frame_pull(struct l2cap_frame *frame,49const struct l2cap_frame *source, uint16_t len)50{51frame->index = source->index;52frame->in = source->in;53frame->handle = source->handle;54frame->cid = source->cid;55frame->data = source->data + len;56frame->size = source->size - len;57}5859void l2cap_packet(uint16_t index, bool in, uint16_t handle, uint8_t flags,60const void *data, uint16_t size);616263