| AVR Z-LINKŪ |

# chat.h File Reference

## Detailed Description

Definition of states and error codes etc.

Application note:
  AVR414: User's Guide - ATAVRRZ502 - Accessory Kit

Documentation
  For comprehensive code documentation, supported compilers, compiler settings and supported devices see readme.html

Author:
  Atmel Corporation: http://www.atmel.com
  Support email: avr@atmel.com

Name

Revision
  1.2

RCSfile
  serialInterface.h,v

Date
  2006/09/15 17:02:44

Definition in file chat.h.

`#include <stdint.h>`
`#include <stdbool.h>`

Include dependency graph for chat.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

## Defines
#define | COORD_SHORT_ADDRESS ( 0x0000 )
#define | DEFAULT_CHANNEL ( 0x0B )
#define | DEFAULT_PANID ( 0xBAAD )
#define | END_DEVICE_SHORT_ADDRESS ( 0x0001 )
#define | MAX_MSG_LENGTH ( 0x1E )
#define | SCANDURATION ( 0x03 )
## Enumerations
enum | chatError_t { UNKNOWN_AT_COMMAND = 0x80, EVENT_BUFFER_FULL, INVALID_REQUEST, RESET_FAILED, UNKNOWN_DEVICE_TYPE, INCONSISTENT_STATE, ACTIVE_SCAN_FAILED, SET_MAC_ADDRESS_FAILED, START_NETWORK_FAILED, ASSOCIATION_FAILED, DATA_TRANSMISSION_FAILED, DATA_CONVERSION_FAILED }
| Enumeration that defines the possible errors of the evaluation application. More...
enum | chatRole_t { UNDEFINED = 0x30, COORDINATOR, END_DEVICE }
| Enumeration that defines the two possible network roles. More...
enum | chatState_t { CHAT_IDLE = 0x00, CHAT_RESET_PENDING, CHAT_ACTIVE_SCAN_PENDING, CHAT_SET_ADDRESS_PENDING, CHAT_START_PENDING, CHAT_SET_PERMIT_ASSOCIATION_PENDING, CHAT_WAIT_FOR_ASSOCIATION, CHAT_ASSOCIATION_PENDING, CHAT_CONNECTED }
| Enumeration that defines the states of the evaluation application. More...
## Variables
uint8_t | chatChannel
| The AT+C string.
uint16_t | chatPANID
chatRole_t | role
chatState_t | state

## Define Documentation

#define COORD_SHORT_ADDRESS ( 0x0000 )

Definition at line 32 of file chat.h.

Referenced by sendMsg().

#define DEFAULT_CHANNEL ( 0x0B )

Definition at line 29 of file chat.h.

#define DEFAULT_PANID ( 0xBAAD )

Definition at line 30 of file chat.h.

#define END_DEVICE_SHORT_ADDRESS ( 0x0001 )

Definition at line 33 of file chat.h.

Referenced by sendMsg().

#define MAX_MSG_LENGTH ( 0x1E )

Definition at line 37 of file chat.h.

Referenced by sendMsg().

#define SCANDURATION ( 0x03 )

Definition at line 35 of file chat.h.

Referenced by startNetworkOperation().

## Enumeration Type Documentation

enum chatError_t

Enumeration that defines the possible errors of the evaluation application.

Enumerator:

  UNKNOWN_AT_COMMAND |
  EVENT_BUFFER_FULL |
  INVALID_REQUEST |
  RESET_FAILED |
  UNKNOWN_DEVICE_TYPE |
  INCONSISTENT_STATE |
  ACTIVE_SCAN_FAILED |
  SET_MAC_ADDRESS_FAILED |
  START_NETWORK_FAILED |
  ASSOCIATION_FAILED |
  DATA_TRANSMISSION_FAILED |
  DATA_CONVERSION_FAILED |

Definition at line 68 of file chat.h.

    00068             {
    00069
    00070         UNKNOWN_AT_COMMAND = 0x80,//0x80
    00071         EVENT_BUFFER_FULL,      //0x81
    00072         INVALID_REQUEST,        //0x82
    00073         RESET_FAILED,   //0x83
    00074         UNKNOWN_DEVICE_TYPE,    //0x84
    00075         INCONSISTENT_STATE,     //0x85
    00076         ACTIVE_SCAN_FAILED,     //0x86
    00077         SET_MAC_ADDRESS_FAILED, //0x87
    00078         START_NETWORK_FAILED,   //0x88
    00079         ASSOCIATION_FAILED,     //0x89
    00080         DATA_TRANSMISSION_FAILED,       //0x8A
    00081         DATA_CONVERSION_FAILED          //0x8B
    00082 }chatError_t;

enum chatRole_t

Enumeration that defines the two possible network roles.

Enumerator:

  UNDEFINED |
  COORDINATOR |
  END_DEVICE |

Definition at line 59 of file chat.h.

    00059             {
    00060
    00061         UNDEFINED = 0x30,
    00062         COORDINATOR,
    00063         END_DEVICE
    00064 }chatRole_t;

enum chatState_t

Enumeration that defines the states of the evaluation application.

Enumerator:

  CHAT_IDLE |
  CHAT_RESET_PENDING |
  CHAT_ACTIVE_SCAN_PENDING |
  CHAT_SET_ADDRESS_PENDING |
  CHAT_START_PENDING |
  CHAT_SET_PERMIT_ASSOCIATION_PENDING |
  CHAT_WAIT_FOR_ASSOCIATION |
  CHAT_ASSOCIATION_PENDING |
  CHAT_CONNECTED |

Definition at line 42 of file chat.h.

    00042             {
    00043
    00044         CHAT_IDLE = 0x00,
    00045         CHAT_RESET_PENDING,
    00046         CHAT_ACTIVE_SCAN_PENDING,
    00047         CHAT_SET_ADDRESS_PENDING,
    00048         CHAT_START_PENDING,
    00049         CHAT_SET_PERMIT_ASSOCIATION_PENDING,
    00050
    00051         CHAT_WAIT_FOR_ASSOCIATION,
    00052
    00053         CHAT_ASSOCIATION_PENDING,
    00054         CHAT_CONNECTED,
    00055 }chatState_t;

## Variable Documentation

uint8_t chatChannel

The AT+C string.

Definition at line 50 of file atParser.c.

Referenced by handleNewCommand(), startNetworkOperation(), usr_mlme_scan_conf(), and usr_mlme_set_conf().

uint16_t chatPANID

Definition at line 51 of file atParser.c.

Referenced by handleNewCommand(), sendMsg(), usr_mlme_scan_conf(), and usr_mlme_set_conf().

chatRole_t role

Definition at line 53 of file atParser.c.

Referenced by handleNewCommand(), sendMsg(), and usr_mlme_scan_conf().

chatState_t state

Definition at line 52 of file atParser.c.

Referenced by handleNewCommand(), startNetworkOperation(), usr_mcps_data_ind(), usr_mlme_associate_conf(), usr_mlme_associate_ind(), usr_mlme_comm_status_ind(), usr_mlme_reset_conf(), usr_mlme_scan_conf(), usr_mlme_set_conf(), and usr_mlme_start_conf().

@DOC_TITLE@