Skip to content

A350 not work download new record #85

@brux88

Description

@brux88

Regarding the issue, everything works perfectly with the Anviz A350C device. However, with the newer device, we are facing a problem. Specifically, the method for downloading records seems to behave differently:

From my understanding, this method is supposed to:

Download all new records the first time.
Mark them as "already downloaded."
On subsequent requests, download only records that haven’t been downloaded yet.
However, with the new device, it appears to always download all records, regardless of whether they have been downloaded before.

Could you please confirm if this is the expected behavior for the newer device, or if it might be related to the firmware or SDK?

I look forward to your guidance and support. Thank you once again for your assistance.
i attacmnet a picture of 350c e 350 firmware

This is the command of you sdk 2.52:

namespace Anviz.SDK.Commands
{
class GetRecordsCommand : Command
{
private const byte GET_RECORDS = 0x40;
private const byte GET_ALL_RECORDS = 0x1;
private const byte GET_NEW_RECORDS = 0x2;
public GetRecordsCommand(ulong deviceId, bool isFirst, bool onlyNew, ulong amount) : base(deviceId)
{
byte recordType = onlyNew ? GET_NEW_RECORDS : GET_ALL_RECORDS;
byte kind = isFirst ? recordType : (byte)0;
BuildPayload(GET_RECORDS, new byte[] { kind, (byte)Math.Min(amount, Record.MAX_RECORDS) });

    }
}

}

namespace Anviz.SDK
{
public partial class AnvizDevice
{
public async Task<List> DownloadRecords(bool onlyNew = false)
{
var statistics = await GetDownloadInformation();
var recordAmount = onlyNew ? statistics.NewRecordAmount : statistics.AllRecordAmount;
var records = new List((int)recordAmount);
var isFirst = true;
while (recordAmount > 0)
{
var response = await DeviceStream.SendCommand(new GetRecordsCommand(DeviceId, isFirst, onlyNew, recordAmount));
var counter = response.DATA[0];
recordAmount -= counter;
for (var i = 0; i < counter; i++)
{
records.Add(new Record(response.DATA, 1 + i * Record.RECORD_LENGTH));
}
isFirst = false;
}
return records;
}
}
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions