LunaSysMgr
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
CoreNaviLeds.h
Go to the documentation of this file.
1 /* @@@LICENSE
2 *
3 * Copyright (c) 2009-2012 Hewlett-Packard Development Company, L.P.
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 *
17 * LICENSE@@@ */
18 
19 
20 
21 
22 #ifndef CORENAVILEDS_H
23 #define CORENAVILEDS_H
24 
25 #include "Common.h"
26 
27 #include <fcntl.h>
28 #include <stdio.h>
29 #include <stdlib.h>
30 #include <string.h>
31 #include <sys/ioctl.h>
32 #include <unistd.h>
33 #include <stdint.h>
34 #include <stdarg.h>
35 
36 #include <nyx/nyx_client.h>
37 
38 
39 class CoreNaviLeds {
40  public:
41  int Left();
42  int Right();
43  int Center();
44  int All();
45  void stopAll();
46 
47  void stopAll(int led);
48  //void ledBlink(int led);
49  void ledFade(int led, int brightness, int cFadeIn, int cFadeOut, int sFadeIn, int sFadeOut);
50  void ledPulsate(int led, int brightness, int startDelay, int FadeIn, int FadeOut, int FadeOutDelay, int RepeatDelay, int repeat);
51  void ledDoublePulse(int led, int brightness, int pulseRamp, int pulseDur, int pulseDelay, int RepeatDelay, int repeat);
52 
53  void ledFullFade(int brightness, int firstIn,int firstOut, int secondIn, int secondOut, int thirdOut, bool left);
54  void ledSet (int led, int brightness);
55  void ledRampTo(int led, int brightness, int time);
56  void ledWaterdrop(int brightness, int cFadeIn, int cFadeOut, int sFadeIn, int sFadeOut,bool reverse = false);
57 
58  // for the light bar
59  void ledLightbarSwipe (int brightness, int fadeTime, bool goLeft);
60  void ledLightbarFullSwipe (int brightness, int fadeTime, bool goLeft);
61 
62  void ledSwipe (int brightness, int fadeTime, bool goLeft);
63  void ledFullSwipe (int brightness, int fadeTime, bool goLeft);
64 
65  void ledSeesaw(int brightness, int fadeTime, bool reverse = false);
66  void ledFadeOff (int brightness, int fadeTime, bool goLeft);
67 
69  static CoreNaviLeds* instance ();
70 
71  CoreNaviLeds();
72  ~CoreNaviLeds();
73 
74  private:
75  void configureParameters(int n, ...);
76  void initializeEffect(nyx_led_controller_effect_type_t effect_type, int led);
77  void finalizeAndExecute();
78 
79  nyx_led_controller_core_configuration_handle_t m_config;
80  nyx_led_controller_effect_t m_effect;
81 
82  bool m_lightbarEnabled;
83  nyx_device_handle_t m_device;
84 
85 };
86 
87 #endif//CORENAVILEDS_H