ZCL library
4.3
ZCL library to manage a Zigbee network
|
This Class defines utility methods to convert numbers in array of bytes and conversely. More...
#include <ZCLUtils.h>
Static Public Member Functions | |
static unsigned long | bytesAsUnsigned (const byte array[], const int length) |
Return a unsigned value corresponding to an array of bytes. | |
static unsigned long long | bytesAsUnsigned64bits (const byte array[], const int length) |
Return a unsigned value corresponding to an array of bytes. | |
static long | bytesAsSigned (const byte array[], const int length) |
Return a signed value corresponding to an array of bytes. | |
static long long | bytesAsSigned64bits (const byte array[], const int length) |
Return a unsigned value corresponding to an array of bytes. | |
static int | unsignedAsBytes (byte *buffer, unsigned long value, int length) |
Fill a buffer of 1 to 4 bytes corresponding to the unsigned value. | |
static int | unsigned64bitsAsBytes (byte *buffer, unsigned long long value, int length) |
Fill a buffer of 1 to 8 bytes corresponding to the unsigned value. | |
static int | signedAsBytes (byte *buffer, long value, int length) |
Fill a buffer of 1 to 4 bytes corresponding to the signed value. | |
static int | signed64bitsAsBytes (byte *buffer, long long value, int length) |
Fill a buffer of 1 to 8 bytes corresponding to the signed value. |
This Class defines utility methods to convert numbers in array of bytes and conversely.
static long ZCLUtils::bytesAsSigned | ( | const byte | array[], |
const int | length | ||
) | [inline, static] |
Return a signed value corresponding to an array of bytes.
array | the signed value as an array of bytes. |
length | the array size. |
static long long ZCLUtils::bytesAsSigned64bits | ( | const byte | array[], |
const int | length | ||
) | [inline, static] |
Return a unsigned value corresponding to an array of bytes.
Only for the unsigned value on 5 bytes (40bits) and more.
array | the unsigned value as an array of bytes. |
length | the array size. |
static unsigned long ZCLUtils::bytesAsUnsigned | ( | const byte | array[], |
const int | length | ||
) | [inline, static] |
Return a unsigned value corresponding to an array of bytes.
array | the unsigned value as array of bytes. |
length | the array size. |
static unsigned long long ZCLUtils::bytesAsUnsigned64bits | ( | const byte | array[], |
const int | length | ||
) | [inline, static] |
Return a unsigned value corresponding to an array of bytes.
Only for the unsigned value on 5 bytes (40bits) and more.
array | the unsigned value as array of bytes. |
length | the array size. |
static int ZCLUtils::signed64bitsAsBytes | ( | byte * | buffer, |
long long | value, | ||
int | length | ||
) | [inline, static] |
Fill a buffer of 1 to 8 bytes corresponding to the signed value.
b[0] = LSB, b[1] = ..., b[2] = ..., b[7] = MSB
buffer | the buffer to be written |
value | the signed value. |
length | the length in byte of signed value. |
static int ZCLUtils::signedAsBytes | ( | byte * | buffer, |
long | value, | ||
int | length | ||
) | [inline, static] |
Fill a buffer of 1 to 4 bytes corresponding to the signed value.
b[0] = LSB, b[1] = ..., b[2] = ..., b[3] = MSB
buffer | the buffer to be written |
value | the signed value. |
length | the length in byte of signed value. |
static int ZCLUtils::unsigned64bitsAsBytes | ( | byte * | buffer, |
unsigned long long | value, | ||
int | length | ||
) | [inline, static] |
Fill a buffer of 1 to 8 bytes corresponding to the unsigned value.
b[0] = LSB, b[1] = ..., b[2] = ..., b[7] = MSB
buffer | the buffer to be written |
value | the unsigned value. |
length | the length in byte of unsigned value. |
static int ZCLUtils::unsignedAsBytes | ( | byte * | buffer, |
unsigned long | value, | ||
int | length | ||
) | [inline, static] |
Fill a buffer of 1 to 4 bytes corresponding to the unsigned value.
b[0] = LSB, b[1] = ..., b[2] = ..., b[3] = MSB
buffer | the buffer to be written |
value | the unsigned value. |
length | the length in byte of unsigned value. |