syntax = "proto2";

import "nanopb.proto";



message FirmwareStart {
  required string name = 1 [(nanopb).max_size = 32];
  required uint32 size = 2;
  required uint32 packages = 3;
  required uint32 device_id = 4;
  required uint32 crc_fw = 5;
}

message FirmwareFileCheck {
  required string name = 1 [(nanopb).max_size = 32];
  required uint32 size = 2;
  required uint32 device_id = 3;
  required bool   ready_for_data =4;
  required uint32 crc_fw = 5;
}

message FirmwarePackage {
  required uint32 counter = 1;
  required uint32 crc_pac = 2;
  required uint32 device_id = 3;
  required bytes data = 4 [(nanopb).max_size = 256];
}

message FirmwarePackageAck {
  required uint32 counter = 1;
  required uint32 crc_pac = 2;
  required uint32 device_id = 3;
  required bool ack =4;
}

message FirmwareDone {
  required uint32 size = 1;
  required uint32 crc_fw = 2;
  required uint32 device_id = 3;
}


message FirmwareUpdateDone {
  required uint32 device_id = 3;
}



