linux»ñÈ¡ÍøÂç½Ó¿ÚÃû£ºÈçeth0
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<net/if.h>
static char *bad_interface_names[] = {
"lo:",
"lo",
"stf", /* pseudo-device 6to4 tunnel interface */
"gif", /* psuedo-device generic tunnel interface */
"dummy",
"vmnet",
NULL /* last entry must be NULL */
};
static int is_bad_interface_name(char *i) {
char **p;
for (p = bad_interface_names; *p; ++p)
if (strncmp(i, *p, strlen(*p)) == 0)
return 1;
return 0;
}
/* This finds the first interface which is up and is not the loopback
* interface or one of the interface types listed in bad_interface_names. */
static char *get_first_interface(void) {
struct if_nameindex * nameindex;
char *i = NULL;
int j = 0;
/* Use if_nameindex(3) instead? */
nameindex = if_nameindex();
if(nameindex == NULL) {
return NULL;
}
while(nameindex[j].if_index != 0) {
if (strcmp(nameindex[j].if_name, "lo") != 0 && !is_bad_interface_name(nameindex[j
Ïà¹ØÎĵµ£º
1. HCI²ãÐÒé¸ÅÊö£º
HCIÌṩһÌ×ͳһµÄ·½·¨À´·ÃÎÊBluetoothµ×²ã¡£ÈçͼËùʾ£º
´ÓͼÉÏ¿ÉÒÔ¿´³ö£¬Host Controller Interface(HCI) ¾ÍÊÇÓÃÀ´¹µÍ¨HostºÍModule¡£Hostͨ³£¾ÍÊÇPC£¬ ModuleÔòÊÇÒÔ¸÷ÖÖÎïÀíÁ¬½ÓÐÎʽ£¨USB,serial,pc-cardµÈ£©Á¬½Óµ½PCÉϵÄbluetooth Dongle¡£
ÔÚHostÕâÒ»¶Ë£ºapplication,SDP,L2capµÈÐÒé ......
Service Discovery Protocol(SDP)ÌṩһÖÖÄÜÁ¦£¬ÈÃÓ¦ÓóÌÐòÓз½·¨·¢ÏÖÄÄÖÖ·þÎñ¿ÉÓÃÒÔ¼°ÕâÖÖ·þÎñµÄÌØÐÔ¡£
·þÎñ·¢ÏÖÐÒé(SDP»òBluetooth SDP)ÔÚÀ¶ÑÀÐÒéÕ»ÖжÔÀ¶ÑÀ»·¾³ÖеÄÓ¦ÓóÌÐòÓÐÌØÊâµÄº¬Ò⣬·¢ÏÖÄĸö·þÎñÊÇ¿ÉÓõĺÍÈ·¶¨ÕâЩ¿ÉÓ÷þÎñµÄÌØÕ÷¡£SDP¶¨ÒåÁËbluetooth client·¢ÏÖ¿ÉÓÃbluetooth server·þÎñºÍËüÃǵÄÌØÕ÷µÄ·½·¨¡£ ......
ÀïѧϰlinuxÎļþϵͳ¼¼ÇÉ£¬¹ÒÔØUÅÌÊÇ·ñÁ¬½ÓµÄ¼¼ÇÉ£¬ÎÄÖÐÒÔ°¸Àý½²½â¡£ÍûÄܸø´ó¼Ò´øÀ´Ð¡Ð¡µÄ°ïÖú¡£
LinuxÎļþϵͳÊÇÒì²½µÄ£¬Ò²¾ÍÊÇ˵дһ¸öÎļþ²»ÊÇÁ¢¿Ì±£´æµ½½éÖÊ£¨Ó²ÅÌ£¬UÅ̵ȣ©ÖУ¬¶øÊÇ´æµ½»º³åÇøÄÚ£¬µÈ»ýÀÛµ½Ò»¶¨³Ì¶ÈÔÙÒ»Æð±£´æµ½½éÖÊÖС£Èç¹ûûÓÐumount¾Í·Ç·¨°Î³ö UÅÌ£¬³ÌÐòÊDz»ÖªµÀµÄ£¬fopen,fwriteµÈº¯Êý¶¼ÒÀÈ»·µ»ØÕý ......
Linux USBÇý¶¯¿ò¼Ü·ÖÎö£¨Ò»£©
³õ´Î½Ó´¥ÓëOSÏà¹ØµÄÉ豸Çý¶¯±àд£¬¸Ð¾õ»¹Í¦ÓÐÒâ˼µÄ£¬ÎªÁ˲»ÖÁÓÚÍüµô¿´¹ýµÄ¶«Î÷£¬±Ê¼Ç¸ú×ܽᵱȻ²»¿Éȱ£¬¸üºÎ¿öÎÒ¾ö¶¨ÎªÇ¶ÈëʽÂôÃüÁË¡£ºÃ£¬ÑÔ¹éÕý´«£¬ÎÒ˵һ˵Õâ¶Îʱ¼äµÄÊÕ»ñ£¬¸ú´ó¼Ò·ÖÏíÒ»ÏÂLinuxµÄÇý¶¯¿ª·¢¡£µ«Õâ´ÎÖ»ÏÈÕë¶ÔLinuxµÄUSB×Óϵͳ×÷·ÖÎö£¬ÒòΪÖÜÎåÑÐÌÖÀÏ°å´ß» ......
ÒÔÏÂÊÇÎҵIJâÊÔociµÄÀý×Ó£¡
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "oci.h"
static OCIServer *srvhp;
static OCISession *p_session;
static OCIEnv &nb ......