hikvision_service 0.0.2 copy "hikvision_service: ^0.0.2" to clipboard
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.

example/example.dart

import 'package:hikvision_service/hikvision_service.dart';

void main() async {
  final service = HikvisionService();

  // Replace with actual device credentials
  final ip = '192.168.1.64';
  final user = 'admin';
  final password = 'password';

  try {
    print("Fetching device info...");
    final info = await service.getDeviceInfo(ip, user, password);
    
    print("Device Info Fetched:");
    print("MAC Address: ${info.macAddress}");
    print("Full Serial: ${info.fullSerialNumber}");
    print("Short Serial: ${info.shortSerialNumber}");

    // Uncomment to test registration
    /*
    print("Registering device...");
    await service.createDeviceApi(
      identifier: info.shortSerialNumber,
      vendorId: info.fullSerialNumber,
      macAddress: info.macAddress,
      hikSecurityCode: password,
      timezoneOffsetMinutes: 360,
    );
    print("Device registered successfully.");
    */

    /*
    print("Fetching device list...");
    final deviceList = await service.fetchDeviceList();
    print("Devices: $deviceList");
    */
    
  } catch (e) {
    print("An error occurred: $e");
  }
}
0
likes
145
points
152
downloads

Publisher

unverified uploader

Weekly Downloads

A Dart library to interact with Hikvision devices via ISAPI protocol and register them to cloud services.

Repository (GitHub)

Documentation

API reference

License

MIT (license)

Dependencies

http, http_auth, xml

More

Packages that depend on hikvision_service