添加 获取海康NVR时区的API
This commit is contained in:
@@ -23,6 +23,7 @@ var (
|
||||
initNvr func(unsafe.Pointer, string, string, string, string, int) bool
|
||||
checkTimeRegionWithMonth func(core unsafe.Pointer, year int, month int) string
|
||||
checkTimeRegionWithDay func(core unsafe.Pointer, year int, month int, day int) string
|
||||
nvrUTCDiff func(core unsafe.Pointer)
|
||||
)
|
||||
|
||||
func init() {
|
||||
@@ -45,6 +46,7 @@ func init() {
|
||||
purego.RegisterLibFunc(&initNvr, libc, "InitNvr")
|
||||
purego.RegisterLibFunc(&checkTimeRegionWithMonth, libc, "CheckTimeRegionWithMonth")
|
||||
purego.RegisterLibFunc(&checkTimeRegionWithDay, libc, "CheckTimeRegionWithDay")
|
||||
purego.RegisterLibFunc(&nvrUTCDiff, libc, "NvrUTCDiff")
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ extern "C" {
|
||||
Omnimatrix bool InitNvr(void* PtrHIKNvr,char* ip, char* port, char* username, char* password, int channel);
|
||||
Omnimatrix char* CheckTimeRegionWithMonth(void* PtrHIKNvr,int year,int month);
|
||||
Omnimatrix char* CheckTimeRegionWithDay(void* PtrHIKNvr,int year,int month,int day);
|
||||
Omnimatrix int NvrUTCDiff();
|
||||
Omnimatrix int NvrUTCDiff(void* PtrHIKNvr);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -58,8 +58,7 @@ char* CheckTimeRegionWithMonth(void* PtrHIKNvr,int year,int month){
|
||||
std::vector<int> available_date_vec;
|
||||
nRet = HIKNvrObj->CheckTimeRegionWithMonth(select_time, available_date_vec);
|
||||
|
||||
if (nRet == 0)
|
||||
{
|
||||
if (nRet == 0) {
|
||||
res = HIKNvrObj->TimeToJson(select_time, &available_date_vec).dump();
|
||||
}
|
||||
char *cString = new char[res.size() + 1];
|
||||
@@ -76,8 +75,7 @@ char* CheckTimeRegionWithDay(void* PtrHIKNvr,int year,int month,int day){
|
||||
std::string res;
|
||||
std::vector<TimeRecord> available_time_vec;
|
||||
int nRet = HIKNvrObj->CheckTimeRegionWithDay(select_time, available_time_vec);
|
||||
if (nRet == 0)
|
||||
{
|
||||
if (nRet == 0) {
|
||||
res = HIKNvrObj->TimeToJsonInDay(select_time, &available_time_vec).dump();
|
||||
}
|
||||
char *cString = new char[res.size() + 1];
|
||||
|
||||
Reference in New Issue
Block a user