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

Function OD_write_13FE

304/CO_SRDO.c:301–329  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

299}
300
301static ODR_t
302OD_write_13FE(OD_stream_t* stream, const void* buf, OD_size_t count, OD_size_t* countWritten) {
303 if ((stream == NULL) || (stream->subIndex != 0U) || (buf == NULL) || (countWritten == NULL)) {
304 return ODR_DEV_INCOMPAT;
305 }
306
307 CO_SRDOGuard_t* SRDOGuard = stream->object;
308
309 if (SRDOGuard->NMTisOperational) {
310 /* Data cannot be transferred or stored to the application because of the present device state. */
311 return ODR_DATA_DEV_STATE;
312 }
313
314#ifdef CO_CONFORMANCE_TEST_TOOL_ADAPTATION
315 if (OD_not_write_same_value(stream, buf, count)) {
316 return ODR_OK;
317 }
318#endif
319
320 uint8_t configurationValid = CO_getUint8(buf);
321 if (configurationValid == CO_SRDO_VALID_MAGIC) {
322 SRDOGuard->configurationValid = true;
323 } else {
324 SRDOGuard->configurationValid = false;
325 }
326
327 /* write value to the original location in the Object Dictionary */
328 return OD_writeOriginal(stream, buf, count, countWritten);
329}
330
331static ODR_t
332OD_write_13FF(OD_stream_t* stream, const void* buf, OD_size_t count, OD_size_t* countWritten) {

Callers

nothing calls this directly

Calls 3

OD_not_write_same_valueFunction · 0.85
CO_getUint8Function · 0.85
OD_writeOriginalFunction · 0.85

Tested by

no test coverage detected