server side fixed

This commit is contained in:
2021-11-08 17:24:51 +01:00
parent 7b4f8c118b
commit 64a25a242b
22 changed files with 484 additions and 322 deletions

View File

@ -2,6 +2,8 @@
// Copyright (C) 2021 Contributors to the SLS Detector Package
#pragma once
#include "common.h"
#include <stdint.h>
#include <stdio.h>
#include <sys/types.h>
@ -21,15 +23,17 @@ int emptyTempFolder(char *mess);
* verify memory available to copy
* open file to copy
*/
int preparetoCopyProgram(FILE **fd, uint64_t fsize, char *mess);
int copyToFlash(enum PROGRAMINDEX index, char *mType, ssize_t fsize,
char *clientChecksum, char *mess);
int getDrive(enum PROGRAMINDEX index, char *mess);
int preparetoCopyProgram(char *mess, char *functionType, FILE **fd,
uint64_t fsize);
int eraseAndWriteToFlash(char *mess, enum PROGRAM_INDEX index,
char *functionType, char *clientChecksum,
ssize_t fsize);
int getDrive(char *mess, enum PROGRAM_INDEX index);
/** Notify fpga not to touch flash, open src and flash drive to write */
int openFileForFlash(FILE **flashfd, FILE **srcfd, char *mess);
int openFileForFlash(char *mess, FILE **flashfd, FILE **srcfd);
int eraseFlash(char *mess);
/* write from tmp file to flash */
int writeToFlash(ssize_t fsize, FILE *flashfd, FILE *srcfd, char *mess);
int writeToFlash(char *mess, ssize_t fsize, FILE *flashfd, FILE *srcfd);
/** Notify fpga to pick up firmware from flash and wait for status confirmation
*/
int waitForFPGAtoTouchFlash(char *mess);