| 
 | 
G6执法仪硬件访问说明: 
按键 
 
录像键: 
 
DOWN:  android.intent.action.ACTION_VIDEO_DOWN 
UP:        android.intent.action.ACTION_VIDEO_UP 
 
longpress:   android.intent.action.ACTION_VIDEO_LONG_PRESS 
 
 
录音键: 
 
DOWN:  android.intent.action.ACTION_RECORD_DOWN 
UP:        android.intent.action.ACTION_RECORD_UP 
 
longpress:   android.intent.action.ACTION_RECORD_LONG_PRESS 
 
 
拍照键: 
 
DOWN:  android.intent.action.ACTION_CAMERA_DOWN 
UP:        android.intent.action.ACTION_CAMERA_UP 
 
longpress:   android.intent.action.ACTION_CAMERA_LONG_PRESS 
 
SOS: 
 
DOWN:  android.intent.action.ACTION_SOS_DOWN 
UP:        android.intent.action.ACTION_SOS_UP 
 
longpress:   android.intent.action.ACTION_SOS_LONG_PRESS 
 
PTT: 
 
DOWN:  android.intent.action.ACTION_PTTKEY_DOWN 
UP:        android.intent.action.ACTION_PTTKEY_UP 
 
longpress:   android.intent.action.ACTION_PTT_LONG_PRESS 
 
LED 
客户调用摄像头时可以亮,可以使用下面的节点: 
 
右边红色 
sys/class/leds/aw2013_right_red/brightness 
右边绿色 
sys/class/leds/aw2013_right_green/brightness 
右边红色闪烁 
sys/class/leds/aw2013_right_red/blink 
 
直接对这些节点写入操作。 
 
获取ID 
        private String getMacAddress() { 
                try { 
                        WifiManager wifi = (WifiManager) context 
                                        .getSystemService(Context.WIFI_SERVICE); 
                        WifiInfo info = wifi.getConnectionInfo(); 
                        return info.getMacAddress().replace(":", ""); 
                } catch (Exception e) { 
                        Log.e("MPUDefaultDevice", "getMacAddress--->" + e.getMessage()); 
                } 
                return null; 
        } 
         
        private String getImeiInfo() { 
                TelephonyManager telephonyMgr = (TelephonyManager) context 
                                .getSystemService(Context.TELEPHONY_SERVICE); 
                return telephonyMgr.getDeviceId(); 
                 
        } 
         
        /*获取ID接口*/ 
        public String getStringDefaultDevice() { 
                String stringDevice = null; 
                try { 
                        // stringDevice = getImeiInfo().subSequence( 
                        // getImeiInfo().length() - 7, getImeiInfo().length()) 
                        // .toString(); 
                        stringDevice = getImeiInfo().subSequence( 
                                        getImeiInfo().length() - 7, getImeiInfo().length()) 
                                        .toString(); 
 
                } catch (Exception e) { 
                        Log.e("MPUDefaultDevice", "e--->" + e.getMessage()); 
                } 
                try { 
                        if (stringDevice == null) { 
                                stringDevice = getMacAddress().subSequence( 
                                                getMacAddress().length() - 7, getMacAddress().length()) 
                                                .toString(); 
                        } 
                } catch (Exception e) { 
                        Log.e("MPUDefaultDevice", "e--->" + e.getMessage()); 
                } 
                if (stringDevice == null || stringDevice.equals("0000000")) { 
                        stringDevice = "aff8866"; 
                } 
                return "2" + stringDevice; 
        } 
 
 
 
 |   
 
 
 
 |