#include <stdbool.h>
#include <stdint.h>
#include <stddef.h>
Go to the source code of this file.
◆ LENGTH_EXTENDER_BYTE
#define LENGTH_EXTENDER_BYTE 0xFF |
◆ OFFSET_TO_BID
◆ OFFSET_TO_LEN
◆ OFFSET_TO_LEN_EXT_HI
#define OFFSET_TO_LEN_EXT_HI 4 |
◆ OFFSET_TO_LEN_EXT_LO
#define OFFSET_TO_LEN_EXT_LO 5 |
◆ OFFSET_TO_MID
◆ OFFSET_TO_PAYLOAD
#define OFFSET_TO_PAYLOAD 4 |
◆ OFFSET_TO_PAYLOAD_EXT
#define OFFSET_TO_PAYLOAD_EXT 6 |
◆ OFFSET_TO_PREAMBLE
#define OFFSET_TO_PREAMBLE 0 |
◆ XBUS_CHECKSUM_SIZE
#define XBUS_CHECKSUM_SIZE 1 |
◆ XBUS_EXTENDED_LENGTH
#define XBUS_EXTENDED_LENGTH 0xFF |
◆ XBUS_MASTERDEVICE
#define XBUS_MASTERDEVICE 0xFF |
◆ XBUS_PREAMBLE
#define XBUS_PREAMBLE 0xFA |
◆ Xbus_checkPreamble()
bool Xbus_checkPreamble |
( |
const uint8_t * |
xbusMessage | ) |
|
Returns true if the preamble equeals 0xFA, false othersise.
Definition at line 70 of file xbus.c.
◆ Xbus_getBusId()
int Xbus_getBusId |
( |
const uint8_t * |
xbusMessage | ) |
|
Returns xbus Bus identifier.
Definition at line 77 of file xbus.c.
◆ Xbus_getConstPointerToPayload()
uint8_t const* Xbus_getConstPointerToPayload |
( |
uint8_t const * |
xbusMessage | ) |
|
Returns a const pointer to payload of an xbus message.
Definition at line 167 of file xbus.c.
◆ Xbus_getMessageId()
int Xbus_getMessageId |
( |
const uint8_t * |
xbusMessage | ) |
|
Returns xbus Message identifier.
Definition at line 91 of file xbus.c.
◆ Xbus_getPayloadLength()
int Xbus_getPayloadLength |
( |
const uint8_t * |
xbusMessage | ) |
|
Returns xbus message (payload) length.
Definition at line 105 of file xbus.c.
◆ Xbus_getPointerToPayload()
uint8_t* Xbus_getPointerToPayload |
( |
uint8_t * |
xbusMessage | ) |
|
Returns pointer to payload of an xbus message.
Definition at line 157 of file xbus.c.
◆ Xbus_getRawLength()
int Xbus_getRawLength |
( |
const uint8_t * |
xbusMessage | ) |
|
Returns total length of xbus message (header + payload + checksum)
Definition at line 144 of file xbus.c.
◆ Xbus_insertChecksum()
void Xbus_insertChecksum |
( |
uint8_t * |
xbusMessage | ) |
|
Inserts the correct checksum in xbus message.
Definition at line 175 of file xbus.c.
◆ Xbus_message()
void Xbus_message |
( |
uint8_t * |
xbusMessage, |
|
|
uint8_t |
bid, |
|
|
uint8_t |
mid, |
|
|
uint16_t |
len |
|
) |
| |
Initialize a xbus message with BID, MID and Length.
Definition at line 134 of file xbus.c.
◆ Xbus_setBusId()
void Xbus_setBusId |
( |
uint8_t * |
xbusMessage, |
|
|
uint8_t |
busId |
|
) |
| |
Sets xbus Bus identifier.
Definition at line 84 of file xbus.c.
◆ Xbus_setMessageId()
void Xbus_setMessageId |
( |
uint8_t * |
xbusMessage, |
|
|
uint8_t |
messageId |
|
) |
| |
Sets xbus Message identifier.
Definition at line 98 of file xbus.c.
◆ Xbus_setPayloadLength()
void Xbus_setPayloadLength |
( |
uint8_t * |
xbusMessage, |
|
|
uint16_t |
payloadLength |
|
) |
| |
Sets xbus message (payload) length.
Definition at line 120 of file xbus.c.
◆ Xbus_verifyChecksum()
bool Xbus_verifyChecksum |
( |
const uint8_t * |
xbusMessage | ) |
|
Verifies the checksum of aon xbus message.
Definition at line 188 of file xbus.c.