ʵսLinux Bluetooth±à³Ì (Æß) SDPÐÒé
Service Discovery Protocol(SDP)ÌṩһÖÖÄÜÁ¦£¬ÈÃÓ¦ÓóÌÐòÓз½·¨·¢ÏÖÄÄÖÖ·þÎñ¿ÉÓÃÒÔ¼°ÕâÖÖ·þÎñµÄÌØÐÔ¡£
·þÎñ·¢ÏÖÐÒé(SDP»òBluetooth SDP)ÔÚÀ¶ÑÀÐÒéÕ»ÖжÔÀ¶ÑÀ»·¾³ÖеÄÓ¦ÓóÌÐòÓÐÌØÊâµÄº¬Ò⣬·¢ÏÖÄĸö·þÎñÊÇ¿ÉÓõĺÍÈ·¶¨ÕâЩ¿ÉÓ÷þÎñµÄÌØÕ÷¡£SDP¶¨ÒåÁËbluetooth client·¢ÏÖ¿ÉÓÃbluetooth server·þÎñºÍËüÃǵÄÌØÕ÷µÄ·½·¨¡£Õâ¸öÐÒ鶨ÒåÁË¿Í»§ÈçºÎÄܹ»Ñ°ÕÒ»ùÓÚÌض¨ÊôÐԵķþÎñ¶ø²»Èÿͻ§ÖªµÀ¿ÉÓ÷þÎñµÄÈκÎ֪ʶ¡£SDPÌṩ·¢ÏÖзþÎñµÄ·½·¨£¬ÔÚµ±¿Í»§µÇ¼µ½ÕýÔÚ²Ù×÷µÄÀ¶ÑÀ·þÎñÆ÷µÄÒ»¸öÇøÓòʱÊÇ¿ÉÓõÄʱ¡£
Service discovery»úÖÆÌṩclientÓ¦ÓóÌÐòÕì²âserverÓ¦ÓóÌÐòÌṩµÄ·þÎñµÄÄÜÁ¦£¬²¢ÇÒÄܹ»µÃµ½·þÎñµÄÌØÐÔ¡£·þÎñµÄÆ·ÖÊ°üº¬·þÎñtype»ò·þÎñclass.
SDPÒ²ÌṩSDP serverÓëSDP clientÖ®¼äµÄͨѶ¡£SDP serverά»¤×ÅÒ»¸ö·þÎñÌõÄ¿(service record)Áбí.ÿ¸ö·þÎñÌõÄ¿ÃèÊöÒ»¸öµ¥¶ÀµÄ·þÎñÊôÐÔ¡£ SDP client¿ÉÒÔͨ¹ý·¢ËÍSDP requestÀ´µÃµ½·þÎñÌõÄ¿¡£
Èç¹ûÒ»¸öclient»òÕßÒÀ¸½ÓÚclientÖ®ÉϵÄÓ¦ÓóÌÐò¾ö¶¨Ê¹ÓÃij¸öservice. Ëü´´½¨Ò»¸öµ¥¶ÀµÄÁ¬½Óµ½serviceÌṩÕß¡£ SDP Ö»ÌṩÕì²âServiceµÄ»úÖÆ£¬µ«²»ÌṩÈçºÎÀûÓÃÕâЩServiceµÄ»úÖÆ¡£Sam¾õµÃ£¬ÕâÀïÆäʵÊÇ˵£ºSDPÖ»ÌṩÕì²âServiceµÄ°ì·¨£¬µ«ÈçºÎÓã¬SDP²»¹Ü¡£
ÿ¸öBluetooth Device×î¶àÖ»ÄÜÓµÓÐÒ»¸öSDP Server¡£Èç¹ûÒ»¸öBluetooth DeviceÖ»µ£ÈÎClient£¬ÄÇËü²»ÐèÒªSDP Server¡£µ«Ò»¸öBluetooth Device¿ÉÒÔͬʱµ£µ±SDP ServerºÍSDP client.
Service Record(Service ÌõÄ¿)£º
Ò»¸öserviceÊÇÒ»¸öʵÌåΪÁíÒ»¸öʵÌåÌṩÐÅÏ¢£¬Ö´Ðж¯×÷»ò¿ØÖÆ×ÊÔ´¡£Ò»¸öservice¿ÉÒÔÓÉÈí¼þ£¬Ó²¼þ»òÈíÓ²¼þ½áºÏÌṩ¡£
ËùÓеÄServiceÐÅÏ¢¶¼°üº¬ÓÚÒ»¸öService RecordÄÚ¡£Ò»¸öService Record °üº¬Ò»¸öService attribute(ServiceÊôÐÔ) list.
ÔÚÒ»¸öSDP ServerÄÚ£¬Ã¿¸öService RecordÓµÓÐÒ»¸ö32-bitµÄΨһÐÔÊý¾Ý¡£Í¨³££¬Õâ¸öΨһÐÔÖ»ÊÇÔÚÿ¸öSDP ServerÄÚ²¿¡£ Èç¹ûSDP Server S1 ºÍSDP Server S2ÓµÓÐͬÑùµÄÒ»¸öService Record¡£ÄÇËûÃÇÔÚ²»Í¬SDP SeverÄڵĶÀÌØÊýÖµ²¢²»Ò»¶¨Ïàͬ¡£
SDPÔÚSDP ServerÔö¼Ó»ò¼õÉÙService Recordʱ£¬²¢²»»á֪ͨSDP client.
Service Attribute(Service ÊôÐÔ)£º
ÿ¸öServiceÊôÐÔÃèÊöservcieµÄÌØÐÔ.Ò»¸öService AttributeÓÉ2²¿·Ö£º
Attribute ID + Attribute Value¡£
Attribute ID£º16-bitÎÞ·ûºÅÕûÊý£¬ÓÃÓÚÇø±ðÒ»¸öService RecordÄÚµÄÆäËüÊôÐÔ¡£
Attribute Value£ºAttributeÖµ¡£
Service Class£º
ÿ¸öServi
Ïà¹ØÎĵµ£º
½ñÌ칫˾ÓиöͬÊÂŪÁ˸öRed Hat Enterprise 5×°£¬ÏµÍ³×°ºÃºó£¬·¢ÏÖtelnet²»ÄÜÓã¬sshÊÇ¿ÉÒԵġ£¸ãÁ˺þ㬲Ÿø¸ã¶¨£¬½áºÏÒÔǰժϵĹØÓÚÕâ·½ÃæµÄ×ÊÁÏ£¬²Î¿¼ÈçÏ£º
1¡£¸ÅÊöLinuxÌṩ·þÎñÊÇÓÉÔËÐÐÔÚºǫ́µÄÊØ»¤³ÌÐò£¨daemon£©À´Ö´Ðеġ£
ÊØ»¤½ø³ÌµÄ¹¤×÷¾ÍÊÇ´ò¿ª1¸ö¶Ë¿Ú£¨port£©£¬µÈ´ý£¨listen£©½øÈëµÄÁ¬½Ó¡£ÔÚC/SģʽÖУ¬Èç¹ ......
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
......
×î½üÒ»¸öÏîÄ¿µÄϵͳÓõÄÊÇSolaris 10£¬ËäÈ»ÒÔÇ°ÓõĶ¼ÊÇ Linuxϵͳ£¬µ«ÊÇLinuxϵͳÖеÄһЩÃüÁîºÍSolarisϵͳÊÇͨÓõģ¬ÎªÁË·½±ãÎÒÏÖÔÚÁгö²¿·Ö£¬ÒÔºó½Ðø¸üС£
¡¡1£© ²é¿´¿ª·Å¶Ë¿Ú
¡¡
¡¡¡¡Linux£º netstat -atn
¡¡
¡¡¡¡Solaris£º netstat -P tcp -f inet -an
¡¡
¡¡¡¡2£© ²é¿´Íø¿¨/ÍøÂç״̬
¡¡
¡¡¡¡ ......
Ç°Ãæ½²ÁËʹÓà ioctl·¢ËÍHCI CommandµÄ·½·¨¡£µ«HCI protocol»¹ÓÐһЩCommand£¬±ÈÈçInquiryµÈ£¬ËûÃÇÔò²»ÐèҪʹÓÃioctlÀ´·¢ËÍ¡£blueZ Ö±½ÓÌṩÁËÖ§³Ö£¬ËäÈ»ËûÃǵÄ×îÖÕ¶¼ÊÇÓÃͬÑù°ì·¨ÊµÏֵġ£
ÔÚÓ¦ÓóÌÐòÖУº
hci_inquiry(dev_id, length, num_rsp, NULL, &info, flags);
ÕâÑùÐèÒª°üº¬blueZ Í·ÎļþÈçÏ£º
#include //BT ......