Zigbee Module Examples

- Main Page
- Related Pages
- Modules
- Data Structures
- Files

- File List
- Globals

All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Functions
infoMessage.c File Reference

message containing information about this device. This is commonly used to send sensor data. More...

`#include "infoMessage.h"`
`#include "../../HAL/hal.h"`
`#include "../../Common/utilities.h"`

## Functions
void | printInfoMessage (struct infoMessage *im)
int8_t | addKvpToInfoMessage (struct infoMessage *im, struct kvp *kvp)
void | serializeInfoMessage (struct infoMessage *im, unsigned char *destinationPtr)
int16_t | deserializeInfoMessage (unsigned char *source, struct infoMessage *info)
uint16_t | getSizeOfInfoMessage (struct infoMessage *im)

## Detailed Description

message containing information about this device. This is commonly used to send sensor data.

Info Message Cluster = 0x0007

Rev:
  1642

Author:
  dsmith

Date:
  2012-10-31 11:17:04 -0700 (Wed, 31 Oct 2012)

# Support

Please refer to the wiki at www.anaren.com/air-wiki-zigbee for more information. Additional support is available via email at the following addresses:

- Questions on how to use the product: AIR@a.nosp@m.nare.nosp@m.n.com
- Feature requests, comments, and improvements: featu.nosp@m.rere.nosp@m.quest.nosp@m.s@te.nosp@m.slaco.nosp@m.ntro.nosp@m.ls.co.nosp@m.m
- Consulting engagements: sales.nosp@m.@tes.nosp@m.lacon.nosp@m.trol.nosp@m.s.com

# License

Copyright (c) 2012 Tesla Controls. All rights reserved. This Software may only be used with an Anaren A2530E24AZ1, A2530E24CZ1, A2530R24AZ1, or A2530R24CZ1 module. Redistribution and use in source and binary forms, with or without modification, are subject to the Software License Agreement in the file "anaren_eula.txt"

YOU FURTHER ACKNOWLEDGE AND AGREE THAT THE SOFTWARE AND DOCUMENTATION ARE PROVIDED “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL ANAREN MICROWAVE OR TESLA CONTROLS BE LIABLE OR OBLIGATED UNDER CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSE INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.

## Function Documentation

int8_t addKvpToInfoMessage | ( | struct infoMessage * | im,
|  | struct kvp * | kvp
| ) |  |

Convenience method for adding a KVP to the infoMessage.

Parameters:

  im | the infoMessage to add a kvp to
  kvp | points to the kvp to add. This will be deep copied into the infoMessage.

Returns:
  0 if success, -1 if there are too many kvps

int16_t deserializeInfoMessage | ( | unsigned char * | source,
|  | struct infoMessage * | info
| ) |  |

Creates an infoMessage from the stream of bytes starting at source

Parameters:

  source | the beginning of the serialized Info Message
  info | the infoMessage to create

Returns:
  the number of bytes deserialized if success, or else an error code < 0

uint16_t getSizeOfInfoMessage | ( | struct infoMessage * | im | ) |

    Gets the size of this info message.

Parameters:

  im | the infoMessage to get the size of

Returns:
  the size of the Info Message, including all KVPs. This is implemented as a method (not macro) for consistency with other messages.

void printInfoMessage | ( | struct infoMessage * | im | ) |

Display the contents of the infoMessage to console

Parameters:

  im | the Info Message to display

void serializeInfoMessage | ( | struct infoMessage * | im,
|  | unsigned char * | destinationPtr
| ) |  |

Converts the info message into a stream of bytes to memory pointed to by destinationPtr Number of bytes streamed is equal to getSizeOfInfoMessage()

Parameters:

  im | the infoMessage to serialize
  destinationPtr | where to copy the stream of bytes to

Precondition:
  destinationPtr points to a region of memory at least getSizeOfInfoMessage() bytes in size