summaryrefslogtreecommitdiff
path: root/service/include
diff options
context:
space:
mode:
authorwangmenglan <[email protected]>2023-10-30 14:29:00 +0800
committerwangmenglan <[email protected]>2023-11-03 18:55:49 +0800
commit1864e517bef94064094724e491d28214d06a3ead (patch)
tree693f8cf7088fea7b3787a4b9d98b28a71ec5c59f /service/include
parentacb9f575974f8609bdb65aefa51ea0aae227d76c (diff)
feature TSG-17374 TSG-17474 support olp6500 configurev4.6.60-20231103
Diffstat (limited to 'service/include')
-rw-r--r--service/include/olp_dev.h106
1 files changed, 106 insertions, 0 deletions
diff --git a/service/include/olp_dev.h b/service/include/olp_dev.h
new file mode 100644
index 0000000..8205242
--- /dev/null
+++ b/service/include/olp_dev.h
@@ -0,0 +1,106 @@
+#pragma once
+#include <netinet/in.h>
+
+#include <common.h>
+
+#define NR_OLP_DEVICE_MAX 8
+#define NR_OLP_CHANNEL_PER_DEVICE_MAX 16
+
+typedef int (*olp_status_query_cb)(void);
+
+enum olp_connect_type
+{
+ OLP_CONNECT_TYPE_UNKNOW,
+ OLP_CONNECT_TYPE_COM,
+ OLP_CONNECT_TYPE_USB,
+ OLP_CONNECT_TYPE_NETWORK,
+};
+
+enum olp_device_type
+{
+ OLP_DEVICE_TYPE_UNKNOWN,
+ OLP_DEVICE_TYPE_NIAGARA_3296,
+ OLP_DEVICE_TYPE_OLP_6500,
+};
+
+enum olp_channel_used
+{
+ OLP_CHANNEL_STATE_UNUSED,
+ OLP_CHANNEL_STATE_USED,
+};
+
+enum olp_channel_state
+{
+ OLP_CHANNEL_STATE_FORCE_ACTIVE,
+ OLP_CHANNEL_STATE_FORCE_BYPASS,
+ OLP_CHANNEL_STATE_REGULAR,
+};
+
+enum olp_channel_heartbeat
+{
+ OLP_CHANNEL_HEARTBEAT_DISABLE,
+ OLP_CHANNEL_HEARTBEAT_ENABLE,
+};
+
+enum olp_channel_nonrevertive_mode
+{
+ OLP_CHANNEL_NONREVERTIVE_DISABLE,
+ OLP_CHANNEL_NONREVERTIVE_ENABLE,
+};
+
+struct olp_channel_timer
+{
+ int enable;
+ pthread_mutex_t timer_lock;
+};
+
+struct olp_channel
+{
+ uint32_t olp_channel_id;
+ enum olp_channel_used used;
+ enum olp_channel_state state;
+
+ uint32_t en_heartbeat;
+ uint32_t heartbeat_send_interval_in_ms;
+ uint32_t heartbeat_timeout_interval_in_ms;
+ uint32_t heartbeat_lost_threshold;
+ uint32_t nonrevertive_mode;
+
+ struct olp_channel_timer timer;
+ struct olp_dev_desc * dev_desc;
+};
+
+struct olp_network_s
+{
+ struct sockaddr_in addr;
+};
+
+struct olp_dev_desc
+{
+ char devsym[MR_SYMBOL_MAX];
+ enum olp_device_type type;
+ enum olp_connect_type conn_type;
+ union {
+ struct olp_network_s network;
+ };
+
+ struct olp_channel * channels;
+
+ olp_status_query_cb status_query;
+};
+
+struct olp_manager_main
+{
+ struct olp_dev_desc * olp_dev_descs[NR_OLP_DEVICE_MAX];
+ uint32_t nr_olp_dev_descs;
+};
+
+struct olp_dev_register
+{
+ char devsym[MR_SYMBOL_MAX];
+ enum olp_device_type type;
+
+ olp_status_query_cb status_query;
+};
+
+struct olp6500_packet;