ʵս linuxÀ¶ÑÀ±à³ÌÖ®(°Ë) hci ÐÒé Ó¦Óñà³ÌʵÏÖ
¶ÔÓÚhci²ãµÄ±à³Ì ÊÇÏ൱¸´Ô ¹¦ÄÜÒ²ÊÇÇ¿´óµÄ,½¨ÒéѧϰÕß È¥¶Ábluez-libÖеÄhciºÍsdp
ÕâÀï¼òÒª½éÉÜ ÎÒÔÚ¿ª·¢¹«Ë¾µÄÏîÄ¿ÖÐµÄ Ò»¸öСµÄ»ù´¡¶¯×÷. ¸Ã±à³ÌµÄ¹ý³Ì»ù±¾ÀíÇåÁËhciºÍsdpµÄÏνӺÍÓ¦ÓÃ.Ï£Íû¶ÔѧϰÕßÓаïÖú
˵Ã÷Óв»µ½Ö®´¦,Íû´ó¼Ò¶à¶àÑо¿,²»Òª¾ÖÏÞ,ÿ¸öÈËÓÐ×Ô¼ºµÄ·½Ê½,Ò²ÐíÄãµÄÔÚÂß¼Ëã·¨ÉϱÈÎҵĺÃ!!
//scanÊÇÒ»¸öÀûÓÃhci²ãÐÒé »ñµÃÔ¶³ÌÀ¶ÑÀÉ豸µÄÀ¶ÑÀµØÖ·ºÍÀ¶ÑÀêdzƵĺ¯Êý;
int scan()
{
inquiry_info *ii = NULL;
int max_rsp, num_rsp;
int dev_id, sock, len, flags;
int i;
char addr[19] = { 0 };
char name[248] = { 0 };
dev_id = hci_get_route(NULL);
printf("\nhci%d is scanning......\n",dev_id);
//dev_id = lc[scannum].name;
sock = hci_open_dev( dev_id );
if (dev_id < 0 || sock < 0) {
system("reboot");
perror("opening socket");
return 0;
}
bdaddr_t src;
bacpy(&src, BDADDR_ANY);
len = 8;
max_rsp = 255;
flags = IREQ_CACHE_FLUSH;
ii = (inquiry_info*)malloc(max_rsp * sizeof(inquiry_info));
num_rsp = hci_inquiry(dev_id, len, max_rsp, NULL, &ii, flags);
if( num_rsp < 0 ) perror("hci_inquiry");
for (i = 0; i < num_rsp; i++) {
ba2str(&(ii+i)->bdaddr, addr);
memset(name, 0, sizeof(name));
int c=0;
if (sdp_get_channel_opush(&src, &(ii+i)->bdaddr, &c))
//printf("\n%d\n",c);
if(c>0)addadr(addr,c); //´Ë´¦ÊÇÎÒÔÚ×öÏîÄ¿ÖÐ×öµÄÒ»¸öÓëÓ¦ÓóÌÐòÁ¬½ÓµÄ½Ó¿Úº¯Êý,¹¦ÄÜÊÇÍê³ÉÔ¶³ÌÀ¶ÑÀÉ豸µÄµØÖ·ºÍÎļþ´«ÊäͨµÀºÅÌí¼Óµ½
Ïà¹ØÎĵµ£º
±¾ÎÄת×Ô£ºhttp://www.cnblogs.com/blueoceanli/archive/2009/04/27/1444491.html
(ÐÞ¸Ä~/.vimrc,ûÓд´½¨Ö®)
set encoding=utf-8
syntax enable
syntax on
filetype on
set tabstop=4
set softtabstop=4
set shiftwidth=4
set cindent
set autoindent
filetype plugin indent on
1.Alternate (http://www.vim ......
¡¡Èç¹ûÄãµÄ·þÎñÆ÷apache»¹Ã»Óа²×°£¬ÄǺܼòµ¥£¬ÔÚ±àÒëapacheʱ½«mod_rewriteÄ£¿é±àÒë½øÈ¥¾Í¿ÉÒÔ£¬Ïà¹ØÎĵµ¿ÉÒÔÔÚhttp://man.ddvip.com/soft/apache2.2/misc/rewriteguide.html
ÖÐÕÒµ½¡£Èç¹ûÄãµÄapacheÒѾ°²×°ºÃÁË£¬ÏÖÔÚÖ»Ïë±àÒë³ömod_rewrite.soÄ£¿é£¬ÔÚapacheÖнøÐмÓÔØ£¬ÏÂÃæÎÒÃǾͽéÉÜÕâ¸ö·½·¨¡£
¡¡¡¡ÒÔFedora² ......
ÎÒ²»Ì«Ï²»¶linuxÁË£¬ËäÈ»ÎÒÔÚËûÉÏÃæ¶Ï¶ÏÐøÐøµÄ»¨¹ýһЩʱ¼ä£¬ÏÖÔÚ»ØÍ·À´¿´£¬ËüÒ²ÈÃÎÒÀË·ÑÁ˺ܶàµÄʱ¼ä£¬linuxÂÒÆß°ËÔãµÄÅäÖã¬Èí¼þµÄȱ·¦ÁîÎҺܲ»ÊÊ´Ó£¬¶øÇÒËüÒ²²»ÄÜʹÎÒ°ÑÖ÷ÒªµÄ¾Àú¼¯ÖÐÔÚÕæÕý¸ÐÐËȤµÄµØ·½£¬¶ø²»ÊÇΪÁË“Õ÷·þ”linuxÕ´Õ´×Ôϲ£¬ÎÒ²»Ï²»¶ÕâÑùµÄlinux£¬ÕâÑùµÄlinuxÌ«³ÌÐòÔ±»¯ÁË¡£ÎÒΪʲôҪ¶ÁÄÇЩ ......
errno
ÊǸöint±äÁ¿£¬·µ»Ø´íÎó
ÓдíÎóʱʹÓ÷½·¨
fprintf(fp, "%s", strerror(errno))
perrorÓ÷¨
#include <stdio.h>
#include <stdlib.h>
#include<errno.h>
int main(void)
{
FILE *fp;
if((fp=fopen("aaa.txt","r+"))==NULL)
{
puts("²»ÄܽøÈ ......
Linux·þÎñ£¨Linux services£©¶ÔÓÚÿ¸öÓ¦ÓÃLinuxµÄÓû§À´Ëµ¶¼ºÜÖØÒª¡£¹Ø±Õ²»ÐèÒªµÄ·þÎñ£¬¿ÉÒÔÈÃLinuxÔËÐеĸü¸ßЧ£¬µ«²¢²»ÊÇËùÓеÄLinux·þÎñ¶¼¿ÉÒԹرա£½ñÌì°²×°ÁËÒ»´ÎCentOs Linux£¬·¢ÏÖLinuxÆô¶¯µÄʱºòÆô¶¯Á˺öà·þÎñ£¬´ó²¿·Ö¶¼²»ÖªµÀÊǸÉʲôµÄ¡£Òò´Ë×ÅÖØÁ˽âÁËÒ»ÏÂÄÇЩLinux·þÎñ£¨Linux services£©¿ÉÒԹرգ¬ÄÇЩLinux· ......