Javaでは、JSR-82を実装したライブラリを使います。
例:
bluecoveここでは、bluecoveを使います。
ライブラリをダウンロードし、Windowsなら、bluecove-2.1.0.jarを利用します。
このライブラリをアプリケーションにリンクします。
上記のHPにあるサンプルの、SPP関係は、動きませんでした。理由は分かりませんが、
uuidSet[0]=new UUID("1101",true);
と、falseから、trueに修正すると動作しました。
最初に、理解できなかったのは、UUIDでした。これは、以下のとおりです。
| Name |
Value |
Size |
| Base UUID Value (Used in promoting 16-bit and 32-bit UUIDs to 128-bit
UUIDs) |
0x0000000000001000800000805F9B34FB |
128-bit |
| SDP |
0x0001 |
16-bit |
| RFCOMM |
0x0003 |
16-bit |
| OBEX |
0x0008 |
16-bit |
| HTTP |
0x000C |
16-bit |
| L2CAP |
0x0100 |
16-bit |
| BNEP |
0x000F |
16-bit |
| Serial Port |
0x1101 |
16-bit |
| ServiceDiscoveryServerServiceClassID |
0x1000 |
16-bit |
| BrowseGroupDescriptorServiceClassID |
0x1001 |
16-bit |
| PublicBrowseGroup |
0x1002 |
16-bit |
| OBEX Object Push Profile |
0x1105 |
16-bit |
| OBEX File Transfer Profile |
0x1106 |
16-bit |
| Personal Area Networking User |
0x1115 |
16-bit |
| Network Access Point |
0x1116 |
16-bit |
| Group Network |
0x1117 |
16-bit |