resol-vbus-c
|
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
Go to the source code of this file.
Data Structures | |
struct | RESOLVBUS_LIVEENCODEREVENT |
struct | RESOLVBUS_LIVEENCODER |
struct | RESOLVBUS_LIVEDECODEREVENT |
struct | RESOLVBUS_LIVEDECODER |
struct | RESOLVBUS_LIVETRANSCEIVEREVENT |
struct | RESOLVBUS_LIVETRANSCEIVEROPTIONS |
struct | RESOLVBUS_LIVETRANSCEIVER |
Macros | |
#define | RESOLVBUS_CONTAINEROF(__Pointer__, __Type__, __Member__) ((__Type__ *) (((uint8_t *) (__Pointer__)) - ((uint8_t *) (&((__Type__ *) 0)->__Member__)))) |
#define | RESOLVBUS_COUNTOF(__Array__) (sizeof (__Array__) / sizeof ((__Array__) [0])) |
#define | RESOLVBUS_PACKETFRAMECOUNTOF(__Type__) ((sizeof (__Type__) + 3) >> 2) |
#define | RESOLVBUS_LIVEENCODER_INITIALIZER { .BufferLength = 0, } |
#define | RESOLVBUS_LIVEDECODER_INITIALIZER { .BufferIndex = 0, } |
#define | RESOLVBUS_LIVETRANSCEIVEROPTIONS_INITIALIZER { .Tries = 0, } |
#define | RESOLVBUS_LIVETRANSCEIVER_INITIALIZER { .ActionTries = 0, } |
#define RESOLVBUS_CONTAINEROF | ( | __Pointer__, | |
__Type__, | |||
__Member__ | |||
) | ((__Type__ *) (((uint8_t *) (__Pointer__)) - ((uint8_t *) (&((__Type__ *) 0)->__Member__)))) |
#define RESOLVBUS_COUNTOF | ( | __Array__ | ) | (sizeof (__Array__) / sizeof ((__Array__) [0])) |
#define RESOLVBUS_LIVEDECODER_INITIALIZER { .BufferIndex = 0, } |
#define RESOLVBUS_LIVEENCODER_INITIALIZER { .BufferLength = 0, } |
#define RESOLVBUS_LIVETRANSCEIVER_INITIALIZER { .ActionTries = 0, } |
#define RESOLVBUS_LIVETRANSCEIVEROPTIONS_INITIALIZER { .Tries = 0, } |
#define RESOLVBUS_PACKETFRAMECOUNTOF | ( | __Type__ | ) | ((sizeof (__Type__) + 3) >> 2) |
typedef struct RESOLVBUS_LIVEDECODER RESOLVBUS_LIVEDECODER |
typedef struct RESOLVBUS_LIVEDECODEREVENT RESOLVBUS_LIVEDECODEREVENT |
typedef RESOLVBUS_RESULT(* RESOLVBUS_LIVEDECODERHANDLER) (RESOLVBUS_LIVEDECODER *Decoder, const RESOLVBUS_LIVEDECODEREVENT *Event) |
typedef struct RESOLVBUS_LIVEENCODER RESOLVBUS_LIVEENCODER |
typedef RESOLVBUS_RESULT(* RESOLVBUS_LIVEENCODERCALLBACK) (RESOLVBUS_LIVEENCODER *Encoder, void *Context) |
typedef struct RESOLVBUS_LIVEENCODEREVENT RESOLVBUS_LIVEENCODEREVENT |
typedef RESOLVBUS_RESULT(* RESOLVBUS_LIVEENCODERHANDLER) (RESOLVBUS_LIVEENCODER *Encoder, const RESOLVBUS_LIVEENCODEREVENT *Event) |
typedef enum RESOLVBUS_LIVEENCODERPHASE RESOLVBUS_LIVEENCODERPHASE |
typedef struct RESOLVBUS_LIVETRANSCEIVER RESOLVBUS_LIVETRANSCEIVER |
typedef struct RESOLVBUS_LIVETRANSCEIVEREVENT RESOLVBUS_LIVETRANSCEIVEREVENT |
typedef RESOLVBUS_RESULT(* RESOLVBUS_LIVETRANSCEIVERHANDLER) (RESOLVBUS_LIVETRANSCEIVER *Transceiver, const RESOLVBUS_LIVETRANSCEIVEREVENT *Event) |
typedef struct RESOLVBUS_LIVETRANSCEIVEROPTIONS RESOLVBUS_LIVETRANSCEIVEROPTIONS |
typedef enum RESOLVBUS_RESULT RESOLVBUS_RESULT |
Used as return type for most functions.
It is guaranteed, that RESOLVBUS_OK
always has 0
assigned to it. That means, that if (Result == RESOLVBUS_OK) ...
and if (Result == 0) ...
are equivalent.
It is also guaranteed, that RESOLVBUS_WOULDBLOCK
always has 1
assigned to it.
All other values are not guaranteed to keep their numerical value and / or their order.
enum RESOLVBUS_RESULT |
Used as return type for most functions.
It is guaranteed, that RESOLVBUS_OK
always has 0
assigned to it. That means, that if (Result == RESOLVBUS_OK) ...
and if (Result == 0) ...
are equivalent.
It is also guaranteed, that RESOLVBUS_WOULDBLOCK
always has 1
assigned to it.
All other values are not guaranteed to keep their numerical value and / or their order.
void ResolVBus_AddBacktrace | ( | const char * | Expression, |
const char * | File, | ||
int | Line, | ||
const char * | Func | ||
) |
Adds another line to the backtrace.
Expression | Expression used in the backtrace line |
File | Filename used in the backtrace line |
Line | Line number used in the backtrace line |
Func | Function name used in the backtrace line |
RESOLVBUS_RESULT ResolVBus_CalcAndCompareCrc | ( | uint8_t | ProtocolVersion, |
const uint8_t * | Buffer, | ||
size_t | Length, | ||
bool * | pCrcIsValid | ||
) |
Calculate the checksum over (Length - 1) bytes and compare the result to the last byte of the buffer.
ProtocolVersion | Protocol version to select checksum algorithm |
Buffer | Buffer to calculate and compare checksum |
Length | Size of buffer including checksum byte at the end |
pCrcIsValid | Pointer to store checksum comparison result into |
RESOLVBUS_RESULT ResolVBus_CalcAndSetCrc | ( | uint8_t | ProtocolVersion, |
uint8_t * | Buffer, | ||
size_t | Length | ||
) |
Calculate the checksum over (Length - 1) bytes and set the result into the last byte of the buffer.
ProtocolVersion | Protocol version to select checksum algorithm |
Buffer | Buffer to calculate and store checksum |
Length | Size of buffer including checksum byte at the end |
RESOLVBUS_RESULT ResolVBus_CalcCrc | ( | uint8_t | ProtocolVersion, |
const uint8_t * | Buffer, | ||
size_t | Length, | ||
uint8_t * | pCrc | ||
) |
Calculate the checksum according to the provided protocol version.
ProtocolVersion | Protocol version to select checksum algorithm |
Buffer | Buffer to calculate checksum over |
Length | Size of buffer to calculate checksum over |
pCrc | Pointer to store calculated checksum into |
RESOLVBUS_RESULT ResolVBus_CalcCrcV0 | ( | const uint8_t * | Buffer, |
size_t | Length, | ||
uint8_t * | pCrc | ||
) |
Calculate the checksum according to VBus protocol version X.0.
Buffer | Buffer to calculate checksum over |
Length | Size of buffer to calculate checksum over |
pCrc | Pointer to store calculated checksum into |
void ResolVBus_DebugLog | ( | const char * | File, |
int | Line, | ||
const char * | Func, | ||
const char * | Format, | ||
... | |||
) |
Print debug related information on stdout
.
Will print something like FormattedMessage [Func (File:Line)]\n
to stdout
.
File | Filename used in the debug output |
Line | Line number used in the debug output |
Func | Function name used in the debug output |
Format | printf -style format string followed by optional arguments |
RESOLVBUS_RESULT ResolVBus_ExtractSeptett | ( | const uint8_t * | Source, |
uint8_t * | Destination, | ||
size_t | Length | ||
) |
Extract the MSBs into a septett byte.
This function converts Length
bytes of Source
data into Length + 1
bytes of destination data. The MSBs of up to 7 Source
bytes get extracted into a septett byte which is stored at Destination [Length]
.
Source | Buffer of Length bytes |
Destination | Buffer of Length + 1 bytes (data plus septett byte) |
Length | Size of buffers without the septett byte (can be between 1 and 7) |
const char * ResolVBus_GetBacktrace | ( | void | ) |
Get the currently stored backtrace.
RESOLVBUS_RESULT ResolVBus_InjectSeptett | ( | const uint8_t * | Source, |
uint8_t * | Destination, | ||
size_t | Length | ||
) |
Inject a septett byte into the MSBs.
This function converts Length + 1
bytes of Source
data into Length
bytes of destination data. The MSBs of up to 7 Destination
bytes are injected from a septett byte which is stored at Source [Length]
.
Source | Buffer of Length + 1 bytes (data plus septett byte) |
Destination | Buffer of Length bytes |
Length | Size of buffers without the septett byte (can be between 1 and 7) |
RESOLVBUS_RESULT ResolVBus_LiveDecoder_Decode | ( | RESOLVBUS_LIVEDECODER * | Decoder, |
const uint8_t * | Bytes, | ||
size_t | Length | ||
) |
Decode the provided bytes.
This function decodes the provided bytes and emits events every time a valid VBus primitive is reconstructed.
Decoder | Decoder instance |
Bytes | Data to decode |
Length | Length of the Bytes buffer |
RESOLVBUS_RESULT ResolVBus_LiveDecoder_Initialize | ( | RESOLVBUS_LIVEDECODER * | Decoder, |
void * | FrameDataBuffer, | ||
size_t | FrameDataBufferLength, | ||
RESOLVBUS_LIVEDECODERHANDLER | Handler | ||
) |
Initialize a RESOLVBUS_LIVEDECODER
instance.
Lifetime: FrameDataBuffer
must outlive Decoder
.
Decoder | Decoder instance to initialize |
FrameDataBuffer | Optional buffer to reconstruct frame data into |
FrameDataBufferLength | Length of the optional FrameDataBuffer |
Handler | Handler that is called when an event is emitted |
RESOLVBUS_RESULT ResolVBus_LiveEncoder_GetTimeout | ( | RESOLVBUS_LIVEENCODER * | Encoder, |
uint32_t * | pMicroseconds | ||
) |
Return the amount of time that the encoder needs to pass into another phase.
The resulting timeout depends on the phase the encoder is currently in:
..._IDLE
: timeout is always 0, because it will emit ..._IDLE
events every time ResolVBus_LiveEncoder_HandleTimer
is called..._TRANSMITTING
: calculates remaining time for the data to be transmitted at the configured baudrate..._GAININGENERGY
: calculates remaining time for the VBus to reach full energy level..._SUSPENDED
: timeout is always UINT32_MAX
..._SUSPENDEDWITHTIMEOUT
: calculates remaining time for the encoder to automatically resumeEncoder | Encoder instance |
pMicroseconds | Pointer to store the timeout value into |
RESOLVBUS_RESULT ResolVBus_LiveEncoder_HandleTimer | ( | RESOLVBUS_LIVEENCODER * | Encoder, |
uint32_t | Microseconds | ||
) |
Inform the encoder that a certain amount of time has passed.
This function should be called "frequently" to update the internal state machine of the encoder:
ResolVBus_LiveEncoder_GetTimeout
has passedResolVBus_LiveEncoder_Resume
ResolVBus_LiveEncoder_Send...
Whenever the internal state machine transitions into the IDLE phase, the encoder checks whether it can automatically transition into another phase:
TRANSMIT
event and transition into the TRANSMITTING
phaseSUSPENDED
phase nowSUSPENDEDWITHTIMEOUT
phase nowIDLE
event and stays in the IDLE
phaseEncoder | Encoder instance |
Microseconds | Amount of time passed since last call to this function |
RESOLVBUS_RESULT ResolVBus_LiveEncoder_Initialize | ( | RESOLVBUS_LIVEENCODER * | Encoder, |
uint8_t * | Buffer, | ||
size_t | Length, | ||
RESOLVBUS_LIVEENCODERHANDLER | Handler | ||
) |
Initialize a RESOLVBUS_LIVEENCODER
instance.
Lifetime: Buffer
must outlive Encoder
.
Encoder | Encoder instance to initialize |
Buffer | Transmit buffer to construct VBus primitives into |
Length | Length of the Buffer |
Handler | Handler that is called when an event is emitted |
RESOLVBUS_RESULT ResolVBus_LiveEncoder_QueueDatagram | ( | RESOLVBUS_LIVEENCODER * | Encoder, |
uint16_t | DestinationAddress, | ||
uint16_t | SourceAddress, | ||
uint8_t | MinorVersion, | ||
uint16_t | Command, | ||
uint16_t | Param16, | ||
uint32_t | Param32 | ||
) |
Queue a VBus datagram into the transmit buffer.
See ResolVBus_LiveEncoder_HandleTimer
for transmit buffer handling details.
This function will return RESOLVBUS_ERROR_SUSPENDED
if the encoder is already flagged for or running in a suspended state.
Encoder | Encoder instance |
DestinationAddress | Destination address of the datagram |
SourceAddress | Source address of the datagram |
MinorVersion | Minor protocol version of the datagram (major version will always be 0x20) |
Command | Command of the datagram |
Param16 | 16-bit parameter of the datagram |
Param32 | 32-bit parameter of the datagram |
RESOLVBUS_RESULT ResolVBus_LiveEncoder_QueuePacketFrame | ( | RESOLVBUS_LIVEENCODER * | Encoder, |
const uint8_t * | FourBytes | ||
) |
Queue a VBus packet frame into the transmit buffer.
See ResolVBus_LiveEncoder_HandleTimer
for transmit buffer handling details.
This function will return RESOLVBUS_ERROR_SUSPENDED
if the encoder is already flagged for or running in a suspended state.
Encoder | Encoder instance |
FourBytes | Buffer containing the four bytes payload of the frame |
RESOLVBUS_RESULT ResolVBus_LiveEncoder_QueuePacketFrames | ( | RESOLVBUS_LIVEENCODER * | Encoder, |
const void * | Bytes, | ||
size_t | Length | ||
) |
Queue one or more VBus packet frames into the transmit buffer.
If Length
is not a multiple of four, the last frame is padded with 0xFF.
See ResolVBus_LiveEncoder_HandleTimer
for transmit buffer handling details.
This function will return RESOLVBUS_ERROR_SUSPENDED
if the encoder is already flagged for or running in a suspended state.
Encoder | Encoder instance |
Bytes | Buffer containing the payload of the frames |
Length | Length of the Bytes buffer |
RESOLVBUS_RESULT ResolVBus_LiveEncoder_QueuePacketHeader | ( | RESOLVBUS_LIVEENCODER * | Encoder, |
uint16_t | DestinationAddress, | ||
uint16_t | SourceAddress, | ||
uint8_t | MinorVersion, | ||
uint16_t | Command, | ||
uint8_t | FrameCount | ||
) |
Queue a VBus packet header into the transmit buffer.
See ResolVBus_LiveEncoder_HandleTimer
for transmit buffer handling details.
This function will return RESOLVBUS_ERROR_SUSPENDED
if the encoder is already flagged for or running in a suspended state.
Encoder | Encoder instance |
DestinationAddress | Destination address of the packet |
SourceAddress | Source address of the packet |
MinorVersion | Minor protocol version of the packet (major version will always be 0x10) |
Command | Command of the packet |
FrameCount | Frame count of the packet |
RESOLVBUS_RESULT ResolVBus_LiveEncoder_QueueTelegramFrame | ( | RESOLVBUS_LIVEENCODER * | Encoder, |
const uint8_t * | SevenBytes | ||
) |
Queue a VBus telegram frame into the transmit buffer.
See ResolVBus_LiveEncoder_HandleTimer
for transmit buffer handling details.
This function will return RESOLVBUS_ERROR_SUSPENDED
if the encoder is already flagged for or running in a suspended state.
Encoder | Encoder instance |
SevenBytes | Buffer containing the seven bytes payload of the frame |
RESOLVBUS_RESULT ResolVBus_LiveEncoder_QueueTelegramFrames | ( | RESOLVBUS_LIVEENCODER * | Encoder, |
const void * | Bytes, | ||
size_t | Length | ||
) |
Queue one or more VBus telegram frames into the transmit buffer.
If Length
is not a multiple of seven, the last frame is padded with 0xFF.
See ResolVBus_LiveEncoder_HandleTimer
for transmit buffer handling details.
This function will return RESOLVBUS_ERROR_SUSPENDED
if the encoder is already flagged for or running in a suspended state.
Encoder | Encoder instance |
Bytes | Buffer containing the payload of the frames |
Length | Length of the Bytes buffer |
RESOLVBUS_RESULT ResolVBus_LiveEncoder_QueueTelegramHeader | ( | RESOLVBUS_LIVEENCODER * | Encoder, |
uint16_t | DestinationAddress, | ||
uint16_t | SourceAddress, | ||
uint8_t | MinorVersion, | ||
uint8_t | Command, | ||
uint8_t | FrameCount | ||
) |
Queue a VBus telegram header into the transmit buffer.
See ResolVBus_LiveEncoder_HandleTimer
for transmit buffer handling details.
This function will return RESOLVBUS_ERROR_SUSPENDED
if the encoder is already flagged for or running in a suspended state.
Encoder | Encoder instance |
DestinationAddress | Destination address of the telegram |
SourceAddress | Source address of the telegram |
MinorVersion | Minor protocol version of the telegram (major version will always be 0x30) |
Command | Command of the telegram |
FrameCount | Frame count of the telegram |
RESOLVBUS_RESULT ResolVBus_LiveEncoder_Resume | ( | RESOLVBUS_LIVEENCODER * | Encoder | ) |
Resume operation of a suspended encoder.
Encoder | Encoder instance |
RESOLVBUS_RESULT ResolVBus_LiveEncoder_Suspend | ( | RESOLVBUS_LIVEENCODER * | Encoder | ) |
Suspend the encoder indefinitely.
If the encoder is idle, it will be suspended immediately. If the encoder is not idle, it will complete the currently running operation first. After that it will enter a suspended state indefinitely. The encoder must be manually resumed using ResolVBus_LiveEncoder_Resume
to continue operation.
Encoder | Encoder instance |
RESOLVBUS_RESULT ResolVBus_LiveEncoder_SuspendWithTimeout | ( | RESOLVBUS_LIVEENCODER * | Encoder, |
uint32_t | Microseconds | ||
) |
Suspend the encoder for the provided time.
If the encoder is not idle, it will complete the currently running operation first. After that it will enter a suspended state for the provided time. After that time has passed, the encoder will automatically resume operation again. The encoder can be manually resumed before the timeout has passed by using ResolVBus_LiveEncoder_Resume
.
Encoder | Encoder instance |
Microseconds | Amount of time after which the encoder automatically resumes operation |
RESOLVBUS_RESULT ResolVBus_LiveEncoder_SuspendWithTimeoutAndCallback | ( | RESOLVBUS_LIVEENCODER * | Encoder, |
uint32_t | Microseconds, | ||
RESOLVBUS_LIVEENCODERCALLBACK | Callback, | ||
void * | Context | ||
) |
Suspend the encoder for the provided time, calling the callback after the time has passed.
If the encoder is not idle, it will complete the currently running operation first. After that it will enter a suspended state for the provided time. After that time has passed, the encoder will call the provided callback and automatically resume operation again. The encoder can be manually resumed before the timeout has passed by using ResolVBus_LiveEncoder_Resume
. In that case the callback is not called.
This function will return RESOLVBUS_ERROR_SUSPENDED
if the encoder is already flagged for or running in a suspended state. Calling ResolVBus_LiveEncoder_Resume
directly before this function makes sure that the encoder is in a safe state.
Encoder | Encoder instance |
Microseconds | Amount of time after which the encoder automatically resumes operation |
Callback | Function to call after the timeout has passed |
Context | Context to pass into the callback |
RESOLVBUS_RESULT ResolVBus_LiveTransceiver_Decode | ( | RESOLVBUS_LIVETRANSCEIVER * | Transceiver, |
const uint8_t * | Bytes, | ||
size_t | Length | ||
) |
Decode the provided bytes.
This function decodes the provided bytes and emits events every time a valid VBus primitive is reconstructed.
Transceiver | Transceiver instance |
Bytes | Data to decode |
Length | Length of the Bytes buffer |
RESOLVBUS_RESULT ResolVBus_LiveTransceiver_GetEncoder | ( | RESOLVBUS_LIVETRANSCEIVER * | Transceiver, |
RESOLVBUS_LIVEENCODER ** | pEncoder | ||
) |
Get access to the transceiver's encoder.
Transceiver | Transceiver instance |
pEncoder | Pointer to store the Encoder instance into |
RESOLVBUS_RESULT ResolVBus_LiveTransceiver_GetTimeout | ( | RESOLVBUS_LIVETRANSCEIVER * | Transceiver, |
uint32_t * | pMicroseconds | ||
) |
Returns the amount of time that the transceiver needs to pass into another phase.
The resulting timeout depends on the phase the transceiver's encoder is currently in as well as the remaining time until the currently active action times out.
Transceiver | Transceiver instance |
pMicroseconds | Pointer to store the timeout value into |
RESOLVBUS_RESULT ResolVBus_LiveTransceiver_GetValueById | ( | RESOLVBUS_LIVETRANSCEIVER * | Transceiver, |
uint16_t | PeerAddress, | ||
uint16_t | ValueId, | ||
uint8_t | ValueSubIndex, | ||
const RESOLVBUS_LIVETRANSCEIVEROPTIONS * | CustomOptions, | ||
RESOLVBUS_LIVETRANSCEIVERHANDLER | Handler | ||
) |
Start an action to get a value from the controller.
Transceiver | Transceiver instance |
PeerAddress | VBus address to pass bus control back to |
ValueId | ID of the value to read |
ValueSubIndex | Subindex of the value to read (if supported) |
CustomOptions | Optional custom options |
Handler | Handler that is called when an action related event is emitted |
RESOLVBUS_RESULT ResolVBus_LiveTransceiver_GetValueIdByIdHash | ( | RESOLVBUS_LIVETRANSCEIVER * | Transceiver, |
uint16_t | PeerAddress, | ||
uint32_t | ValueIdHash, | ||
const RESOLVBUS_LIVETRANSCEIVEROPTIONS * | CustomOptions, | ||
RESOLVBUS_LIVETRANSCEIVERHANDLER | Handler | ||
) |
Start an action to lookup a value's ID based on its ID hash.
Transceiver | Transceiver instance |
PeerAddress | VBus address to pass bus control back to |
ValueIdHash | ID hash of the value to lookup |
CustomOptions | Optional custom options |
Handler | Handler that is called when an action related event is emitted |
RESOLVBUS_RESULT ResolVBus_LiveTransceiver_HandleTimer | ( | RESOLVBUS_LIVETRANSCEIVER * | Transceiver, |
uint32_t | Microseconds | ||
) |
Inform the transceiver that a certain amount of time has passed.
This function should be called "frequently" to update the internal state machine of the encoder:
ResolVBus_LiveTransceiver_GetTimeout
has passedTransceiver | Transceiver instance |
Microseconds | Amount of time passed since last call to this function |
RESOLVBUS_RESULT ResolVBus_LiveTransceiver_Initialize | ( | RESOLVBUS_LIVETRANSCEIVER * | Transceiver, |
uint8_t * | EncoderBuffer, | ||
size_t | EncoderBufferLength, | ||
void * | DecoderBuffer, | ||
size_t | DecoderBufferLength, | ||
RESOLVBUS_LIVETRANSCEIVERHANDLER | Handler | ||
) |
Initialize a RESOLVBUS_LIVETRANSCEIVER
instance.
Lifetime: EncoderBuffer
and DecoderBuffer
must outlive Transceiver
.
Transceiver | Transceiver instance to initialize |
EncoderBuffer | Transmit buffer to construct VBus primitives into |
EncoderBufferLength | Length of the EncoderBuffer |
DecoderBuffer | Optional buffer to reconstruct frame data into |
DecoderBufferLength | Length of the optional DecoderBuffer |
Handler | Handler that is called when an event is emitted |
RESOLVBUS_RESULT ResolVBus_LiveTransceiver_ReleaseBus | ( | RESOLVBUS_LIVETRANSCEIVER * | Transceiver, |
uint16_t | PeerAddress, | ||
const RESOLVBUS_LIVETRANSCEIVEROPTIONS * | CustomOptions, | ||
RESOLVBUS_LIVETRANSCEIVERHANDLER | Handler | ||
) |
Start an action to release bus control back to the controller.
Transceiver | Transceiver instance |
PeerAddress | VBus address to pass bus control back to |
CustomOptions | Optional custom options |
Handler | Handler that is called when an action related event is emitted |
RESOLVBUS_RESULT ResolVBus_LiveTransceiver_SetValueById | ( | RESOLVBUS_LIVETRANSCEIVER * | Transceiver, |
uint16_t | PeerAddress, | ||
uint16_t | ValueId, | ||
uint8_t | ValueSubIndex, | ||
uint32_t | Value, | ||
const RESOLVBUS_LIVETRANSCEIVEROPTIONS * | CustomOptions, | ||
RESOLVBUS_LIVETRANSCEIVERHANDLER | Handler | ||
) |
Start an action to set a value in the controller.
Transceiver | Transceiver instance |
PeerAddress | VBus address to pass bus control back to |
ValueId | ID of the value to write |
ValueSubIndex | Subindex of the value to write (if supported) |
Value | Value to write |
CustomOptions | Optional custom options |
Handler | Handler that is called when an action related event is emitted |
RESOLVBUS_RESULT ResolVBus_LiveTransceiver_WaitForFreeBus | ( | RESOLVBUS_LIVETRANSCEIVER * | Transceiver, |
const RESOLVBUS_LIVETRANSCEIVEROPTIONS * | CustomOptions, | ||
RESOLVBUS_LIVETRANSCEIVERHANDLER | Handler | ||
) |
Start an action to wait for the controller to offer bus control.
Transceiver | Transceiver instance |
CustomOptions | Optional custom options |
Handler | Handler that is called when an action related event is emitted |
void ResolVBus_PrintBacktrace | ( | void | ) |
Print the currently stored backtrace.
uint16_t ResolVBus_ReadUInt16LE | ( | const uint8_t * | Buffer | ) |
Read an unsigned, little-endian 16-bit integer from the buffer.
Buffer | Buffer of at least 2 bytes to read integer from |
uint32_t ResolVBus_ReadUInt32LE | ( | const uint8_t * | Buffer | ) |
Read an unsigned, little-endian 32-bit integer from the buffer.
Buffer | Buffer of at least 4 bytes to read integer from |
void ResolVBus_ResetBacktrace | ( | const char * | Message, |
const char * | Expression, | ||
const char * | File, | ||
int | Line, | ||
const char * | Func | ||
) |
Clear the backtrace buffer and fill it with the provided information.
Message | Message to put above the backtrace |
Expression | Expression used in the backtrace line |
File | Filename used in the backtrace line |
Line | Line number used in the backtrace line |
Func | Function name used in the backtrace line |
void ResolVBus_WriteUInt16LE | ( | uint8_t * | Buffer, |
uint16_t | Value | ||
) |
Write an unsigned, little-endian 16-bit integer to the buffer.
Buffer | Buffer of at least 2 bytes to write integer into |
Value | Integer to write |
void ResolVBus_WriteUInt32LE | ( | uint8_t * | Buffer, |
uint32_t | Value | ||
) |
Write an unsigned, little-endian 32-bit integer to the buffer.
Buffer | Buffer of at least 4 bytes to write integer into |
Value | Integer to write |