Linux ¶àÏß³ÌͨÐÅ
Linux ¶àÏß³ÌͨÐÅ
Linux ¶àÏß³ÌͨÐÅ
Õª×Ô×ÊÁÏ£¨linux ÓëWindows²»Í¬£©
Ï̼߳äÎÞÐèÌرðµÄÊֶνøÐÐͨÐÅ£¬ÒòΪÏ̼߳ä¿ÉÒÔ¹²ÏíÊý¾Ý½á¹¹£¬Ò²¾ÍÊÇÒ»¸öÈ«¾Ö±äÁ¿¿ÉÒÔ±»Á½¸öÏß³ÌͬʱʹÓᣲ»¹ýҪעÒâµÄÊÇÏ̼߳äÐèÒª×öºÃͬ²½£¬Ò»°ãÓÃmutex¡£¿ÉÒԲο¼Ò»Ð©±È½ÏеÄUNIX/Linux±à³ÌµÄÊ飬¶¼»áÌáµ½PosixÏ̱߳à³Ì£¬±ÈÈ硶UNIX»·¾³¸ß¼¶±à³Ì£¨µÚ¶þ°æ£©¡·¡¢¡¶UNIXϵͳ±à³Ì¡·µÈµÈ¡£ linuxµÄÏûÏ¢ÊôÓÚIPC£¬Ò²¾ÍÊǽø³Ì¼äͨÐÅ£¬Ïß³ÌÓò»ÉÏ¡£
linuxÓÃpthread_kill¶ÔÏ̷߳¢Ðźš£ Áí£ºwindowsϲ»ÊÇÓÃpost..(ÄãÊÇ˵PostMessageÂð£¿)½øÐÐÏß³ÌͨÐŵİɣ¿
windowsÓÃPostThreadMessage½øÐÐÏ̼߳äͨÐÅ£¬µ«Êµ¼ÊÉϼ«ÉÙÓÃÕâÖÖ·½·¨¡£»¹ÊÇÀûÓÃͬ²½¶àһЩ LINUXϵÄͬ²½ºÍWindowsÔÀí¶¼ÊÇÒ»ÑùµÄ¡£²»¹ýLinuxϵÄsingalÖжÏÒ²ºÜºÃÓá£
ÓúÃÐźÅÁ¿£¬¹²Ïí×ÊÔ´¾Í¿ÉÒÔÁË¡£
ʹÓöàÏ̵߳ÄÀíÓÉÖ®Ò»ÊǺͽø³ÌÏà±È£¬ËüÊÇÒ»Öַdz£"½Ú¼ó"µÄ¶àÈÎÎñ²Ù×÷·½Ê½¡£ÎÒÃÇÖªµÀ£¬ÔÚLinuxϵͳÏ£¬Æô¶¯Ò»¸öеĽø³Ì±ØÐë·ÖÅä¸øËü¶ÀÁ¢µÄµØÖ·¿Õ¼ä£¬½¨Á¢ÖÚ¶àµÄÊý¾Ý±íÀ´Î¬»¤ËüµÄ´úÂë¶Î¡¢¶ÑÕ»¶ÎºÍÊý¾Ý¶Î£¬ÕâÊÇÒ»ÖÖ"°º¹ó"µÄ¶àÈÎÎñ¹¤×÷·½Ê½¡£¶øÔËÐÐÓÚÒ»¸ö½ø³ÌÖеĶà¸öỊ̈߳¬ËüÃDZ˴ËÖ®¼äʹÓÃÏàͬµÄµØÖ·¿Õ¼ä£¬¹²Ïí´ó²¿·ÖÊý¾Ý£¬Æô¶¯Ò»¸öÏß³ÌËù»¨·ÑµÄ¿Õ¼äԶԶСÓÚÆô¶¯Ò»¸ö½ø³ÌËù»¨·ÑµÄ¿Õ¼ä£¬¶øÇÒ£¬Ï̼߳ä±Ë´ËÇл»ËùÐèµÄʱ¼äҲԶԶСÓÚ½ø³Ì¼äÇл»ËùÐèÒªµÄʱ¼ä¡£
¡¡¡¡Ê¹ÓöàÏ̵߳ÄÀíÓÉÖ®¶þÊÇÏ̼߳䷽±ãµÄͨÐÅ»úÖÆ¡£¶Ô²»Í¬½ø³ÌÀ´Ëµ£¬ËüÃǾßÓжÀÁ¢µÄÊý¾Ý¿Õ¼ä£¬Òª½øÐÐÊý¾ÝµÄ´«µÝÖ»ÄÜͨ¹ýͨÐŵķ½Ê½½øÐУ¬ÕâÖÖ·½Ê½²»½ö·Ñʱ£¬¶øÇҺܲ»·½±ã¡£Ïß³ÌÔò²»È»£¬ÓÉÓÚͬһ½ø³ÌϵÄÏß³ÌÖ®¼ä¹²ÏíÊý¾Ý¿Õ¼ä£¬ËùÒÔÒ»¸öÏ̵߳ÄÊý¾Ý¿ÉÒÔÖ±½ÓΪÆäËüÏß³ÌËùÓã¬Õâ²»½ö¿ì½Ý£¬¶øÇÒ·½±ã¡£µ±È»£¬Êý¾ÝµÄ¹²ÏíÒ²´øÀ´ÆäËûһЩÎÊÌ⣬ÓеıäÁ¿²»ÄÜͬʱ±»Á½¸öÏß³ÌËùÐ޸ģ¬ÓеÄ×Ó³ÌÐòÖÐÉùÃ÷ΪstaticµÄÊý¾Ý¸üÓпÉÄܸø¶àÏ̳߳ÌÐò´øÀ´ÔÖÄÑÐԵĴò»÷£¬ÕâЩÕýÊDZàд¶àÏ̳߳ÌÐòʱ×îÐèҪעÒâµÄµØ·½¡£
1¡¢¼òµ¥µÄ¶àÏ̳߳ÌÐò
Ê×ÏÈÔÚÖ÷º¯ÊýÖУ¬ÎÒÃÇʹÓõ½ÁËÁ½¸öº¯Êý£¬pthread_createºÍpthread_join£¬²¢ÉùÃ÷ÁËÒ»¸öpthread_tÐ͵ıäÁ¿¡£
pthread_tÔÚÍ·Îļþpthread.hÖÐÒѾÉùÃ÷£¬ÊÇÏ̵߳ıêʾ·û
º¯Êýpthread_createÓÃÀ´´´½¨Ò»¸öỊ̈߳¬º¯ÊýÔÐÍ£º
extern int pthread_create __P ((pthread_t *__thread, __const pthread_attr_t *__attr,void *(*__start_routine) (void *), void *__arg));
¡¡¡¡µÚÒ»¸ö²ÎÊýΪָÏòÏ̱߳êʶ·ûµÄÖ¸Õ룬µÚ¶þ¸ö²ÎÊý
Ïà¹ØÎĵµ£º
Ç°Ãæ½²ÁËʹÓà ioctl·¢ËÍHCI CommandµÄ·½·¨¡£µ«HCI protocol»¹ÓÐһЩCommand£¬±ÈÈçInquiryµÈ£¬ËûÃÇÔò²»ÐèҪʹÓÃioctlÀ´·¢ËÍ¡£blueZ Ö±½ÓÌṩÁËÖ§³Ö£¬ËäÈ»ËûÃǵÄ×îÖÕ¶¼ÊÇÓÃͬÑù°ì·¨ÊµÏֵġ£
ÔÚÓ¦ÓóÌÐòÖУº
hci_inquiry(dev_id, length, num_rsp, NULL, &info, flags);
ÕâÑùÐèÒª°üº¬blueZ Í·ÎļþÈçÏ£º
#include //BT ......
¸Õ¿ªÊ¼½Ó´¥Linux,ÄÇô¶àµÄ°æ±¾,Õæ²»ÖªµÀ¸ÃÓÃʲôÑùµÄºÃ.¿´ÁËÍøÉϵÄÆÀÂÛ,¶¼ËµUbuntnºÃ.ÏÂÁËÒ»¸ö,ÔÚÐéÄâ»úÉÏ×°Á˼¸±é.·¢ÏÖµÚÒ»´Î°²×°µÄʱºòºÜ¿ì,ÒÔºó¾Í×Ü¿¨ÔÚAptÅäÖÃÄÇ,²»ÖªµÀÊÇΪʲô.
ºóÀ´,·¢ÏÖºìÆìLinux.µ«ÍøÉϵÄÆÀÂÛ¸÷Òì,²»¹ýÎÒ»¹ÊÇÑ¡ÔñÁ˺ìÆì.û±ðµÄÔÒò,¾ÍÒòΪËýÊÇÖйúµÄ.
¶ÔÓÚûÓÐÒ»µãLINUX¾ÑéµÄ³õѧÕß,±¾ÈËÈÏΪ»¹Ê ......
1.Linux“Ï߳̔
½ø³ÌÓëÏß³ÌÖ®¼äÊÇÓÐÇø±ðµÄ£¬²»¹ýLinuxÄÚºËÖ»ÌṩÁËÇáÁ¿½ø³ÌµÄÖ§³Ö£¬Î´ÊµÏÖÏß³ÌÄ£ÐÍ¡£LinuxÊÇÒ»ÖÖ“¶à½ø³Ìµ¥Ï߳̔µÄ²Ù×÷ϵͳ¡£Linux±¾ÉíÖ»Óнø³ÌµÄ¸ÅÄ¶øÆäËùνµÄ“Ï߳̔±¾ÖÊÉÏÔÚÄÚºËÀïÈÔÈ»Êǽø³Ì¡£
´ó¼Ò ......
À´Ô´£ºhttp://www.armjishu.com/index.php
´ó²¿·ÖÈ˶¼²»Ì«ÇåÎúµÄÒÉ»ó-----LinuxÖеĵØÖ·¿Õ¼ä
ÓÐÕâôһϵÁеÄÎÊÌ⣬ÊÇ·ñÔÚÀ§ÈÅ×ÅÄ㣺Óû§³ÌÐò±àÒëÁ¬½ÓÐγɵĵØÖ·¿Õ¼äÔÚʲô·¶Î§ÄÚ£¿Äں˱àÒëºóµØÖ·¿Õ¼äÔÚʲô·¶Î§ÄÚ£¿Òª¶ÔÍâÉè½øÐзÃÎÊ£¬I/OµÄµØÖ·¿Õ¼äÓÖÊÇʲôÑùµÄ£¿
ÏȻشðµÚÒ»¸öÎÊÌâ¡£Linux×î³£¼ûµÄ¿ÉÖ´ÐÐÎļþ¸ñʽΪelf(E ......