亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? rfcomm.c

?? blue tooth protocol stack source code
?? C
?? 第 1 頁 / 共 5 頁
字號:
/* * rfcomm.c -- Implementation of Bluetooth RFCOMM with TS 07.10,  *             Serial Port Emulation * * Copyright (C) 2000, 2001  Axis Communications AB * * Author: Mats Friden <mats.friden@axis.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 2 * 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, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA. * * Exceptionally, Axis Communications AB grants discretionary and * conditional permissions for additional use of the text contained * in the company's release of the AXIS OpenBT Stack under the * provisions set forth hereunder. * * Provided that, if you use the AXIS OpenBT Stack with other files, * that do not implement functionality as specified in the Bluetooth * System specification, to produce an executable, this does not by * itself cause the resulting executable to be covered by the GNU * General Public License. Your use of that executable is in no way * restricted on account of using the AXIS OpenBT Stack code with it. * * This exception does not however invalidate any other reasons why * the executable file might be covered by the provisions of the GNU* General Public License. * * $Id: rfcomm.c,v 1.127 2001/10/18 15:49:25 pkj Exp $ * *//****************** INCLUDE FILES SECTION ***********************************/#define __NO_VERSION__ /* don't define kernel_version in module.h */#ifdef __KERNEL__ #include <linux/config.h>#include <linux/bluetooth/sysdep-2.1.h>#include <linux/malloc.h>#include <linux/types.h>#include <linux/string.h>#include <linux/sched.h>#include <asm/unaligned.h>#include <linux/bluetooth/rfcomm.h>#include <linux/bluetooth/rfcomm_sec.h>#include <linux/bluetooth/btmem.h>#include <linux/bluetooth/l2cap.h>#include <linux/bluetooth/bluetooth.h>#include <linux/bluetooth/btconfig.h>#include <linux/bluetooth/bt_errno.h>#else#include <stdlib.h>#include <string.h>#include <errno.h>#include <asm/unaligned.h>#include "include/rfcomm.h"#include "include/rfcomm_sec.h"#include "include/btmem.h"#include "include/l2cap.h"#include "include/bluetooth.h"#include "include/local.h"#include "include/bt_errno.h"#endif/****************** DEBUG CONSTANT AND MACRO SECTION ************************//* Defines for the debug macros */#if DEBUG_RFCOMM_RECEIVE_FLOW#define D_REC(fmt...) printk(RFCOMM_DBG_STR fmt)#else#define D_REC(fmt...) #endif#if DEBUG_RFCOMM_SEND_PROCESS#define D_SND(fmt...) printk(RFCOMM_DBG_STR fmt)#else#define D_SND(fmt...)#endif#if DEBUG_RFCOMM_INTERNAL_SIGNALING#define D_CTRL(fmt...) printk(RFCOMM_DBG_STR fmt)#else#define D_CTRL(fmt...)#endif#if PRINT_DATA_ENABLE#define RF_DATA(str, data, len) print_data(str, data, len)#else#define RF_DATA(str, data, len)#endif#define FNC __FUNCTION__ ": "/****************** CONSTANT AND MACRO SECTION ******************************/#define SET_PF(ctr) ((ctr) | (1 << 4)) /* Sets the P/F-bit in the control field */#define CLR_PF(ctr) ((ctr) & 0xef)/* clears the P/F-bit in the control field */#define GET_PF(ctr) (((ctr) >> 4) & 0x1)/* Returns the P/F bit */#define SHORT_CRC_CHECK 2/* Used for uih packets */#define LONG_CRC_CHECK 3/* Used for all packet exepts for the uih packets */#define SHORT_HDR 2/* Short header for short uih packets */#define LONG_HDR 3/* and long header for long uih packets *//* FIXME: Should thsi one be define here? */#define SHORT_PAYLOAD_SIZE 127#define EA 1/* Used for setting the EA field in different packets,  really neccessary? */#define FCS_SIZE 1/* Yes the FCS size is only one byte */#define RFCOMM_MAX_HDR_SIZE 5#define MAX_CREDITS   30#define START_CREDITS 7#define MIN_CREDITS   15#define DEF_RFCOMM_MTU 127/* The values in the control field when sending ordinary rfcomm packets */#define SABM      0x2f#define SABM_SIZE 4#define UA        0x63#define UA_SIZE   4#define DM        0x0f#define DISC      0x43#define UIH       0xef/* The values in the type field in a multiplexer command packet */#define TEST  0x08#define FCON  0x28#define FCOFF 0x18#define MSC   0x38#define RPN   0x24#define RLS   0x14#define PN    0x20#define NSC   0x04/* Define of some V.24 signals modem control signals in RFCOMM */#define FC  0x02#define RTC 0x04#define RTR 0x08#define DV  0x80/* endian-swapping macros for structs */#define swap_long_frame(x) ((x)->h.length.val = le16_to_cpu((x)->h.length.val))#define swap_mcc_long_frame(x) (swap_long_frame(x))#define RFCOMM_CON_TIMEOUT (5*HZ)/****************** TYPE DEFINITION SECTION *********************************//* Typedefinitions of stuctures used for creating and parsing packets, for a   further description of the structures please se the bluetooth core   specification part F:1 and the ETSI TS 07.10 specification  */#include <asm/byteorder.h>#ifdef __LITTLE_ENDIAN_BITFIELDtypedef struct address_field {	u8 ea:1;	u8 cr:1;	u8 d:1;	u8 server_chn:5;} __attribute__ ((packed)) address_field;typedef struct short_length {	u8 ea:1;	u8 len:7;} __attribute__ ((packed)) short_length;typedef union long_length {	struct bits {		u16 ea:1;		u16 len:15;	} __attribute__ ((packed)) bits;	u16 val;} __attribute__ ((packed)) long_length;typedef struct short_frame_head {	address_field addr;	u8 control;	short_length length;} __attribute__ ((packed)) short_frame_head;typedef struct short_frame {	short_frame_head h;	u8 data[0];} __attribute__ ((packed)) short_frame;typedef struct long_frame_head {	address_field addr;	u8 control;	long_length length;	u8 data[0];} __attribute__ ((packed)) long_frame_head;typedef struct long_frame {	long_frame_head h;	u8 data[0];} __attribute__ ((packed)) long_frame;/* Typedefinitions for structures used for the multiplexer commands */typedef struct mcc_type {	u8 ea:1;	u8 cr:1;	u8 type:6;} __attribute__ ((packed)) mcc_type;typedef struct mcc_short_frame_head {	mcc_type type;	short_length length;	u8 value[0];} __attribute__ ((packed)) mcc_short_frame_head;typedef struct mcc_short_frame {	mcc_short_frame_head h;	u8 value[0];} __attribute__ ((packed)) mcc_short_frame;typedef struct mcc_long_frame_head {	mcc_type type;	long_length length;	u8 value[0];} __attribute__ ((packed)) mcc_long_frame_head;typedef struct mcc_long_frame {	mcc_long_frame_head h;	u8 value[0];} __attribute__ ((packed)) mcc_long_frame;/* MSC command */typedef struct v24_signals {	u8 ea:1;	u8 fc:1;	u8 rtc:1;	u8 rtr:1;	u8 reserved:2;	u8 ic:1;	u8 dv:1;} __attribute__ ((packed)) v24_sigs;typedef struct brk_sigs {	u8 ea:1;	u8 b1:1;	u8 b2:1;	u8 b3:1;	u8 len:4;} __attribute__ ((packed)) brk_sigs;typedef struct msc_msg {	short_frame_head s_head;	mcc_short_frame_head mcc_s_head;	address_field dlci;	u8 v24_sigs;//	brk_sigs break_signals;	u8 fcs;} __attribute__ ((packed)) msc_msg;/* RPN command */typedef struct rpn_msg {	short_frame_head s_head;	mcc_short_frame_head mcc_s_head;	address_field dlci;	rpn_values rpn_val;	u8 fcs;} __attribute__ ((packed)) rpn_msg;/* RLS command */  typedef struct rls_msg {	short_frame_head s_head;	mcc_short_frame_head mcc_s_head;	address_field dlci;	u8 error:4;	u8 res:4;	u8 fcs;} __attribute__ ((packed)) rls_msg;/* PN command */typedef struct pn_msg {	short_frame_head s_head;	mcc_short_frame_head mcc_s_head;/* The res1, res2 and res3 values have to be set to 0 by the sender */	u8 dlci:6;	u8 res1:2;	u8 frame_type:4;	u8 credit_flow:4;	u8 prior:6;	u8 res2:2;	u8 ack_timer;	u16 frame_size;	u8 max_nbrof_retrans;	u8 credits;	u8 fcs;} __attribute__ ((packed)) pn_msg;/* NSC-command */typedef struct nsc_msg {	short_frame_head s_head;	mcc_short_frame_head mcc_s_head;	mcc_type command_type;	u8 fcs;} __attribute__ ((packed)) nsc_msg;#elif defined(__BIG_ENDIAN_BITFIELD)typedef struct address_field {	u8 server_chn:5;	u8 d:1;	u8 cr:1;	u8 ea:1;} __attribute__ ((packed)) address_field;typedef struct short_length {	u8 len:7;	u8 ea:1;} __attribute__ ((packed)) short_length;typedef union long_length {	struct bits {		u16 len:15;		u16 ea:1;	} __attribute__ ((packed)) bits;	u16 val;} __attribute__ ((packed)) long_length;typedef struct short_frame_head { 	address_field addr;	u8 control;	short_length length;} __attribute__ ((packed)) short_frame_head;typedef struct short_frame {	short_frame_head h;	u8 data[0];} __attribute__ ((packed)) short_frame;typedef struct long_frame_head { 	address_field addr;	u8 control;	long_length length;	u8 data[0];} __attribute__ ((packed)) long_frame_head;typedef struct long_frame { 	long_frame_head h;	u8 data[0];} __attribute__ ((packed)) long_frame;/* Typedefinitions for structures used for the multiplexer commands */typedef struct mcc_type { 	u8 type:6;	u8 cr:1;	u8 ea:1;} __attribute__ ((packed)) mcc_type;typedef struct mcc_short_frame_head { 	mcc_type type;	short_length length;	u8 value[0];} __attribute__ ((packed)) mcc_short_frame_head;typedef struct mcc_short_frame { 	mcc_short_frame_head h;	u8 value[0];} __attribute__ ((packed)) mcc_short_frame;typedef struct mcc_long_frame_head { 	mcc_type type;	long_length length;	u8 value[0];} __attribute__ ((packed)) mcc_long_frame_head;typedef struct mcc_long_frame { 	mcc_long_frame_head h;	u8 value[0];} __attribute__ ((packed)) mcc_long_frame;/* MSC command */typedef struct v24_signals { 	u8 dv:1;	u8 ic:1;	u8 reserved:2;	u8 rtr:1;	u8 rtc:1;	u8 fc:1;	u8 ea:1;} __attribute__ ((packed)) v24_sigs;typedef struct brk_sigs { 	u8 len:4;	u8 b3:1;	u8 b2:1;	u8 b1:1;	u8 ea:1;} __attribute__ ((packed)) brk_sigs;typedef struct msc_msg { 	short_frame_head s_head;	mcc_short_frame_head mcc_s_head;	address_field dlci;	u8 v24_sigs;//	brk_sigs break_signals;	u8 fcs;} __attribute__ ((packed)) msc_msg;/* RPN command */typedef struct rpn_msg { 	short_frame_head s_head;	mcc_short_frame_head mcc_s_head;	address_field dlci;	rpn_values rpn_val;	u8 fcs;} __attribute__ ((packed)) rpn_msg;/* RLS command */  typedef struct rls_msg { 	short_frame_head s_head;	mcc_short_frame_head mcc_s_head;	address_field dlci;	u8 res:4;	u8 error:4;	u8 fcs;} __attribute__ ((packed)) rls_msg;/* PN command */typedef struct pn_msg { 	short_frame_head s_head;	mcc_short_frame_head mcc_s_head;/* The res1, res2 and res3 values have to be set to 0 by the sender */	u8 res1:2;	u8 dlci:6;	u8 credit_flow:4;	u8 frame_type:4;	u8 res2:2;	u8 prior:6;	u8 ack_timer;	u16 frame_size;	u8 max_nbrof_retrans;	u8 credits;	u8 fcs;} __attribute__ ((packed)) pn_msg;/* NSC-command */typedef struct nsc_msg { 	short_frame_head s_head;	mcc_short_frame_head mcc_s_head;	mcc_type command_type;	u8 fcs;} __attribute__ ((packed)) nsc_msg;#else /* __XXX_ENDIAN */#error Processor endianness unknown!#endif /* __XXX_ENDIAN *//****************** LOCAL FUNCTION DECLARATION SECTION **********************/static void process_mcc(u8* data, u32 len, rfcomm_con *rfcomm, s32 long_pkt);static s32 send_ua(rfcomm_con *rfcomm, u8 dlci);static s32 send_dm(rfcomm_con *rfcomm, u8 dlci);static s32 send_sabm(rfcomm_con *rfcomm, u8 dlci);static s32 send_disc(rfcomm_con *rfcomm, u8 dlci);static s32 send_uih(u8 *data, u32 len, rfcomm_con *rfcomm, u8 dlci);static s32 send_pn_msg(rfcomm_con *rfcomm, u8 prior, u32 frame_size, u8 credit_flow, u8 credits, u8 dlci, u8 cr);static s32 send_nsc_msg(rfcomm_con *rfcomm, mcc_type cmd, u8 cr);static void set_uih_hdr(short_frame *uih_pkt, u8 dlci, u32 len, u8 cr);static u32 crc_check(u8 *data, u32 length, u8 check_sum);static u8 crc_calc(u8 *data, u32 length);

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人av片在线观看| 欧美国产精品一区二区| 国产人久久人人人人爽| 亚洲自拍偷拍欧美| 国产成人免费视频精品含羞草妖精| 91福利精品视频| 精品精品国产高清a毛片牛牛 | 国产精品久久久久久久岛一牛影视| 亚洲午夜久久久久久久久久久 | 久久综合九色综合欧美98| 一区二区三区色| 国产成人午夜高潮毛片| 91精品国产麻豆| 亚洲夂夂婷婷色拍ww47| 波多野结衣在线一区| 日韩一区二区三区在线| 久久精品国产久精国产| 在线观看视频91| 中文字幕一区在线| 国产91精品一区二区| 日韩欧美亚洲国产另类| 婷婷久久综合九色综合绿巨人| 99久久免费国产| 国产精品免费久久| 国产成人夜色高潮福利影视| 亚洲精品一区二区三区精华液 | 亚洲国产视频网站| 色婷婷av一区二区三区大白胸| 国产精品视频九色porn| 国产超碰在线一区| 欧美国产成人精品| 国产东北露脸精品视频| 国产亚洲一二三区| 国产成人综合精品三级| 国产欧美一区二区三区在线看蜜臀 | 日韩精品一区在线| 裸体一区二区三区| 精品欧美一区二区在线观看| 久久99精品国产| 国产午夜亚洲精品羞羞网站| 国产不卡在线播放| 中文字幕免费一区| 99热精品国产| 精品捆绑美女sm三区| 欧美a级理论片| 欧美一卡2卡3卡4卡| 婷婷国产在线综合| 欧美精品v日韩精品v韩国精品v| 一区二区三区小说| 欧美在线你懂的| 一区二区三区在线视频播放 | 激情综合色播激情啊| 欧美精品tushy高清| 一区av在线播放| 欧美日韩国产大片| 日韩av一级片| 欧美一区永久视频免费观看| 免费久久99精品国产| 欧美成人伊人久久综合网| 精品在线观看视频| 国产亲近乱来精品视频 | 中文字幕亚洲精品在线观看| 蜜臀av性久久久久蜜臀aⅴ四虎| 欧美日韩1234| 美国毛片一区二区| 欧美成人一区二区| 成人精品在线视频观看| 中文字幕在线视频一区| 色天天综合色天天久久| 亚洲国产精品久久人人爱蜜臀 | 国产成人aaaa| 亚洲视频在线观看一区| 欧美日韩一区二区三区四区五区| 丝袜亚洲另类欧美| 欧美精品一级二级三级| 亚洲国产wwwccc36天堂| 欧美一区二区三区四区在线观看| 美女视频免费一区| 国产欧美视频一区二区三区| 91麻豆精品在线观看| 亚洲国产综合91精品麻豆| 欧美一区二区视频在线观看2020 | 欧美xxx久久| 岛国精品在线播放| 亚洲视频一区二区在线观看| 在线不卡免费欧美| 久久精品国产精品亚洲精品| 国产精品全国免费观看高清 | 日精品一区二区| 欧美国产精品劲爆| 欧美又粗又大又爽| 国产精品亚洲第一区在线暖暖韩国| 亚洲图片另类小说| 欧美日韩国产高清一区二区| 成人av在线资源网| 日本午夜精品视频在线观看| 欧美激情一区二区三区| 91麻豆精品91久久久久同性| 成人黄色网址在线观看| 日韩在线卡一卡二| 亚洲免费资源在线播放| 日韩精品一区二区三区蜜臀| 欧美在线免费观看亚洲| 不卡一区二区中文字幕| 日韩高清不卡一区二区| 亚洲免费观看高清| 69堂国产成人免费视频| 成人网在线免费视频| 玖玖九九国产精品| 偷拍日韩校园综合在线| 亚洲色大成网站www久久九九| 日韩亚洲欧美综合| 欧美三级日韩三级| 99精品国产99久久久久久白柏| 久久电影网站中文字幕| 亚洲成av人在线观看| 亚洲欧美日韩在线不卡| 国产精品久久777777| 国产精品久久久久一区二区三区共| 欧美大片在线观看一区| 欧美精品精品一区| 欧美日韩激情在线| 欧美在线不卡视频| 在线观看亚洲a| 日本韩国视频一区二区| 91麻豆精品一区二区三区| 白白色 亚洲乱淫| 成人丝袜高跟foot| 99re这里只有精品6| www.视频一区| 色综合久久中文字幕综合网 | 天天做天天摸天天爽国产一区| 亚洲人成网站在线| 亚洲欧美色综合| 洋洋成人永久网站入口| 一区二区成人在线观看| 亚洲自拍另类综合| 亚洲午夜三级在线| 亚洲精品日产精品乱码不卡| 一区二区不卡在线视频 午夜欧美不卡在| 亚洲欧洲精品一区二区三区 | 一区二区三区四区在线播放| 亚洲欧美激情视频在线观看一区二区三区 | 一区二区三区不卡在线观看| 尤物视频一区二区| 午夜欧美在线一二页| 日韩激情一区二区| 久久99久久99精品免视看婷婷| 国产一区二区三区黄视频| 国产黄色91视频| www.日韩大片| 欧美日韩久久久| 在线观看日产精品| 欧美精品一卡二卡| 亚洲精品一区二区三区在线观看 | 国产综合久久久久久鬼色| 国产精一区二区三区| 成人ar影院免费观看视频| 在线免费观看日本欧美| 777奇米成人网| 久久久久国产精品厨房| 综合久久给合久久狠狠狠97色| 一级女性全黄久久生活片免费| 日韩专区一卡二卡| 国产麻豆精品久久一二三| 91麻豆123| 91精品国产色综合久久久蜜香臀| 欧美经典一区二区三区| 亚洲国产一区视频| 国产综合色视频| 欧美在线影院一区二区| 久久影院电视剧免费观看| 亚洲色图.com| 狠狠色综合日日| 在线亚洲一区观看| 久久久久久综合| 亚洲三级在线免费观看| 福利91精品一区二区三区| 欧美日韩日日夜夜| 中文字幕一区二区在线观看| 日本亚洲三级在线| 色综合久久久久综合体| 精品精品国产高清a毛片牛牛 | 中文无字幕一区二区三区| 午夜伦欧美伦电影理论片| 成人黄色a**站在线观看| 91麻豆精品91久久久久同性| 中日韩av电影| 麻豆国产欧美一区二区三区| 色婷婷av一区二区三区之一色屋| 久久网站热最新地址| 婷婷亚洲久悠悠色悠在线播放| 99久久精品免费看国产免费软件| 日韩三级免费观看| 亚洲不卡av一区二区三区| 不卡的看片网站| 久久久美女毛片| 亚洲成va人在线观看| 色94色欧美sute亚洲13| 中文一区二区在线观看 |