diff options
author | Abhay Agarwal <ay.agarwal@samsung.com> | 2022-06-06 14:00:06 +0530 |
---|---|---|
committer | Abhay Agarwal <ay.agarwal@samsung.com> | 2022-06-06 14:00:06 +0530 |
commit | bf5081fa3ddb0163c07fe7e4c26b82c76e33944d (patch) | |
tree | 08c8334532df0accac5053fe22c62b5069291ca8 | |
parent | d84e6fb585e59290db562feeeb62f0c269532fe1 (diff) | |
download | user-awareness-bf5081fa3ddb0163c07fe7e4c26b82c76e33944d.tar.gz user-awareness-bf5081fa3ddb0163c07fe7e4c26b82c76e33944d.tar.bz2 user-awareness-bf5081fa3ddb0163c07fe7e4c26b82c76e33944d.zip |
Update README
Change-Id: Ied85a969374ac03c179bc6b8dbc9f298604d7663
Signed-off-by: Abhay Agarwal <ay.agarwal@samsung.com>
-rw-r--r-- | README.md | 902 |
1 files changed, 308 insertions, 594 deletions
@@ -4,22 +4,23 @@ User Awareness Framework CAPI # Test Environment(demo#1 version) * TV Board used: -> 1. Kant M2 ATSC [To verify BLE and WiFi Sensors] +> 1. Nike 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 +http://repos.vd.sec.samsung.net/products/tv/official/2023/ONEMAIN/NikeM2/latest/images/T-NKM2AKUC/TIZEN-ONEMAIN-NikeM2-RELEASE_20220603.4_T-NKM2AKUC.tar.gz * TV Image info : ``` +sh-3.2# cat /etc/info.ini [Version] -Model=Tizen5/TV; +Model=Tizen6/TV; Build=latest; Release=latest; [Build] Type=eng; -Date=20190108_221638; -Time=22:16:38; +Date=20220417_165901; +Time=16:59:01; Variant=NONE; ID=latest; ``` @@ -47,722 +48,437 @@ logger-mgr --filter UA_MANAGER UAM_API UA_CAPI UA_PLUGIN_BLE UA_PLUGIN_LIGHT UA_ 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 + ## 1. Initialze ``` -saerome.kim@sx:~$ sdb shell ua-test +root:~> ua-test * User Awareness test application -* Build On: Jan 29 2019 02:06:11 +* Build On: May 23 2022 03:56:18 ================================================================= Main ----------------------------------------------------------------- [ 1] Init > --------------------------------------------------------------- - [ u ] Account [ ] - [ - ] Name [ ] + [ - ] Added Sensor(s) [ ] --------------------------------------------------------------- - [ - ] Addes Sensor(s) [ ] + [ u ] Account / Name [default@default.com / default ] --------------------------------------------------------------- - [ d ] Selected Device ID [ ] + [ s ] Service [ua.service.default ] --------------------------------------------------------------- - [ p ] Previous menu - [ m ] Show Menu - [ q ] Quit -================================================================= -( 4923) >> 1 -ua_initialize - - ua_initialize() ret: [0x0] [UA_ERROR_NONE] -( 4923) >> -================================================================= - Main >> Init ------------------------------------------------------------------ - [ 1] Init > - [ 2] Devices > - [ 3] Users > - [ 4] Sensors > - [ 5] Detection > - --------------------------------------------------------------- - [ u ] Account [ ] - [ - ] Name [ ] - --------------------------------------------------------------- - [ - ] Addes Sensor(s) [ ] - --------------------------------------------------------------- - [ d ] Selected Device ID [ ] + [ d ] Device [WIFI Android ] --------------------------------------------------------------- [ p ] Previous menu [ m ] Show Menu [ q ] Quit ================================================================= -( 4923) >> 1 -================================================================= - Main >> Init >> Init ------------------------------------------------------------------ - [ 1] ua_monitor_create - [ 2] ua_monitor_destroy - [ 3] ua_monitor_set_absence_detected_cb - [ 4] ua_monitor_set_sensor_state_cb - [ 5] ua_monitor_unset_absence_detected_cb - [ 6] ua_monitor_unset_sensor_state_cb - [ 7] ua_enable_low_power_mode - [ 8] ua_disable_low_power_mode - --------------------------------------------------------------- - [ u ] Account [ ] - [ - ] Name [ ] - --------------------------------------------------------------- - [ - ] Addes Sensor(s) [ ] - --------------------------------------------------------------- - [ d ] Selected Device ID [ ] - --------------------------------------------------------------- - [ p ] Previous menu - [ m ] Show Menu - [ q ] Quit -================================================================= -( 5088) >> 1 -ua_create_create - - ua_create_create() ret: [0x0] [UA_ERROR_NONE] -( 5088) >> 3 -ua_monitor_set_absence_detected_cb - - ua_monitor_set_absence_detected_cb() ret: [0x0] [UA_ERROR_NONE] -( 5088) >> 4 -ua_monitor_set_sensor_state_cb - - ua_monitor_set_sensor_state_cb() ret: [0x0] [UA_ERROR_NONE] -( 5088) >> -``` - -## 2. Add Devices (Example: Wi-Fi device) -``` +(10890) >> ================================================================= Main >> Init ----------------------------------------------------------------- [ 1] Init > [ 2] Devices > [ 3] Users > - [ 4] Sensors > - [ 5] Detection > + [ 4] Services > + [ 5] Sensors > + [ 6] Detection > + [ 7] Scenario > --------------------------------------------------------------- - [ u ] Account [ ] - [ - ] Name [ ] + [ - ] Added Sensor(s) [ ] --------------------------------------------------------------- - [ - ] Addes Sensor(s) [BLE WIFI MOTION LIGHT ] + [ u ] Account / Name [default@default.com / default ] --------------------------------------------------------------- - [ d ] Selected Device ID [ ] + [ s ] Service [ua.service.default ] --------------------------------------------------------------- - [ p ] Previous menu - [ m ] Show Menu - [ q ] Quit -================================================================= -( 3717) >> 2 - -================================================================= - Main >> Init >> Devices ------------------------------------------------------------------ - [ 1] ua_device_create - [ 2] ua_device_destroy - [ 3] ua_device_set_mac_type () > - [ 4] ua_device_set_os_info () > - [ 5] ua_device_set_mobile_id () > - [ 6] ua_device_set_mac_address () > - [ 7] ua_device_get_wifi_bssid - [ 8] ua_device_set_wifi_ipv4_address () > - [ 9] ua_user_add_device - [ 10] ua_user_remove_device - [ 11] ua_device_get_handle_by_mac_address > - [ 12] ua_device_get_handle_by_mobile_id > - [ 13] ua_foreach_all_registered_dev_info - [ 14] ua_foreach_registered_dev_info_by_user > - --------------------------------------------------------------- - [ u ] Account [ ] - [ - ] Name [ ] - --------------------------------------------------------------- - [ - ] Addes Sensor(s) [BLE WIFI MOTION LIGHT ] - --------------------------------------------------------------- - [ d ] Selected Device ID [ ] + [ d ] Device [WIFI Android ] --------------------------------------------------------------- [ p ] Previous menu [ m ] Show Menu [ q ] Quit ================================================================= -( 3717) >> 1 -ua_device_create - - ua_device_create() ret: [0x0] [UA_ERROR_NONE] -( 3717) >> 3 +(10890) >> -================================================================= - Main >> Init >> Devices >> ua_device_set_mac_type ------------------------------------------------------------------ - [ 1] type (1:BT 2:BLE 3:Wi-Fi 4:Motion 5:Light 6:Audio) () - [ 2] run - --------------------------------------------------------------- - [ u ] Account [ ] - [ - ] Name [ ] - --------------------------------------------------------------- - [ - ] Addes Sensor(s) [BLE WIFI MOTION LIGHT ] - --------------------------------------------------------------- - [ d ] Selected Device ID [ ] - --------------------------------------------------------------- - [ p ] Previous menu - [ m ] Show Menu - [ q ] Quit -================================================================= -( 3717) >> 1 -================================================================= - Input [type (1:BT 2:BLE 3:Wi-Fi 4:Motion 5:Light 6:Audio)] data ------------------------------------------------------------------ - current = [] - new >> 3 -OK. +(10890) >> 7 ================================================================= - Main >> Init >> Devices >> ua_device_set_mac_type + Main >> Init >> Scenario ----------------------------------------------------------------- - [ 1] type (1:BT 2:BLE 3:Wi-Fi 4:Motion 5:Light 6:Audio) (3) - [ 2] run - --------------------------------------------------------------- - [ u ] Account [ ] - [ - ] Name [ ] - --------------------------------------------------------------- - [ - ] Addes Sensor(s) [BLE WIFI MOTION LIGHT ] + [ 1] ua_startup + [ 2] ua_cleanup + [ 3] ua_add_device > + [ 4] ua_foreach + [ 11] start/stop absence/presence detection > + [ 12] start/stop location detection > + [ 21] ua_loop_init_deinit () > + [ 22] ua_loop_startup_cleanup () > --------------------------------------------------------------- - [ d ] Selected Device ID [ ] - --------------------------------------------------------------- - [ p ] Previous menu - [ m ] Show Menu - [ q ] Quit -================================================================= -( 3717) >> 2 -ua_device_set_mac_type - - ua_device_set_mac_type() ret: [0x0] [UA_ERROR_NONE] -( 3717) >> p - -================================================================= - Main >> Init >> Devices ------------------------------------------------------------------ - [ 1] ua_device_create - [ 2] ua_device_destroy - [ 3] ua_device_set_mac_type (WIFI) > - [ 4] ua_device_set_os_info () > - [ 5] ua_device_set_mobile_id () > - [ 6] ua_device_set_mac_address () > - [ 7] ua_device_get_wifi_bssid - [ 8] ua_device_set_wifi_ipv4_address () > - [ 9] ua_user_add_device - [ 10] ua_user_remove_device - [ 11] ua_device_get_handle_by_mac_address > - [ 12] ua_device_get_handle_by_mobile_id > - [ 13] ua_foreach_all_registered_dev_info - [ 14] ua_foreach_registered_dev_info_by_user > + [ - ] Added Sensor(s) [ ] --------------------------------------------------------------- - [ u ] Account [ ] - [ - ] Name [ ] + [ u ] Account / Name [default@default.com / default ] --------------------------------------------------------------- - [ - ] Addes Sensor(s) [BLE WIFI MOTION LIGHT ] + [ s ] Service [ua.service.default ] --------------------------------------------------------------- - [ d ] Selected Device ID [ ] + [ d ] Device [WIFI Android ] --------------------------------------------------------------- [ p ] Previous menu [ m ] Show Menu [ q ] Quit ================================================================= -( 3717) >> 4 +(10890) >> -================================================================= - Main >> Init >> Devices >> ua_device_set_os_info ------------------------------------------------------------------ - [ 1] type (1:Tizen 2:Andorid 3:iOS) () - [ 2] run - --------------------------------------------------------------- - [ u ] Account [ ] - [ - ] Name [ ] - --------------------------------------------------------------- - [ - ] Addes Sensor(s) [BLE WIFI MOTION LIGHT ] - --------------------------------------------------------------- - [ d ] Selected Device ID [ ] - --------------------------------------------------------------- - [ p ] Previous menu - [ m ] Show Menu - [ q ] Quit -================================================================= -( 3717) >> 1 +( 3881) >> 1 + ### uat_scenario_startup ### + - ua_initialize() ret: [0xFCF60003] [UA_ERROR_ALREADY_DONE] +ua_service_create + - ua_service_create() ret: [0x0] [UA_ERROR_NONE] + - ua_service_add() ret: [0x0] [UA_ERROR_NONE] + - ua_set_detection_cycle() ret: [0x0] [UA_ERROR_NONE] +ua_user_create + - ua_user_create() ret: [0x0] [UA_ERROR_NONE] + - ua_user_add() ret: [0x0] [UA_ERROR_NONE] + - ua_service_add_user() ret: [0x0] [UA_ERROR_NONE] +ua_monitor_create + - ua_monitor_create() ret: [0x0] [UA_ERROR_NONE] + - ua_monitor_add_sensor() ret: [0x0] [UA_ERROR_NONE] +ua_monitor_set_sensor_status_changed_cb + - ua_monitor_set_sensor_status_changed_cb() ret: [0x0] [UA_ERROR_NONE] +( 3881) >> -================================================================= - Input [type (1:Tizen 2:Andorid 3:iOS)] data ------------------------------------------------------------------ - current = [] - new >> 2 -OK. -================================================================= - Main >> Init >> Devices >> ua_device_set_os_info ------------------------------------------------------------------ - [ 1] type (1:Tizen 2:Andorid 3:iOS) (2) - [ 2] run - --------------------------------------------------------------- - [ u ] Account [ ] - [ - ] Name [ ] - --------------------------------------------------------------- - [ - ] Addes Sensor(s) [BLE WIFI MOTION LIGHT ] - --------------------------------------------------------------- - [ d ] Selected Device ID [ ] - --------------------------------------------------------------- - [ p ] Previous menu - [ m ] Show Menu - [ q ] Quit -================================================================= -( 3717) >> 2 -ua_device_set_os_info - - ua_device_set_os_info() ret: [0x0] [UA_ERROR_NONE] -( 3717) >> p -================================================================= - Main >> Init >> Devices ------------------------------------------------------------------ - [ 1] ua_device_create - [ 2] ua_device_destroy - [ 3] ua_device_set_mac_type (WIFI) > - [ 4] ua_device_set_os_info (Android) > - [ 5] ua_device_set_mobile_id () > - [ 6] ua_device_set_mac_address () > - [ 7] ua_device_get_wifi_bssid - [ 8] ua_device_set_wifi_ipv4_address () > - [ 9] ua_user_add_device - [ 10] ua_user_remove_device - [ 11] ua_device_get_handle_by_mac_address > - [ 12] ua_device_get_handle_by_mobile_id > - [ 13] ua_foreach_all_registered_dev_info - [ 14] ua_foreach_registered_dev_info_by_user > - --------------------------------------------------------------- - [ u ] Account [ ] - [ - ] Name [ ] - --------------------------------------------------------------- - [ - ] Addes Sensor(s) [BLE WIFI MOTION LIGHT ] - --------------------------------------------------------------- - [ d ] Selected Device ID [ ] - --------------------------------------------------------------- - [ p ] Previous menu - [ m ] Show Menu - [ q ] Quit -================================================================= -( 3717) >> 5 -================================================================= - Main >> Init >> Devices >> ua_device_set_mobile_id ------------------------------------------------------------------ - [ 1] mobile_id () - [ 2] run - --------------------------------------------------------------- - [ u ] Account [ ] - [ - ] Name [ ] - --------------------------------------------------------------- - [ - ] Addes Sensor(s) [BLE WIFI MOTION LIGHT ] - --------------------------------------------------------------- - [ d ] Selected Device ID [ ] - --------------------------------------------------------------- - [ p ] Previous menu - [ m ] Show Menu - [ q ] Quit -================================================================= -( 3717) >> 1 +## 2. Add Devices (Example: Wi-Fi device) -================================================================= - Input [mobile_id] data ------------------------------------------------------------------ - current = [] - new >> 50:77:05:2A:01:E8 -OK. +( 3881) >> 3 ================================================================= - Main >> Init >> Devices >> ua_device_set_mobile_id + Main >> Init >> Scenario >> ua_add_device ----------------------------------------------------------------- - [ 1] mobile_id (50:77:05:2A:01:E8) - [ 2] run + [ 1] OS type (1:Tizen 2:Andorid 3:iOS) (2) + [ 2] device_id () + [ 3] MAC () + [ 4] IPv4 address () + [ 5] run + --------------------------------------------------------------- + [ - ] Added Sensor(s) [WIFI ] --------------------------------------------------------------- - [ u ] Account [ ] - [ - ] Name [ ] + [ u ] Account / Name [ua.scenerio.account1 / default ] --------------------------------------------------------------- - [ - ] Addes Sensor(s) [BLE WIFI MOTION LIGHT ] + [ s ] Service [ua.scenerio.service1 ] --------------------------------------------------------------- - [ d ] Selected Device ID [ ] + [ d ] Device [WIFI Android ] --------------------------------------------------------------- [ p ] Previous menu [ m ] Show Menu [ q ] Quit ================================================================= -( 3717) >> 2 -ua_device_set_mobile_id - - ua_device_set_mobile_id() ret: [0x0] [UA_ERROR_NONE] -( 3717) >> p +( 3881) >> -================================================================= - Main >> Init >> Devices + +================================================================ + Main >> Init >> Scenario >> ua_add_device ----------------------------------------------------------------- - [ 1] ua_device_create - [ 2] ua_device_destroy - [ 3] ua_device_set_mac_type (WIFI) > - [ 4] ua_device_set_os_info (Android) > - [ 5] ua_device_set_mobile_id (50:77:05:2A:01:E8) > - [ 6] ua_device_set_mac_address () > - [ 7] ua_device_get_wifi_bssid - [ 8] ua_device_set_wifi_ipv4_address () > - [ 9] ua_user_add_device - [ 10] ua_user_remove_device - [ 11] ua_device_get_handle_by_mac_address > - [ 12] ua_device_get_handle_by_mobile_id > - [ 13] ua_foreach_all_registered_dev_info - [ 14] ua_foreach_registered_dev_info_by_user > + [ 1] OS type (1:Tizen 2:Andorid 3:iOS) (2) + [ 2] device_id (17:34:98:08:67:12) + [ 3] MAC () + [ 4] IPv4 address () + [ 5] run --------------------------------------------------------------- - [ u ] Account [ ] - [ - ] Name [ ] + [ - ] Added Sensor(s) [WIFI ] --------------------------------------------------------------- - [ - ] Addes Sensor(s) [BLE WIFI MOTION LIGHT ] + [ u ] Account / Name [ua.scenerio.account1 / default ] --------------------------------------------------------------- - [ d ] Selected Device ID [ ] + [ s ] Service [ua.scenerio.service1 ] + --------------------------------------------------------------- + [ d ] Device [WIFI Android 17:34:98:08:67:12 ] --------------------------------------------------------------- [ p ] Previous menu [ m ] Show Menu [ q ] Quit ================================================================= -( 3717) >> 6 +( 3881) >> + ================================================================= - Main >> Init >> Devices >> ua_device_set_mac_address + Main >> Init >> Scenario >> ua_add_device ----------------------------------------------------------------- - [ 1] MAC () - [ 2] run + [ 1] OS type (1:Tizen 2:Andorid 3:iOS) (2) + [ 2] device_id (17:34:98:08:67:12) + [ 3] MAC (17:34:98:08:67:12) + [ 4] IPv4 address () + [ 5] run --------------------------------------------------------------- - [ u ] Account [ ] - [ - ] Name [ ] + [ - ] Added Sensor(s) [WIFI ] --------------------------------------------------------------- - [ - ] Addes Sensor(s) [BLE WIFI MOTION LIGHT ] + [ u ] Account / Name [ua.scenerio.account1 / default ] --------------------------------------------------------------- - [ d ] Selected Device ID [ ] + [ s ] Service [ua.scenerio.service1 ] + --------------------------------------------------------------- + [ d ] Device [WIFI Android 17:34:98:08:67:12 17:34:98:08:67:12 ] --------------------------------------------------------------- [ p ] Previous menu [ m ] Show Menu [ q ] Quit ================================================================= -( 3717) >> 1 +( 3881) >> ================================================================= - Input [MAC] data + Main >> Init >> Scenario >> ua_add_device +----------------------------------------------------------------- + [ 1] OS type (1:Tizen 2:Andorid 3:iOS) (2) + [ 2] device_id (17:34:98:08:67:12) + [ 3] MAC (17:34:98:08:67:12) + [ 4] IPv4 address () + [ 5] run + --------------------------------------------------------------- + [ - ] Added Sensor(s) [BLE WIFI LIGHT ] + --------------------------------------------------------------- + [ u ] Account / Name [ua.scenerio.account1 / default ] + --------------------------------------------------------------- + [ s ] Service [ua.scenerio.service1 ] + --------------------------------------------------------------- + [ d ] Device [WIFI Android 17:34:98:08:67:12 17:34:98:08:67:12 ] + --------------------------------------------------------------- + [ p ] Previous menu + [ m ] Show Menu + [ q ] Quit +================================================================= +( 3756) >> 4 + +================================================================= + Input [IPv4 address] data ----------------------------------------------------------------- current = [] - new >> 24:18:1D:3A:D8:17 + new >> 192.168.60.118 OK. ================================================================= - Main >> Init >> Devices >> ua_device_set_mac_address + Main >> Init >> Scenario >> ua_add_device ----------------------------------------------------------------- - [ 1] MAC (24:18:1D:3A:D8:17) - [ 2] run - --------------------------------------------------------------- - [ u ] Account [ ] - [ - ] Name [ ] - --------------------------------------------------------------- - [ - ] Addes Sensor(s) [BLE WIFI MOTION LIGHT ] - --------------------------------------------------------------- - [ d ] Selected Device ID [ ] - --------------------------------------------------------------- - [ p ] Previous menu - [ m ] Show Menu - [ q ] Quit -================================================================= -( 3717) >> 2 -ua_device_set_mac_address - - ua_device_set_mac_address() ret: [0x0] [UA_ERROR_NONE] -( 3717) >> p - -================================================================= - Main >> Init >> Devices ------------------------------------------------------------------ - [ 1] ua_device_create - [ 2] ua_device_destroy - [ 3] ua_device_set_mac_type (WIFI) > - [ 4] ua_device_set_os_info (Android) > - [ 5] ua_device_set_mobile_id (50:77:05:2A:01:E8) > - [ 6] ua_device_set_mac_address (24:18:1D:3A:D8:17) > - [ 7] ua_device_get_wifi_bssid - [ 8] ua_device_set_wifi_ipv4_address () > - [ 9] ua_user_add_device - [ 10] ua_user_remove_device - [ 11] ua_device_get_handle_by_mac_address > - [ 12] ua_device_get_handle_by_mobile_id > - [ 13] ua_foreach_all_registered_dev_info - [ 14] ua_foreach_registered_dev_info_by_user > - --------------------------------------------------------------- - [ u ] Account [ ] - [ - ] Name [ ] - --------------------------------------------------------------- - [ - ] Addes Sensor(s) [BLE WIFI MOTION LIGHT ] - --------------------------------------------------------------- - [ d ] Selected Device ID [ ] - --------------------------------------------------------------- - [ p ] Previous menu - [ m ] Show Menu - [ q ] Quit -================================================================= -( 3717) >> 9 -ua_user_add_device + [ 1] OS type (1:Tizen 2:Andorid 3:iOS) (2) + [ 2] device_id (17:34:98:08:67:12) + [ 3] MAC (17:34:98:08:67:12) + [ 4] IPv4 address () + [ 5] run + --------------------------------------------------------------- + [ - ] Added Sensor(s) [BLE WIFI LIGHT ] + --------------------------------------------------------------- + [ u ] Account / Name [ua.scenerio.account1 / default ] + --------------------------------------------------------------- + [ s ] Service [ua.scenerio.service1 ] + --------------------------------------------------------------- + [ d ] Device [WIFI Android 17:34:98:08:67:12 17:34:98:08:67:12 ] + --------------------------------------------------------------- + [ p ] Previous menu + [ m ] Show Menu + [ q ] Quit +================================================================= +( 3756) >> 5 +_ +_create_add_device + - ua_device_create() ret: [0x0] [UA_ERROR_NONE] + - ua_device_set_os_info() ret: [0x0] [UA_ERROR_NONE] + - ua_device_set_wifi_ipv4_address() ret: [0x0] [UA_ERROR_NONE] - ua_user_add_device() ret: [0x0] [UA_ERROR_NONE] -( 3717) >> sensor: WIFI is Ready -``` + - Wi-Fi device add ret: [0x0] [UA_ERROR_NONE] +__create_add_device + - ua_device_create() ret: [0x0] [UA_ERROR_NONE] + - ua_device_set_os_info() ret: [0x0] [UA_ERROR_NONE] + - ua_user_add_device() ret: [0x0] [UA_ERROR_NONE] + - BLE device add () ret: [0x0] [UA_ERROR_NONE] +__device_added_cb() result: [0x0] [UA_ERROR_NONE] +Device MAC Type : BLE +Device OS Type : Android +Device ID : 17:34:98:08:67:12 +Device MAC : 17:34:98:08:67:12 +Device IPv4 Addr : + - ua_device_get_mac_type() ret: [0x0] [UA_ERROR_NONE] +__device_added_cb() result: [0x0] [UA_ERROR_NONE] +Device MAC Type : WIFI +Device OS Type : Android +Device ID : 17:34:98:08:67:12 +Device MAC : 17:34:98:08:67:12 +Device IPv4 Addr : 192.168.60.118 + - ua_device_get_mac_type() ret: [0x0] [UA_ERROR_NONE + ## 3. How to check the added device list ``` -================================================================= - Main >> Init >> Devices >> ua_device_set_mac_address ------------------------------------------------------------------ - [ 1] MAC (24:18:1D:3A:D8:17) - [ 2] run - --------------------------------------------------------------- - [ u ] Account [ ] - [ - ] Name [ ] - --------------------------------------------------------------- - [ - ] Addes Sensor(s) [BLE WIFI MOTION LIGHT ] - --------------------------------------------------------------- - [ d ] Selected Device ID [ ] - --------------------------------------------------------------- - [ p ] Previous menu - [ m ] Show Menu - [ q ] Quit -================================================================= -( 3717) >> 2 ================================================================= - Main >> Init >> Devices >> Select Device + Main >> Init >> Scenario >> ua_add_device +----------------------------------------------------------------- + [ 1] OS type (1:Tizen 2:Andorid 3:iOS) (2) + [ 2] device_id (17:34:98:08:67:12) + [ 3] MAC (17:34:98:08:67:12) + [ 4] IPv4 address (192.168.60.118) + [ 5] run + --------------------------------------------------------------- + [ - ] Added Sensor(s) [BLE WIFI LIGHT ] + --------------------------------------------------------------- + [ u ] Account / Name [ua.scenerio.account1 / default ] + --------------------------------------------------------------- + [ s ] Service [ua.scenerio.service1 ] + --------------------------------------------------------------- + [ d ] Device [WIFI Android 17:34:98:08:67:12 17:34:98:08:67:12 ] + --------------------------------------------------------------- + [ p ] Previous menu + [ m ] Show Menu + [ q ] Quit +================================================================= +( 3756) >> d + +================================================================= + Main >> Init >> Scenario >> ua_add_device >> Select Device ----------------------------------------------------------------- [ 1] Device list () [ 2] Apply - --------------------------------------------------------------- - [ u ] Account [ ] - [ - ] Name [ ] - --------------------------------------------------------------- - [ - ] Addes Sensor(s) [BLE WIFI MOTION LIGHT ] - --------------------------------------------------------------- - [ d ] Selected Device ID [ ] - --------------------------------------------------------------- - [ p ] Previous menu - [ m ] Show Menu - [ q ] Quit -================================================================= -( 3717) >> 1 + --------------------------------------------------------------- + [ - ] Added Sensor(s) [BLE WIFI LIGHT ] + --------------------------------------------------------------- + [ u ] Account / Name [ua.scenerio.account1 / default ] + --------------------------------------------------------------- + [ s ] Service [ua.scenerio.service1 ] + --------------------------------------------------------------- + [ d ] Device [WIFI Android 17:34:98:08:67:12 17:34:98:08:67:12 ] + --------------------------------------------------------------- + [ p ] Previous menu + [ m ] Show Menu + [ q ] Quit +================================================================= +( 3756) >> 1 +ua_foreach_devices +g_device_list is NULL + [1] Device MAC Type : WIFI Device OS Type : Android -Device Mobile ID : 50:77:05:2A:01:E8 -Device MAC : 24:18:1D:3A:D8:17 +Device ID : 17:34:98:08:67:12 +Device MAC : 17:34:98:08:67:12 Device BSSID : (null) -Device IPv4 Addr : +Device IPv4 Addr : 192.168.60.118 Pairing Required : NO -( 3717) >> -================================================================= - Input [Device list] data ------------------------------------------------------------------ - current = [] - new >> 1 -OK. +Last present at : 240325 +[2] +Device MAC Type : BLE +Device OS Type : Android +Device ID : 17:34:98:08:67:12 +Device MAC : 17:34:98:08:67:12 +Device BSSID : (null) +Device IPv4 Addr : +Pairing Required : NO +Last present at : 117373 + - ua_foreach_devices() ret: [0x0] [UA_ERROR_NONE] +( 3756) >> ================================================================= - Main >> Init >> Devices ------------------------------------------------------------------ - [ 1] ua_device_create - [ 2] ua_device_destroy - [ 3] ua_device_set_mac_type (WIFI) > - [ 4] ua_device_set_os_info (Android) > - [ 5] ua_device_set_mobile_id (50:77:05:2A:01:E8) > - [ 6] ua_device_set_mac_address (24:18:1D:3A:D8:17) > - [ 7] ua_device_get_wifi_bssid - [ 8] ua_device_set_wifi_ipv4_address () > - [ 9] ua_user_add_device - [ 10] ua_user_remove_device - [ 11] ua_device_get_handle_by_mac_address > - [ 12] ua_device_get_handle_by_mobile_id > - [ 13] ua_foreach_all_registered_dev_info - [ 14] ua_foreach_registered_dev_info_by_user > - --------------------------------------------------------------- - [ u ] Account [ ] - [ - ] Name [ ] - --------------------------------------------------------------- - [ - ] Addes Sensor(s) [BLE WIFI MOTION LIGHT ] - --------------------------------------------------------------- - [ d ] Selected Device ID [1 ] - --------------------------------------------------------------- - [ p ] Previous menu - [ m ] Show Menu - [ q ] Quit -================================================================= -``` + ## 4. Remove device (Following step 3.) ``` + ================================================================= - Main >> Init >> Devices + Main >> Init >> Users ----------------------------------------------------------------- - [ 1] ua_device_create - [ 2] ua_device_destroy - [ 3] ua_device_set_mac_type (WIFI) > - [ 4] ua_device_set_os_info (Android) > - [ 5] ua_device_set_mobile_id (50:77:05:2A:01:E8) > - [ 6] ua_device_set_mac_address (24:18:1D:3A:D8:17) > - [ 7] ua_device_get_wifi_bssid - [ 8] ua_device_set_wifi_ipv4_address () > - [ 9] ua_user_add_device - [ 10] ua_user_remove_device - [ 11] ua_device_get_handle_by_mac_address > - [ 12] ua_device_get_handle_by_mobile_id > - [ 13] ua_foreach_all_registered_dev_info - [ 14] ua_foreach_registered_dev_info_by_user > - --------------------------------------------------------------- - [ u ] Account [ ] - [ - ] Name [ ] - --------------------------------------------------------------- - [ - ] Addes Sensor(s) [BLE WIFI MOTION LIGHT ] - --------------------------------------------------------------- - [ d ] Selected Device ID [1 ] - --------------------------------------------------------------- - [ p ] Previous menu - [ m ] Show Menu - [ q ] Quit -================================================================= -( 3717) >> 10 + [ 1] ua_user_create > + [ 2] ua_user_destroy + [ 4] ua_user_add + [ 5] ua_user_remove + [ 6] ua_get_default_user + [ 7] ua_service_get_user_by_account > + [ 8] ua_foreach_users > + [ 11] ua_user_add_device + [ 12] ua_user_remove_device + [ 14] ua_user_foreach_devices > + --------------------------------------------------------------- + [ - ] Added Sensor(s) [BLE WIFI LIGHT ] + --------------------------------------------------------------- + [ u ] Account / Name [ua.scenerio.account1 / default ] + --------------------------------------------------------------- + [ s ] Service [ua.scenerio.service1 ] + --------------------------------------------------------------- + [ d ] Device [BLE Android 17:34:98:08:67:12 17:34:98:08:67:12 ] + --------------------------------------------------------------- + [ p ] Previous menu + [ m ] Show Menu + [ q ] Quit +================================================================= +( 3756) >> 12 ua_user_remove_device - ua_user_remove_device() ret: [0x0] [UA_ERROR_NONE] -( 3717) >> sensor: WIFI is Not Ready ``` ## 5. Detect PRESENCE (Example. Wi-Fi) ``` ================================================================= - Main >> Init ------------------------------------------------------------------ - [ 1] Init > - [ 2] Devices > - [ 3] Users > - [ 4] Sensors > - [ 5] Detection > - --------------------------------------------------------------- - [ u ] Account [ ] - [ - ] Name [ ] - --------------------------------------------------------------- - [ - ] Addes Sensor(s) [BLE WIFI MOTION LIGHT ] - --------------------------------------------------------------- - [ d ] Selected Device ID [ ] - --------------------------------------------------------------- - [ p ] Previous menu - [ m ] Show Menu - [ q ] Quit -================================================================= -( 3717) >> 5 - -================================================================= - Main >> Init >> Detection + Main >> Init >> Scenario ----------------------------------------------------------------- - [ 1] ua_monitor_start_presence_detection > - [ 2] ua_monitor_stop_presence_detection - [ 3] ua_monitor_start_absence_detection > - [ 4] ua_monitor_stop_absence_detection - --------------------------------------------------------------- - [ u ] Account [ ] - [ - ] Name [ ] - --------------------------------------------------------------- - [ - ] Addes Sensor(s) [BLE WIFI ] - --------------------------------------------------------------- - [ d ] Selected Device ID [ ] - --------------------------------------------------------------- - [ p ] Previous menu - [ m ] Show Menu - [ q ] Quit -================================================================= -( 5088) >> 1 - -================================================================= - Main >> Init >> Detection >> ua_monitor_start_presence_detection + [ 1] ua_startup + [ 2] ua_cleanup + [ 3] ua_add_device > + [ 4] ua_foreach + [ 11] start/stop absence/presence detection > + [ 12] start/stop location detection > + [ 21] ua_loop_init_deinit () > + [ 22] ua_loop_startup_cleanup () > + --------------------------------------------------------------- + [ - ] Added Sensor(s) [BLE WIFI LIGHT ] + --------------------------------------------------------------- + [ u ] Account / Name [ua.scenerio.account1 / default ] + --------------------------------------------------------------- + [ s ] Service [ua.scenerio.service1 ] + --------------------------------------------------------------- + [ d ] Device [BLE Android 17:34:98:08:67:12 17:34:98:08:67:12 ] + --------------------------------------------------------------- + [ p ] Previous menu + [ m ] Show Menu + [ q ] Quit +================================================================= +( 3756) >> 11 + +================================================================= + Main >> Init >> Scenario >> start/stop absence/presence detection ----------------------------------------------------------------- - [ 1] type (1:ALL 2:ANY) (2) - [ 2] run - --------------------------------------------------------------- - [ u ] Account [ ] - [ - ] Name [ ] - --------------------------------------------------------------- - [ - ] Addes Sensor(s) [BLE WIFI ] - --------------------------------------------------------------- - [ d ] Selected Device ID [ ] - --------------------------------------------------------------- - [ p ] Previous menu - [ m ] Show Menu - [ q ] Quit -================================================================= -( 4478) >> 2 -ua_monitor_start_presence_detection + [ 1] ABSENCE detection type (1:ALL 2:ANY) (2) + [ 2] PRESENCE detection type (1:ALL 2:ANY) (2) + [ 3] start + [ 4] stop + --------------------------------------------------------------- + [ - ] Added Sensor(s) [BLE WIFI LIGHT ] + --------------------------------------------------------------- + [ u ] Account / Name [ua.scenerio.account1 / default ] + --------------------------------------------------------------- + [ s ] Service [ua.scenerio.service1 ] + --------------------------------------------------------------- + [ d ] Device [BLE Android 17:34:98:08:67:12 17:34:98:08:67:12 ] + --------------------------------------------------------------- + [ p ] Previous menu + [ m ] Show Menu + [ q ] Quit +================================================================= +( 3756) >> 3 +run_ua_monitor_start_detection + - ua_monitor_start_absence_detection() ret: [0x0] [UA_ERROR_NONE] - ua_monitor_start_presence_detection() ret: [0x0] [UA_ERROR_NONE] -( 4478) >> result : UA_ERROR_NONE -sensor WIFI PRESENCE detected -User account info default@default.com -``` - -## 6. Detect ABSENCE (Example. Wi-Fi) -``` -================================================================= - Main >> Init >> Detection ------------------------------------------------------------------ - [ 1] ua_monitor_start_presence_detection > - [ 2] ua_monitor_stop_presence_detection - [ 3] ua_monitor_start_absence_detection > - [ 4] ua_monitor_stop_absence_detection - --------------------------------------------------------------- - [ u ] Account [ ] - [ - ] Name [ ] - --------------------------------------------------------------- - [ - ] Addes Sensor(s) [BLE MOTION ] - --------------------------------------------------------------- - [ d ] Selected Device ID [ ] - --------------------------------------------------------------- - [ p ] Previous menu - [ m ] Show Menu - [ q ] Quit -================================================================= -( 4478) >> 2 -ua_monitor_stop_presence_detectio - - ua_monitor_stop_presence_detectio() ret: [0x0] [UA_ERROR_NONE] -( 4478) >> 3 +( 3756) >> +[1970-01-01 05:39:57] +Absence detected for service [ua.scenerio.service1] +[WIFI] ABSENCE detected [UA_ERROR_NONE] -================================================================= - Main >> Init >> Detection >> ua_monitor_start_absence_detection ------------------------------------------------------------------ - [ 1] type (1:ALL 2:ANY) (2) - [ 2] run - --------------------------------------------------------------- - [ u ] Account [ ] - [ - ] Name [ ] - --------------------------------------------------------------- - [ - ] Addes Sensor(s) [BLE MOTION ] - --------------------------------------------------------------- - [ d ] Selected Device ID [ ] - --------------------------------------------------------------- - [ p ] Previous menu - [ m ] Show Menu - [ q ] Quit -================================================================= -( 4478) >> 2 -ua_monitor_start_absence_detection - - ua_monitor_start_absence_detection() ret: [0x0] [UA_ERROR_NONE] +[1970-01-01 05:39:58] +[LIGHT] Sensor Status Changed -> ABSENCE +[LIGHT] timestamp [598519] +4 +run_ua_monitor_stop_detection, + - ua_monitor_stop_absence_detection() ret: [0x0] [UA_ERROR_NONE] + - ua_monitor_stop_presence_detection() ret: [0x0] [UA_ERROR_NONE] +( 3756) >> -( 4478) >> result : UA_ERROR_NONE -sensor WIFI ABSENCE detected -User account info default@default.com -absence all detected -``` # Trouble shooting ###### 1. If get_default user command fails @@ -789,5 +505,3 @@ sh-3.2# /usr/share/security-config/set_capability STEP 4. sync & reboot ``` - - |