MahouCode calculates the transmit pattern from GwtS/MwM hex codes. The pattern calculated is ready for use with Android's infrared transmitter API.
repositories {
jcenter()
maven { url "https://jitpack.io" }
}
dependencies {
compile 'com.github.daveenguyen:mahoucode:0.1.1'
}
import com.daveenguyen.mahoucode.MahouCode;
import java.util.Arrays;
public class Example {
public static void main(String[] args) {
// right ear white and left ear blue.
// CRC not in code.
MahouCode code = new MahouCode("93 0E 00 0E 84 DD");
System.out.println(code.getCarrierFrequency());
// 38005
System.out.println(Arrays.toString(code.getPattern()));
// [417, 833, 833, 417, 833, 833, 833, 1250, 1667, 417, 3750, 417, 833, 1250, 1667, 417, 1250, 417, 1667, 833, 417, 417, 417, 1250, 417, 1250]
code = new MahouCode(MahouCode.parse9x("0E 00 0E 84"));
System.out.println(code.getCode());
// 93 0E 00 0E 84 DD
}
}
Copyright (c) 2015 Davee Nguyen - [email protected] Released under the terms of the MIT license.