xFSTK  1.8.1-17.9
Intel SoC Cross Platform Firmware & Software Tool Kit
Public Member Functions | List of all members
DlThreadObj Class Reference

#include <xfstk-dldr-example-parallel.h>

Inheritance diagram for DlThreadObj:
Inheritance graph
[legend]
Collaboration diagram for DlThreadObj:
Collaboration graph
[legend]

Public Member Functions

void DldrRun (void *)
 
void * Arg () const
 
void Arg (void *a)
 
void DoWork ()
 
void DldrRun (void *)
 
void * Arg () const
 
void Arg (void *a)
 
void DoWork ()
 

Member Function Documentation

void DlThreadObj::DldrRun ( void *  arg)

References donetargets, xfstkdldrapi::downloadmtfwosasync(), LastError::error_code, LastError::error_message, failtargets, arg_type::fwdnx, arg_type::fwimage, xfstkdldrapi::getlasterror(), ghListMutex, arg_type::gpflags, list_done, list_running, arg_type::osdnx, arg_type::osimage, xfstkdldrapi::registerstatuscallback(), xfstkdldrapi::settargetretrycount(), xfstkdldrapi::setusbreadwritedelay(), xfstkdldrapi::setwipeifwi(), arg_type::statuscallback, arg_type::usbsn, and thread_rectype::usbsn.

Referenced by DoWork().

48 {
49  bool bResult = false;
50  LastError er;
51  thread_rectype * trd;
52  arg_type * myarg = (arg_type*) arg;
53  xfstkdldrapi xfstktest;
54  xfstkstatuspfn mystatusfn = myarg->statuscallback;
55  xfstktest.registerstatuscallback(mystatusfn,0);
56  xfstktest.settargetretrycount(20);
57  xfstktest.setusbreadwritedelay(0);
58  xfstktest.setwipeifwi(false);
59 
60  bResult = xfstktest.downloadmtfwosasync(
61  (char*)myarg->fwdnx.c_str(),
62  (char*)myarg->fwimage.c_str(),
63  (char*)myarg->osdnx.c_str(),
64  (char*)myarg->osimage.c_str(),
65  (char*)myarg->gpflags.c_str(),
66  (char*)myarg->usbsn.c_str()
67  );
68  xfstktest.getlasterror(&er);
69  if(!bResult) {
70  printf("USBSN: %s -- Downloader thread failed %d Returned error code:%d -- %s\n", myarg->usbsn.c_str(), ThreadId_, er.error_code, er.error_message);
71  } else {
72  printf("USBSN: %s -- Downloader thread succeed %d Returned error code:%d -- %s\n", myarg->usbsn.c_str(), ThreadId_, er.error_code, er.error_message);
73  }
74 #if 1
75  ghListMutex.lock();
76  for (list<void*>::iterator it=list_running.begin(); it!=list_running.end(); it++) {
77  trd = (thread_rectype *)*it;
78  if(trd->usbsn == myarg->usbsn) {
79 
80  list_done.push_back(*it);
81  donetargets++;
82  if(er.error_code != 0)
83  failtargets++;
84  break;
85  }
86  }
87  ghListMutex.unlock();
88 #endif
89 }
virtual void setusbreadwritedelay(unsigned long delayms)
Set the delay time for before each USB bulk read/write in miliseconds.
virtual bool getlasterror(LastError *er)
Get the Last error from XFSTK API version string.
Definition: xfstk-dldr-example-parallel.h:48
string usbsn
Definition: xfstk-dldr-example-parallel.h:43
string usbsn
Definition: xfstk-dldr-example-parallel.h:50
string fwimage
Definition: xfstk-dldr-example-parallel.h:39
unsigned long error_code
Definition: xfstkdldrapi.h:68
This interface enables the development of Intel SoC firmware/operating system provisioning applicatio...
Definition: xfstkdldrapi.h:124
virtual bool downloadmtfwosasync(char *fwdnx, char *fwimage, char *osdnx, char *osimage, char *gpflags, char *usbsn)
Performs parallel multitarget firmware and operating system download in async mode, it will return after the download to the device is done.
virtual void settargetretrycount(int retries)
Sets the number of retries to perform during faulty USB I/O.
list< void * > list_running
Definition: xfstk-dldr-example-parallel.cpp:39
int donetargets
Definition: xfstk-dldr-example-parallel.cpp:44
string fwdnx
Definition: xfstk-dldr-example-parallel.h:38
void(* xfstkstatuspfn)(char *status, void *)
Represents an optional status callback function that can be provided to xfstk API to obtain status in...
Definition: xfstkdldrapi.h:113
string osdnx
Definition: xfstk-dldr-example-parallel.h:40
list< void * > list_done
Definition: xfstk-dldr-example-parallel.cpp:40
string gpflags
Definition: xfstk-dldr-example-parallel.h:42
string osimage
Definition: xfstk-dldr-example-parallel.h:41
virtual void setwipeifwi(bool enable)
Not a POR feature, only a testing/debug feature.
QMutex ghListMutex
Definition: xfstk-dldr-example-parallel.cpp:26
xfstkstatuspfn statuscallback
Definition: xfstk-dldr-example-parallel.h:45
Definition: xfstk-dldr-example-parallel.h:37
int failtargets
Definition: xfstk-dldr-example-parallel.cpp:45
virtual bool registerstatuscallback(xfstkstatuspfn statuspfn, void *clientdata)
Registers a callback with the xfstk api in order to obtain download status information.
char error_message[128]
Definition: xfstkdldrapi.h:69
The last error happened during download.
Definition: xfstkdldrapi.h:67

Here is the call graph for this function:

Here is the caller graph for this function:

void* DlThreadObj::Arg ( ) const
inline

Referenced by DoWork(), and main().

60 {return Arg_;}

Here is the caller graph for this function:

void DlThreadObj::Arg ( void *  a)
inline
61 {Arg_ = a;}
void DlThreadObj::DoWork ( )

References Arg(), and DldrRun().

Referenced by Dlthread::run().

91 {
92  this->DldrRun(this->Arg());
93 }
void * Arg() const
Definition: xfstk-dldr-example-parallel.h:60
void DldrRun(void *)
Definition: xfstk-dldr-example-parallel.cpp:47

Here is the call graph for this function:

Here is the caller graph for this function:

void DlThreadObj::DldrRun ( void *  )
void* DlThreadObj::Arg ( ) const
inline
59 {return Arg_;}
void DlThreadObj::Arg ( void *  a)
inline
60 {Arg_ = a;}
void DlThreadObj::DoWork ( )

The documentation for this class was generated from the following files: