summaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorsaerome.kim <saerome.kim@samsung.com>2019-01-17 11:34:51 +0900
committer김새롬/Tizen Platform Lab(SR)/Staff Engineer/삼성전자 <saerome.kim@samsung.com>2019-01-17 15:09:15 +0900
commit4ba89dffc02b2d0d63f4854deab8ecd9e32e98f2 (patch)
tree12b398cc09bb7e0088f1add968373498eef7e3ca /README.md
parent466c87d4b99d9d7a089f0c162d55af480b8e85c3 (diff)
downloaduser-awareness-4ba89dffc02b2d0d63f4854deab8ecd9e32e98f2.tar.gz
user-awareness-4ba89dffc02b2d0d63f4854deab8ecd9e32e98f2.tar.bz2
user-awareness-4ba89dffc02b2d0d63f4854deab8ecd9e32e98f2.zip
updated README
- how to make test environment - how to test Signed-off-by: saerome.kim <saerome.kim@samsung.com>
Diffstat (limited to 'README.md')
-rw-r--r--README.md463
1 files changed, 463 insertions, 0 deletions
diff --git a/README.md b/README.md
index fa58813..8f01431 100644
--- a/README.md
+++ b/README.md
@@ -1,2 +1,465 @@
# capi-user-awareness
User Awarness Framework CAPI
+
+# Test Environment(demo#1 version)
+
+* TV Board used:
+> 1. Kant M2 ATSC [To verify BLE and WiFi Sensors]
+> 2. Frame TV (Factory Setting: model name -> LS03R) [To verify Light & Motion Sensors]
+
+* Verified Image Path:
+http://168.219.244.109/products/tv/archive/2019/MAIN2019/KantM2_ATSC/TIZEN-5.0-MAIN2019-KantM2-RELEASE_20190109.3/images/T-KTM2AKUC/TIZEN-5.0-MAIN2019-KantM2-RELEASE_20190109.3_T-KTM2AKUC.tar.gz
+
+* TV Image info :
+```
+[Version]
+Model=Tizen5/TV;
+Build=latest;
+Release=latest;
+[Build]
+Type=eng;
+Date=20190108_221638;
+Time=22:16:38;
+Variant=NONE;
+ID=latest;
+ ```
+
+### For verifying BLE operations,
+**BLE Advertisement using nRF is used for BLE device detection**
+We have used nRF connect application on Android to emulate Mobile side GATT scenario. In nRF connect application, do following:
+
+```
+1. Create advertiser
+2. Set property connectable
+3. Include TX power in Adv data
+4. Add manufacturer data as : Company Id: 0x0075, Data: 0X420D0101010100E45D75FDE345
+```
+For verifying WiFi operations,
+```
+1. Connect TV and mobile to same WiFi AP first
+```
+
+*Note: We have executed the Light and Motion operations on Frame TV*
+
+**For debugging UA framework logs can be checked with below command:**
+```
+logger-mgr --filter UA_MANAGER UAM_API UA_CAPI UA_PLUGIN_BLE UA_PLUGIN_LIGHT UA_PLUGIN_WIFI UA_PLUGIN_MOTION
+dlogutil -v threadtime UA_MANAGER UAM_API UA_CAPI UA_PLUGIN_BLE UA_PLUGIN_LIGHT UA_PLUGIN_WIFI UA_PLUGIN_MOTION
+````
+
+**Set Capability:**
+```
+setcap cap_net_admin,cap_net_raw,cap_sys_rawio+eip /usr/bin/ua-manager
+/usr/share/security-config/set_capability
+sync and reboot
+```
+
+
+
+
+# How to test UAFW (Demo#1 version)
+
+> 1. Create and add user (Optional, if user is not added, default user will be used)
+> 2. Create and Add BLE device
+> 3. Create and Add WiFi Device
+> 4. Create Monitor
+> 5. Add Sensors (BLE and WiFi)
+> 6.1. Start Presence Detection
+> 6.2 Stop Presence Detection and Start Absence Detection
+
+## 1. Crete and add user (OPTIONAL)
+- Add User (Account & Name)
+```sh
+tc_usage_print:828() Key 1 : usage Create Monitor
+...
+tc_usage_print:828() Key 19 : usage Add User
+tc_usage_print:828() Key 20 : usage Remove User
+tc_usage_print:828() Key 21 : usage Get default user
+tc_usage_print:828() Key 22 : usage User get account
+tc_usage_print:828() Key 23 : usage User set name
+...
+tc_usage_print:828() Key 45 : usage Set function parameters
+```
+
+```sh
+45
+key_event_cb:1100() 45
+test_input_callback:811() Select the function again
+17
+test_set_params:928() Input account: <xxxx@xxxx.com>
+atul@abcd.com
+test_input_callback:558() returns UA_ERROR_NONE
+
+45
+key_event_cb:1100() 45
+test_input_callback:811() Select the function again
+23
+test_set_params:950() Input User name: <xxxxxxx>
+Atul
+test_input_callback:558() returns UA_ERROR_NONE
+```
+- Get all registered users
+```sh
+tc_usage_print:828() Key 1 : usage Create Monitor
+...
+tc_usage_print:828() Key 25 : usage Foreach registered users
+...
+tc_usage_print:828() Key 45 : usage Set function parameters
+```
+- OUTPUT
+```sh
+25
+key_event_cb:1100() 25
+
+__foreach_registered_user_cb:296() ua_user_get_account returned : UA_ERROR_NONE
+__foreach_registered_user_cb:298() User account info default@default.com
+__foreach_registered_user_cb:296() ua_user_get_account returned : UA_ERROR_NONE
+__foreach_registered_user_cb:298() User account info atul@abcd.com
+test_input_callback:798() returns UA_ERROR_NONE
+```
+
+## 2. Create and Add BLE device
+- Add BLE device
+```sh
+tc_usage_print:828() Key 1 : usage Create Monitor
+...
+tc_usage_print:828() Key 26 : usage Creater Device handle
+tc_usage_print:828() Key 27 : usage Destroy Device handle
+tc_usage_print:828() Key 28 : usage Device set os info
+tc_usage_print:828() Key 29 : usage Device get os info
+tc_usage_print:828() Key 30 : usage Device set mac address
+tc_usage_print:828() Key 31 : usage Device get mac address
+tc_usage_print:828() Key 32 : usage Device set mobile id
+tc_usage_print:828() Key 33 : usage Device get mobile id
+tc_usage_print:828() Key 34 : usage Device set ipv4 address
+tc_usage_print:828() Key 35 : usage Device get ipv4 address
+...
+tc_usage_print:828() Key 45 : usage Set function parameters
+```
+- OUTPUT
+
+```sh
+45
+key_event_cb:1100() 45
+test_input_callback:811() Select the function again
+26
+test_set_params:941() Input MAC type:
+1 - UA_MAC_TYPE_BT
+2 - UA_MAC_TYPE_BLE
+3 - UA_MAC_TYPE_WIFI
+4 - UA_SENSOR_P2P
+2 <====== create BLE device
+test_input_callback:526() returns UA_ERROR_NONE
+
+45
+key_event_cb:1100() 45
+test_input_callback:811() Select the function again
+28
+test_set_params:962() Input Device OS:
+1 - UA_OS_TYPE_TIZEN
+2 - UA_OS_TYPE_ANDROID
+3 - UA_OS_TYPE_IOS
+2 **Selected Android OS**
+test_input_callback:584() returns UA_ERROR_NONE
+
+45
+key_event_cb:1100() 45
+test_input_callback:811() Select the function again
+32 <====== Add MOBILE id
+test_set_params:980() Input Mobile ID: <XX:XX:XX:XX:XX:XX>
+E4:5D:75:FD:E3:45
+test_input_callback:636() returns UA_ERROR_NONE
+
+-> (IMPORTANT!!) Here, delete the TV device listed in mobile BT setting
+ and, do BT/BLE scanning again using nRF app.
+
+38 <====== Add Device
+key_event_cb:1100() 38
+test_input_callback:737() returns UA_ERROR_NONE
+
+-> (IMPORTANT!!) Here, make a connection with TV device using nRF app.
+```
+
+## 3. Create and Add WiFi Device
+- Add WiFi device
+```sh
+tc_usage_print:828() Key 1 : usage Create Monitor
+...
+tc_usage_print:828() Key 26 : usage Creater Device handle
+tc_usage_print:828() Key 27 : usage Destroy Device handle
+tc_usage_print:828() Key 28 : usage Device set os info
+tc_usage_print:828() Key 29 : usage Device get os info
+tc_usage_print:828() Key 30 : usage Device set mac address
+tc_usage_print:828() Key 31 : usage Device get mac address
+tc_usage_print:828() Key 32 : usage Device set mobile id
+tc_usage_print:828() Key 33 : usage Device get mobile id
+tc_usage_print:828() Key 34 : usage Device set ipv4 address
+tc_usage_print:828() Key 35 : usage Device get ipv4 address
+...
+tc_usage_print:828() Key 45 : usage Set function parameters
+```
+- OUTPUT
+
+```sh
+45
+key_event_cb:1100() 45
+test_input_callback:811() Select the function again
+26
+test_set_params:941() Input MAC type:
+1 - UA_MAC_TYPE_BT
+2 - UA_MAC_TYPE_BLE
+3 - UA_MAC_TYPE_WIFI
+4 - UA_SENSOR_P2P
+3 <====== create WiFi device
+test_input_callback:526() returns UA_ERROR_NONE
+
+45
+key_event_cb:1100() 45
+test_input_callback:811() Select the function again
+28
+test_set_params:962() Input Device OS:
+1 - UA_OS_TYPE_TIZEN
+2 - UA_OS_TYPE_ANDROID
+3 - UA_OS_TYPE_IOS
+2 <===== Selected Android OS
+test_input_callback:584() returns UA_ERROR_NONE
+
+45
+key_event_cb:1100() 45
+test_input_callback:811() Select the function again
+30 <====== Add MAC address
+test_set_params:971() Input MAC: <XX:XX:XX:XX:XX:XX>
+4C:66:41:A9:2B:94
+test_input_callback:609() returns UA_ERROR_NONE
+
+45
+key_event_cb:1100() 45
+test_input_callback:811() Select the function again
+32 <====== Add MOBILE id
+test_set_params:980() Input Mobile ID: <XX:XX:XX:XX:XX:XX>
+E4:5D:75:FD:E3:45
+test_input_callback:636() returns UA_ERROR_NONE
+
+38 <====== Add Device
+key_event_cb:1100() 38
+test_input_callback:737() returns UA_ERROR_NONE
+```
+
+## 4. Create monitor & set all absence detectiion callback
+- Create Monitor
+```sh
+tc_usage_print:828() Key 1 : usage Create Monitor
+...
+tc_usage_print:828() Key 45 : usage Set function parameters
+```
+1
+key_event_cb:1100() 1
+test_input_callback:316() returns UA_ERROR_NONE
+```
+- OUTPUT
+```sh
+Set All user absence detected callback
+=============================================================================
+tc_usage_print:828() Key 1 : usage Create Monitor
+...
+tc_usage_print:828() Key 5 : usage Set absence detected callback
+...
+tc_usage_print:828() Key 45 : usage Set function parameters
+------------------------------------------------------------------------------
+5
+key_event_cb:1100() 5
+test_input_callback:357() returns UA_ERROR_NONE
+```
+## 5. Add Sensors (BLE and WiFi)
+- Add Sensors
+
+```sh
+tc_usage_print:828() Key 1 : usage Create Monitor
+...
+tc_usage_print:828() Key 7 : usage Add sensor
+...
+tc_usage_print:828() Key 45 : usage Set function parameters
+````
+OUTPUT
+```sh
+45
+key_event_cb:1100() 45
+test_input_callback:811() Select the function again
+7
+test_set_params:855() Input Sensor type:
+1 - UA_SENSOR_BT
+2 - UA_SENSOR_BLE
+3 - UA_SENSOR_WIFI
+4 - UA_SENSOR_MOTION
+5 - UA_SENSOR_LIGHT
+6 - UA_SENSOR_AUDIO
+2 <====== Added BLE sensor
+test_input_callback:357() returns UA_ERROR_NONE
+
+45
+key_event_cb:1100() 45
+test_input_callback:811() Select the function again
+7
+test_set_params:855() Input Sensor type:
+1 - UA_SENSOR_BT
+2 - UA_SENSOR_BLE
+3 - UA_SENSOR_WIFI
+4 - UA_SENSOR_MOTION
+5 - UA_SENSOR_LIGHT
+6 - UA_SENSOR_AUDIO
+3 <===== Added WiFi Sensor
+test_input_callback:357() returns UA_ERROR_NONE
+```
+## 6.1. Start Presence Detection
+- Start Presence Detection
+```sh
+tc_usage_print:828() Key 1 : usage Create Monitor
+...
+tc_usage_print:828() Key 10 : usage Start user presence detection
+...
+tc_usage_print:828() Key 45 : usage Set function parameters
+```
+- OUTPUT
+
+```sh
+45
+key_event_cb:1100() 45
+test_input_callback:811() Select the function again
+10
+test_set_params:893() Input detection mode:
+1 - UA_DETECT_MODE_ALL_SENSOR
+2 - UA_DETECT_MODE_ANY_SENSOR
+1
+test_input_callback:407() returns UA_ERROR_NONE
+```
+- Start Presence Detection
+```sh
+tc_usage_print:828() Key 1 : usage Create Monitor
+...
+tc_usage_print:828() Key 10 : usage Start user presence detection
+...
+tc_usage_print:828() Key 45 : usage Set function parameters
+```
+-OUTPUT
+```sh
+45
+key_event_cb:1100() 45
+test_input_callback:811() Select the function again
+10
+test_set_params:893() Input detection mode:
+1 - UA_DETECT_MODE_ALL_SENSOR
+2 - UA_DETECT_MODE_ANY_SENSOR
+1
+test_input_callback:407() returns UA_ERROR_NONE
+```
+
+## 6.2 Stop Presence Detection and Start Absence Detection
+- Start Absence Detection
+```sh
+tc_usage_print:828() Key 1 : usage Create Monitor
+...
+tc_usage_print:828() Key 10 : usage Start user presence detection
+...
+tc_usage_print:828() Key 45 : usage Set function parameters
+```
+- OUTPUT
+```sh
+45
+key_event_cb:1100() 45
+test_input_callback:811() Select the function again
+12
+test_set_params:904() Input detection mode:
+1 - UA_DETECT_MODE_ALL_SENSOR
+2 - UA_DETECT_MODE_ANY_SENSOR
+1
+test_input_callback:427() returns UA_ERROR_NONE
+```
+
+- Absence detected event
+```sh
+__absence_detected_all_cb:217() absence all detected for sensor: 0x07 <------- All user absence detected
+
+__absence_detected_cb:241() result : UA_ERROR_NONE <------- User absence detected
+__absence_detected_cb:242() sensor: 0x07
+__absence_detected_cb:248() ua_user_get_account returned : UA_ERROR_NONE
+__absence_detected_cb:250() User account info default@default.com
+```
+
+# Etc
+
+##### 1. METHOD FOR CONFIGURING ADDED DEVICE AND ADDED DEICES PER USER
+We can also check list of All registered devices and List of device registered against user using below:
+
+tc_usage_print:828() Key 42 : usage Foreach registered devices
+tc_usage_print:828() Key 43 : usage Foreach registered devices by user
+
+```sh
+Get all registered Devices & Get all user devices
+=============================================================================
+tc_usage_print:828() Key 1 : usage Create Monitor
+...
+tc_usage_print:828() Key 42 : usage Foreach registered devices
+tc_usage_print:828() Key 43 : usage Foreach registered devices by user
+...
+tc_usage_print:828() Key 45 : usage Set function parameters
+```
+
+- OUTPUT
+```sh
+42
+key_event_cb:1100() 42
+
+__foreach_registered_dev_cb:264() returns UA_ERROR_NONE
+__foreach_registered_dev_cb:270() Device MAC Address : 4c:66:41:a9:2b:94
+__foreach_registered_dev_cb:276() Device Mobile ID : E4:5D:75:FD:E3:45
+__foreach_registered_dev_cb:264() returns UA_ERROR_NONE
+__foreach_registered_dev_cb:270() Device MAC Address : 71:A0:C2:FF:99:5D
+__foreach_registered_dev_cb:276() Device Mobile ID : E4:5D:75:FD:E3:45
+test_input_callback:792() returns UA_ERROR_NONE
+
+43
+key_event_cb:1100() 43
+
+__foreach_registered_dev_cb:264() returns UA_ERROR_NONE
+__foreach_registered_dev_cb:270() Device MAC Address : 4c:66:41:a9:2b:94
+__foreach_registered_dev_cb:276() Device Mobile ID : E4:5D:75:FD:E3:45
+__foreach_registered_dev_cb:264() returns UA_ERROR_NONE
+__foreach_registered_dev_cb:270() Device MAC Address : 71:A0:C2:FF:99:5D
+__foreach_registered_dev_cb:276() Device Mobile ID : E4:5D:75:FD:E3:45
+test_input_callback:792() returns UA_ERROR_NONE
+```
+
+# Trouble shooting
+###### 1. If get_default user command fails
+- Execute 'get_default_user'
+```sh
+tc_usage_print:828() Key 21 : usage Get default user)
+```
+- OUTPUT
+```sh
+test_input_callback:499() returns UA_ERROR_NONE
+test_input_callback:505() ua_user_get_account returned : UA_ERROR_NONE
+test_input_callback:507() User account info default@default.com
+```
+- Solution
+```sh
+STEP 1. remove DB first
+sh-3.2# rm -f /opt/usr/dbspace/.ua-manager-data.db*
+
+STEP 2. re-install ua-manager RPMs
+
+STEP 3. set capabilities
+sh-3.2# setcap cap_net_admin,cap_net_raw,cap_sys_rawio+eip /usr/bin/ua-manager
+sh-3.2# /usr/share/security-config/set_capability
+
+STEP 4. sync & reboot
+```
+
+##### 2. If Wi-Fi plugin can't find any 'added_devices' when I use sdb using the Ethernet.
+You must unplug the Ethernet and test it. Regarding this, you can see the network type currently being used by Wi-Fi plugin below.
+```sh
+01-01 09:28:18.256+0900 I/UA_PLUGIN_WIFI(P 1925, T 1925): wifi-networkmanager.c: __nm_get_mac_address(390) > Currently Network Status Wired
+01-01 09:28:18.256+0900 D/UA_PLUGIN_WIFI(P 1925, T 1925): wifi-networkmanager.c: __nm_get_mac_address(404) > -
+01-01 09:28:18.256+0900 I/UA_PLUGIN_WIFI(P 1925, T 1925): wifi-scan.c: __arp_packet_make(57) > currently Network mac Address = fe:ae:48:72:e2:5a source_mac = fe:ae:48:72:e2:5a
+```
+