LinuxÏ´®¿ÚͨÐÅ
1. ´ò¿ª´®¿Ú
ÓëÆäËûµÄ¹ØÓÚÉ豸±à³ÌµÄ·½·¨Ò»Ñù£¬ÔÚLinuxÏ£¬²Ù×÷¡¢¿ØÖÆ´®¿ÚÒ²ÊÇͨ¹ý²Ù×÷ÆðÉ豸Îļþ½øÐеġ£ÔÚLinuxÏ£¬´®¿ÚµÄÉ豸ÎļþÊÇ/dev/ttyS0»ò/dev/ttyS1µÈ¡£Òò´ËÒª¶Áд´®¿Ú£¬ÎÒÃÇÊ×ÏÈÒª´ò¿ª´®¿Ú£º
char *dev = "/dev/ttyS0"; //´®¿Ú1
int fd = open( dev, O_RDWR );
//| O_NOCTTY | O_NDELAY
if (-1 == fd)
{
perror("Can't Open Serial Port");
return -1;
}
else
return fd;
2. ÉèÖô®¿ÚËÙ¶È
´ò¿ª´®¿Ú³É¹¦ºó£¬ÎÒÃǾͿÉÒÔ¶ÔÆä½øÐжÁдÁË¡£Ê×ÏÈÒªÉèÖô®¿ÚµÄ²¨ÌØÂÊ£º
int speed_arr[] = { B38400, B19200, B9600, B4800, B2400, B1200, B300,
B38400, B19200, B9600, B4800, B2400, B1200, B300, };
int name_arr[] = {38400, 19200, 9600, 4800, 2400, 1200, 300, 38400,
&n
Ïà¹ØÎĵµ£º
£¨L2CAPÐÒé¼ò½é£¬L2CAPÔÚBlueZÖеÄʵÏÖÒÔ¼°L2CAP±à³Ì½Ó¿Ú£©
Ò»£ºL2CAPÐÒé¼ò½é£º
Logical Link Control and Adaptation Protocol(L2CAP)
Âß¼Á¬½Ó¿ØÖƺÍÊÊÅäÐÒé (L2CAP) ΪÉϲãÐÒéÌá¹©ÃæÏòÁ¬½ÓºÍÎÞÁ¬½ÓµÄÊý¾Ý·þÎñ£¬²¢Ìṩ¶àÐÒ鹦ÄܺͷָîÖØ×é²Ù×÷¡£L2CAP ³äÐíÉϲãÐÒéºÍÓ¦ÓÃÈí¼þ´«ÊäºÍ½ÓÊÕ×î´ó³¤¶ÈΪ 64K µÄ L2CAP Ê ......
Service Discovery Protocol(SDP)ÌṩһÖÖÄÜÁ¦£¬ÈÃÓ¦ÓóÌÐòÓз½·¨·¢ÏÖÄÄÖÖ·þÎñ¿ÉÓÃÒÔ¼°ÕâÖÖ·þÎñµÄÌØÐÔ¡£
·þÎñ·¢ÏÖÐÒé(SDP»òBluetooth SDP)ÔÚÀ¶ÑÀÐÒéÕ»ÖжÔÀ¶ÑÀ»·¾³ÖеÄÓ¦ÓóÌÐòÓÐÌØÊâµÄº¬Ò⣬·¢ÏÖÄĸö·þÎñÊÇ¿ÉÓõĺÍÈ·¶¨ÕâЩ¿ÉÓ÷þÎñµÄÌØÕ÷¡£SDP¶¨ÒåÁËbluetooth client·¢ÏÖ¿ÉÓÃbluetooth server·þÎñºÍËüÃǵÄÌØÕ÷µÄ·½·¨¡£ ......
Ò»£ºÇ°ÑÔ
×î½üÔÚÑо¿androidµÄsensor driver£¬Ö÷ÒªÊÇE-compass£¬ÆäÖÐÓõ½ÁËLinux input×Óϵͳ.ÔÚÍøÉÏÒ²¿´Á˺ܶàÕâ·½ÃæµÄ×ÊÁÏ£¬¸Ð¾õ»¹ÊÇÕâÆª·ÖÎöµÄ±È½ÏϸÖÂ͸³¹£¬Òò´Ë×ªÔØÒ»ÏÂÒÔ±ã×Ô¼ºÑ§Ï°£¬Í¬Ê±ºÍ´ó¼Ò·ÖÏí£¡
£¨ÕâÆª²©¿ÍÖ÷ÒªÊÇÒÔ¼üÅÌÇý¶¯ÎªÀýµÄ£¬²»¹ý½²½âµÄÊÇLinux Input Subsystem£¬¿ÉÒÔ×ÐϸµÄÑо¿Ò»Ï£¡£©
¼üÅÌÇý¶¯½«¼ì ......
ÕâÊDZ¾È˵Ĵ¦ÄÐ×÷Æ·£¬¿´ÍêµÄÈËÒª¶Ô±¾È˸ºÔð°¡£¡
gccºÍg++¶¼ÊÇGNU(×éÖ¯)µÄÒ»¸ö±àÒëÆ÷¡£
gccÓëg++µÄ¶Ô±È
ÎóÇøÒ»:gccÖ»ÄܱàÒëc´úÂë,g++Ö»ÄܱàÒëc++´úÂë
Á½Õß¶¼¿ÉÒÔ£¬µ«ÊÇÇë×¢Ò⣺
1.ºó׺Ϊ.cµÄ£¬gcc°ÑËüµ±×÷ÊÇC³ÌÐò£¬¶øg++µ±×÷ÊÇc++³ÌÐò£»ºó׺Ϊ.cppµÄ£¬Á½Õß¶¼»áÈÏΪÊÇc++³ÌÐò£¬×¢Ò⣬ËäÈ»c++ÊÇcµÄ³¬¼¯£¬µ«ÊÇÁ½Õß ......
±àÖÃÄں˰üº¬Á½´óÏîÄÚÈÝ£¬¼´ÅäÖÃÄں˺ͱàÒëÄںˡ£ÕâÁ½Ï×÷ÐèÒª¾³£²é¿´Äں˵ÄÎĵµ,ÖÁÉÙÒª²é¿´ReadmeÎļþºÍDocumentationĿ¼ÏµÄChangesÎļþ¡£ËüÃǶÔÄں˽øÐÐÁËÃèÊö£¬±ÈÈçÉý¼¶Äں˿ÉÄܳöÏÖµÄÎÊÌâºÍÄں˶ÔϵͳÖй¤¾ßµÄ°æ±¾ÒªÇóµÈ¡£
1£¬Ê×ÏÈÐèÒª½«ÄÚºËÔ´ÂëÏÂÔØµ½/usr/src/Ŀ¼ÏÂÃæ£¬½âѹºó ......