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
example_rf_tester.c File Reference
Module Interface Examples

Simple utility to configure the Module to output an RF test signal. More...

`#include "../HAL/hal.h"`
`#include "../ZM/module.h"`
`#include "../ZM/module_errors.h"`
`#include "../ZM/zm_phy_spi.h"`
`#include <stdint.h>`

#define | NO_CHARACTER_RECEIVED 0xFF
#define | RF_OUTPUT_POWER RF_OUTPUT_POWER_PLUS_4_5_DBM
uint8_t | zmBuf [ZIGBEE_MODULE_BUFFER_SIZE]
uint8_t | rfTestMode = RF_TEST_UNMODULATED
uint8_t | rfTestChannel = 11
volatile char | command = NO_CHARACTER_RECEIVED
void(* | debugConsoleIsr )(int8_t)
void | handleDebugConsoleInterrupt (int8_t rxByte)
void | printUsage ()
void | setTestMode ()
int | main (void)

## Detailed Description

Simple utility to configure the Module to output an RF test signal.

Configures Module interface, resets module, and then processes typed commands. The Module can output either an RF carrier signal, or random modulated data. The user can change which test mode to use, channel (11-26), and turn off the transmitter. This utility can be used for radiated emissions compliance testing or tuning the RF circuit.

The Utility can be controlled through the simple command-line menu. Commands: ] Increment RF Test Channel [ Increment RF Test Channel M Change RF Test Mode to modulated output U Change RF Test Mode to UNmodulated output R Change RF Test Mode to receive (Turn off output) ! Reset Module ? Print this menu

If, instead, you would like it to output one particular mode on startup, change `rfTestMode` and `rfTestChannel` accordingly.

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.

## Macro Definition Documentation

#define RF_OUTPUT_POWER RF_OUTPUT_POWER_PLUS_4_5_DBM

    The RF Output Power used for testing. Note that this is the value output by the CC2530 itself.

If the module has a PA/LNA (CC2590, CC2591, etc.) then the actual transmitted output power will be higher of course. See module.h for valid values.

## Function Documentation

void handleDebugConsoleInterrupt | ( | int8_t | rxByte | ) |

locally function to process bytes received on the debug console

    Method to handle bytes received on the debug console. Just stores it to the variable

`command`. This gets called by the ISR in the hal file since we set the debugConsoleIsr function pointer (in hal file) to point to this function.

## Variable Documentation

volatile char command = NO_CHARACTER_RECEIVED

the command that was entered by the user

void(* debugConsoleIsr)(int8_t)

    function pointer (in hal file) for the function that gets called when a byte is received on the

debug console.

    This is a function pointer for the Interrupt Service Routine called when a debug console

character is received. To use it, declare it with `extern void (*debugConsoleIsr)(int8_t);` and then point it to a function you created, e.g. `debugConsoleIsr =` and your function handleDebugConsoleInterrupt() will be called when a byte is received on the debug serial port. Obviously your handleDebugConsoleInterrupt must have the same method signature as the function pointer. In other words, your function should be declared as: void handleDebugConsoleInterrupt(int8_t);

    This is a function pointer for the Interrupt Service Routine called when a debug console character is received.

To use it, declare it with `extern void (*debugConsoleIsr)(char);` and then point it to a function you created, e.g. `debugConsoleIsr =` and your function handleDebugConsoleInterrupt() will be called when a byte is received on the debug serial port.

This is a function pointer for the Interrupt Service Routine called when a debug console character is received. To use it, declare it with `extern void (*debugConsoleIsr)(char);` and then point it to a function you created, e.g. `debugConsoleIsr =` and your function handleDebugConsoleInterrupt() will be called when a byte is received on the debug serial port.

    This is a function pointer for the Interrupt Service Routine called when a debug console character is received.

To use it, declare it with `extern void (*debugConsoleIsr)(char);` and then point it to a function you created, e.g. `debugConsoleIsr =` and your function handleDebugConsoleInterrupt() will be called when a byte is received.

    This is a function pointer for the Interrupt Service Routine called when a debug console character is received.

To use it, declare it with `extern void (*debugConsoleIsr)(int8_t);` and then point it to a function you created, e.g. `debugConsoleIsr =` and your function handleDebugConsoleInterrupt() will be called when a byte is received on the debug serial port.

uint8_t rfTestChannel = 11

    The current channel that the RF test mode is set to.

Stored so that we can increment/decrement this channel easily. Change this if you want the application to start on a different channel.

uint8_t rfTestMode = RF_TEST_UNMODULATED

    Which RF Test Mode we're in. Will be changed by the commands.

Change this if you want the application to start in a different mode.

uint8_t zmBuf[ZIGBEE_MODULE_BUFFER_SIZE]

    This buffer will hold the transmitted messages and received SRSP Payload after sendMessage() was

called. If fragmentation support is not required then this can be smaller, e.g. 100B.