hikvision_service 0.0.2
hikvision_service: ^0.0.2 copied to clipboard
A Dart library to interact with Hikvision devices via ISAPI protocol and register them to cloud services.
Hikvision Service #
A Dart library for interacting with Hikvision devices using the ISAPI protocol. This package allows you to fetch device information and register devices to a backend API.
Features #
- Device Info: Fetch MAC address, Serial Number (Full & Short) from Hikvision devices via ISAPI (XML).
- Authentication: Supports Digest Authentication required by Hikvision devices.
- Registration: Helper methods to push device data to a cloud API (Tipsoi/CS3 compatible).
Getting started #
Add this to your package's pubspec.yaml file:
dependencies:
hikvision_service: ^0.0.1
Usage #
import 'package:hikvision_service/hikvision_service.dart';
void main() async {
final service = HikvisionService();
try {
// 1. Fetch Device Info
final info = await service.getDeviceInfo('192.168.1.64', 'admin', 'password');
print('MAC: ${info.macAddress}');
print('Serial: ${info.shortSerialNumber}');
// 2. Register (Optional)
await service.createDeviceApi(
identifier: info.shortSerialNumber,
vendorId: info.fullSerialNumber,
macAddress: info.macAddress,
hikSecurityCode: 'password',
timezoneOffsetMinutes: 360,
);
} catch (e) {
print('Error: $e');
}
}