• 로그인 함 해보끄나?

  • Sarangnamu.net June 17, 2003
    Home Login Profile Study Open Project Q&A Google Code
    vibrate api
    Last Modify : 13 December, 2010(12:01)
    /**
     * @file CVibrate.h
     * @author cheol-dong choi <aucd29@gmail.com>
     * @version 1.0
     * @date December 16, 2009 12:2:28
     * @section LICENSE
     *
     * Copyright (c) 2003-2010, cheol-dong choi, (http://www.sarangnamu.net)
     *
     * Permission is hereby granted, free of charge, to any person
     * obtaining a copy of this software and associated documentation
     * files (the "Software"), to deal in the Software without
     * restriction, including without limitation the rights to use,
     * copy, modify, merge, publish, distribute, sublicense, and/or sell
     * copies of the Software, and to permit persons to whom the
     * Software is furnished to do so, subject to the following
     * conditions:
     *
     * The above copyright notice and this permission notice shall be
     * included in all copies or substantial portions of the Software.
     * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
     * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
     * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
     * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
     * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
     * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,ARISING
     * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
     * OTHER DEALINGS IN THE SOFTWARE.
     * 
     * @section DESCRIPTION
     * @code
     * CVibrate vib;
     * vib.FewSecondPlay();
     * @endcode
     * 
     * @code
     * CVibrate vib;
     * vib.Start();
     * .
     * . others
     * .
     * vib.End();
     * @endcode
     *
     *
     * @section CHANGE_LOG
     *
     */
    
    
    #ifndef __CD_CVIBRATE_H__
    #define __CD_CVIBRATE_H__
    
    
    /**
     * @class CVibrate
     * @brief Omnia2 에서 진동을 일으킨다.
     */
    class CVibrate
    {
    public:
    
    	/*
    	 * Construction
    	 */
    	CVibrate();
    
    	/*
    	 * Destructor
    	 */
    	virtual ~CVibrate();
    
    public:
    
    	/*
    	 * Getter methods
    	 */
    	void Start();
    
    	void End();
    
    	void FewSecondPlay();
    
    	void SetFewID(int nFewID);
    
    	void SetLongID(int nLongID);
    
    protected:
    
    	/*
    	 * Attributes
    	 */
    	int _nFewID;
    
    	int _nLongID;
    };
    
    #endif
    
    
    /**
     * @file CVibrate.cpp
     * @author cheol-dong choi <aucd29@gmail.com>
     * @version 1.0
     * @date 2010-12-13 (12:01:04)
     * @section LICENSE
     *
     * Copyright (c) 2003-2010, cheol-dong choi, (http://www.sarangnamu.net)
     *
     * Permission is hereby granted, free of charge, to any person
     * obtaining a copy of this software and associated documentation
     * files (the "Software"), to deal in the Software without
     * restriction, including without limitation the rights to use,
     * copy, modify, merge, publish, distribute, sublicense, and/or sell
     * copies of the Software, and to permit persons to whom the
     * Software is furnished to do so, subject to the following
     * conditions:
     *
     * The above copyright notice and this permission notice shall be
     * included in all copies or substantial portions of the Software.
     * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
     * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
     * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
     * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
     * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
     * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,ARISING
     * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
     * OTHER DEALINGS IN THE SOFTWARE.
     * 
     * @section DESCRIPTION
     *
     *
     * @section CHANGE_LOG
     *
     */
    
    
    #include "CVibrate.h"
    #include "RSLOGGER.H"
    #include <nled.h>
    
    
    /*
     * Constructor
     */
    CVibrate::CVibrate()
    {
    	// for OMNIA 2
    	_nFewID = 10;
    	_nLongID = 11;
    }
    
    
    /*
     * Destructor
     */
    CVibrate::~CVibrate()
    {
    
    }
    
    
    /**
     * Vibrate start
     */
    void CVibrate::Start()
    {
    	LOG1("CVibrate::Start\n");
    
    #if _WIN32_WCE == 0x502
    	NLED_SETTINGS_INFO settings;
    
    	memset(&settings, 0, sizeof(NLED_SETTINGS_INFO));
    	settings.LedNum = _nLongID;
    	settings.OnTime = 500;
    	settings.OffTime = 500;
    	settings.OffOnBlink = true;
    
    	NLedSetDevice (NLED_SETTINGS_INFO_ID, &settings);
    #endif
    }
    
    
    /**
     * Vibrate end
     */
    void CVibrate::End()
    {
    	LOG1("CVibrate::End\n");
    
    #if _WIN32_WCE == 0x502
    	NLED_SETTINGS_INFO settings;
    
    	memset(&settings, 0, sizeof(NLED_SETTINGS_INFO));
    	settings.LedNum = _nLongID;
    	settings.OnTime = 500;
    	settings.OffTime = 500;
    	settings.OffOnBlink = false;
    
    	NLedSetDevice (NLED_SETTINGS_INFO_ID, &settings);
    #endif
    }
    
    
    /**
     * Vibrate few second play
     */
    void CVibrate::FewSecondPlay()
    {
    	LOG1("CVibrate::Few\n");
    
    #if _WIN32_WCE == 0x502
    	NLED_SETTINGS_INFO settings;
    
    	memset(&settings, 0, sizeof(NLED_SETTINGS_INFO));
    	settings.LedNum = _nFewID;
    	settings.OnTime = 500;
    	settings.OffTime = 500;
    	settings.OffOnBlink = true;
    
    	NLedSetDevice (NLED_SETTINGS_INFO_ID, &settings);
    #endif
    }
    
    
    /**
     * vibrate 를 구동시키는 기본 아이디가 변경되었을 때 설정 한다.
     *
     * @param nFewID 변경할 id
     */
    void CVibrate::SetFewID(int nFewID)
    {
    	LOG1("CVibrate::SetFewID\n");
    
    	_nFewID = nFewID;
    }
    
    
    /**
     * vibrate 를 구동시키는 기본 아이디가 변경되었을 때 설정 한다.
     *
     * @param nFewID 변경할 id
     */
    void CVibrate::SetLongID(int nLongID)
    {
    	LOG1("CVibrate::SetLongID\n");
    
    	_nLongID = nLongID;
    }
    

    Comment


    입력하3 1498665019



    Locations of visitors to this page