MCPcopy Create free account
hub / github.com/CANopenNode/CANopenNode / OD_write_1300

Function OD_write_1300

304/CO_GFC.c:31–48  ·  view source on GitHub ↗

* Custom function for reading or writing OD object. * * For more information see file CO_ODinterface.h, OD_IO_t. */

Source from the content-addressed store, hash-verified

29 * For more information see file CO_ODinterface.h, OD_IO_t.
30 */
31static ODR_t
32OD_write_1300(OD_stream_t* stream, const void* buf, OD_size_t count, OD_size_t* countWritten) {
33 if ((stream == NULL) || (stream->subIndex != 0U) || (buf == NULL) || (countWritten == NULL)) {
34 return ODR_DEV_INCOMPAT;
35 }
36
37 CO_GFC_t* GFC = stream->object;
38
39 uint8_t value = CO_getUint8(buf);
40 if (value > 1U) {
41 return ODR_INVALID_VALUE;
42 }
43
44 GFC->valid = (value == 1U);
45
46 /* write value to the original location in the Object Dictionary */
47 return OD_writeOriginal(stream, buf, count, countWritten);
48}
49
50#if ((CO_CONFIG_GFC)&CO_CONFIG_GFC_CONSUMER) != 0
51static void

Callers

nothing calls this directly

Calls 2

CO_getUint8Function · 0.85
OD_writeOriginalFunction · 0.85

Tested by

no test coverage detected