本文打算将蓝牙适配器和手机蓝牙进行配对。

买了个支持蓝牙4.0协议的蓝牙适配器,将其插入到pc(debian 7.4)的usb口。

查看手机蓝牙信息:

选择手机中"设置"->"关于手机"->"状态信息"可以看到蓝牙地址是18:DC:56:D2:1C:1A

pc上安装蓝牙工具:

  1. sudo apt-get install bluez bluez-hcidump

查看系统输出信息:

  1. $ dmesg | tail -n
  2. [25259.408121] usb -1.2: new full-speed USB device number using ehci_hcd
  3. [25259.614615] usb -1.2: New USB device found, idVendor=0a12, idProduct=
  4. [25259.614621] usb -1.2: New USB device strings: Mfr=, Product=, SerialNumber=
  5. [25259.614626] usb -1.2: Product: CSR8510 A10

查看蓝牙适配器设备信息:

  1. $ lsusb
  2. Bus Device : ID 1d6b: Linux Foundation 2.0 root hub
  3. Bus Device : ID 1d6b: Linux Foundation 1.1 root hub
  4. Bus Device : ID 1d6b: Linux Foundation 1.1 root hub
  5. Bus Device : ID 1d6b: Linux Foundation 1.1 root hub
  6. Bus Device : ID 1d6b: Linux Foundation 1.1 root hub
  7. Bus Device : ID 1a40: Terminus Technology Inc. -Port HUB
  8. Bus 001 Device 031: ID 0a12:0001 Cambridge Silicon Radio, Ltd Bluetooth Dongle (HCI mode)
  9. Bus Device : ID 046d:c05a Logitech, Inc. Optical Mouse M90
  10. Bus Device : ID 413c: Dell Computer Corp. Keyboard
  11. $ lsusb -s : -v
  12.  
  13. Bus Device : ID 0a12: Cambridge Silicon Radio, Ltd Bluetooth Dongle (HCI mode)
  14. Couldn't open device, some information will be missing
  15. Device Descriptor:
  16. bLength
  17. bDescriptorType
  18. bcdUSB 2.00
  19. bDeviceClass Wireless
  20. bDeviceSubClass Radio Frequency
  21. bDeviceProtocol Bluetooth
  22. bMaxPacketSize0
  23. idVendor 0x0a12 Cambridge Silicon Radio, Ltd
  24. idProduct 0x0001 Bluetooth Dongle (HCI mode)
  25. bcdDevice 88.91
  26. iManufacturer
  27. iProduct
  28. iSerial
  29. bNumConfigurations
  30. Configuration Descriptor:
  31. bLength
  32. bDescriptorType
  33. wTotalLength
  34. bNumInterfaces
  35. bConfigurationValue
  36. iConfiguration
  37. bmAttributes 0xe0
  38. Self Powered
  39. Remote Wakeup
  40. MaxPower 100mA
  41. Interface Descriptor:
  42. bLength
  43. bDescriptorType
  44. bInterfaceNumber
  45. bAlternateSetting
  46. bNumEndpoints
  47. bInterfaceClass Wireless
  48. bInterfaceSubClass Radio Frequency
  49. bInterfaceProtocol Bluetooth
  50. iInterface
  51. Endpoint Descriptor:
  52. bLength
  53. bDescriptorType
  54. bEndpointAddress 0x81 EP IN
  55. bmAttributes
  56. Transfer Type Interrupt
  57. Synch Type None
  58. Usage Type Data
  59. wMaxPacketSize 0x0010 1x bytes
  60. bInterval
  61. Endpoint Descriptor:
  62. bLength
  63. bDescriptorType
  64. bEndpointAddress 0x02 EP OUT
  65. bmAttributes
  66. Transfer Type Bulk
  67. Synch Type None
  68. Usage Type Data
  69. wMaxPacketSize 0x0040 1x bytes
  70. bInterval
  71. Endpoint Descriptor:
  72. bLength
  73. bDescriptorType
  74. bEndpointAddress 0x82 EP IN
  75. bmAttributes
  76. Transfer Type Bulk
  77. Synch Type None
  78. Usage Type Data
  79. wMaxPacketSize 0x0040 1x bytes
  80. bInterval
  81. Interface Descriptor:
  82. bLength
  83. bDescriptorType
  84. bInterfaceNumber
  85. bAlternateSetting
  86. bNumEndpoints
  87. bInterfaceClass Wireless
  88. bInterfaceSubClass Radio Frequency
  89. bInterfaceProtocol Bluetooth
  90. iInterface
  91. Endpoint Descriptor:
  92. bLength
  93. bDescriptorType
  94. bEndpointAddress 0x03 EP OUT
  95. bmAttributes
  96. Transfer Type Isochronous
  97. Synch Type None
  98. Usage Type Data
  99. wMaxPacketSize 0x0000 1x bytes
  100. bInterval
  101. Endpoint Descriptor:
  102. bLength
  103. bDescriptorType
  104. bEndpointAddress 0x83 EP IN
  105. bmAttributes
  106. Transfer Type Isochronous
  107. Synch Type None
  108. Usage Type Data
  109. wMaxPacketSize 0x0000 1x bytes
  110. bInterval
  111. Interface Descriptor:
  112. bLength
  113. bDescriptorType
  114. bInterfaceNumber
  115. bAlternateSetting
  116. bNumEndpoints
  117. bInterfaceClass Wireless
  118. bInterfaceSubClass Radio Frequency
  119. bInterfaceProtocol Bluetooth
  120. iInterface
  121. Endpoint Descriptor:
  122. bLength
  123. bDescriptorType
  124. bEndpointAddress 0x03 EP OUT
  125. bmAttributes
  126. Transfer Type Isochronous
  127. Synch Type None
  128. Usage Type Data
  129. wMaxPacketSize 0x0009 1x bytes
  130. bInterval
  131. Endpoint Descriptor:
  132. bLength
  133. bDescriptorType
  134. bEndpointAddress 0x83 EP IN
  135. bmAttributes
  136. Transfer Type Isochronous
  137. Synch Type None
  138. Usage Type Data
  139. wMaxPacketSize 0x0009 1x bytes
  140. bInterval
  141. Interface Descriptor:
  142. bLength
  143. bDescriptorType
  144. bInterfaceNumber
  145. bAlternateSetting
  146. bNumEndpoints
  147. bInterfaceClass Wireless
  148. bInterfaceSubClass Radio Frequency
  149. bInterfaceProtocol Bluetooth
  150. iInterface
  151. Endpoint Descriptor:
  152. bLength
  153. bDescriptorType
  154. bEndpointAddress 0x03 EP OUT
  155. bmAttributes
  156. Transfer Type Isochronous
  157. Synch Type None
  158. Usage Type Data
  159. wMaxPacketSize 0x0011 1x bytes
  160. bInterval
  161. Endpoint Descriptor:
  162. bLength
  163. bDescriptorType
  164. bEndpointAddress 0x83 EP IN
  165. bmAttributes
  166. Transfer Type Isochronous
  167. Synch Type None
  168. Usage Type Data
  169. wMaxPacketSize 0x0011 1x bytes
  170. bInterval
  171. Interface Descriptor:
  172. bLength
  173. bDescriptorType
  174. bInterfaceNumber
  175. bAlternateSetting
  176. bNumEndpoints
  177. bInterfaceClass Wireless
  178. bInterfaceSubClass Radio Frequency
  179. bInterfaceProtocol Bluetooth
  180. iInterface
  181. Endpoint Descriptor:
  182. bLength
  183. bDescriptorType
  184. bEndpointAddress 0x03 EP OUT
  185. bmAttributes
  186. Transfer Type Isochronous
  187. Synch Type None
  188. Usage Type Data
  189. wMaxPacketSize 0x0019 1x bytes
  190. bInterval
  191. Endpoint Descriptor:
  192. bLength
  193. bDescriptorType
  194. bEndpointAddress 0x83 EP IN
  195. bmAttributes
  196. Transfer Type Isochronous
  197. Synch Type None
  198. Usage Type Data
  199. wMaxPacketSize 0x0019 1x bytes
  200. bInterval
  201. Interface Descriptor:
  202. bLength
  203. bDescriptorType
  204. bInterfaceNumber
  205. bAlternateSetting
  206. bNumEndpoints
  207. bInterfaceClass Wireless
  208. bInterfaceSubClass Radio Frequency
  209. bInterfaceProtocol Bluetooth
  210. iInterface
  211. Endpoint Descriptor:
  212. bLength
  213. bDescriptorType
  214. bEndpointAddress 0x03 EP OUT
  215. bmAttributes
  216. Transfer Type Isochronous
  217. Synch Type None
  218. Usage Type Data
  219. wMaxPacketSize 0x0021 1x bytes
  220. bInterval
  221. Endpoint Descriptor:
  222. bLength
  223. bDescriptorType
  224. bEndpointAddress 0x83 EP IN
  225. bmAttributes
  226. Transfer Type Isochronous
  227. Synch Type None
  228. Usage Type Data
  229. wMaxPacketSize 0x0021 1x bytes
  230. bInterval
  231. Interface Descriptor:
  232. bLength
  233. bDescriptorType
  234. bInterfaceNumber
  235. bAlternateSetting
  236. bNumEndpoints
  237. bInterfaceClass Wireless
  238. bInterfaceSubClass Radio Frequency
  239. bInterfaceProtocol Bluetooth
  240. iInterface
  241. Endpoint Descriptor:
  242. bLength
  243. bDescriptorType
  244. bEndpointAddress 0x03 EP OUT
  245. bmAttributes
  246. Transfer Type Isochronous
  247. Synch Type None
  248. Usage Type Data
  249. wMaxPacketSize 0x0031 1x bytes
  250. bInterval
  251. Endpoint Descriptor:
  252. bLength
  253. bDescriptorType
  254. bEndpointAddress 0x83 EP IN
  255. bmAttributes
  256. Transfer Type Isochronous
  257. Synch Type None
  258. Usage Type Data
  259. wMaxPacketSize 0x0031 1x bytes
  260. bInterval

安装bluez后,会提供两个工具hciconfig和hcitool进行蓝牙相关的配置。

查看当前蓝牙适配器参数配置:

  1. $ sudo hciconfig -a
  2. hci0: Type: BR/EDR Bus: USB
  3. BD Address: :1A:7D:DA:: ACL MTU: : SCO MTU: :
  4. UP RUNNING PSCAN
  5. RX bytes: acl: sco: events: errors:
  6. TX bytes: acl: sco: commands: errors:
  7. Features: 0xff 0xff 0x8f 0xfe 0xdb 0xff 0x5b 0x87
  8. Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3
  9. Link policy: RSWITCH HOLD SNIFF PARK
  10. Link mode: SLAVE ACCEPT
  11. Name: 'debian-0'
  12. Class: 0x420100
  13. Service Classes: Networking, Telephony
  14. Device Class: Computer, Uncategorized
  15. HCI Version: 4.0 (0x6) Revision: 0x22bb
  16. LMP Version: 4.0 (0x6) Subversion: 0x22bb
  17. Manufacturer: Cambridge Silicon Radio ()

蓝牙适配器的mac地址是: 00:1A:7D:DA:71:13,名称是debian-0。

查看蓝牙适配器提供的各种功能:

  1. $ sdptool browse local
  2. Browsing FF:FF:FF::: ...
  3. Service Name: SIM Access Server
  4. Service RecHandle: 0x10000
  5. Service Class ID List:
  6. "SIM Access" (0x112d)
  7. "Generic Telephony" (0x1204)
  8. Protocol Descriptor List:
  9. "L2CAP" (0x0100)
  10. "RFCOMM" (0x0003)
  11. Channel:
  12. Profile Descriptor List:
  13. "SIM Access" (0x112d)
  14. Version: 0x0101
  15.  
  16. Service Name: Headset Audio Gateway
  17. Service RecHandle: 0x10001
  18. Service Class ID List:
  19. "Headset Audio Gateway" (0x1112)
  20. "Generic Audio" (0x1203)
  21. Protocol Descriptor List:
  22. "L2CAP" (0x0100)
  23. "RFCOMM" (0x0003)
  24. Channel:
  25. Profile Descriptor List:
  26. "Headset" (0x1108)
  27. Version: 0x0102
  28.  
  29. Service Name: Hands-Free Audio Gateway
  30. Service RecHandle: 0x10002
  31. Service Class ID List:
  32. "Handsfree Audio Gateway" (0x111f)
  33. "Generic Audio" (0x1203)
  34. Protocol Descriptor List:
  35. "L2CAP" (0x0100)
  36. "RFCOMM" (0x0003)
  37. Channel:
  38. Profile Descriptor List:
  39. "Handsfree" (0x111e)
  40. Version: 0x0105
  41.  
  42. Service Name: AVRCP TG
  43. Service RecHandle: 0x10003
  44. Service Class ID List:
  45. "AV Remote Target" (0x110c)
  46. Protocol Descriptor List:
  47. "L2CAP" (0x0100)
  48. PSM:
  49. "AVCTP" (0x0017)
  50. uint16: 0x103
  51. Profile Descriptor List:
  52. "AV Remote" (0x110e)
  53. Version: 0x0103
  54.  
  55. Service Name: AVRCP CT
  56. Service RecHandle: 0x10004
  57. Service Class ID List:
  58. "AV Remote" (0x110e)
  59. Protocol Descriptor List:
  60. "L2CAP" (0x0100)
  61. PSM:
  62. "AVCTP" (0x0017)
  63. uint16: 0x103
  64. Profile Descriptor List:
  65. "AV Remote" (0x110e)
  66. Version: 0x0100
  67.  
  68. Service Name: Dial-Up Networking
  69. Service RecHandle: 0x10005
  70. Service Class ID List:
  71. "Dialup Networking" (0x1103)
  72. "Generic Networking" (0x1201)
  73. Protocol Descriptor List:
  74. "L2CAP" (0x0100)
  75. "RFCOMM" (0x0003)
  76. Channel:
  77. Profile Descriptor List:
  78. "Dialup Networking" (0x1103)
  79. Version: 0x0100
  80.  
  81. Service Name: OBEX Object Push
  82. Service RecHandle: 0x10006
  83. Service Class ID List:
  84. "OBEX Object Push" (0x1105)
  85. Protocol Descriptor List:
  86. "L2CAP" (0x0100)
  87. "RFCOMM" (0x0003)
  88. Channel:
  89. "OBEX" (0x0008)
  90. Profile Descriptor List:
  91. "OBEX Object Push" (0x1105)
  92. Version: 0x0100
  93.  
  94. Service Name: OBEX File Transfer
  95. Service RecHandle: 0x10007
  96. Service Class ID List:
  97. "OBEX File Transfer" (0x1106)
  98. Protocol Descriptor List:
  99. "L2CAP" (0x0100)
  100. "RFCOMM" (0x0003)
  101. Channel:
  102. "OBEX" (0x0008)
  103. Profile Descriptor List:
  104. "OBEX File Transfer" (0x1106)
  105. Version: 0x0100

扫描蓝牙设备:

  1. $ hcitool scan
  2. Scanning ...
  3. C4::FE:F6::FF PC-
  4. CC::AF:4F:: HR-6F1397D64651
  5. 18:DC:56:D2:1C:1A Coolpad 8297

使用hcitool获取手机蓝牙信息:

  1. $ hcitool name :DC::D2:1C:1A
  2. Coolpad
  3. $ sudo hcitool info :DC::D2:1C:1A
  4. Requesting information ...
  5. BD Address: :DC::D2:1C:1A
  6. Device Name: Coolpad
  7. LMP Version: 4.0 (0x6) LMP Subversion: 0x0
  8. Manufacturer: MediaTek, Inc. ()
  9. Features page : 0xbf 0x3e 0x8d 0xfe 0xdb 0xff 0x5b 0x87
  10. <-slot packets> <-slot packets> <encryption> <slot offset>
  11. <timing accuracy> <role switch> <sniff mode> <RSSI>
  12. <channel quality> <SCO link> <HV2 packets> <HV3 packets>
  13. <CVSD> <power control> <transparent SCO> <broadcast encrypt>
  14. <EDR ACL Mbps> <EDR ACL Mbps> <enhanced iscan>
  15. <interlaced iscan> <interlaced pscan> <inquiry with RSSI>
  16. <extended SCO> <EV4 packets> <EV5 packets> <AFH cap. slave>
  17. <AFH class. slave> <LE support> <-slot EDR ACL>
  18. <-slot EDR ACL> <sniff subrating> <pause encryption>
  19. <AFH cap. master> <AFH class. master> <EDR eSCO Mbps>
  20. <EDR eSCO Mbps> <-slot EDR eSCO> <extended inquiry>
  21. <LE and BR/EDR> <simple pairing> <encapsulated PDU>
  22. <non-flush flag> <LSTO> <inquiry TX power> <EPC>
  23. <extended features>
  24. Features page : 0x03 0x00 0x00 0x00 0x00 0x00 0x00 0x00
  25. Features page : 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00

配置蓝牙适配器使得能被其他设备搜索到:

  1. $ sudo hciconfig hci0 iscan

这时在手机中搜索蓝牙设备可以搜索到"debian-0",但是使用手机配对时提示“PIN或者配对密钥不正确,无法和debian-0进行配对"。

在执行下面几条命令:

  1. $ sudo hciconfig hci0 pscan
  2. $ sudo hciconfig hci0 noencrypt
  3. $ sudo hciconfig hci0 noauth

然后在手机里可以对"debian-0"配对即可配对成功。

此时可以在pc上执行l2ping命令 :

  1. host@debian:~$ sudo l2ping -c :DC::D2:1C:1A
  2. [sudo] password for host:
  3. Ping: :DC::D2:1C:1A from :1A:7D:DA:: (data size ) ...
  4. bytes from :DC::D2:1C:1A id time .00ms
  5. bytes from :DC::D2:1C:1A id time .16ms
  6. bytes from :DC::D2:1C:1A id time .14ms
  7. sent, received, % loss

如果不使用上面的hciconfig命令来进行配置,也可以使用blueman或者gnome-bluetooth来配置蓝牙,安装这些工具:

  1. sudo apt-get install blueman gnome-bluetooth

这两个工具都是图形化界面,使用起来相当方便,只是需要从手机端发起配对请求,然后在pc端和手机端分别进行确认即完成配对。

然后可以在pc端用蓝牙来向手机发送文件。

上面这两种情况下都是在手机端发起配对请求,之后也只是能通过蓝牙发文件。

但我希望能够使用bluez系列工具中提供的命令行工具从pc端发起配对请求,以便于以后将蓝牙适配器用到嵌入式开发板上。

参考《在linux下蓝牙使用rfcomm连接》 、《BluetoothUser》以及《Bluetooth_Mouse》进行操作,但都没成功,

这是因为我使用的bluez版本是4.99,没有bluez5中的bluetoothctl工具,也没有bluez4中的hidd工具,也没有常用的bluez3中的/etc/bluetooth/hcid.conf配置文件,

进行配对时总是会因为pin或者key的问题而导致配对失败,导致网络上大部分教程都不适用于这个版本。

最终我选用了另一种方式,先从手机来对蓝牙设备进行配对,然后将其模式修改成master,再从pc下执行命令就可以了。

首先配置rfcomm,修改/etc/bluetooth/rfcomm.conf(其实我不确定是否需要该配置,只是在参考网络文章时修改了这个配置文件):

  1. host@debian:~$ cat /etc/bluetooth/rfcomm.conf
  2. #
  3. # RFCOMM configuration file.
  4. #
  5.  
  6. rfcomm0 {
  7. # Automatically bind the device at startup
  8. bind no;
  9.  
  10. # Bluetooth address of the device
  11. device :DC::D2:1C:1A;
  12.  
  13. # RFCOMM channel for the connection
  14. channel ;
  15.  
  16. # Description of the connection
  17. comment "Example Bluetooth device";
  18. }

重启蓝牙服务:

  1. sudo /etc/init.d/bluetooth restart

可以使用hcidump(类似于tcpdump工具能够打印bluez中每步都执行了什么功能,可以用于调试):

  1. sudo hcidump -Xt

按照前面的步骤从手机来对蓝牙适配器进行配对,可以配对成功。

查看hci0(类似于网卡的eth0接口)的连接模式(link mode,可以是master或者slave):

  1. $ sudo hciconfig hci0 lm
  2. hci0: Type: BR/EDR Bus: USB
  3. BD Address: :1A:7D:DA:: ACL MTU: : SCO MTU: :
  4. Link mode: SLAVE ACCEPT

将其连接模式从SLAVE修改为master:

  1. sudo hciconfig hci0 lm master

这时查看连接模式:

  1. $ sudo hciconfig hci0 lm
  2. [sudo] password for host:
  3. hci0: Type: BR/EDR Bus: USB
  4. BD Address: :1A:7D:DA:: ACL MTU: : SCO MTU: :
  5. Link mode: MASTER

已经将link mode修改为master模式。

使用rfcomm来连接手机蓝牙设备:

  1. $ sudo rfcomm connect hci0 :DC::D2:1C:1A
  2. Connected /dev/rfcomm0 to :DC::D2:1C:1A on channel
  3. Press CTRL-C for hangup

连接成功,查看连接信息:

  1. $ sudo hcitool con
  2. Connections:
  3. < ACL :DC::D2:1C:1A handle state lm MASTER AUTH ENCRYPT

可以执行hcitool中的cmd命令,例如下面的命令将当前设备的名称改成"ABCD":

  1. $ sudo hcitool cmd 0x03 0x0013 0x41 0x42 0x43 0x44
  2. < HCI Command: ogf 0x03, ocf 0x0013, plen
  3.  
  4. > HCI Event: 0x0e plen
  5. 0C

此时在hcidump对应窗口显示下面的信息:

  1. -- ::22.929405 < HCI Command: Write Local Name (0x03|0x0013) plen
  2. name 'ABCDBCD'
  3. -- ::22.930381 > HCI Event: Command Complete (0x0e) plen
  4. Write Local Name (0x03|0x0013) ncmd
  5. status 0x00
  6. -- ::22.930474 < HCI Command: Read Local Name (0x03|0x0014) plen
  7. -- ::22.947378 > HCI Event: Command Complete (0x0e) plen
  8. Read Local Name (0x03|0x0014) ncmd
  9. status 0x00 name 'ABCD'

使用hciconfig工具也可以查看到当前蓝牙适配器名称:

  1. $ sudo hciconfig hci0 name
  2. hci0: Type: BR/EDR Bus: USB
  3. BD Address: :1A:7D:DA:: ACL MTU: : SCO MTU: :
  4. Name: 'ABCD'

可以看到蓝牙适配器的名称已经被改成ABCD了。

还有其他很多命令都可以用hcitool hci0 cmd来进行配置,《利用 hcitool 通过hci 命令与芯片交互》中提供了其他的一些命令,感兴趣的话可以自己玩玩看。

也可以下载《蓝牙4.0规范》,从704-1103页有关于蓝牙命令的详细说明。

debian下蓝牙适配器的配置和使用的更多相关文章

  1. debian下mysql主从配置

    1.确保master/slave只有一份/etc/mysql/my.cnf , 不要在其他地方再有my.cnf (如/etc/my.cnf  /usr/local之类) 2.master配置: 在[m ...

  2. debian下samba配置

    debian下samba配置  http://blog.chinaunix.net/uid-2282111-id-2113216.html 服务器端配置过程:1. apt-get install sa ...

  3. Debian下配置防火墙iptables

    debian下iptables输入命令后即时生效,但重启之后配置就会消失,可用iptables-save快速保存配置,因为Debian上iptables是不会保存规则的,然后在开机自动的时候让ipta ...

  4. debian下配置keepalived ha

    抄袭自http://blog.51yip.com/server/1417.html,做了一些修改 可以参考http://blog.linuxphp.org/archives/1615/ 备注:NAT模 ...

  5. debian下安装zendframework

    第一步,打开apache的rewrite模块,因为在debian下使用apache必须执行这一步 a2enmod rewrite #激活rewrite模块 /etc/init.d/apache2 re ...

  6. debian下使用gitosis+gitweb搭建SSH认证的git服务器

    搭建完成Git服务器后,需要使用两台机器进行测试,一台机器作为服务器端server,一台服务器作为客户端client.整个系统,需要三个计算机账户,这里假设server端的账户名为git,client ...

  7. Debian 入门安装与配置2

    Debian 入门安装与配置2 1. C/C++开发必装软件 atp-get install gcc    这个不用说,用来编译C程序 apt-get install g++ 用来编译C++程序 ap ...

  8. Debian 入门安装与配置1

    Debian 入门安装与配置1 最近安装了多个发行版本的Linux,包括Ubuntu.Fedora.Centos和Debian,发现只有Debian在界面和稳定性等综合特性上表现最优,自己也最喜欢,所 ...

  9. debian下软件包管理方式总结

    linux最流行的包管理方式除了rpm之外就是debian的deb格式了.目前采用deb管理方式的主流操作系统主要有debian和ubuntu系列.和rpm包管理方式不同的是,虽然debian也有包含 ...

随机推荐

  1. oc 把view添加到rootcontrollerview控制的view

    在当前活跃的window 添加一个view [[[[[UIApplication sharedApplication] keyWindow] rootViewController] view] add ...

  2. 防止Spinner初始化加载

    spinner在初始化的时候会自动调用一次OnItemSelectedListener,我们很多时候需要他不加载这一次,使用下面的代码spinner.setSelection(0, true);

  3. 动态添加ImageView 设置setPadding不起作用问题

    imageView = new ImageView(NavigationActivity.this); imageView.setLayoutParams(new LayoutParams(12,12 ...

  4. GDBus

    1. https://en.wikipedia.org/wiki/D-Bus In computing, D-Bus (for "Desktop Bus"[4]), a softw ...

  5. Hadoop 中的 ArrayWritable

    虽然ArrayWritable不是接口,但貌似必须要子类去extends ArrayWritable,不能直接用ArrayWriable 否则会报下面的错误?(不是很确定) java.lang.Exc ...

  6. docker教程之从一头雾水到不一头雾水(3)

    本文主要是介绍Docker容器的相关内容 容器创建 我们已经知道,镜像是只读的,而基于镜像创建出来的容器是可读写的,所以,一般我们实际中,会经常使用对应镜像创建容器并且使用这些容器.同样,如果我们想要 ...

  7. github上比較好的开源项目(持续更新)

    1:https://github.com/Skykai521/StickerCamera 实现相机功能 实现对图片进行裁剪的功能 图片的滤镜功能 能为图片加入贴纸(贴纸可移动,放大,旋转) 能为图片加 ...

  8. python 用win32修改注册表,修改打开IE浏览器的配置

    打开注册表:win+r, regedit,注册表的管理是按照文件夹的形式的. 注册表总共有五项: HKEY_CLASSES_ROOT 是HKEY_LOCAL_MACHINE\Software的子项,保 ...

  9. 【JMeter4.0学习(五)】JMeter对服务器监控测试脚本开发

    目录: 下载相关JMeter插件 服务器监控测试脚本开发 附:参考相关文档 本文主要来说一下如何通过JMeter插件来监控服务器CPU.内存.磁盘.网络等相关资源. 一.首先,需要下载相关JMeter ...

  10. Root(hdu5777+扩展欧几里得+原根)

    Root                                                                          Time Limit: 30000/1500 ...