From: Radek Kintop
Date: Mon, 7 Dec 2015 11:01:31 +0000 (+0100)
Subject: Mobile radio sample documentation (addendum)
X-Git-Tag: tizen_3.0/TD_SYNC/20161201~288^2
X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1ac3df138fbf8fe4665da3f8ed4252bb97722d88;p=sdk%2Fonline-doc.git
Mobile radio sample documentation (addendum)
Change-Id: Ifa56dfeff413b279d313b1ba1d63bd1320217bc6
Signed-off-by: Radek Kintop
---
diff --git a/org.tizen.sampledescriptions/html/images/radio_screen_0.png b/org.tizen.sampledescriptions/html/images/radio_screen_0.png
index 46f2cf7..6d7b5bd 100644
Binary files a/org.tizen.sampledescriptions/html/images/radio_screen_0.png and b/org.tizen.sampledescriptions/html/images/radio_screen_0.png differ
diff --git a/org.tizen.sampledescriptions/html/images/radio_screen_1.png b/org.tizen.sampledescriptions/html/images/radio_screen_1.png
index 22053bd..222961d 100644
Binary files a/org.tizen.sampledescriptions/html/images/radio_screen_1.png and b/org.tizen.sampledescriptions/html/images/radio_screen_1.png differ
diff --git a/org.tizen.sampledescriptions/html/mobile_n/radio_sd_mn.htm b/org.tizen.sampledescriptions/html/mobile_n/radio_sd_mn.htm
index eb77652..a48bc97 100644
--- a/org.tizen.sampledescriptions/html/mobile_n/radio_sd_mn.htm
+++ b/org.tizen.sampledescriptions/html/mobile_n/radio_sd_mn.htm
@@ -36,7 +36,8 @@ It takes some time for the radio hardware to set itself up.
You can change the frequency manually, using the knob or let the radio seek the station for you. The signal strength indicator can help you tune the radio.
-To obtain the list of strongest stations frequencies, press the scan buton. Scanning turns the radio off, so afterwards you have to switch it back on manually.
+To obtain the list of strongest stations frequencies, press the scan buton. Scanning turns the radio off, so afterwards you have to switch it back on manually.
+Scanning also disables all the buttons. Once it is finished, buttons return to their previous states and become enabled again.
Prerequisites
This application requires the device to support the following feature:
@@ -53,6 +54,16 @@ To obtain the list of strongest stations frequencies, press the scan buton. Scan
__ui_cb(). The first one reacts to radio module changes and sets up the
application view accordingly. The latter one does the opposite - it invokes radio module functions depending on user interface selections.
+There are a few types of events generated by radio controller module:
+
+- RADIO_EVENT_SCAN_END - scan command has been completed so it is necessary to unlock the UI and update the list of known frequencies,
+- RADIO_EVENT_SCAN_UPDATE - this event is generated during scan command execution, each time the device has found a station signal; this is when UI fequency display is updated,
+- RADIO_EVENT_SEEK_END - seek command has been completed and it is a good moment to update the interface's state, i.e. the frequency the device is set to,
+- RADIO_EVENT_RSSI_UPDATE - this is the event related to the radio module's internal timer; it indicates a good moment to read RSSI and update the UI accordingly,
+- RADIO_EVENT_INTERRUPTION - this event is generated when something unpredicted has occured during radio operation, like
+- RADIO_EVENT_FREQ_SET - desired frequency has been set (using frequency knob).
+
+
static void __radio_cb(radio_event event)
{
@@ -101,6 +112,25 @@ static void __radio_cb(radio_event event)
}
+Events communicated from the view module to the main controller are as follows:
+
+
+- UI_EVENT_FREQ_CHANGE - this is generated multiple times as the user rotates the knob; event contains information about selected frequency; this is where the radio controller is asked to set
+it,
+- UI_EVENT_FREQ_CHANGE_END - this event occurs when the user has stopped and released the frequency knob; the UI is updated and the current frequency the device is tuned to is displayed,
+- UI_EVENT_STATION_SELECTION - generated when the user selects a frequency from the known frequencies table menu,
+- UI_EVENT_BUTTON_ACTIVATE or UI_EVENT_BUTTON_DEACTIVATE - they are generated when the user toggles one of the panel buttons on or off; radio controller function, associated with the selected button is called;
+there are five buttons in the radio panel:
+
+
+- UI_ELEMENT_ON_OFF_BUTTON - turns the radio on or off,
+- UI_ELEMENT_MUTE_BUTTON - mutes/unmutes the radio, radio mute state is preserved during scans,
+- UI_ELEMENT_SCAN_BUTTON - begins scan command and automatically shuts the radio off; this process takes some time as the whole frequency range is checked for stations,
+- UI_ELEMENT_SEEK_MINUS_BUTTON - begins seek command by gradually decreasing the frequency; seek is similar to scan, but stops on the first found station,
+- UI_ELEMENT_SEEK_PLUS_BUTTON - begins seek command by gradually increasing the frequency.
+
+
+
static void __ui_cb(ui_event event, ui_element element, const void *data)
{
@@ -242,6 +272,9 @@ bool radio_controller_set_frequency(int freq)
}
+The __thread_function() function is called in the context of another thread.
+This prevents UI lockup and allows for fluent frequency change.
+
static void __thread_function(void *frequency, Ecore_Thread *thread)
{
@@ -249,6 +282,9 @@ static void __thread_function(void *frequency, Ecore_Thread *thread)
}
+The __thread_end_cb() function is called when thread has finished. Since it is called in
+the context of the main thread, it is possible to invoke a callback function and update the UI.
+
static void __thread_end_cb(void *data, Ecore_Thread *thread)
{
@@ -390,6 +426,8 @@ bool radio_controller_is_muted(bool *muted)
}
+The signal strenght is calculated in the function below. It is linearized in dBm domain. The range is from -128 to 128 dBm.
+
bool radio_controller_get_rssi(float *strength)
{
@@ -409,6 +447,8 @@ bool radio_controller_get_rssi(float *strength)
}
+The function below is used to get the current radio frequency.
+
bool radio_controller_get_freq(int *freq)
{
@@ -416,6 +456,10 @@ bool radio_controller_get_freq(int *freq)
}
+The radio_controller_get_freq_range()
+function is used to get the range of frequencies the radio can operate on.
+
+
bool radio_controller_get_freq_range(int *freq_min, int *freq_max)
{