37 lines
823 B
C
37 lines
823 B
C
#pragma once
|
|
#include <stdio.h>
|
|
#include <stdint.h>
|
|
#include <time.h>
|
|
#include <sys/time.h>
|
|
#include <pthread.h>
|
|
#include "bsp_rtdb.h"
|
|
#include "kit_math.h"
|
|
#include "kit_data.h"
|
|
#include "kit_db.h"
|
|
#include "utextend.h"
|
|
#include "uthash.h"
|
|
|
|
typedef struct
|
|
{
|
|
uint16_t bsupointId;
|
|
uint16_t bcupointId;
|
|
} bcu2bsu_t;
|
|
|
|
typedef struct
|
|
{
|
|
uint16_t bsupointId; // key
|
|
int bcupointId; // value
|
|
UT_hash_handle hh; // makes this structure hashable
|
|
} BcuBsuMap;
|
|
|
|
// 初始化全局哈希表
|
|
void init_bcu_bsu_map(BcuBsuMap **bsu_map);
|
|
|
|
// 清理全局哈希表
|
|
void free_bcu_bsu_map(BcuBsuMap *bsu_map);
|
|
|
|
// 使用哈希表
|
|
int bcuTransbsuPoint(BcuBsuMap *bsu_map, uint16_t bsupointId);
|
|
|
|
double getBsuRTDBPointValue(BcuBsuMap *bsu_map, rtdb_type_e type, uint16_t devType, uint16_t devId, uint16_t pointId);
|