ʵս 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); //´Ë´¦ÊÇÎÒÔÚ×öÏîÄ¿ÖÐ×öµÄÒ»¸öÓëÓ¦ÓóÌÐòÁ¬½ÓµÄ½Ó¿Úº¯Êý,¹¦ÄÜÊÇÍê³ÉÔ¶³ÌÀ¶ÑÀÉ豸µÄµØÖ·ºÍÎļþ´«ÊäͨµÀºÅÌí¼Óµ½
Ïà¹ØÎĵµ£º
ÀýÒ»£º·¢ËÍSignaling Packet£º
Signaling CommandÊÇ2¸öBluetoothʵÌåÖ®¼äµÄL2CAP²ãÃüÁî´«Êä¡£ËùÒÔµÃSignaling CommandʹÓÃCID 0x0001.
¶à¸öCommand¿ÉÒÔÔÚÒ»¸öC-frame£¨control frame£©Öз¢ËÍ¡£
Èç¹ûÒªÖ±½Ó·¢ËÍSignaling Command.ÐèÒª½¨Á¢SOCK_RAWÀàÐ͵ÄL2CAPÁ¬½ÓSocket¡£ÕâÑù²ÅÓлú»á×Ô¼ºÌî³äCommand Code£¬Identi ......
ʲôÊÇSocket
¡¡¡¡Socket½Ó¿ÚÊÇTCP/IPÍøÂçµÄAPI£¬Socket½Ó¿Ú¶¨ÒåÁËÐí¶àº¯Êý»òÀý³Ì£¬³ÌÐòÔ±¿ÉÒÔÓÃËüÃÇÀ´¿ª·¢TCP/IPÍøÂçÉϵÄÓ¦ÓóÌÐò¡£ÒªÑ§InternetÉϵÄTCP/IPÍøÂç±à³Ì£¬±ØÐëÀí½âSocket½Ó¿Ú¡£
¡¡¡¡Socket½Ó¿ÚÉè¼ÆÕß×îÏÈÊǽ«½Ó¿Ú·ÅÔÚUnix²Ù×÷ϵͳÀïÃæµÄ¡£Èç¹ûÁ˽âUnixϵͳµÄÊäÈëºÍÊä³öµÄ»°£¬¾ÍºÜÈÝÒ×Á˽âSocketÁË¡£Í ......
NFS server¿ÉÒÔ¿´×÷ÊÇÒ»¸öFILE SERVER,Ëü¿ÉÒÔÈÃÄãµÄPCͨ¹ýÍøÂ罫Զ¶ËµÃNFS SERVER¹²Ïí³öÀ´µÄµµ°¸MOUNTµ½×Ô¼ºµÄϵͳÖУ¬ÔÚCLIENT¿´À´Ê¹ÓÃNFSµÄÔ¶¶ËÎļþ¾ÍÏóÊÇÔÚʹÓñ¾µØÎļþÒ»Ñù¡£
NFSÐÒé´Óµ®Éúµ½ÏÖÔÚΪֹ£¬ÒѾÓжà¸ö°æ±¾£¬ÈçNFS V2£¨rfc1094£©,NFS V3£¨rfc1813£©£¨×îÐÂµÄ°æ± ......
LinuxϵͳʡÂÔÊäÈëÓû§ÃûÃÜÂë(×Ö·û½çÃæÏ£©
1¡¢Ê¡ÂÔÃÜÂëÑéÖ¤
ºÜ¼òµ¥£¬Ö»Ðè°Ñ/etc/passwdÖеÄroot:x:0:0:root:/root:/bin/bash£¬¸ÄΪroot::0:0:root:/root:/bin/bash£¬¾Í¿ÉÒÔÁË£¬¾ÍÊÇÈ¥µôÁËÀïÃæµÄx£¬ÕâÑùrootÓû§¾Í²»ÓÃÃÜÂëÁË¡£ÆäËûÓû§Ò²Ò»Ñù¡£
2¡¢Ê¡ÂÔÊäÈëÓû§Ãû
(1)ÐÞ¸Ä/etc/inittab
ÔÚinittabÖУ¬ÓÐÈçÏÂÅä ......
ÍøÂçÅäÖÃÎļþ LINUX ÔÚ °²×°ÖÐ »ù±¾µÄÅäÖà ¶¼ÒѾÍê³ÉÁË ¶¼ÒÔÎı¾·½Ê½ ±£´æÔÚ/etcĿ¼ÏÂ
.
ÍøÂçÅäÖÃÎļþ£º/etc/sysconfig/network
²é¿´ÃüÁ
[root@localhost ~]# cat /etc/sysconfig/network
NETWORKING=yes
NETWORKING_IPV6=yes
HOSTNAME=localhost.localdomai ......