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

ʵսLinux Bluetooth±à³Ì(Áù) L2CAP±à³ÌʵÀý

ÀýÒ»£º·¢ËÍSignaling Packet£º
Signaling CommandÊÇ2¸öBluetoothʵÌåÖ®¼äµÄL2CAP²ãÃüÁî´«Êä¡£ËùÒÔµÃSignaling CommandʹÓÃCID 0x0001.
¶à¸öCommand¿ÉÒÔÔÚÒ»¸öC-frame£¨control frame£©Öз¢ËÍ¡£
 Èç¹ûÒªÖ±½Ó·¢ËÍSignaling Command.ÐèÒª½¨Á¢SOCK_RAWÀàÐ͵ÄL2CAPÁ¬½ÓSocket¡£ÕâÑù²ÅÓлú»á×Ô¼ºÌî³äCommand Code£¬IdentifierµÈ¡£
ÒÔÏÂÊÇÒ»¸ö·¢ËÍsignaling CommandÒÔ¼°½ÓÊÕResponseµÄ¼òµ¥Àý×Ó£º
int main(int argc, char** argv)
{
 int l2_sck = 0;
 int iRel  = 0;
 struct sockaddr_l2 local_l2_addr;
 struct sockaddr_l2 remote_l2_addr;
 char str[24] ={0};
 int len = 0;
 int size = 50;
 char* send_buf;
 char* recv_buf;
 int i = 0;
 int id = 1; //²»ÒªÎª0
 
 send_buf = malloc(L2CAP_CMD_HDR_SIZE + size);
 recv_buf = malloc(L2CAP_CMD_HDR_SIZE + size);
 
 if(argc < 2)
 {
  printf("\n%s <bdaddr>\n", argv[0]);
  exit(0);
 }
 // create l2cap raw socket
 l2_sck = socket(PF_BLUETOOTH, SOCK_RAW, BTPROTO_L2CAP); //´´½¨L2CAP protocolµÄRAW Packet
 if(l2_sck < 0)
 {
  perror("\nsocket:");
  return -1;
 }
 //bind
 memset(&local_l2_addr, 0, sizeof(struct sockaddr_l2));
 local_l2_addr.l2_family = PF_BLUETOOTH;
 bacpy(&local_l2_addr.l2_bdaddr , BDADDR_ANY);
 iRel = bind(l2_sck, (struct sockaddr*) &local_l2_addr, sizeof(struct sockaddr_l2));
 if(iRel < 0)
 {
  perror("\nbind()");
  exit(0);
 }
 //connect
 memset(&remote_l2_addr, 0 , sizeof(struct sockaddr_l2));
 remote_l2_addr.l2_family = PF_BLUETOOTH;
 //printf("\nConnect to %s\n", argv[1]);
 str2ba(argv[1], &remote_l2_addr.l2_bdaddr);
 iRel = connect(l2_sck, (struct sockaddr*)&remote_l2_addr, sizeof(struct sockaddr_l2));
 if(iRel < 0)
 {
  perror("\nconnect()");
  exit(0);
 }
 //get local bda


Ïà¹ØÎĵµ£º

Linux²Ù×÷ϵͳÏÂÉèÖû·¾³±äÁ¿PathµÄ·½·¨

ÓÐÁ½ÖÖÉèÖû·¾³±äÁ¿ PATH µÄ·½·¨¡£µÚÒ»ÖÖÊÊÓÃÓÚΪµ¥Ò»Óû§ÉèÖà PATH£¬µÚ¶þÖÖÊÇΪȫ¾ÖÉèÖà PATH¡£
 
1.ÔÚÓû§Ö÷Ŀ¼ÏÂÓÐÒ»¸ö .bashrc Îļþ£¬¿ÉÒÔÔÚ´ËÎļþÖмÓÈë PATH µÄÉèÖÃÈçÏ£º
export PATH=”$PATH:/your path1/:/your path2/…..”
×¢Ò⣺ÿһ¸ö path Ö®¼äÒªÓà “:“ ·Ö¸ô¡£
× ......

Linux 0.12ÄÚºË

ÔÚÓ¦ÓóÌÐò¿ª·¢Ê±£¬Ò²¾­³£ÐèÒªÈçϵĶ¨Ê±Æ÷. ÕâÀï¶Ô¶¨Ê±Æ÷×öÁËÒ»¸öÓÅ»¯£¬¾ÍÊÇÔÚ²åÈë¶ÓÁÐÖÐʱ½øÐÐÁËÒ»´ÎÅÅÐò£¬Ê¹µÃ¼ì²âʱ²»ÐèÒª±éÀúÕû¸öÁ´±í£¬Ö»Ðè°ÑÅÅÔÚÇ°ÃæµÄ¼¸¸öµ½Ê±µÄÈÎÎñÈ¡³öÀ´¾Í¿ÉÒÔÁË¡£
static struct timer_list {
     long jiffies;
     void (*fn)();
   ......

linux ½âѹÎÊÌâ

tar vxfz ttt-1.00.tar.bz2ºó³öÏÖÒÔÉÏ´íÎóÊÇÔõô»ØÊ°¡£¿
gzip:stdin:not in gzip format
tar:Child returned status1
tar:Error exit delayed from prvious errors
tar jxvf  busybox-1.00.tar.bz2
½âѹ£ºtar jxvf FileName.tar.bz2
ѹËõ£ºtar jcvf FileName.tar.bz2 DirName
bz2¸ñʽÓÃj
gz¸ñʽÓÃz
cÊÇ´´½¨ ......

solarisºÍlinuxÃüÁî¶Ô±È

×î½üÒ»¸öÏîÄ¿µÄϵͳÓõÄÊÇSolaris 10£¬ËäÈ»ÒÔÇ°ÓõĶ¼ÊÇ Linuxϵͳ£¬µ«ÊÇLinuxϵͳÖеÄһЩÃüÁîºÍSolarisϵͳÊÇͨÓõģ¬ÎªÁË·½±ãÎÒÏÖÔÚÁгö²¿·Ö£¬ÒÔºó½Ðø¸üС£
   ¡¡1£© ²é¿´¿ª·Å¶Ë¿Ú
¡¡
¡¡¡¡Linux£º netstat -atn
¡¡
¡¡¡¡Solaris£º netstat -P tcp -f inet -an
¡¡
¡¡¡¡2£© ²é¿´Íø¿¨/ÍøÂç״̬
¡¡
¡¡¡¡ ......

Linux²»ÐèÒª´ÅÅÌËéƬÕûÀí





Linux²»ÐèÒª´ÅÅÌËéƬÕûÀí¡£
ÒÔÏÂÒý×Ôlinux¹Ù·½ÍøÕ¾¶ÔËéƬµÄ½â˵£ºÀ´Ô´ÓÚ
http://www.linux.org/docs/ldp/howto/Partition/appendix.html#fragmentation

ÒýÓÃ:
10.4. Some facts about file systems and fragmentation
Disk
space is administered by the operating system in units of ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ