<< 前のページ
2011年1月31日(月) 20:19
---------------------------ここから--------------------------- @echo off set BASE=%~dp0 for %%i in (%*) do %BASE%\CCC.exe -d:XVID -f %%i ---------------------------ここまで---------------------------
written by sirius [デジモノ] [この記事のURL] [コメントを書く] [コメント(0)] [TB(0)]
2011年1月30日(日) 19:40
written by sirius [KURO-RS] [この記事のURL] [コメントを書く] [コメント(1)] [TB(0)]
2011年1月30日(日) 11:01
written by sirius [デジモノ] [この記事のURL] [コメントを書く] [コメント(0)] [TB(0)]
2011年1月29日(土) 17:20
written by sirius [デジモノ] [この記事のURL] [コメントを書く] [コメント(0)] [TB(0)]
2011年1月28日(金) 23:18
written by sirius [KURO-RS] [この記事のURL] [コメントを書く] [コメント(0)] [TB(0)]
2011年1月26日(水) 21:20
written by sirius [KURO-RS] [この記事のURL] [コメントを書く] [コメント(0)] [TB(0)]
2011年1月25日(火) 21:51
written by sirius [アースソフト PT2] [この記事のURL] [コメントを書く] [コメント(0)] [TB(0)]
2011年1月24日(月) 21:05
typedef struct _param_t {
int vender; /* カスタムコード */
int l_on; /* Leader 部の on bit の数 */
int l_off; /* Leader 部の off bit の数 */
int on; /* on bit の数 */
int off1; /* 0 の時の off bit のビット数 */
int off2; /* 1 の時の off bit のビット数 */
int s_on; /* ストップビットのビット数 */
int bit_length; /* 送信データのビット数 */
int frame_size; /* Leader 部を除いたデータのビット数 */
int repeat_type; /* データの繰り返しタイプ */
} param_t;
param_t table[] = {
{ 0x50ef, 90, 45, 6, 6, 16, 6, 32, 1083, 1 }, /* HDUSF */
{ 0x30ce, 90, 45, 6, 6, 16, 6, 32, 1073, 1 }, /* LT-H91DTV */
{ 0xc4a2, 90, 44, 6, 6, 16, 6, 32, 1069, 1 }, /* SHDSW_4SV */
{ 0x06, 90, 45, 6, 6, 16, 6, 32, 1075, 1 }, /* PF720 */
{ 0xc5, 86, 42, 6, 6, 16, 6, 16, 465, 2 }, /* TH-BA1 */
{ 0xf5, 86, 42, 6, 6, 16, 6, 16, 465, 2 }, /* TH-BA1 */
{ 0x20, 23, 11, 5, 6, 17, 5, 16, 489, 3 }, /* DT-100HDMI */
{ 0,0,0,0,0,0,0,0,0,0 }
};
written by sirius [KURO-RS] [この記事のURL] [コメントを書く] [コメント(0)] [TB(0)]
2011年1月23日(日) 20:39
written by sirius [KURO-RS] [この記事のURL] [コメントを書く] [コメント(0)] [TB(0)]
2011年1月22日(土) 11:57
written by sirius [KURO-RS] [この記事のURL] [コメントを書く] [コメント(0)] [TB(0)]
2011年1月21日(金) 18:45
written by sirius [KURO-RS] [この記事のURL] [コメントを書く] [コメント(0)] [TB(0)]
2011年1月20日(木) 21:13
written by sirius [KURO-RS] [この記事のURL] [コメントを書く] [コメント(0)] [TB(0)]
2011年1月19日(水) 21:31
written by sirius [KURO-RS] [この記事のURL] [コメントを書く] [コメント(0)] [TB(0)]
2011年1月18日(火) 22:18
written by sirius [KURO-RS] [この記事のURL] [コメントを書く] [コメント(0)] [TB(0)]
2011年1月17日(月) 21:57
----------------------ここから----------------------
#include <stdio.h>
#include <stdlib.h>
#include <signal.h>
#include <string.h>
#include <malloc.h>
#include "kuro_rs.h"
#include "kuro_rs_common.h"
int main(int argc,char *argv[])
{
unsigned char buf[255];
char *data_file = NULL;
char *device = "/dev/ttyUSB0";
FILE *fp;
RS *rp;
if( argc >= 2 && argv[1] && *argv[1] )
data_file = argv[1];
if( !data_file ) {
printf("%s data file\n", argv[0]);
exit(1);
}
if( !(rp = open_rs(device, 1)) ) {
printf("device open error(%s)\n", device);
exit(1);
}
if( recive_irdata(rp, buf) ) {
printf("recive error\n");
exit(1);
}
close_rs(rp);
if( !(fp = fopen(data_file, "wb")) ) {
printf("file open err(%s)\n", data_file);
exit(1);
} else {
fwrite(buf, sizeof(unsigned char), REC_DATA_SIZE, fp);
fclose(fp);
}
printf("Rec File : %s\n", data_file);
exit(0);
}
----------------------ここまで----------------------
----------------------ここから----------------------
#include <stdio.h>
#include <stdlib.h>
#include <signal.h>
#include <string.h>
#include <malloc.h>
#include "kuro_rs.h"
#include "kuro_rs_common.h"
int main(int argc,char *argv[])
{
unsigned char buf[255];
char *port = "1";
char *data_file = NULL;
char *device = "/dev/ttyUSB0";
FILE *fp;
RS *rp;
if( argc >= 2 && argv[1] && *argv[1] )
data_file = argv[1];
if( argc >= 3 && argv[1] && *argv[2] )
port = argv[2];
if( !data_file ) {
printf("%s data file [port]\n", argv[0]);
exit(1);
}
if( !(fp = fopen(data_file, "rb")) ) {
printf("file open err(%s)\n", data_file);
exit(1);
} else {
fread(buf, sizeof(unsigned char), REC_DATA_SIZE, fp);
fclose(fp);
}
if( !port || (*port < '1' || *port > '4') )
*port = '1';
if( !(rp = open_rs(device, 1)) ) {
printf("device open error(%s)\n", device);
exit(1);
}
if( send_irdata(rp, *port, buf) ) {
printf("can't send data\n");
exit(1);
}
close_rs(rp);
printf("Send File : %s\n", data_file);
exit(0);
}
----------------------ここまで----------------------
written by sirius [KURO-RS] [この記事のURL] [コメントを書く] [コメント(0)] [TB(0)]
2011年1月15日(土) 18:50
written by sirius [デジモノ] [この記事のURL] [コメントを書く] [コメント(0)] [TB(0)]
2011年1月14日(金) 21:42
written by sirius [デジモノ] [この記事のURL] [コメントを書く] [コメント(0)] [TB(0)]
2011年1月13日(木) 22:12
------------------------ここから------------------------
#include <stdio.h>
#include <stdlib.h>
#define bits(x) ((x) < 0 ? 0 : (buf[(x)/8]>>((x)%8))&0x1)
#define is_one(on, off) ((on) >= 3 && (off) >= 10)
#define is_zero(on, off) ((on) >= 3 && (off) <= 9)
int main(int argc, char *argv[])
{
FILE *fp;
unsigned char buf[255];
int i, on, off, count, leader, tailer;
unsigned long code;
if( argc != 2 ) exit(1);
if( !(fp = fopen(argv[1], "rb")) ) exit(1);
fread(buf, sizeof(unsigned char), 240, fp);
fclose(fp);
printf("%-14s ", argv[1]);
on = off = code = count = leader = tailer = 0;
for( i = 0 ; i < 240*8; i++ ) {
if( bits(i) && bits(i-1) ) on++;
else if( !bits(i) && !bits(i-1) ) {
off++;
if( off > 90 ) {
tailer = 1;
break;
}
} else if( !bits(i) && bits(i-1) ) off = 1;
else if( bits(i) && !bits(i-1) ) {
if( on > 20 && off > 10 ) leader = 1;
else if( is_one(on, off) ) code = (code<<1) + 1,count++;
else if( is_zero(on, off) ) code = (code<<1), count++;
on = 1;
}
}
printf("code = %-8lx(%d bit) %s-%s ", code, count,
leader ? "true " : "false", tailer ? "true " : "false");
if( count == 32 ) {
if( ((code>>16) & 0xff) != (~(code>>24) & 0xff) )
printf("Vender = 0x%04x ", (code>>16)&0xffff);
else
printf("Vender = 0x%02x ", (code>>24)&0xff);
if( (code & 0xff) == (~(code>>8) & 0xff) )
printf("Data = 0x%02x\n", (code>>8)&0xff);
else
printf("data error\n");
} else
printf("\n");
}
------------------------ここまで------------------------
HDUS_Power code = 50ef817e(32 bit) true -true Vender = 0x50ef Data = 0x81
written by sirius [KURO-RS] [この記事のURL] [コメントを書く] [コメント(0)] [TB(0)]
2011年1月12日(水) 22:11
----------------------ここから----------------------
#include <stdio.h>
#include <stdlib.h>
#define bits(x) ((x) < 0 ? 0 : (buf[(x)/8]>>((x)%8))&0x1)
#define max(x, y) (((x) > (y)) ? (x) : (y))
int main(int argc, char *argv[])
{
FILE *fp;
unsigned char buf[255];
int i, max_on, max_off, on, off, count;
if( argc != 2 ) exit(1);
if( !(fp = fopen(argv[1], "rb")) ) exit(1);
fread(buf, sizeof(unsigned char), 240, fp);
max_on = max_off = on = off = count = 0;
for( i = 0; i < 240*8; i++ ) {
if( bits(i) ) {
if( bits(i-1) ) on++;
else {
if( i ) {
count++;
printf("%-3d, " , off);
if( (count % 8) == 7 ) printf("\n");
} else count--;
max_off = max(max_off, off);
on = 1;
}
} else {
if( bits(i-1) ) {
count++;
printf("%-3d, ", on);
if( (count % 8) == 7 ) printf("\n");
max_on = max(max_on, on);
off = 1;
} else off++;
}
}
if( bits(i-2) == bits(i-1) ) {
if( bits(i-1) ) {
printf("%-3d\n", on);
max_on = max(max_on, on);
} else {
printf("%-3d\n", off);
max_off = max(max_off, off);
}
}
printf("max on bit %d, off bit %d\n", max_on, max_off);
}
----------------------ここまで----------------------
written by sirius [KURO-RS] [この記事のURL] [コメントを書く] [コメント(0)] [TB(0)]
2011年1月11日(火) 20:50
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[])
{
FILE *fp;
int i, j;
int msb, byte;
unsigned char buf[255], c;
if( argc != 3 ) exit(1);
msb = byte = 0;
if( *(argv[2]) == '1' ) msb = 1;
if( *(argv[2]+1) == '1' ) byte = 1;
if( !(fp = fopen(argv[1], "rb")) ) exit(1);
fread(buf, sizeof(unsigned char), 240, fp);
for( i = 0; i < 240; i++ ) {
if( byte ) {
if( i % 2 ) c = buf[i-1];
else c = buf[i+1];
} else c = buf[i];
for( j = 0; j < 8; j++ ) {
if( msb ) printf("%d", (c>>j) &0x1);
else printf("%d", (c>>(7-j)) &0x1);
}
if( (i % 8) == 7 ) printf("\n");
else printf(" ");
}
printf("\n");
}
written by sirius [KURO-RS] [この記事のURL] [コメントを書く] [コメント(0)] [TB(0)]
<< 前のページ
MySketch 2.7.2 written by 夕雨