2 Overview of bindings shipped with AFB-Daemon
3 ===========================================
8 Here are the bindings shipped in the source tree:
13 * Audio _(2 backends: ALSA/PulseAudio)_
14 * Radio _(1 backend: RTLSDR RTL2832U)_
15 * Media _(1 backend: Rygel UPnP)_
17 All bindings may not be built, depending on the development libraries present on
18 the system at build time.
26 A sample Hello World binding for demonstration and learning purposes.
28 This binding provides a few unauthenticated requests, all beginning with
29 "ping", to demonstrate basic binder capabilities.
33 * _ping:_ returns a success response
34 * _pingfail:_ returns a failure response
35 * _pingnull:_ returns a success response, with an empty JSON response field
36 * _pingbug:_ does a memory violation (intercepted by the binder)
37 * _pingJson:_ returns a success response, with a complex JSON response field
38 * _pingevent:_ broadcasts a global event
45 A sample Authentication binding for demonstration purposes.
47 This binding provides a few requests to demonstrate the binder's token-based
50 Calling "_connect_" with a security token will initiate a session, calling
51 "_refresh_" will issue a new token and invalidate the previous one, calling
52 "_logout_" will invalidate all tokens and close the session.
56 * _ping:_ returns a success response
57 * _connect:_ creates a session and returns a new token
58 * _refresh:_ returns a new token
59 * _check:_ verifies the passed token is valid
60 * _logout:_ closes the session
67 A sample Tic Tac Toe game binding.
69 This binding provides an interactive Tic Tac Toe game where the binder returns
70 the grid as a JSON response.
74 * _new:_ starts a new game
75 * _play:_ asks the server to play
76 * _move:_ gives a client move
77 * _board:_ gets the current board state, as a JSON structure
78 * _level_: sets the server level
79 * _join_: joins an existing board
80 * _undo_: undo the last move
81 * _wait_: wait for a move
88 A sample Audio binding with 2 backends:
91 * PulseAudio (optional)
93 This binding is able to initialize a specific soundcard, define volume levels,
94 channels (mono/stereo...), mute sound, and play a 22,050 Hz PCM stream.
98 * _ping:_ returns a success response
99 * _init:_ initializes backend, on the "default" sound card
100 * _volume:_ gets or sets volume, in % (0-100)
101 * _channels:_ gets or sets channels count (1-8)
102 * _mute:_ gets or sets the mute status (on-off)
103 * _play_: gets or sets the playing status (on-off)
105 _(if PulseAudio development libraries are not found at build time, only ALSA
108 _(if a PulseAudio server is not found at runtime, the binding will dynamically
111 _(a specifc backend can be forced by using this syntax before running afb-daemon
112 : **$ export AFB_AUDIO_OUTPUT=Alsa**)_
119 A sample AM/FM Radio binding with 1 backend:
121 * RTLSDR - Realtek RTL2832U dongles (mandatory)
123 This binding is able to initialize specific RTL2832U dongles, switch between
124 AM/FM modes, define frequency, mute sound, and play sound (if combining with
125 the **audio** binding).
129 * _ping:_ returns a success response
130 * _init:_ initializes backend, looking for plugged-in devices
131 * _power:_ sets device power status (on-off)
132 * _mode:_ sets device reception mode (AM-FM)
133 * _freq:_ sets device frequency (in Hz)
134 * _mute_: sets device mute status (on-off)
135 * _play_: sets device playing status (on-off)
137 _(if rtlsdr development libraries are not found at build time, this binding will
144 A sample Media Server binding with 1 backend:
148 This binding is able to detect a local Rygel UPnP media server, list audio
149 files, select an audio file for playback, play/pause/seek in this file, upload
150 an audio file to the server.
154 * _ping:_ returns a success response
155 * _init:_ initializes backend, looking for an active local UPnP server
156 * _list:_ returns list of audio files, as a JSON structure
157 * _select:_ select an audio files, by index number (001-...)
158 * _play:_ plays the currently selected audio file
159 * _stop:_ stops the currently selected audio file
160 * _pause:_ pauses the currently selected audio file
161 * _seek:_ seeks in the currently selected audio file, in seconds
162 * _upload:_ uploads an audio file, with a POST request
164 _(if GUPnP/GSSDP development libraries are not found at build time, this binding
173 Sample command-line applications: _afb-client-demo_ (built by default)
175 Sample HTML5 applications:
177 **[afb-client](https://gerrit.automotivelinux.org/gerrit/gitweb?p=src/app-framework-demo.git;a=tree)**,
178 **[afb-radio](https://github.com/iotbzh/afb-radio)**
180 Sample Qt/QML applications: *test/token-websock.qml*