In preparation for supporting IR learning for ZWave, change the IRLearn()
function to be a subclass function for each so that IR learning can be
implemented and easily merged for each type separately.

Signed-off-by: Scott Talbert <s...@techie.net>
---
 libconcord/remote.h     |  9 ++++++---
 libconcord/remote_z.cpp | 15 +++++++++++----
 2 files changed, 17 insertions(+), 7 deletions(-)

diff --git a/libconcord/remote.h b/libconcord/remote.h
index d26ea4a..fea2f1b 100644
--- a/libconcord/remote.h
+++ b/libconcord/remote.h
@@ -304,9 +304,6 @@ public:
     int SetTime(const TRemoteInfo &ri, const THarmonyTime &ht,
         lc_callback cb=NULL, void *cb_arg=NULL, uint32_t cb_stage=0);
 
-    int LearnIR(uint32_t *freq, uint32_t **ir_signal,
-        uint32_t *ir_signal_length, lc_callback cb=NULL,
-        void *cb_arg=NULL, uint32_t cb_stage=0);
     int IsZRemote() {return true;}
     int IsMHRemote() {return false;}
 };
@@ -340,6 +337,9 @@ public:
     int UpdateConfig(const uint32_t len, const uint8_t *wr,
         lc_callback cb, void *cb_arg, uint32_t cb_stage,
         uint32_t xml_size=0, uint8_t *xml=NULL);
+    int LearnIR(uint32_t *freq, uint32_t **ir_signal,
+        uint32_t *ir_signal_length, lc_callback cb=NULL,
+        void *cb_arg=NULL, uint32_t cb_stage=0);
     int IsUSBNet() {return false;}
     virtual int ReadRegion(uint8_t region, uint32_t &len, uint8_t *rd,
         lc_callback cb, void *cb_arg, uint32_t cb_stage);
@@ -370,6 +370,9 @@ public:
     int GetTime(const TRemoteInfo &ri, THarmonyTime &ht);
     int SetTime(const TRemoteInfo &ri, const THarmonyTime &ht,
         lc_callback cb=NULL, void *cb_arg=NULL, uint32_t cb_stage=0);
+    int LearnIR(uint32_t *freq, uint32_t **ir_signal,
+        uint32_t *ir_signal_length, lc_callback cb=NULL,
+        void *cb_arg=NULL, uint32_t cb_stage=0);
     int IsUSBNet() {return true;}
 };
 
diff --git a/libconcord/remote_z.cpp b/libconcord/remote_z.cpp
index f7ffa1a..b09082c 100644
--- a/libconcord/remote_z.cpp
+++ b/libconcord/remote_z.cpp
@@ -576,6 +576,13 @@ int CRemoteZ_USBNET::SetTime(const TRemoteInfo &ri, const 
THarmonyTime &ht,
     return 0;
 }
 
+int CRemoteZ_USBNET::LearnIR(uint32_t *freq, uint32_t **ir_signal,
+                             uint32_t *ir_signal_length, lc_callback cb,
+                             void *cb_arg, uint32_t cb_stage)
+{
+    return LC_ERROR_UNSUPP;
+}
+
 int CRemoteZ_USBNET::ReadRegion(uint8_t region, uint32_t &rgn_len, uint8_t *rd,
                                 lc_callback cb, void *cb_arg, uint32_t 
cb_stage)
 {
@@ -1480,9 +1487,9 @@ int CRemoteZ_HID::UpdateConfig(const uint32_t len, const 
uint8_t *wr,
     return 0;
 }
 
-int CRemoteZ_Base::LearnIR(uint32_t *freq, uint32_t **ir_signal,
-                           uint32_t *ir_signal_length, lc_callback cb,
-                           void *cb_arg, uint32_t cb_stage)
+int CRemoteZ_HID::LearnIR(uint32_t *freq, uint32_t **ir_signal,
+                          uint32_t *ir_signal_length, lc_callback cb,
+                          void *cb_arg, uint32_t cb_stage)
 {
-    return 0;
+    return LC_ERROR_UNSUPP;
 }
-- 
1.8.3.1


------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
_______________________________________________
concordance-devel mailing list
concordance-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/concordance-devel

Reply via email to