10 #define HAL_LOG_CHANNEL SCOM
11 #define HAL_LOG_SUBCHANNEL SERVICE
23 HAL_ASSERT_AND_EXECUTE(NULL != scom) {
27 if(NULL != frameQueueItem) {
33 .size = frameDataSize + 1,
34 .payload = { .serviceframe.primitive_id = primitiveID }
37 if(frameDataSize > 0) {
67 HAL_ASSERT_AND_EXECUTE(NULL != scom) {
69 HAL_ASSERT_AND_EXECUTE(NULL != multiFrameDesc) {
74 frame = &frameQueueItem->
frame;
77 frame->
type = serviceID;
83 frameCount = frameDataSize / SCOMFrame_GetMaxServiceMultiframePayloadSize();
84 if (frameDataSize % SCOMFrame_GetMaxServiceMultiframePayloadSize()) {
108 if ((frameData) && (frameDataSize)) {
110 uint32_t size = frameDataSize - multiFrameDesc->
progress;
111 if (size > SCOMFrame_GetMaxServiceMultiframePayloadSize()) {
112 size = SCOMFrame_GetMaxServiceMultiframePayloadSize();
115 frame->
size = (uint8_t)size+1;
145 HAL_ASSERT_AND_EXECUTE(NULL != scom) {
Definition of multiframe descriptor structure.
SCOMResult SCOM_DeinitializeServiceMatchFilter(SCOMServiceMatchFilter *serviceMatchFilter)
uint8_t null
TODO: XOR from sof, ctrl, type, size.
SCOMFrameQueue txFrameQueue
descriptor of the frame queue used for sending
struct HAL_PACKED::@1::@4 serviceframe
payload definition for service frame
SCOMResult SCOM_WaitForServiceFilter(SCOMServiceMatchFilter *serviceMatchFilter, OSTime timeout)
SCOMResult SCOM_SetupServiceMatchFilter(SCOMServiceMatchFilter *serviceMatchFilter, uint8_t serviceID, uint8_t primitiveID)
SCOM Data Link descriptor.
uint32_t progress
multiframe id
SCOMResult SCOM_ServiceTransaction(SCOMDataLink scom, const uint8_t framePriority, const uint8_t serviceID, const uint8_t primitiveID, const void *const txData, const uint8_t txDataSize, void *rxData, const size_t rxDataSize)
uint32_t multiCounter
Counter increased after every frame scheduled to send.
bool SCOMFrame_SetPriority(SCOMFrame *const frame, const uint8_t priority)
Definition of a single SCOM frame queue item.
SCOMResult SCOM_RemoveFilter(SCOMDataLink scom, SCOMFilter filter)
SCOMResult SCOM_InitializeServiceMatchFilter(SCOMServiceMatchFilter *serviceMatchFilter, void *data, size_t max_data_size)
uint8_t type
frame type field
#define SCOM_FRAME_CTRL_MULTI_ID_MASK
#define SCOM_SOF_CHARACTER
uint8_t size
frame type field
SCOMFilterDesc filter
Native SCOM filter descriptor.
SCOMResult SCOM_InsertFilter(SCOMDataLink scom, SCOMFilter filter)
SCOMResult SCOM_SendServiceFrame(SCOMDataLink scom, uint8_t framePriority, uint8_t serviceID, uint8_t primitiveID, const void *frameData, uint8_t frameDataSize)
uint8_t ctrl
frame control field
SCOMFrameState state
SCOM frame state.
SCOMFrameQueueItem * SCOMFrameQueue_Lock(SCOMFrameQueue *frameQueue)
union HAL_PACKED::@1 payload
payload field
struct HAL_PACKED SCOMFrame
Definition of an SCOM frame.
uint8_t sof
synchronization field: always 0xFF
SCOMFrame frame
SCOM frame.
struct HAL_PACKED::@1::@5 servicemultiframe
payload definition for a service multi frame
SCOMResult SCOM_SendServiceMultiFrame(SCOMDataLink scom, uint8_t framePriority, uint8_t serviceID, uint8_t primitiveID, const void *frameData, uint32_t frameDataSize, SCOMMultiFrameDesc *multiFrameDesc)
bool SCOMFrameQueue_Insert(SCOMFrameQueue *frameQueue, SCOMFrameQueueItem *frame)
SCOMFrameBuffer * frameBuffer
monitor mode indication (when true - monitor mode is on, the device does not transmit anything...