Microcontroller Wireless Solutions


zrc.h File Reference

API for ZRC profile includes cmd discovery and RC commands. More...

Go to the source code of this file.

Data Structures

struct  zrc_cmd_frm_tag
struct  zrc_indication_callback

Defines

#define DISCOVERY_DURATION   0x00186A
#define AUTO_DISC_DURATION_SYM   0x1C9C38
#define DISCOVERY_REPETITION_INTERVAL   0x00F424
#define MAX_DISCOVERY_REPETITIONS   0x1E
#define MAX_REPORTED_NODE_DESCRIPTORS   1
#define aplcMaxKeyRepeatInterval_ms   100
#define aplKeyRepeatInterval_def   (aplcMaxKeyRepeatInterval_ms)
#define aplKeyRepeatWaitTime_def   (2 * aplcMaxKeyRepeatInterval_ms)
#define aplcMaxCmdDiscRxOnDuration   200
#define aplcMaxPairIndicationWaitTime   1.2
#define aplcMaxPairIndicationWaitTime_us   (aplcMaxPairIndicationWaitTime * 1000000L)
#define aplcMaxResponseWaitTime   200
#define aplcMaxResponseWaitTime_us   (aplcMaxResponseWaitTime * 1000L)
#define aplcMinKeyExchangeTransferCount   3
#define aplcKeyExchangeTransferCount_def   aplcMinKeyExchangeTransferCount
#define aplcMinTargetBlackoutPeriod   500
#define aplcMinTargetBlackoutPeriod_us   (aplcMinTargetBlackoutPeriod * 1000L)

Typedefs

typedef enum zrc_cmd_code_tag zrc_cmd_code_t
typedef enum cec_code_tag cec_code_t
typedef struct zrc_cmd_frm_tag zrc_cmd_frm_t
typedef void(* zrc_cmd_confirm_cb_t )(nwk_enum_t Status, uint8_t PairingRef, cec_code_t RcCmd)
typedef struct
zrc_indication_callback 
zrc_indication_callback_t

Enumerations

enum  zrc_cmd_code_tag {
  USER_CONTROL_IDLE = 0x00,
  USER_CONTROL_PRESSED = 0x01,
  USER_CONTROL_REPEATED = 0x02,
  USER_CONTROL_RELEASED = 0x03,
  CMD_DISCOVERY_REQUEST = 0x04,
  CMD_DISCOVERY_RESPONSE = 0x05
}
enum  cec_code_tag {
  SELECT = 0x00,
  UP = 0x01,
  DOWN = 0x02,
  LEFT = 0x03,
  RIGHT = 0x04,
  RIGHT_UP = 0x05,
  RIGHT_DOWN = 0x06,
  LEFT_UP = 0x07,
  LEFT_DOWN = 0x08,
  ROOT_MENU = 0x09,
  SETUP_MENU = 0x0a,
  CONTENTS_MENU = 0x0b,
  FAVORITE_MENU = 0x0c,
  EXIT = 0x0d,
  MEDIA_TOP_MENU = 0x10,
  MEDIA_CONTEXT_MENU = 0x11,
  NUMBER_SHIFT = 0x1d,
  NUMBER_11 = 0x1e,
  NUMBER_12 = 0x1f,
  NUMBER_0 = 0x20,
  NUMBER_1 = 0x21,
  NUMBER_2 = 0x22,
  NUMBER_3 = 0x23,
  NUMBER_4 = 0x24,
  NUMBER_5 = 0x25,
  NUMBER_6 = 0x26,
  NUMBER_7 = 0x27,
  NUMBER_8 = 0x28,
  NUMBER_9 = 0x29,
  DOT = 0x2a,
  ENTER = 0x2b,
  CLEAR = 0x2c,
  NEXT_FAVORITE = 0x2f,
  CHANNEL_UP = 0x30,
  CHANNEL_DOWN = 0x31,
  PREVIOUS_CHANNEL = 0x32,
  SOUND_SELECT = 0x33,
  INPUT_SELECT = 0x34,
  DISPLAY_INFORMATION = 0x35,
  HELP = 0x36,
  PAGE_UP = 0x37,
  PAGE_DOWN = 0x38,
  POWER = 0x40,
  VOLUME_UP = 0x41,
  VOLUME_DOWN = 0x42,
  MUTE = 0x43,
  PLAY = 0x44,
  STOP = 0x45,
  PAUSE = 0x46,
  RECORD = 0x47,
  REWIND = 0x48,
  FAST_FORWARD = 0x49,
  EJECT = 0x4a,
  FORWARD = 0x4b,
  BACKWARD = 0x4c,
  STOP_RECORD = 0x4d,
  PAUSE_RECORD = 0x4e,
  ANGLE = 0x50,
  SUB_PICTURE = 0x51,
  VIDEO_ON_DEMAND = 0x52,
  ELECTRONIC_PROGRAM_GUIDE = 0x53,
  TIMER_PROGRAMMING = 0x54,
  INITIAL_CONFIGURATION = 0x55,
  SELECT_BROADCAST_TYPE = 0x56,
  SELECT_SOUND_PRESENTATION = 0x57,
  PLAY_FUNCTION = 0x60,
  PAUSE_PLAY_FUNCTION = 0x61,
  RECORD_FUNCTION = 0x62,
  PAUSE_RECORD_FUNCTION = 0x63,
  STOP_FUNCTION = 0x64,
  MUTE_FUNCTION = 0x65,
  RESTORE_VOLUME_FUNCTION = 0x66,
  TUNE_FUNCTION = 0x67,
  SELECT_MEDIA_FUNCTION = 0x68,
  SELECT_AV_INPUT_FUNCTION = 0x69,
  SELECT_AUDIO_INPUT_FUNCTION = 0x6a,
  POWER_TOGGLE_FUNCTION = 0x6b,
  POWER_OFF_FUNCTION = 0x6c,
  POWER_ON_FUNCTION = 0x6d,
  F1_BLUE = 0x71,
  F2_RED = 0x72,
  F3_GREEN = 0x73,
  F4_YELLOW = 0x74,
  F5 = 0x75,
  DATA = 0x76
}

Functions

char * zrc_print_rc_cmd_text (uint8_t command)
 Prints RC command code text; used for example apps and debugging.
bool zrc_cmd_request (uint8_t PairingRef, uint16_t VendorId, zrc_cmd_code_t CmdCode, uint8_t CmdLength, uint8_t *Cmd, uint8_t TxOptions, FUNC_PTR confirm_cb)
 Initialites the command transmission from the application.
void zrc_cmd_confirm (nwk_enum_t Status, uint8_t PairingRef, cec_code_t RcCmd)
 Callback function to the application indicating the status the sent ZRC command request.
void zrc_cmd_indication (uint8_t PairingRef, uint8_t nsduLength, uint8_t *nsdu, uint8_t RxLinkQuality, uint8_t RxFlags)
 API indicating a received the command to ZRC application.
void zrc_data_indication (uint8_t PairingRef, uint16_t VendorId, uint8_t nsduLength, uint8_t *nsdu, uint8_t RxLinkQuality, uint8_t RxFlags)
 Handles the cmd data indications received from the network layer. (cmd discovery and remote control commands).
void zrc_data_confirm (nwk_enum_t Status, uint8_t PairingRef, profile_id_t ProfileId, uint8_t Handle)
 Handle the data confirm (received from network layer).
bool zrc_cmd_disc_request (uint8_t PairingRef, FUNC_PTR confirm_cb)
 Sends the ZRC command discovery request.
void zrc_cmd_disc_confirm (nwk_enum_t Status, uint8_t PairingRef, uint8_t *SupportedCmd)
 Callback ZRC command discovery confirm.
void zrc_cmd_disc_indication (uint8_t PairingRef)
 Callback ZRC command discovery indication.
bool zrc_cmd_disc_response (uint8_t PairingRef, uint8_t *SupportedCmd)
 ZRC command discovery response.
void register_zrc_indication_callback (zrc_indication_callback_t *zrc_ind_callback)
 Registering zrc indication callback.

Detailed Description

API for ZRC profile includes cmd discovery and RC commands.

Id:
zrc.h 31267 2012-03-12 12:35:25Z agasthian.s
Author:
Atmel Corporation: http://www.atmel.com
Support email: avr@atmel.com

Definition in file zrc.h.


Define Documentation

#define aplcKeyExchangeTransferCount_def   aplcMinKeyExchangeTransferCount

Default value of the key exchange transfer count.

Definition at line 78 of file zrc.h.

#define aplcMaxCmdDiscRxOnDuration   200

The maximum duration that the receiver is enabled on a controller after pairing to receive any command discovery request command frames.

Definition at line 59 of file zrc.h.

#define aplcMaxKeyRepeatInterval_ms   100

The maximum time between consecutive user control repeated command frame transmissions.

Definition at line 52 of file zrc.h.

#define aplcMaxPairIndicationWaitTime   1.2

The maximum amount of time a device waits after receiving a successful NLME-AUTO-DISCOVERY.confirm primitive for a pair indication to arrive from the pairing initiator. Unit is seconds.

Definition at line 63 of file zrc.h.

#define aplcMaxPairIndicationWaitTime_us   (aplcMaxPairIndicationWaitTime * 1000000L)

The maximum amount of time a device waits after receiving a successful NLME-AUTO-DISCOVERY.confirm primitive for a pair indication to arrive from the pairing initiator. Unit is micro seconds.

Definition at line 67 of file zrc.h.

#define aplcMaxResponseWaitTime   200

The maximum time a device shall wait for a response command frame following a request command frame. Unit is milli seconds.

Definition at line 70 of file zrc.h.

#define aplcMaxResponseWaitTime_us   (aplcMaxResponseWaitTime * 1000L)

The maximum time a device shall wait for a response command frame following a request command frame. Unit is micro seconds.

Definition at line 73 of file zrc.h.

#define aplcMinKeyExchangeTransferCount   3

The minimum value of the KeyExTransferCount parameter passed to the pair request primitive during the push button pairing procedure.

Definition at line 76 of file zrc.h.

#define aplcMinTargetBlackoutPeriod   500

The minimum amount of time a device must wait after a successful pairing attempt with a target before attempting command discovery. Unit is milli seconds.

Definition at line 81 of file zrc.h.

#define aplcMinTargetBlackoutPeriod_us   (aplcMinTargetBlackoutPeriod * 1000L)

The minimum amount of time a device must wait after a successful pairing attempt with a target before attempting command discovery. Unit is micro seconds.

Definition at line 84 of file zrc.h.

#define aplKeyRepeatInterval_def   (aplcMaxKeyRepeatInterval_ms)

Default value of the key repeat interval

Definition at line 54 of file zrc.h.

#define aplKeyRepeatWaitTime_def   (2 * aplcMaxKeyRepeatInterval_ms)

Default value of the key repeat wait time

Definition at line 56 of file zrc.h.

#define AUTO_DISC_DURATION_SYM   0x1C9C38

The automatic discovery response mode duration shall be set to 0x1c9c38 (30s).

Definition at line 39 of file zrc.h.

#define DISCOVERY_REPETITION_INTERVAL   0x00F424

Default value for the discovery repetition interval

Definition at line 42 of file zrc.h.

#define MAX_DISCOVERY_REPETITIONS   0x1E

Default value for maximum number of times the discovery request command is sent

Definition at line 45 of file zrc.h.

#define MAX_REPORTED_NODE_DESCRIPTORS   1

Default value for Number of reported node descriptor received during discovery process

Definition at line 48 of file zrc.h.


Typedef Documentation

ZRC command frame structure


Function Documentation

void zrc_data_confirm ( nwk_enum_t  Status,
uint8_t  PairingRef,
profile_id_t  ProfileId,
uint8_t  Handle 
)

Handle the data confirm (received from network layer).

Parameters:
StatusStatus received from the network layer.
PairingRefPairing reference
HandleData retry handle
void zrc_data_indication ( uint8_t  PairingRef,
uint16_t  VendorId,
uint8_t  nsduLength,
uint8_t *  nsdu,
uint8_t  RxLinkQuality,
uint8_t  RxFlags 
)

Handles the cmd data indications received from the network layer. (cmd discovery and remote control commands).

Parameters:
PairingRefPairing reference
VendorIdVendor ID
nsduLengthLength of the received data
nsduActual data
RxLinkQualityLink quality of received packet
RxFlagsRx Flags.