Documentation/Maemo 5 Developer Guide/Using Multimedia Components/FM Transmitter API Usage

m (1 revision)
(wikify slightly)
 
(7 intermediate revisions not shown)
Line 1: Line 1:
__FORCETOC__
__FORCETOC__
-
= FM Transmitter API Usage =
+
The [[N900 FM radio transmitter|FM Transmitter]] is controlled by <code>fmtx-middleware</code> program via D-Bus API. API includes functions to enable transmitter, change transmitting frequency and station name. Please note that available frequencies may vary by sales region and FM Transmitter may be disabled in certain sales regions. Transmitter is also disabled when external devices are connected to Maemo device, excluding charger and Bluetooth devices. When FM Transmitter is enabled, fmtx-middleware will route audio automatically to the transmitter and enforce proper transmission power allowed in sales region. Fmtx-middleware will emit beeping tone when no other audio is being transmitter to comply with legislature. API documentation is in the [http://maemo.org/packages/view/fmtx-middleware-doc/ fmtx-middleware-doc] package.
-
FM Transmitter is controlled by fmtx-middleware program via D-Bus api. Api includes functions to enable transmitter, change transmitting frequency and station name. Please note that available frequencies may vary by sales region and FM Transmitter may be disabled in certain sales regions. Transmitter is also disabled when external devices are connected to Maemo device, excluding charger and Bluetooth devices. When FM Transmitter is enabled, fmtx-middleware will route audio automatically to the transmitter and enforce proper transmission power allowed in sales region. Fmtx-middleware will emit beeping tone when no other audio is being transmitter to comply with legislature. Api documentation is in the fmtx-middleware-doc package.
+
== API documentation ==
-
== Api documentation ==
+
;Service
 +
: <code>com.nokia.FMTx</code>
 +
;Interface
 +
: <code>com.nokia.FMTx.Device</code>
 +
;Object path
 +
: <code>/com/nokia/fmtx/default</code>
-
<div class="graybox">
+
===Properties===
-
+
{| class="wikitable"
-
Service: com.nokia.FMTx
+
|+ D-Bus properties
-
Interface: com.nokia.FMTx.Device
+
-
Object path: /com/nokia/fmtx/default
+
-
 
+
-
</div>
+
-
 
+
-
 
+
-
'''Properties:'''
+
-
 
+
-
{| border="1" cellpadding="3"
+
-
| align="LEFT" | version
+
-
| align="LEFT" | Uint32
+
-
| align="LEFT" | Read only
+
-
| align="LEFT" | Version number of fmtx-middleware
+
|-
|-
-
| align="LEFT" | frequency
+
! Name
-
| align="LEFT" | Uint32
+
! Type
-
| align="LEFT" | Read/write
+
! Flags
-
| align="LEFT" | Frequency in kHz. Returns DBUS_GERROR_INVALID_ARGS error, if frequency is not allowed
+
! Description
|-
|-
-
| align="LEFT" | freq_max
+
| <code>version</code>
-
| align="LEFT" | Uint32
+
| Uint32
-
| align="LEFT" | Read only
+
| Read only
-
| align="LEFT" | Returns maximum allowed frequency in kHz
+
| Version number of <code>fmtx-middleware</code>
|-
|-
-
| align="LEFT" | freq_step
+
| <code>frequency</code>
-
| align="LEFT" | Uint32
+
| Uint32
-
| align="LEFT" | Read only
+
| Read/write
-
| align="LEFT" | Returns the minimum step between frequencies is kHz
+
| Frequency in kHz. Returns <code>DBUS_GERROR_INVALID_ARGS</code> error, if frequency is not allowed
|-
|-
-
| align="LEFT" | state
+
| <code>freq_max</code>
-
| align="LEFT" | String
+
| Uint32
-
| align="LEFT" | Read/write
+
| Read only
-
| align="LEFT" | Returns the state of the transmitter. States are: enabled – Transmitter is currently enabled disabled – Transmitter is currently disabled error – Internal error while initializing the transmitter, transmitter can’t be enabled. n/a – Transmitter is permanently disabled in this device. State can be set to enabled or disabled. May return DBUS_GERROR_FAILED if transmitter can’t be enabled
+
| Returns maximum allowed frequency in kHz
|-
|-
-
| align="LEFT" | startable
+
| <code>freq_step</code>
-
| align="LEFT" | String
+
| Uint32
-
| align="LEFT" | Read only
+
| Read only
-
| align="LEFT" | Returns message about can the transmitter be enabled at current time. Messages are: true Device is in offline mode Headphones are connected Usb device is connected
+
| Returns the minimum step between frequencies in kHz
|-
|-
-
| align="LEFT" | rds_ps
+
| <code>state</code>
-
| align="LEFT" | String
+
| String
-
| align="LEFT" | Read/write
+
| Read/write
-
| align="LEFT" | Get/Set RDS text (displayed alternating with station name. Maximum length is 64 characters. Returns DBUS_GERROR_INVALID_ARGS is set text is too long
+
| Returns the state of the transmitter. States are:
 +
* enabled – Transmitter is currently enabled
 +
* disabled – Transmitter is currently disabled
 +
* error – Internal error while initializing the transmitter, transmitter can’t be enabled.  
 +
* n/a – Transmitter is permanently disabled in this device.
 +
State can be set to enabled or disabled.
 +
May return <code>DBUS_GERROR_FAILED</code> if transmitter can’t be enabled
|-
|-
-
| align="LEFT" | rds_text
+
| <code>startable</code>
-
| align="LEFT" | String
+
| String
-
| align="LEFT" | Read/write
+
| Read only
-
| align="LEFT" | Get/Set RDS text (displayed alternating with station name. Maximum length is 64 characters. Returns DBUS_GERROR_INVALID_ARGS is set text is too long
+
| Returns message about can the transmitter be enabled at current time. Messages are: true Device is in offline mode Headphones are connected USB device is connected
 +
|-
 +
| <code>rds_ps</code>
 +
| String
 +
| Read/write
 +
| Get/Set RDS Station name (displayed on rds capable radios). To avoid problems with some radios, use text which length is dividable by 8. Pad with spaces if necessary
 +
|-
 +
| <code>rds_text</code>
 +
| String
 +
| Read/write
 +
| Get/Set RDS text (displayed alternating with station name. Maximum length is 64 characters. Returns <code>DBUS_GERROR_INVALID_ARGS</code> is set if the text is too long
|}
|}
 +
===Signals===
-
'''Signals:'''
+
{| class="wikitable"
-
 
+
|+ D-Bus signals
-
{| border="1" cellpadding="3"
+
|-
-
| align="LEFT" | Changed
+
! Name
-
| align="LEFT" | None
+
! Type
-
| align="LEFT" | Some fmtx property was changed
+
! Description
|-
|-
-
| align="LEFT" | Error
+
| <code>Changed</code>
-
| align="LEFT" | String
+
| None
-
| align="LEFT" | Fm transmitter was disabled by one of the following reasons: Device entered offline mode Usb device was connected (excluding charger) Headphones were connected TV-Out cable was connecte
+
| Some fmtx property was changed
 +
|-
 +
| <code>Error</code>
 +
| String
 +
| FM transmitter was disabled by one of the following reasons: <ul><li>Device entered offline mode</li><li>USB device was connected (excluding charger)</li><li>Headphones were connected</li><li>TV-Out cable was connected</li></ul>
|}
|}
 +
Properties are manipulated with <code>org.freedesktop.DBus.Properties</code> interface. For more information see [[Documentation/Maemo 5 Developer Guide/DBus|D-Bus documentation]].
-
Properties are manipulated with org.freedesktop.DBus.Properties interface. For more information see D-Bus documentation.
+
[[Category:Development]]
-
 
+
[[Category:Documentation]]
-
[[Category:Maemo training material]]
+
[[Category:Fremantle]]

Latest revision as of 13:20, 1 March 2011


The FM Transmitter is controlled by fmtx-middleware program via D-Bus API. API includes functions to enable transmitter, change transmitting frequency and station name. Please note that available frequencies may vary by sales region and FM Transmitter may be disabled in certain sales regions. Transmitter is also disabled when external devices are connected to Maemo device, excluding charger and Bluetooth devices. When FM Transmitter is enabled, fmtx-middleware will route audio automatically to the transmitter and enforce proper transmission power allowed in sales region. Fmtx-middleware will emit beeping tone when no other audio is being transmitter to comply with legislature. API documentation is in the fmtx-middleware-doc package.

Contents

[edit] API documentation

Service
com.nokia.FMTx
Interface
com.nokia.FMTx.Device
Object path
/com/nokia/fmtx/default

[edit] Properties

D-Bus properties
Name Type Flags Description
version Uint32 Read only Version number of fmtx-middleware
frequency Uint32 Read/write Frequency in kHz. Returns DBUS_GERROR_INVALID_ARGS error, if frequency is not allowed
freq_max Uint32 Read only Returns maximum allowed frequency in kHz
freq_step Uint32 Read only Returns the minimum step between frequencies in kHz
state String Read/write Returns the state of the transmitter. States are:
  • enabled – Transmitter is currently enabled
  • disabled – Transmitter is currently disabled
  • error – Internal error while initializing the transmitter, transmitter can’t be enabled.
  • n/a – Transmitter is permanently disabled in this device.

State can be set to enabled or disabled. May return DBUS_GERROR_FAILED if transmitter can’t be enabled

startable String Read only Returns message about can the transmitter be enabled at current time. Messages are: true Device is in offline mode Headphones are connected USB device is connected
rds_ps String Read/write Get/Set RDS Station name (displayed on rds capable radios). To avoid problems with some radios, use text which length is dividable by 8. Pad with spaces if necessary
rds_text String Read/write Get/Set RDS text (displayed alternating with station name. Maximum length is 64 characters. Returns DBUS_GERROR_INVALID_ARGS is set if the text is too long

[edit] Signals

D-Bus signals
Name Type Description
Changed None Some fmtx property was changed
Error String FM transmitter was disabled by one of the following reasons:
  • Device entered offline mode
  • USB device was connected (excluding charger)
  • Headphones were connected
  • TV-Out cable was connected

Properties are manipulated with org.freedesktop.DBus.Properties interface. For more information see D-Bus documentation.