Software Guide

9.2.3.2CMainFrame Class Methods

The CMainFrame class is the Visual C++ generated file that is a derived frame-window class for the system tray application's main frame window. This class has been modified to also perform the timer based polling of the PRoC LP bridge HID device to obtain the radio parameters and display any appropriate pop up messages. Additionally, this class also processes the command message to cre- ate the WirelessUSB Status Property Sheet.

Table 9-5. CMainFrame Methods

Method

Type

Description

OnCreate()

Public

This method is called when a new window is created for this frame. It

 

 

sets up the HID Notification callback and device status property

 

 

sheet, initializes the HID manager, creates the system tray icon, sets

 

 

up the menu and tool tips. If any HID devices are present, it displays

 

 

the icon on the system tray and makes a call to start the timer.

HIDNotification()

Public

This method processes notifications of when an HID device is added

 

 

or removed from the list. It adds or removes property pages to the

 

 

wireless status page and adds or removes the icon from the system

 

 

tray when the first or last HID devices is added or removed.

OnStartTimer()

Public

This method starts the timer based on the hard-coded poll timer (cur-

 

 

rently set to once every 5 seconds).

OnStopTimer()

Public

This method stops the timer.

OnTimer()

Public

This method is the timer routine that is called when the timer expires.

 

 

It loops through all the HID devices in the list and updates their status

 

 

values then restarts the timer; also, it occasionally requests an update

 

 

in the battery level, currently set to once every hour.

OnDestroy()

Public

This method is called when the frame window is destroyed. It stops

 

 

the timer, removes the property sheet (if displayed), and removes the

 

 

icon from the system tray.

OnAppWireless

Public

This method displays the wireless status page, if it is not already dis-

USBStatus()

 

played.

 

 

116

CY4672 Reference Design Guide, Document # 001-16968 Revision **

[+] Feedback

Page 116
Image 116
Cypress CY4672 manual CMainFrame Class Methods, OnStopTimer Public This method stops the timer OnTimer