UA_VALIDATE_INPUT_PARAMETER(device_id);
retv_if(UA_MAC_TYPE_NONE >= mac_type, UA_ERROR_INVALID_PARAMETER);
- retv_if(UA_MAC_TYPE_INVALID <= mac_type, UA_ERROR_INVALID_PARAMETER);
+ /*retv_if(UA_MAC_TYPE_INVALID <= mac_type, UA_ERROR_INVALID_PARAMETER);*/
retv_if((strlen(mac_address) != (UA_MAC_ADDRESS_STRING_LEN -1)),
UA_ERROR_INVALID_PARAMETER);
retv_if((((device->device_id == NULL) && (device->mac == NULL))), UA_ERROR_INVALID_PARAMETER);
retv_if((UA_MAC_TYPE_NONE >= device->type), UA_ERROR_INVALID_PARAMETER);
- retv_if((UA_MAC_TYPE_INVALID <= device->type), UA_ERROR_INVALID_PARAMETER);
+ /*retv_if((UA_MAC_TYPE_INVALID <= device->type), UA_ERROR_INVALID_PARAMETER);*/
user_callback = _ua_get_user_callback(UA_USER_EVENT_DEVICE_ADDED, device->type);
if (user_callback && user_callback != callback) {
}
}
-const char* uat_get_sensor_bitmask_str(ua_sensor_type_e sensor)
+const char* uat_get_sensor_bitmask_str(int sensor)
{
switch (sensor) {
/* CHECK: List all enum values here */
default:
return "Unknown";
}
-
}
char* uat_get_time()
const char* uat_get_sensor_str(int sensors);
const char* uat_get_mac_type_str(int sensor);
const char* uat_get_str_from_uat_mac_type(int mac_type);
-const char* uat_get_sensor_bitmask_str(ua_sensor_type_e sensor);
+const char* uat_get_sensor_bitmask_str(int sensor);
char* uat_get_time(void);
-const char * uat_convert_device_mac_type_to_txt(ua_mac_type_e mac_type);
+const char * uat_convert_device_mac_type_to_txt(int mac_type);
void uat_print_device_uid(const char *device_uid);
void uat_clear_device_list(void);
ua_mac_type_e uat_convert_idx_to_device_type(int idx);
bool _foreach_added_device_cb(
ua_device_h device_handle, void *user_data);
+#define UA_SENSOR_WIFI_LOCATION 0x00000040
+#define UA_MAC_TYPE_WIFI_LOCATION 0x10
+#define UA_SENSOR_UWB 0x00000080
+#define UA_MAC_TYPE_UWB 0x20
+
#ifdef __cplusplus
}
#endif
msg(" - ua_device_get_mac_type() ret: [0x%X] [%s]",
ret, uat_get_error_str(ret));
}
- msgb("[%s] Presence detected on [%s]",
+ msgb("[%s] Device detected on [%s]",
uat_convert_device_mac_type_to_txt(mac_type), mac);
g_free(mac);
}
/* For device information */
- //if (device_handle)
- // __sensor_presence_detected_device(device_handle);
+ if (device_handle)
+ __sensor_presence_detected_device(device_handle);
ret = ua_location_get_distance(location_handle, &distance);
if (UA_ERROR_NONE != ret) {
extern char g_sensor_list_str[MENU_DATA_SIZE + 1]; /**< Sendosr list string */
extern unsigned int g_sensor_list; /**< Added sensor list */
-const char * uat_convert_device_mac_type_to_txt(ua_mac_type_e mac_type)
+const char * uat_convert_device_mac_type_to_txt(int mac_type)
{
switch (mac_type) {
case UA_MAC_TYPE_BT:
}
is_available = false;
}
+
+ /* Add Wifi location Sensor */
+ unsigned int i;
+ i = UA_SENSOR_WIFI_LOCATION;
+ ret = ua_monitor_is_sensor_available(i, &is_available);
+ if (UA_ERROR_NONE == ret && is_available) {
+ ua_monitor_add_sensor(g_ua_mon_h, i);
+ g_sensor_list |= i;
+ buf = uat_get_sensor_bitmask_str(i);
+ strncat(g_sensor_list_str, buf,
+ sizeof(g_sensor_list_str) - strlen(g_sensor_list_str) - 1);
+ strncat(g_sensor_list_str, " ",
+ sizeof(g_sensor_list_str) - strlen(g_sensor_list_str) - 1);
+ }
+
+ /* Add UWB Sensor */
+ i = UA_SENSOR_UWB;
+ ret = ua_monitor_is_sensor_available(i, &is_available);
+ if (UA_ERROR_NONE == ret && is_available) {
+ ua_monitor_add_sensor(g_ua_mon_h, i);
+ g_sensor_list |= i;
+ buf = uat_get_sensor_bitmask_str(i);
+ strncat(g_sensor_list_str, buf,
+ sizeof(g_sensor_list_str) - strlen(g_sensor_list_str) - 1);
+ strncat(g_sensor_list_str, " ",
+ sizeof(g_sensor_list_str) - strlen(g_sensor_list_str) - 1);
+ }
+
return ret;
}