ʵս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
Ïà¹ØÎĵµ£º
×¼±¸¹¤×÷:
¡¡¡¡Óõ½µÄperl À©Õ¹×é¼þ(modules)ÔÚÉÏƪÌù³ö.( win32::odbc Ä£¿é
)ÏÂÔØ×é¼þºó°´ÕÕReadmeÎļþ°²×°µ¹ÏìӦĿ¼.ÅäÖúÃÏàÓ¦µÄodbcÊý¾ÝÔ´.
¡¡¡¡
¡¡¡¡³ÌÐòʵÏÖ:
¡¡¡¡Ê¹ÓÃ
¡¡¡¡use
Win32::ODBC;
¡¡¡¡
¡¡¡¡Óï¾ä°üº¬Ó¦Ê¹ÓõÄÄ£¿éÊÇwin32::odbc,д³öÊý¾Ý¿â
Á¬½Ó×Ö·û´®
¡¡¡¡
¡¡¡¡$DSN = "DSN =
My DSN ......
ÓÐÁ½ÖÖÉèÖû·¾³±äÁ¿ PATH µÄ·½·¨¡£µÚÒ»ÖÖÊÊÓÃÓÚΪµ¥Ò»Óû§ÉèÖà PATH£¬µÚ¶þÖÖÊÇΪȫ¾ÖÉèÖà PATH¡£
1.ÔÚÓû§Ö÷Ŀ¼ÏÂÓÐÒ»¸ö .bashrc Îļþ£¬¿ÉÒÔÔÚ´ËÎļþÖмÓÈë PATH µÄÉèÖÃÈçÏ£º
export PATH=”$PATH:/your path1/:/your path2/…..”
×¢Ò⣺ÿһ¸ö path Ö®¼äÒªÓà “:“ ·Ö¸ô¡£
× ......
mkdir /downloads
chown -R root:root /downloads
chmod -R 774 /downloads
Ò»¡¢°²×°Apache2
ÏÂÔصØÖ·£ºhttp://www.apache.org/ --> HTTP Server --> from a mirror
1. »ñÈ¡mysqlÔ´Âë
shell> cd /downloads
......
ʲôÊÇ LVM
LVM ÊÇÂß¼Å̾í¹ÜÀí£¨Logical Volume Manager£©µÄ¼ò³Æ£¬ËüÊÇ Linux »·¾³Ï¶ԴÅÅÌ·ÖÇø½øÐйÜÀíµÄÒ»ÖÖ»úÖÆ£¬LVM
Êǽ¨Á¢ÔÚÓ²Å̺ͷÖÇøÖ®ÉϵÄÒ»¸öÂß¼²ã£¬À´ÎªÎļþϵͳÆÁ±Îϲã´ÅÅÌ·ÖÇø²¼¾Ö£¬´Ó¶øÌá¸ß´ÅÅÌ·ÖÇø¹ÜÀíµÄÁé»îÐÔ¡£Í¨¹ý LVM
ϵͳ¹ÜÀíÔ±¿ÉÒÔÇáËɹÜÀí´ÅÅÌ·ÖÇø£¬È磺½«Èô¸É¸ö´ÅÅÌ·ÖÇøÁ¬½ÓΪһ¸öÕû¿éµÄ¾í×é ......
Ç°Ãæ½²ÁËʹÓà ioctl·¢ËÍHCI CommandµÄ·½·¨¡£µ«HCI protocol»¹ÓÐһЩCommand£¬±ÈÈçInquiryµÈ£¬ËûÃÇÔò²»ÐèҪʹÓÃioctlÀ´·¢ËÍ¡£blueZ Ö±½ÓÌṩÁËÖ§³Ö£¬ËäÈ»ËûÃǵÄ×îÖÕ¶¼ÊÇÓÃͬÑù°ì·¨ÊµÏֵġ£
ÔÚÓ¦ÓóÌÐòÖУº
hci_inquiry(dev_id, length, num_rsp, NULL, &info, flags);
ÕâÑùÐèÒª°üº¬blueZ Í·ÎļþÈçÏ£º
#include //BT ......