Add support for HAL_MODULE_UWB v1.0 interface 91/313191/3
authorChanwoo Choi <cw00.choi@samsung.com>
Thu, 20 Jun 2024 04:16:26 +0000 (13:16 +0900)
committerChanwoo Choi <cw00.choi@samsung.com>
Thu, 20 Jun 2024 07:59:24 +0000 (16:59 +0900)
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>
CMakeLists.txt
include/hal-uwb-interface-1.h [new file with mode: 0755]
include/hal-uwb-interface.h

index 47fbf43da11ba8367e55f3d92a568288772283c3..dc48e4f99c206ed6d0001c9b5eb53372a748d77e 100644 (file)
@@ -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 (executable)
index 0000000..8b6e3ed
--- /dev/null
@@ -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__ */
index 36115a0934ab0a46abb8e219b94ec78556721ddf..a959404cb53cfacdc3680ca3608832158f36218b 100755 (executable)
 #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__ */