Skip to content

daveenguyen/MahouCode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MahouCode

Build Status

MahouCode calculates the transmit pattern from GwtS/MwM hex codes. The pattern calculated is ready for use with Android's infrared transmitter API.

ConsumerIrManager.transmit

Usage

Gradle

repositories {
  jcenter()
  maven { url "https://jitpack.io" }
}

dependencies {
  compile 'com.github.daveenguyen:mahoucode:0.1.1'
}

Example

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
  }
}

License

Copyright (c) 2015 Davee Nguyen - [email protected] Released under the terms of the MIT license.

About

MwM hex codes to Android IR transmit pattern adapter.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages