PyBluezのadvertisse_service

advertise_service(sock, name, service_id=‘’, service_classes=, profiles=, provider=‘’, description=‘’)

Advertises a service with the local SDP server.

ローカルSDPサーバでサービスを提供します。

sock must be a bound, listening socket.

sockは縛られたリスニングソケットでなければなりません。

name should be the name of the service, and service_id (if specified) should be a string of the form “XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX”, where each ‘X’ is a hexadecimal digit.

nameはサービスの名前でないといけない。そして、service_id(指定されている場合)は”XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"のような文字列形式でないといけない。各Xは16進数である。

service_classes is a list of service classes whose this service belongs to.

service_classesはサービスクラスのリストであり、それはこのサービスに属する。

Each class service is a 16-bit UUID in the form “XXXX”, where each ‘X’ is a hexadecimal digit, or a 128-bit UUID in the form “XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX”.

各クラスサービスは"XXXX"の形式の16bitのUUID、もしくは"XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX”の形式の128bitのUUIDである。

There are some constants for standard services, e.g. SERIAL_PORT_CLASS that equals to “1101”.

基本的なサービスのためにいくつかの定石があり、"1101"はSERIAL_PORT_CLASSに等しい。

Some class constants: SERIAL_PORT_CLASS LAN_ACCESS_CLASS DIALUP_NET_CLASS HEADSET_CLASS CORDLESS_TELEPHONY_CLASS AUDIO_SOURCE_CLASS AUDIO_SINK_CLASS PANU_CLASS NAP_CLASS GN_CLASS profiles is a list of service profiles that thie service fulfills. Each profile is a tuple with ( uuid, version ).

SERIAL_PORT_CLASS LAN_ACCESS_CLASS DIALUP_NET_CLASS HEADSET_CLASS CORDLESS_TELEPHONY_CLASS AUDIO_SOURCE_CLASS AUDIO_SINK_CLASS PANU_CLASS NAP_CLASS GN_CLASSプロファイルはサービスが満たすサービスプロファイルのリストである。各プロファイルは(uuid,version)のタプルである。

Most standard profiles use standard classes as UUIDs.

ほとんどの標準プロファイルはUUIDとして標準的なクラスを使用する。

PyBluez offers a list of standard profiles, for example SERIAL_PORT_PROFILE.

PyBluezはSERIAL_PORT_PROFILEなどの標準プロファイルのリストを提供する。

All standard profiles have the same name as the classes, except that CLASS suffix is replaced by PROFILE.

全ての標準プロファイルはクラスとして同じ名前を持つ。ただし、CLASSサフィックスPROFILEに置き換えられる。

provider is a text string specifying the provider of the service

providerはサービスのプロバイダを指定するテキスト文字列である。

description is a text string describing the service

descriptionはサービスを説明するテキスト文字列である。

A note on working with Symbian smartphones: bt_discover in Python for Series 60 will only detect service records with service class SERIAL_PORT_CLASS and profile SERIAL_PORT_PROFILE