Skip to content

BM_INIT_LIN_MSG macro reference

BMAPI 1.14.0.42 · bm_usb_def.h

#define BM_INIT_LIN_MSG(_msg, _id, _dlc, _payload) { \
(_msg).ctrl.lin.DLC = (_dlc); \
(_msg).id = (_id); \
if ((_payload) != NULL) { uint8_t i; for (i = 0; i < sizeof((_msg).payload); i++) { (_msg).payload[i] = ((uint8_t*)(_payload))[i]; } } \
}

Value:

{ \
(_msg).ctrl.lin.DLC = (_dlc); \
(_msg).id = (_id); \
if ((_payload) != NULL) { uint8_t i; for (i = 0; i < sizeof((_msg).payload); i++) { (_msg).payload[i] = ((uint8_t*)(_payload))[i]; } } \
}

Helper macro to initialize a BM_LinMessageTypeDef object.


Source: BMAPI 1.14.0.42 released Doxygen documentation. The headers and help files bundled with an installed SDK define its version-specific contract.