Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion SupportedModels.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Don't see your model? We may have missed one. Just give it a shot, and if you ru
| 10 | 890<br/>895 | Working | Not working | Not working | |
| 12 | One | Working | Working | Not working | |
| 14 | 700 | Working | Believed working | Not working | Needs kernel > 2.6.37 |
| 15 | 900<br/>1000<br/>1000i<br/>1100<br/>Xbox | Working | Not working | Not working | Not yet supported on Mac |
| 15 | 900 | Working | Working | Not working | Not yet supported on Mac |
| 15 | 1000<br/>1000i<br/>1100<br/>Xbox | Working | Not working | Not working | Not yet supported on Mac |
| 16 | 200<br/>300 | Working | Working | Not working | |
Comment thread
jaymzh marked this conversation as resolved.
| 17 | Link | Working | Working | Not working | |
5 changes: 4 additions & 1 deletion libconcord/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
# libconcord
ACLOCAL_AMFLAGS = -I m4
lib_LTLIBRARIES = libconcord.la
AUTOMAKE_OPTIONS = subdir-objects
libconcord_la_SOURCES = remote.cpp remote_z.cpp libconcord.cpp binaryfile.cpp \
web.cpp usblan.cpp binaryfile.h hid.h protocol_z.h \
remote_info.h web.h protocol.h remote.h usblan.h xml_headers.h \
operationfile.cpp remote_mh.cpp libusbhid.cpp libhidapi.cpp
operationfile.cpp remote_mh.cpp libusbhid.cpp libhidapi.cpp \
remote_z_learn/data.cpp remote_z_learn/base.cpp \
remote_z_learn/single.cpp remote_z_learn/stream.cpp
include_HEADERS = libconcord.h
libconcord_la_CPPFLAGS = -Wall
libconcord_la_LDFLAGS = -version-info 6:0:0 $(LIBCONCORD_LDFLAGS) -lzip -lcurl
Expand Down
16 changes: 16 additions & 0 deletions libconcord/libconcord.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1701,6 +1701,22 @@ void delete_key_names(char **key_names, uint32_t key_names_length)
}
}

/*
* set USBNET learn mode / time
*/
int set_learning_mode(int mode, uint32_t timeout_ms)
{
if (rmt == NULL){
return LC_ERROR_CONNECT;
}

auto *p = dynamic_cast<CRemoteZ_USBNET*>(rmt);
if (p == nullptr) {
return LC_ERROR;
}
return p->SetIrMode(mode, timeout_ms);
}

/*
* Fill ir_data with IR code learned from other remote
* via Harmony IR receiver.
Expand Down
17 changes: 17 additions & 0 deletions libconcord/libconcord.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
#define LC_ERROR_UNSUPP 15
#define LC_ERROR_INVALID_CONFIG 16
#define LC_ERROR_IR_OVERFLOW 17
#define LC_ERROR_IR_TIMEOUT 18

/*
* Filetypes, used by identity_file()
Expand All @@ -50,6 +51,11 @@
#define LC_FILE_TYPE_CONFIGURATION 2
#define LC_FILE_TYPE_FIRMWARE 3
#define LC_FILE_TYPE_LEARN_IR 4
/*
* IR Learn mode
*/
#define LC_LEARN_SINGLE 0
#define LC_LEARN_STREAM 1
/*
* Callback counter types
*/
Expand Down Expand Up @@ -455,6 +461,17 @@ int get_key_names(char ***key_names, uint32_t *key_names_length);

void delete_key_names(char **key_names, uint32_t key_names_length);

/*
* H900 only
* Set mode that will be used for learing. There are two available
* - Single: Remote waits a fixed time for a command, and if received
* returns the data of one single IR frame
* - Stream: Remote records IR data for the time given in _timeout_ms_
* Any data within this window is returned, including silence. Data
* before the first reception is dropped.
*/
int set_learning_mode(int mode, uint32_t timeout_ms);

/*
* Fill ir_data with IR code learned from other remote
* via Harmony IR receiver.
Expand Down
6 changes: 3 additions & 3 deletions libconcord/protocol_z.h
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,9 @@
#define COMMAND_SEND_LONG_ZWAVE_RESPONSE_DATA 0x8B
#define COMMAND_SEND_LONG_ZWAVE_RESPONSE_DATA_DONE 0x8C
#define COMMAND_INITIATE_LEARNIR_TCP_CHANNEL 0xA0
#define COMMAND_LEARNIR 0xA1
#define COMMAND_LEARNIR_HEADER 0xA2
#define COMMAND_LEARNIR_DATA 0xA3
#define COMMAND_LEARNIR_START 0xA1
#define COMMAND_LEARNIR_SINGLE 0xA2
#define COMMAND_LEARNIR_STREAM 0xA3
#define COMMAND_LEARNIR_DONE 0xA4
#define COMMAND_LEARNIR_STOP 0xA5
// 1000 only
Expand Down
12 changes: 12 additions & 0 deletions libconcord/remote.h
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,9 @@ class CRemoteZ_HID : public CRemoteZ_Base
class CRemoteZ_USBNET : public CRemoteZ_Base
{
protected:
int ir_learn_mode = LC_LEARN_SINGLE;
uint32_t ir_stream_timeout_ms = 1000;

int TCPSendAndCheck(uint8_t cmd, uint32_t len=0, uint8_t *data=NULL);
virtual int Write(uint8_t typ, uint8_t cmd, uint32_t len=0,
uint8_t *data=NULL);
Expand All @@ -380,6 +383,14 @@ class CRemoteZ_USBNET : public CRemoteZ_Base
| x[2]<<8 | x[3]; };
virtual int ReadRegion(uint8_t region, uint32_t &len, uint8_t *rd,
lc_callback cb, void *cb_arg, uint32_t cb_stage);
virtual int SendLearnStart();
virtual int SendLearnStop();
virtual int ReadIrData(uint32_t *freq, uint32_t **ir_signal,
uint32_t *ir_signal_length, lc_callback cb, void *cb_arg,
uint32_t cb_stage);
virtual int ReadIrStream(uint32_t *freq, uint32_t **ir_signal,
uint32_t *ir_signal_length, lc_callback cb, void *cb_arg,
uint32_t cb_stage);

public:
CRemoteZ_USBNET() {};
Expand All @@ -390,6 +401,7 @@ class CRemoteZ_USBNET : public CRemoteZ_Base
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 SetIrMode(int mode = LC_LEARN_SINGLE, uint32_t stream_timeout_ms = 1000);
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);
Expand Down
Loading
Loading