MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / _rym_recv_data

Function _rym_recv_data

components/utilities/ymodem/ry_sy.c:77–97  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

75}
76
77static enum rym_code _rym_recv_data(
78 struct rym_ctx *ctx,
79 rt_uint8_t *buf,
80 rt_size_t len)
81{
82 struct custom_ctx *cctx = (struct custom_ctx *)ctx;
83
84 RT_ASSERT(cctx->fd >= 0);
85 if (cctx->flen == -1)
86 {
87 write(cctx->fd, buf, len);
88 }
89 else
90 {
91 int wlen = len > cctx->flen ? cctx->flen : len;
92 write(cctx->fd, buf, wlen);
93 cctx->flen -= wlen;
94 }
95
96 return RYM_CODE_ACK;
97}
98
99static enum rym_code _rym_recv_end(
100 struct rym_ctx *ctx,

Callers

nothing calls this directly

Calls 1

writeFunction · 0.50

Tested by

no test coverage detected