Firmware update
78
Bonito PRO Technical Manual V1.0.0
Step 4: Write the firmware data to the camera
Euresys frame grabber
enum CameraRegister
{
FileAccessBufferReg = 0x25200,
};
template <typename T>
static bool WriteCameraFile( EGrabber<T> & frameGrabber, const std::vector<char> &data )
{
std::cout<<"\n";
const int64_t dataToWrite = static_cast<int64_t>(data.size());
int64_t maxWriteSize = frameGrabber.getInteger<RemoteModule>("FileAccessLength.Max");
std::vector<char>::const_iterator dataPos = data.begin();
frameGrabber.setString<RemoteModule>("FileOperationSelector", "Write");
int64_t bytesWritten = 0;
while (dataPos < data.end())
{
int writeSize = std::min( maxWriteSize, dataToWrite);
frameGrabber.gcWritePortData<RemoteModule>(FileAccessBufferReg,&*dataPos, writeSize);
frameGrabber.setInteger<RemoteModule>("FileAccessLength",writeSize);
frameGrabber.execute<RemoteModule>("FileOperationExecute");
if( frameGrabber.getInteger<RemoteModule>("FileOperationResult") != writeSize
|| frameGrabber.getString<RemoteModule>("FileOperationStatus") != "Success" )
{
return false;
}
double percentWritten = (100.0* bytesWritten )/ dataToWrite;
std::cout<<"\r"<<std::fixed<<std::setprecision(2)<<percentWritten<<" % ";
bytesW=writeSize;
d=writeSize;
}
return true;
}
Code snippet: Euresys code snippet example