//------------------------------------------------------------------------------ // Async Upload DB0 (using callback as completion trigger) //------------------------------------------------------------------------------ void AsCBUploadDB0() { int Size = sizeof(Buffer); // Size is IN/OUT par // In input it tells the client the size available // In output it tells us how many bytes were uploaded. int res; JobDone=false; res=Cli_AsUpload(Client, Block_SDB, 0, &Buffer, &Size); if (res==0) { while (!JobDone) { SysSleep(100); } res=JobResult; } if (Check(res,"Async (callback) Block Upload (SDB 0)")) { printf("Dump (%d bytes) :\n",Size); hexdump(&Buffer,Size); } }
//------------------------------------------------------------------------------ // Async Upload DB0 (using event wait as completion trigger) //------------------------------------------------------------------------------ void AsEWUploadDB0() { int Size = sizeof(Buffer); // Size is IN/OUT par // In input it tells the client the size available // In output it tells us how many bytes were uploaded. int res; JobDone=false; res=Cli_AsUpload(Client, Block_SDB, 0, &Buffer, &Size); if (res==0) { res=Cli_WaitAsCompletion(Client,3000); } if (Check(res,"Async (Wait event) Block Upload (SDB 0)")) { printf("Dump (%d bytes) :\n",Size); hexdump(&Buffer,Size); } }
//------------------------------------------------------------------------------ // Async Upload DB0 (using polling as completion trigger) //------------------------------------------------------------------------------ void AsPOUploadDB0() { int Size = sizeof(Buffer); // Size is IN/OUT par // In input it tells the client the size available // In output it tells us how many bytes were uploaded. int res; JobDone=false; res=Cli_AsUpload(Client, Block_SDB, 0, &Buffer, &Size); if (res==0) { while (Cli_CheckAsCompletion(Client,&res)!=JobComplete) { SysSleep(100); }; } if (Check(res,"Async (polling) Block Upload (SDB 0)")) { printf("Dump (%d bytes) :\n",Size); hexdump(&Buffer,Size); } }
//--------------------------------------------------------------------------- int TS7Client::AsUpload(int BlockType, int BlockNum, void *pUsrData, int *Size) { return Cli_AsUpload(Client, BlockType, BlockNum, pUsrData, Size); }