Part 1
요약·해설
Media client·server, object transfer와 search의 공식 console 예제 16개를 보존했습니다.
MCC
MCS · MPL
OTS · OTC
16
Part 2
접을 수 있는 영어 원문 전체
영어 원문 전체 펼치기
3F8AE4F21BC52345097689F024DD0670AA27DED64CBDB524E5887E2F2AEB4DDC
Media control for Generic Audio Content Control
###############################################
This document describes how to run the media control functionality,
using the shell, both as a client and as a server.
The media control server consists of to parts. There is a media
player (mpl) that contains the logic to handle media, and there is a
media control service (mcs) that serves as a GATT-based interface to
the player. The media control client consists of one part, the GATT
based client (mcc).
The media control server may include an object transfer service (ots)
and the media control client may include an object transfer client
(otc). When these are included, a richer set of functionality is
available.
The media control server and client both implement the Generic Media
Control Service (only), and do not use any underlying Media Control
Services.
Note that in the examples below, in many cases the debug output has
been removed and long outputs may have been shortened to make the
examples shorter and clearer.
Also note that this documentation does not list all shell commands, it
just shows examples of some of them. The set of commands is
explorable from the mcc shell and the mpl shell, by typing :code:`mcc`
or :code:`mpl` and pressing TAB. A help text for each command can be
found by doing :samp:`mcc {<command>} help` or :samp:`mpl {<command>} help`.
Overview
********
A media player has a *name* and an *icon* that allows identification
of the player for the user.
The content of the media player is structured into tracks and groups.
A media player has a number of groups. A group contains tracks and
other groups. (In this implementation, a group only contains tracks,
not other groups.) Tracks can be divided into segments.
An active player will have a *current track*. This is the track that
is playing now (if the player is playing). The current track has a
*title*, a *duration* (given in hundredths of a second) and a
*position* - the current position of the player within the track.
There is also a *current group* (the group of the current track), a
*parent group* (the parent group of the current group) and a *next
track*.
The media player is in a *state*, which will be one of playing,
paused, seeking or inactive. When playing, playback happens at a
given *playback speed*, and the tracks are played according to the
*playing order*, which is one of the *playing orders supported*.
Track changes are signalled as notifications of the *track changed*
characteristic. When seeking (fast forward or fast rewind), the track
position is moved according to the *seeking speed*.
The *opcodes supported* tells which operations are supported by the
player by writing to the *media control point*. There is also a
*search control point* that allows to search for groups and tracks
according to various criteria, with the result returned in the *search
results*.
Finally, the *content control ID* is used to associate the media
player with an audio stream.
Media Control Client (MCP)
**************************
The media control client is used to control, and to get information
from, a media control server. Control is done by writing to one of
the two control points, or by writing to other writable
characteristics. Getting information is done by reading
characteristics, or by configuring the server to send notifications.
Using the media control client
==============================
Before use, the media control client must be initialized by the
command :code:`mcc init`.
To achieve a connection to the peer, the :code:`bt` commands must be
used - :code:`bt init` followed by :code:`bt advertise on` (or
:code:`bt connect` if the server is advertising).
When the media control client is connected to a media control server,
the client can discover the server's Generic Media Control Service, by
giving the command :code:`mcc discover_mcs`. This will store the
handles of the service, and (optionally, but default) subscribe to all
notifications.
After discovery, the media control client can read and write
characteristics, including the media control point and the search
control point.
Example usage
=============
Setup
-----
.. code-block:: console
uart:~$ bt init
Bluetooth initialized
uart:~$ mcc init
MCC init complete
uart:~$ bt advertise on
Advertising started
Connected: F6:58:DC:27:F3:57 (random)
When connected
--------------
Service discovery (GMCS and included OTS):
.. code-block:: console
uart:~$ mcc discover_mcs
<dbg> bt_mcc.bt_mcc_discover_mcs: start discovery of MCS primary service
<dbg> bt_mcc.discover_primary_func: [ATTRIBUTE] handle 0x00ae
<dbg> bt_mcc.discover_primary_func: Primary discovery complete
<dbg> bt_mcc.discover_primary_func: UUID: 2800
<dbg> bt_mcc.discover_primary_func: UUID: 8fd7
<dbg> bt_mcc.discover_primary_func: Start discovery of MCS characteristics
<dbg> bt_mcc.discover_mcs_char_func: [ATTRIBUTE] handle 0x00b0
<dbg> bt_mcc.discover_mcs_char_func: Player name, UUID: 8fa0
<dbg> bt_mcc.discover_mcs_char_func: [ATTRIBUTE] handle 0x00b2
<dbg> bt_mcc.discover_mcs_char_func: Icon Object, UUID: 8fa1
<dbg> bt_mcc.discover_mcs_char_func: [ATTRIBUTE] handle 0x00b4
<dbg> bt_mcc.discover_mcs_char_func: Icon URI, UUID: 8fa2
<dbg> bt_mcc.discover_mcs_char_func: [ATTRIBUTE] handle 0x00b6
<dbg> bt_mcc.discover_mcs_char_func: Track Changed, UUID: 8fa3
<dbg> bt_mcc.discover_mcs_char_func: Subscribing - handle: 0x00b6
[...]
<dbg> bt_mcc.discover_mcs_char_func: [ATTRIBUTE] handle 0x00ea
<dbg> bt_mcc.discover_mcs_char_func: Content Control ID, UUID: 8fb5
<dbg> bt_mcc.discover_mcs_char_func: Setup complete for MCS
<dbg> bt_mcc.discover_mcs_char_func: Start discovery of included services
<dbg> bt_mcc.discover_include_func: [ATTRIBUTE] handle 0x00af
<dbg> bt_mcc.discover_include_func: Include UUID 1825
<dbg> bt_mcc.discover_include_func: Discover include complete for MCS: OTS
<dbg> bt_mcc.discover_include_func: Start discovery of OTS characteristics
<dbg> bt_mcc.discover_otc_char_func: [ATTRIBUTE] handle 0x009c
<dbg> bt_mcc.discover_otc_char_func: OTS Features
[...]
<dbg> bt_mcc.discover_otc_char_func: [ATTRIBUTE] handle 0x00ac
<dbg> bt_mcc.discover_otc_char_func: Object Size
Discovery complete
<dbg> bt_otc.bt_otc_register: 0
<dbg> bt_otc.bt_otc_register: L2CAP psm 0x 25 sec_level 1 registered
<dbg> bt_mcc.discover_otc_char_func: Setup complete for OTS 1 / 1
uart:~$
Reading characteristics - the player name and the track duration as
examples:
.. code-block:: console
uart:~$ mcc read_player_name
Player name: My media player
4d 79 20 6d 65 64 69 61 20 70 6c 61 79 65 72 |My media player
uart:~$ mcc read_track_duration
Track duration: 6300
Note that the value of some characteristics may be truncated due to
being too long to fit in the ATT packet. Increasing the ATT MTU may
help:
.. code-block:: console
uart:~$ mcc read_track_title
Track title: Interlude #1 (Song for
uart:~$ gatt exchange-mtu
Exchange pending
Exchange successful
uart:~$ mcc read_track_title
Track title: Interlude #1 (Song for Alison)
Writing characteristics - track position as an example:
The track position is where the player "is" in the current track.
Read the track position, change it by writing to it, confirm by
reading it again.
.. code-block:: console
uart:~$ mcc read_track_position
Track Position: 0
uart:~$ mcc set_track_position 500
Track Position: 500
uart:~$ mcc read_track_position
Track Position: 500
Controlling the player via the control point:
Writing to the control point allows the client to request the server
to do operations like play, pause, fast forward, change track, change
group and so on. Some operations (e.g. goto track) take an argument.
Currently, raw opcode values are used as input to the control point
shell command. These opcode values can be found in the mpl.h header
file.
Send the play command (opcode "1"), the command to go to track (opcode
"52") number three, and the pause command (opcode "2"):
.. code-block:: console
uart:~$ mcc set_cp 1
Media State: 1
Operation: 1, result: 1
Operation: 1, param: 0
uart:~$ mcc set_cp 52 3
Track changed
Track title: Interlude #3 (Levanto Seventy)
Track duration: 7800
Track Position: 0
Current Track Object ID: 0x000000000104
Next Track Object ID: 0x000000000105
Operation: 52, result: 1
Operation: 52, param: 3
uart:~$ mcc set_cp 2
Media State: 2
Operation: 2, result: 1
Operation: 2, param: 0
Using the included object transfer client
-----------------------------------------
When object transfer is supported by both the client and the server, a
larger set of characteristics is available. These include object IDs
for the various track and group objects. These IDs can be used to
select and download the corresponding objects from the server's object
transfer service.
Read the object ID of the current group object:
.. code-block:: console
uart:~$ mcc read_current_group_obj_id
Current Group Object ID: 0x000000000107
Select the object with that ID:
.. code-block:: console
uart:~$ mcc ots_select 0x107
Selecting object succeeded
Read the object's metadata:
.. code-block:: console
uart:~$ mcc ots_read_metadata
Reading object metadata succeeded
<inf> bt_mcc: Object's meta data:
<inf> bt_mcc: Current size :35
<inf> bt_otc: --- Displaying 1 metadata records ---
<inf> bt_otc: Object ID: 0x000000000107
<inf> bt_otc: Object name: Joe Pass - Guitar Inte
<inf> bt_otc: Object Current Size: 35
<inf> bt_otc: Object Allocate Size: 35
<inf> bt_otc: Type: Group Obj Type
<inf> bt_otc: Properties:0x4
<inf> bt_otc: - read permitted
Read the object itself:
The object received is a group object. It consists of a series of
records consisting of a type (track or group) and an object ID.
.. code-block:: console
uart:~$ mcc ots_read_current_group_object
<dbg> bt_mcc.on_group_content: Object type: 0, object ID: 0x000000000102
<dbg> bt_mcc.on_group_content: Object type: 0, object ID: 0x000000000103
<dbg> bt_mcc.on_group_content: Object type: 0, object ID: 0x000000000104
<dbg> bt_mcc.on_group_content: Object type: 0, object ID: 0x000000000105
<dbg> bt_mcc.on_group_content: Object type: 0, object ID: 0x000000000106
Search
------
The search control point takes as its input a sequence of search
control items, each consisting of length, type (e.g. track name or
artist name) and parameter (the track name or artist name to search
for). If the result is successful, the search results are stored in
an object in the object transfer service. The ID of the search
results ID object can be read from the search results object ID
characteristic. The search result object can then be downloaded as
for the current group object above. (Note that the search results
object ID is empty until a search has been done.)
This implementation has a working implementation of the search
functionality interface and the server-side search control point
parameter parsing. But the **actual searching is faked**, the same
results are returned no matter what is searched for.
There are two commands for search, one (:code:`mcc set_scp_raw`)
allows to input the search control point parameter (the sequence of
search control items) as a string. The other (:code:`mcc
set_scp_ioptest`) does preset IOP test searches and takes the round
number of the IOP search control point test as a parameter.
Before the search, the search results object ID is empty
.. code-block:: console
uart:~$ mcc read_search_results_obj_id
Search Results Object ID: 0x000000000000
<dbg> bt_mcc.mcc_read_search_results_obj_id_cb: Zero-length Search Results Object ID
Run the search corresponding to the fourth round of the IOP test:
The search control point parameter generated by this command and
parameter has one search control item. The length field (first octet)
is 16 (0x10). (The length of the length field itself is not
included.) The type field (second octet) is 0x04 (search for a group
name). The parameter (the group name to search for) is
"TSPX_Group_Name".
.. code-block:: console
uart:~$ mcc set_scp_ioptest 4
Search string:
00000000: 10 04 54 53 50 58 5f 47 72 6f 75 70 5f 4e 61 6d |..TSPX_G roup_Nam|
00000010: 65 |e |
Search control point notification result code: 1
Search Results Object ID: 0x000000000107
Search Control Point set
After the successful search, the search results object ID has a value:
.. code-block:: console
uart:~$ mcc read_search_results_obj_id
Search Results Object ID: 0x000000000107
Media Control Service (MCS)
***************************
The media control service (mcs) and the associated media player (mpl)
typically reside on devices that can provide access to, and serve,
media content, like PCs and smartphones.
As mentioned above, the media player (mpl) has the player logic, while
the media control service (mcs) has the GATT-based interface. This
separation is done so that the media player can also be used without
the GATT-based interface.
Using the media control service and the media player
====================================================
The media control service and the media player are in general
controlled remotely, from the media control client.
Before use, the media control client must be initialized by the
command :code:`mpl init`.
As for the client, the :code:`bt` commands are used for connecting -
:code:`bt init` followed by :code:`bt connect <address> <address
type>` (or :code:`bt advertise on` if the server is advertising).
Example Usage
=============
Setup
-----
.. code-block:: console
uart:~$ bt init
Bluetooth initialized
uart:~$ mpl init
[Large amounts of debug output]
uart:~$ bt connect F9:33:3B:67:D2:A7 (random)
Connection pending
Connected: F9:33:3B:67:D2:A7 (random)
When connected
--------------
Control is done from the client.
The server will give debug output related to the various operations
performed by the client.
Example: Debug output by the server when the client gives the "next
track" command:
.. code-block:: console
[00:13:29.932,373] <dbg> bt_mcs.control_point_write: Opcode: 49
[00:13:29.932,403] <dbg> bt_mpl.mpl_operation_set: opcode: 49, param: 536880068
[00:13:29.932,403] <dbg> bt_mpl.paused_state_operation_handler: Operation opcode: 49
[00:13:29.932,495] <dbg> bt_mpl.do_next_track: Track ID before: 0x000000000104
[00:13:29.932,586] <dbg> bt_mpl.do_next_track: Track ID after: 0x000000000105
[00:13:29.932,617] <dbg> bt_mcs.mpl_track_changed_cb: Notifying track change
[00:13:29.932,708] <dbg> bt_mcs.mpl_track_title_cb: Notifying track title: Interlude #4 (Vesper Dreams)
[00:13:29.932,800] <dbg> bt_mcs.mpl_track_duration_cb: Notifying track duration: 13500
[00:13:29.932,861] <dbg> bt_mcs.mpl_track_position_cb: Notifying track position: 0
[00:13:29.933,044] <dbg> bt_mcs.mpl_current_track_id_cb: Notifying current track ID: 0x000000000105
[00:13:29.933,258] <dbg> bt_mcs.mpl_next_track_id_cb: Notifying next track ID: 0x000000000106
[00:13:29.933,380] <dbg> bt_mcs.mpl_operation_cb: Notifying control point - opcode: 49, result: 1
Some server commands are available. These commands force
notifications of the various characteristics, for testing that the
client receives notifications. The values sent in the notifications
caused by these testing commands are independent of the media player,
so they do not correspond the actual values of the characteristics nor
to the actual state of the media player.
Example: Force (fake value) notification of the track duration:
.. code-block:: console
uart:~$ mpl duration_changed_cb
[00:15:17.491,058] <dbg> bt_mcs.mpl_track_duration_cb: Notifying track duration: 12000
Part 3
한국어 전문 번역
Generic Audio Content Control의 Media Control
Shell에서 client와 server의 media control을 실행합니다. Server는 media logic을 담당하는 Media Player(mpl)와 player의 GATT interface인 Media Control Service(mcs)로 나뉩니다. Client는 GATT 기반 Media Control Client(mcc)입니다.
Server는 Object Transfer Service, client는 Object Transfer Client를 포함할 수 있으며 이때 더 풍부한 기능을 제공합니다. 양쪽 모두 Generic Media Control Service만 구현하고 그 아래 별도 MCS instance는 사용하지 않습니다. 예제는 긴 debug 출력을 일부 줄였습니다. 모든 shell 명령은 mcc 또는 mpl 뒤 TAB으로 탐색하고 mcc <command> help 형식으로 도움말을 볼 수 있습니다.
Media player model
Player는 user가 식별할 이름과 icon을 가집니다. Content는 track과 group으로 구성되고 group은 track과 다른 group을 포함할 수 있지만 이 구현에서는 track만 포함합니다. Track은 segment로 나눌 수 있습니다.
Active player에는 현재 track, 그 title·duration(1/100초 단위)·position이 있고 current group, parent group과 next track도 있습니다. State는 playing, paused, seeking, inactive 중 하나입니다. Playback speed, playing order, 지원 order, track changed notification과 seeking speed가 재생 동작을 표현합니다.
Supported opcode는 Media Control Point에 쓸 수 있는 operation을 나타냅니다. Search Control Point는 group·track을 조건으로 검색하고 Search Results object로 결과를 돌려줍니다. Content Control ID는 player를 audio stream과 연결합니다.
Media Control Client
Client는 control point 또는 writable characteristic에 write해 server를 제어하고 characteristic read·notification으로 정보를 얻습니다. 사용 전 mcc init을 실행하고 Bluetooth connection을 만든 뒤 mcc discover_mcs로 GMCS handle을 저장하고 기본적으로 notification을 모두 subscribe합니다.
초기화와 연결
uart:~$ bt init
Bluetooth initialized
uart:~$ mcc init
MCC init complete
uart:~$ bt advertise on
Advertising started
Connected: F6:58:DC:27:F3:57 (random)GMCS와 포함된 OTS 발견
MCS characteristic과 notification handle을 찾은 뒤 included OTS service와 OTC characteristic을 발견하고 L2CAP PSM을 등록합니다.
uart:~$ mcc discover_mcs
<dbg> bt_mcc.bt_mcc_discover_mcs: start discovery of MCS primary service
<dbg> bt_mcc.discover_primary_func: [ATTRIBUTE] handle 0x00ae
<dbg> bt_mcc.discover_primary_func: Primary discovery complete
<dbg> bt_mcc.discover_primary_func: UUID: 2800
<dbg> bt_mcc.discover_primary_func: UUID: 8fd7
<dbg> bt_mcc.discover_primary_func: Start discovery of MCS characteristics
<dbg> bt_mcc.discover_mcs_char_func: [ATTRIBUTE] handle 0x00b0
<dbg> bt_mcc.discover_mcs_char_func: Player name, UUID: 8fa0
<dbg> bt_mcc.discover_mcs_char_func: [ATTRIBUTE] handle 0x00b2
<dbg> bt_mcc.discover_mcs_char_func: Icon Object, UUID: 8fa1
<dbg> bt_mcc.discover_mcs_char_func: [ATTRIBUTE] handle 0x00b4
<dbg> bt_mcc.discover_mcs_char_func: Icon URI, UUID: 8fa2
<dbg> bt_mcc.discover_mcs_char_func: [ATTRIBUTE] handle 0x00b6
<dbg> bt_mcc.discover_mcs_char_func: Track Changed, UUID: 8fa3
<dbg> bt_mcc.discover_mcs_char_func: Subscribing - handle: 0x00b6
[...]
<dbg> bt_mcc.discover_mcs_char_func: [ATTRIBUTE] handle 0x00ea
<dbg> bt_mcc.discover_mcs_char_func: Content Control ID, UUID: 8fb5
<dbg> bt_mcc.discover_mcs_char_func: Setup complete for MCS
<dbg> bt_mcc.discover_mcs_char_func: Start discovery of included services
<dbg> bt_mcc.discover_include_func: [ATTRIBUTE] handle 0x00af
<dbg> bt_mcc.discover_include_func: Include UUID 1825
<dbg> bt_mcc.discover_include_func: Discover include complete for MCS: OTS
<dbg> bt_mcc.discover_include_func: Start discovery of OTS characteristics
<dbg> bt_mcc.discover_otc_char_func: [ATTRIBUTE] handle 0x009c
<dbg> bt_mcc.discover_otc_char_func: OTS Features
[...]
<dbg> bt_mcc.discover_otc_char_func: [ATTRIBUTE] handle 0x00ac
<dbg> bt_mcc.discover_otc_char_func: Object Size
Discovery complete
<dbg> bt_otc.bt_otc_register: 0
<dbg> bt_otc.bt_otc_register: L2CAP psm 0x 25 sec_level 1 registered
<dbg> bt_mcc.discover_otc_char_func: Setup complete for OTS 1 / 1
uart:~$Player name과 track duration 읽기
uart:~$ mcc read_player_name
Player name: My media player
4d 79 20 6d 65 64 69 61 20 70 6c 61 79 65 72 |My media player
uart:~$ mcc read_track_duration
Track duration: 6300긴 characteristic과 ATT MTU
ATT packet에 들어가지 않는 긴 값은 잘릴 수 있습니다. MTU를 교환하면 전체 track title을 읽을 수 있습니다.
uart:~$ mcc read_track_title
Track title: Interlude #1 (Song for
uart:~$ gatt exchange-mtu
Exchange pending
Exchange successful
uart:~$ mcc read_track_title
Track title: Interlude #1 (Song for Alison)Track position 읽기·쓰기
현재 위치를 읽고 1/100초 단위 값 500으로 바꾼 뒤 다시 확인합니다.
uart:~$ mcc read_track_position
Track Position: 0
uart:~$ mcc set_track_position 500
Track Position: 500
uart:~$ mcc read_track_position
Track Position: 500Media Control Point
Play, pause, fast forward, track·group 변경 등을 opcode로 요청합니다. 일부 operation은 argument가 필요합니다. 현재 shell은 mpl.h에 정의된 raw opcode 값을 사용합니다. 예제는 play 1, 세 번째 track으로 이동 52와 pause 2입니다.
uart:~$ mcc set_cp 1
Media State: 1
Operation: 1, result: 1
Operation: 1, param: 0
uart:~$ mcc set_cp 52 3
Track changed
Track title: Interlude #3 (Levanto Seventy)
Track duration: 7800
Track Position: 0
Current Track Object ID: 0x000000000104
Next Track Object ID: 0x000000000105
Operation: 52, result: 1
Operation: 52, param: 3
uart:~$ mcc set_cp 2
Media State: 2
Operation: 2, result: 1
Operation: 2, param: 0Object Transfer Client 사용
양쪽이 OTS를 지원하면 track·group object ID를 읽고 해당 object를 선택·download할 수 있습니다.
Current group object ID 읽기
uart:~$ mcc read_current_group_obj_id
Current Group Object ID: 0x000000000107Object 선택
uart:~$ mcc ots_select 0x107
Selecting object succeededObject metadata 읽기
Name, current·allocated size, Group Object type과 read permission을 확인합니다.
uart:~$ mcc ots_read_metadata
Reading object metadata succeeded
<inf> bt_mcc: Object's meta data:
<inf> bt_mcc: Current size :35
<inf> bt_otc: --- Displaying 1 metadata records ---
<inf> bt_otc: Object ID: 0x000000000107
<inf> bt_otc: Object name: Joe Pass - Guitar Inte
<inf> bt_otc: Object Current Size: 35
<inf> bt_otc: Object Allocate Size: 35
<inf> bt_otc: Type: Group Obj Type
<inf> bt_otc: Properties:0x4
<inf> bt_otc: - read permittedGroup object 본문 읽기
받은 object는 track 또는 group type과 object ID로 된 record sequence입니다.
uart:~$ mcc ots_read_current_group_object
<dbg> bt_mcc.on_group_content: Object type: 0, object ID: 0x000000000102
<dbg> bt_mcc.on_group_content: Object type: 0, object ID: 0x000000000103
<dbg> bt_mcc.on_group_content: Object type: 0, object ID: 0x000000000104
<dbg> bt_mcc.on_group_content: Object type: 0, object ID: 0x000000000105
<dbg> bt_mcc.on_group_content: Object type: 0, object ID: 0x000000000106Search
Search Control Point parameter는 length, type(track name·artist name 등), 검색어로 된 item sequence입니다. 성공하면 OTS의 Search Results object에 결과를 저장하고 characteristic에서 ID를 읽어 current group object와 같은 방식으로 download합니다.
mcc set_scp_raw는 raw item sequence 문자열을 받고 mcc set_scp_ioptest는 IOP test round 번호에 해당하는 preset search를 실행합니다.
검색 전 빈 결과 ID
uart:~$ mcc read_search_results_obj_id
Search Results Object ID: 0x000000000000
<dbg> bt_mcc.mcc_read_search_results_obj_id_cb: Zero-length Search Results Object IDIOP test round 4 검색
첫 octet 0x10은 length, 둘째 0x04는 group name search type, 나머지는 TSPX_Group_Name parameter입니다.
uart:~$ mcc set_scp_ioptest 4
Search string:
00000000: 10 04 54 53 50 58 5f 47 72 6f 75 70 5f 4e 61 6d |..TSPX_G roup_Nam|
00000010: 65 |e |
Search control point notification result code: 1
Search Results Object ID: 0x000000000107
Search Control Point set검색 후 결과 object ID
uart:~$ mcc read_search_results_obj_id
Search Results Object ID: 0x000000000107Media Control Service와 Media Player
MCS와 MPL은 PC·smartphone처럼 media content를 제공하는 device에 있습니다. MPL은 player logic, MCS는 GATT interface라서 MPL은 Bluetooth interface 없이도 사용할 수 있습니다. 일반적으로 remote MCC가 제어하며 server는 mpl init으로 초기화합니다.
Server 초기화와 연결
uart:~$ bt init
Bluetooth initialized
uart:~$ mpl init
[Large amounts of debug output]
uart:~$ bt connect F9:33:3B:67:D2:A7 (random)
Connection pending
Connected: F9:33:3B:67:D2:A7 (random)Client의 Next Track 요청을 처리하는 server
Opcode 49를 받아 current track ID를 다음 ID로 바꾸고 title, duration, position, current·next object ID와 control-point result를 notification으로 보냅니다.
[00:13:29.932,373] <dbg> bt_mcs.control_point_write: Opcode: 49
[00:13:29.932,403] <dbg> bt_mpl.mpl_operation_set: opcode: 49, param: 536880068
[00:13:29.932,403] <dbg> bt_mpl.paused_state_operation_handler: Operation opcode: 49
[00:13:29.932,495] <dbg> bt_mpl.do_next_track: Track ID before: 0x000000000104
[00:13:29.932,586] <dbg> bt_mpl.do_next_track: Track ID after: 0x000000000105
[00:13:29.932,617] <dbg> bt_mcs.mpl_track_changed_cb: Notifying track change
[00:13:29.932,708] <dbg> bt_mcs.mpl_track_title_cb: Notifying track title: Interlude #4 (Vesper Dreams)
[00:13:29.932,800] <dbg> bt_mcs.mpl_track_duration_cb: Notifying track duration: 13500
[00:13:29.932,861] <dbg> bt_mcs.mpl_track_position_cb: Notifying track position: 0
[00:13:29.933,044] <dbg> bt_mcs.mpl_current_track_id_cb: Notifying current track ID: 0x000000000105
[00:13:29.933,258] <dbg> bt_mcs.mpl_next_track_id_cb: Notifying next track ID: 0x000000000106
[00:13:29.933,380] <dbg> bt_mcs.mpl_operation_cb: Notifying control point - opcode: 49, result: 1시험용 강제 notification
일부 server shell 명령은 client notification 수신 시험을 위해 characteristic 값을 강제로 알립니다. 이 값은 실제 player 상태와 무관한 test value입니다.
uart:~$ mpl duration_changed_cb
[00:15:17.491,058] <dbg> bt_mcs.mpl_track_duration_cb: Notifying track duration: 12000
Source
출처
영어 원문에는 문단, 문서 지시문, 표, 코드, 코드 심벌, 경로를 그대로 보존했습니다.