ZCL library  4.3
ZCL library to manage a Zigbee network
ZCLUtils Class Reference

This Class defines utility methods to convert numbers in array of bytes and conversely. More...

#include <ZCLUtils.h>

List of all members.

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.

Detailed Description

This Class defines utility methods to convert numbers in array of bytes and conversely.


Member Function Documentation

static long ZCLUtils::bytesAsSigned ( const byte  array[],
const int  length 
) [inline, static]

Return a signed value corresponding to an array of bytes.

Parameters:
arraythe signed value as an array of bytes.
lengththe array size.
Returns:
the signed value;
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.

Parameters:
arraythe unsigned value as an array of bytes.
lengththe array size.
Returns:
the unsigned value;
static unsigned long ZCLUtils::bytesAsUnsigned ( const byte  array[],
const int  length 
) [inline, static]

Return a unsigned value corresponding to an array of bytes.

Parameters:
arraythe unsigned value as array of bytes.
lengththe array size.
Returns:
the unsigned value;
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.

Parameters:
arraythe unsigned value as array of bytes.
lengththe array size.
Returns:
the unsigned value;
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

Parameters:
bufferthe buffer to be written
valuethe signed value.
lengththe length in byte of signed value.
Returns:
the number of bytes written in the buffer.
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

Parameters:
bufferthe buffer to be written
valuethe signed value.
lengththe length in byte of signed value.
Returns:
the number of bytes written in the buffer.
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

Parameters:
bufferthe buffer to be written
valuethe unsigned value.
lengththe length in byte of unsigned value.
Returns:
the number of bytes written in the buffer.
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

Parameters:
bufferthe buffer to be written
valuethe unsigned value.
lengththe length in byte of unsigned value.
Returns:
the number of bytes written in the buffer.

The documentation for this class was generated from the following file: