* Custom function for writing OD object "Consumer heartbeat time" * * For more information see file CO_ODinterface.h, OD_IO_t. */
| 74 | * For more information see file CO_ODinterface.h, OD_IO_t. |
| 75 | */ |
| 76 | static ODR_t |
| 77 | OD_write_1016(OD_stream_t* stream, const void* buf, OD_size_t count, OD_size_t* countWritten) { |
| 78 | CO_HBconsumer_t* HBcons; |
| 79 | |
| 80 | if (stream == NULL) { |
| 81 | return ODR_DEV_INCOMPAT; |
| 82 | } |
| 83 | HBcons = stream->object; |
| 84 | |
| 85 | if ((buf == NULL) || (stream->subIndex < 1U) |
| 86 | || (stream->subIndex > HBcons->numberOfMonitoredNodes) || (count != sizeof(uint32_t)) |
| 87 | || (countWritten == NULL)) { |
| 88 | return ODR_DEV_INCOMPAT; |
| 89 | } |
| 90 | |
| 91 | uint32_t val = CO_getUint32(buf); |
| 92 | uint8_t nodeId = (uint8_t)((val >> 16) & 0xFFU); |
| 93 | uint16_t consumer_time = (uint16_t)(val & 0xFFFFU); |
| 94 | CO_ReturnError_t ret = CO_HBconsumer_initEntry(HBcons, stream->subIndex - 1U, nodeId, consumer_time); |
| 95 | if (ret != CO_ERROR_NO) { |
| 96 | return ODR_PAR_INCOMPAT; |
| 97 | } |
| 98 | |
| 99 | /* write value to the original location in the Object Dictionary */ |
| 100 | return OD_writeOriginal(stream, buf, count, countWritten); |
| 101 | } |
| 102 | #endif |
| 103 | |
| 104 | CO_ReturnError_t |
nothing calls this directly
no test coverage detected