基于DragonBord410C的智能遥控
2017-10-16 16:25
197 查看
前段时间公司有一个基于高通410c开发板的智能遥控项目,该项目的功能点如下:编码解析,编码学习,远程控制。下面我将为大家一一讲解这些功能的实现和APP的整体架构。
主界面详情:
APP的架构:
发送Code:
public static void WriteData(String path, String content) { FileOutputStream fos = null; File file = new File(path); if (file.exists()) { try { fos = new FileOutputStream(file); Log.e("File", "FileWriter"); } catch (FileNotFoundException e) { e.printStackTrace(); } byte[] array = content.getBytes(); try { fos.write(array); } catch (IOException e) { e.printStackTrace(); } try { fos.flush(); fos.close(); } catch (IOException e) { e.printStackTrace(); } } }
解析编码:
public void onClick(View view) { switch (view.getId()) { case R.id.learn_mode: im.setVisibility(View.VISIBLE); message = new Message(); cancle_learn.setVisibility(View.VISIBLE); cancle_learn.setEnabled(true); Config.WriteData(Config.LEARN_PATH, "1"); timer.schedule(new TimerTask() { @Override public void run() { String a = Config.Redata(Config.STATUS); if (a.startsWith("0")) { /* Config.Redata(Config.LEARN_PATH);*/ irCode = new ET4007IRDevice().readlearncode(); if (irCode.isValid()) { irString = irCode.toString(); } else { irString = "ERROR"; } Bundle bundle = new Bundle(); bundle.putString("key", irString); message.setData(bundle); handler.sendMessage(message); timer.cancel(); } } }, 0, 1000); break; case R.id.mode_send: Config.WriteData(Config.SEND_PATH, irString); break; case R.id.cancle_learn: im.setVisibility(View.INVISIBLE); cancle_learn.setVisibility(View.INVISIBLE); setEnabled(false); timer.cancel(); break; case R.id.save_value: DialogUtil.launchdialog(this); break; }
主要用到的SO:
public class RemoteCore { private static final String libSoName = "IRCore"; static { try { System.loadLibrary(libSoName); Log.e("JNI",libSoName+" load finished"); }catch (Exception e){ Log.e("JNI"," exception "+e.getMessage()); } } public native static IRCode ET4007Learn(byte[] codes); public native static byte[] readLearnIRCode(); public native static int IRinit(); }
OK,大功告成,简单的智能遥控就实现啦!
相关文章推荐
- 基于dragonboard 410c的智能魔镜设计(5)——基于人脸的用户身份识别
- 基于Dragonboard410c的智能音箱(二)
- 基于dragonboard 410c的智能魔镜设计(3)——文本消息检索及自动显示
- 基于Dragon Board410c 的智能机器人预研-语音识别及定位
- 基于dragonboard 410c的智能魔镜设计(6)——人脸检测及身份识别启动模块封装
- 基于DragonBoard 410c的家庭智能环保卫士——(10)数据库python代码实现
- 基于DragonBoard410C的智能管家
- 基于Dragonboard410c的智能音箱(三)
- 基于DragonBoard410c的智能照明系统
- 基于dragonboard 410c的智能魔镜设计——硬件搭建
- 基于Dragonboard410c的智能音箱(一)
- 基于DragonBoard 410c的家庭智能环保卫士——(11)室内栅格地图位置更新Python实现
- 基于DragonBoard 410c的遥控炮台三之远程交互(上)
- 基于Dragonboard 410c的智能小车(三)
- 基于DragonBoard 410c的家庭智能环保卫士----各数据获取接口封装
- 基于Dragonboard 410c的智能小车(一)
- 基于Dragonboard 410c的家庭智能环保卫士——(3)室内路径规划
- 基于DragonBoard 410c的家庭智能环保卫士——(8)室内栅格定位
- 基于dragonboard 410c的智能魔镜设计(4)——视频消息检索及自动播放
- 基于DragonBoard 410c的家庭智能环保卫士——(4)A*路径搜索算法