Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

ʵսLinux Bluetooth±à³Ì£¨Èý£© HCI²ã±à³Ì

http://www.ej38.com/showinfo/linux-111338.html
1. HCI²ãЭÒé¸ÅÊö£º
HCIÌṩһÌ×ͳһµÄ·½·¨À´·ÃÎÊBluetoothµ×²ã¡£ÈçͼËùʾ£º
´ÓͼÉÏ¿ÉÒÔ¿´³ö£¬Host
Controller Interface(HCI)  ¾ÍÊÇÓÃÀ´¹µÍ¨HostºÍModule¡£Hostͨ³£¾ÍÊÇPC£¬
ModuleÔòÊÇÒÔ¸÷ÖÖÎïÀíÁ¬½ÓÐÎʽ£¨USB,serial,pc-cardµÈ£©Á¬½Óµ½PCÉϵÄbluetooth Dongle¡£
ÔÚHostÕâÒ»¶Ë£ºapplication,SDP,L2capµÈЭÒ鶼ÊÇÈí¼þÐÎʽÌá³öµÄ£¨BluezÖÐÊÇÒÔkernel²ã³ÌÐò)¡£ÔÚModuleÕâÒ»¶Ë£ºLink Manager, BB, µÈЭÒ鶼ÊÇÓ²¼þÖÐfirmwareÌṩµÄ¡£
¶øHCIÔò±È½ÏÌØÊ⣬ËüÒ»²¿·ÖÔÚÈí¼þÖÐʵÏÖ£¬ÓÃÀ´¸øÉϲãЭÒéºÍ³ÌÐòÌṩ·ÃÎʽӿڣ¨BluezÖÐ,hci.c hci_usb.c£¬hci_sock.cµÈ£©.ÁíÒ»²¿·ÖÒ²ÊÇÔÚFirmwareÖÐʵÏÖ£¬ÓÃÀ´½«Èí¼þ²¿·ÖµÄÖ¸ÁîµÈÓõײãЭÒéÃ÷°×µÄ·½Ê½´«µÝ¸øµ×²ã¡£
¾ÓÓÚPCµÄÉϲã³ÌÐòÓëЭÒéºÍ¾ÓÓÚModulesµÄϲãЭÒéÖ®¼äͨ¹ýHCI¹µÍ¨£¬ÓÐ4ÖÖ²»Í¬ÐÎʽµÄ´«Ê䣺Commands, Event, ACL Data, SCO/eSCO Data¡£
1.1. HCI Command£º
HCI CommandÊÇHostÏòModules·¢ËÍÃüÁîµÄÒ»ÖÖ·½Ê½¡£HCI Command Packet½á¹¹ÈçÏ£º
OpCodeÓÃÀ´Î¨Ò»±êʶHCI Command.ËüÓÉ2²¿·Ö×é³É£¬10bitµÄOpcode Command. 6bitµÄOpcode Group¡£
1.1.1: OpCode Group:
Linux Kernel£¨BlueZ£©ÖУ¬~/include/net/bluetooth/hci.hÖж¨ÒåÁËOpCode Group¡£
#define OGF_LINK_CTL 0x01
#define OGF_LINK_POLICY 0x02  
#define OGF_HOST_CTL 0x03
#define OGF_INFO_PARAM 0x04
#define OGF_STATUS_PARAM 0x05
ËüÃÇ´ú±íÁ˲»Í¬µÄCommand Group£º
OGF_LINK_CTL: Link control,Õâ¸öCommand GroupÖеÄCommandÔÊÐíHost¿ØÖÆÓëÆäËübluetooth device µÄÁ¬½Ó¡£
OGF_LINK_POLICY £ºLink Policy¡£Õâ¸öCommand GroupÖеÄCommandÔÊÐíµ÷ÕûLink Manager control.
OGF_HOST_CTL: Control and Baseband.
1.1.2: Opcode Command: 
ÓÃÀ´ÔÚͬһ¸öGroupÄÚΨһʶ±ðCommand¡£~/include/net/bluetooth/hci.hÖж¨Òå¡£
1.2: HCI Event£º
ModulesÏòHost·¢ËÍһЩÐÅÏ¢£¬Ê¹ÓÃHCI Event¡£Event Packet½á¹¹ÈçÏ£º
HCI Event·Ö3ÖÖ£ºCommand complete Event, Command States Event£¬Command Subsequently Completend.
Command
complete Event:
Èç¹ûHost·¢Ë͵ÄCommand¿ÉÒÔÁ¢¿ÌÓнá¹û£¬Ôò»á·¢ËÍ´ËÀàEvent¡£Ò²¾ÍÊÇ˵£¬Èç¹û·¢Ë͵ÄCommandÖ»Óë±¾µØModulesÓйأ¬²»Óë
remoteÉ豸´ò½»µÀ£¬ÔòʹÓÃCommand complete Event¡£ÀýÈ磺HCI


Ïà¹ØÎĵµ£º

linux find exec rm

#find ... -exec rm {} \;
#find ... | xargs rm -rf
Á½Õ߶¼¿ÉÒÔ°ÑfindÃüÁî²éÕÒµ½µÄ½á¹ûɾ³ý£¬ÆäÇø±ð¼òµ¥µÄ˵ÊÇÇ°ÕßÊÇ°Ñfind·¢ÏֵĽá¹ûÒ»´ÎÐÔ´«¸øexecÑ¡ÏÕâÑùµ±ÎļþÊýÁ¿½Ï¶àµÄʱºò£¬¾Í¿ÉÄÜ»á³öÏÖ“²ÎÊýÌ«¶à”Ö®ÀàµÄ´íÎó£¬Ïà±È½Ï¶øÑÔ£¬ºóÕ߾ͿÉÒÔ±ÜÃâÕâ¸ö´íÎó£¬ÒòΪxargsÃüÁî»á·ÖÅú´ÎµÄ´¦Àí½á¹û¡£ÕâÑù¿´À´£ ......

Notes for Advanced Linux Programming 4. Threads

4.  Threads
To use the POSIX standard thread API (pthreads), link libpthread.so
to your program.
4.1. Thread Creation
Each thread in a process is identified by a thread ID,
pthread_t.
The pthread_self function returns the thread ID of the current
thread.
This thread IDs can be compared ......

Linux°²×°apache¡¢phpºÍmysql·½·¨

apacheµÄÔ´Âë°²×° 
½«Ñ¹Ëõ°ü½âѹ֮ºó½øÈëÏàÓ¦µÄĿ¼
./configure \   #--------------------Ô¤±àÒëÃüÁî
"--prefix=/usr/local/apache" \  #--------------------°²×°Â·¾¶Îª“/usr/local/apache”
"--with-included-apr" \
"--enable-so" \ #--------------------¿ªÆôÏàÓ¦µÄÀ©Õ¹Ä£¿é ......

¡¾×ªÌûLINUX¡¿netfilterÖеÄconntrackÄÚºËÔĶÁ±Ê¼Ç(1)

2008-07-07 22:04×´ ̬¼ì²â(stateful inspection)ÊÇÓÉCheckPoint¹«Ë¾×îÏÈÌá³öµÄ£¬¿ÉËãÊÇ·À»ðǽ¼¼ÊõµÄÒ»ÏîÍ»ÆÆÐÔ±ä¸ï£¬°Ñ°ü¹ýÂ˵ĿìËÙÐԺʹúÀíµÄ°²È«ÐԺܺõؽáºÏÔÚÒ»Æ𣬠ĿǰÒѾ­ÊÇ·À»ðǽ×îÁ÷Ðеļì²â·½Ê½¡£×´Ì¬¼ì²âµÄ¸ù±¾Ë¼ÏëÊǶÔËùÓÐÍøÂçÊý¾Ý½¨Á¢“Á¬½Ó”µÄ¸ÅÄ´Ë“Á¬½Ó”ÊÇÃæÏò“Á¬½Ó&rdquo ......

LinuxÎļþ´ò°ü½â°ü(tar with gzip & bzip2)

´ò°ü: tar [-j] | [-z] [cv] [-f tar°üÎļþ] Òª´òÈë°üµÄÔ´Îļþ
½â°ü: tar [-j] | [-z] [xv] [-f tar°üÎļþ] [-C Ö¸¶¨½â°üµÄĿ¼]
²é¿´: tar [-j] | [-z] [tv] [-f tar°üÎļþ]
³£ÓõĴò°üÑ¡Ïî:
Ñ¡Ïî
ÃèÊö
-c
½¨Á¢tar°üÎļþ
-t
²é¿´tar°üÎļþÖеÄÎļþÁбí
-x
½â¿ªtar°üÎļþ
-C path
Óë½â°üÑ¡Ïî(-x)ÅäºÏʹÓÃ,Ö¸¶¨ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ