summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChanwoo Choi <cw00.choi@samsung.com>2024-06-20 13:16:26 +0900
committerChanwoo Choi <cw00.choi@samsung.com>2024-06-20 16:59:24 +0900
commitd0904f22ec0c5bf98442062ee6eab4e7397ffd80 (patch)
tree9020f8b53ec19b288fd5effc1b6a709381e4cd01
parent9d08ad0008205230d0812f1c4703591fda228011 (diff)
downloaduwb-d0904f22ec0c5bf98442062ee6eab4e7397ffd80.tar.gz
uwb-d0904f22ec0c5bf98442062ee6eab4e7397ffd80.tar.bz2
uwb-d0904f22ec0c5bf98442062ee6eab4e7397ffd80.zip
Add support for HAL_MODULE_UWB v1.0 interface
HAL_MODULE_UWB will support the multiple version of HAL interface. So that v1.0 is first supported version of HAL_MODULE_UWB. hal-uwb-interface-1.h contains the v1.0 HAL interface. Change-Id: If509fe48da09340caf1aa3388188c34f6c12ebc8 Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
-rw-r--r--CMakeLists.txt3
-rwxr-xr-xinclude/hal-uwb-interface-1.h75
-rwxr-xr-xinclude/hal-uwb-interface.h53
3 files changed, 77 insertions, 54 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 47fbf43..dc48e4f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -47,6 +47,5 @@ SET_TARGET_PROPERTIES( ${PROJECT_NAME} PROPERTIES VERSION ${VERSION})
CONFIGURE_FILE( ${PROJECT_NAME}.pc ${PROJECT_NAME}.pc @ONLY)
INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${LIBDIR}/hal)
-INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/include/hal-uwb.h DESTINATION ${INCLUDEDIR}/hal)
-INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/include/hal-uwb-interface.h DESTINATION ${INCLUDEDIR}/hal)
+INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/ DESTINATION ${INCLUDEDIR}/hal FILES_MATCHING PATTERN "hal-uwb*.h")
INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}.pc DESTINATION ${LIBDIR}/pkgconfig)
diff --git a/include/hal-uwb-interface-1.h b/include/hal-uwb-interface-1.h
new file mode 100755
index 0000000..8b6e3ed
--- /dev/null
+++ b/include/hal-uwb-interface-1.h
@@ -0,0 +1,75 @@
+/*
+ * 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 <hal/hal-common-interface.h>
+#include <stdbool.h>
+#include <stdint.h>
+#include <glib.h>
+
+#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__ */
diff --git a/include/hal-uwb-interface.h b/include/hal-uwb-interface.h
index 36115a0..a959404 100755
--- a/include/hal-uwb-interface.h
+++ b/include/hal-uwb-interface.h
@@ -19,57 +19,6 @@
#ifndef __HAL_UWB_INTERFACE__
#define __HAL_UWB_INTERFACE__
-#include <hal/hal-common-interface.h>
-#include <stdbool.h>
-#include <stdint.h>
-#include <glib.h>
+#include <hal-uwb-interface-1.h>
-#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__ */