...
...
Code Block | ||
---|---|---|
| ||
Bool CWPortGetInboundFileWriteBuf (uint8_t** buf, uint16_t *bufSize) { static uint8_t ftBuf[CWMSGCMD_FT_MAX_SIZE]; CW_REQUIRE(buf != NULL); CW_REQUIRE(bufSize != NULL); *buf = ftBuf; *bufSize = sizeof(ftBuf); CW_ENSURE(*buf != NULL); CW_ENSURE(*bufSize >= CWMSGCMD_FT_MAX_SIZE); return true; } bool CWPortExeFileWrite (int8_t* fileStr, uint32_t offset, uint8_t* data, uint16_t dataLen) { CW_REQUIRE(fileStr != NULL); CW_REQUIRE(data != NULL); CW_REQUIRE(dataLen <= CWMSGCMD_FT_MAX_SIZE); if (offset == 0) { if (fpWrite != NULL) fclose(fpWrite); /* Close open files */ CW_ASSERT((fpWrite = _fsopen(fileStr, "wb+", _SH_DENYNO)) != NULL); } CW_ASSERT(fwrite(data, 1, dataLen, fpWrite) == dataLen); if ((dataLen < CWMSGCMD_FT_MAX_SIZE) && (fpWrite != NULL)) { fclose(fpWrite);} return true; } |
Anchor | ||||
---|---|---|---|---|
|
See the following document and video for instructions on testing file transfer.
https://sitesage.atlassian.net/wiki/x/FwBfFQ
https://www.loom.com/share/85f56abaf2874fa79c844c5e0580eb36?sid=aea09ba1-0528-40cf-890f-d6536f5d3f73
Anchor | ||||
---|---|---|---|---|
|
...