/* * HAL (Hardware Abstract Layer) UWB API * * Copyright (c) 2021 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the License); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __HAL_UWB_INTERFACE_1__ #define __HAL_UWB_INTERFACE_1__ #include #include #include #include #ifdef __cplusplus extern "C" { #endif typedef struct { uint64_t node_id; uint16_t pan_id; bool is_remote; uint64_t distance; int x; int y; int z; int range; int aoa; int pdoa; } uwb_hal_node_s; typedef struct { uint16_t pan_id; GSList *remote_node_list; int remote_node_count; } uwb_hal_network_s; typedef struct { void (*message_received_cb) (uint16_t node_id, unsigned char *message, int message_length); void (*position_changed_cb) (uint16_t node_id, int x, int y, int z); } uwb_hal_event_cbs_s; typedef struct _hal_backend_uwb_funcs { int (*start)(uwb_hal_event_cbs_s *event_cbs); int (*stop)(void); int (*test) (void); int (*reset) (void); int (*factory_reset) (void); int (*enable_network) (void); int (*disable_network) (void); int (*get_network_info) (uwb_hal_network_s **network_info); int (*set_configurations) (uint16_t node_id, const GVariant *configurations); int (*get_configurations) (uint16_t node_id, GVariant **configurations); int (*set_position) (uint64_t node_id, int x, int y, int z); int (*get_own_node) (uwb_hal_node_s **own_node); int (*send_message) (const unsigned char *message, int message_length); int (*send_message_to) (uint16_t node_id, const unsigned char *message, int message_length); } hal_backend_uwb_funcs; #ifdef __cplusplus } #endif #endif /* __HAL_UWB_INTERFACE_1__ */