frid android 应用

package com.example.uhf;import android.os.Bundle;import android.os.Handler;import android.os.Message;import android.annotation.SuppressLint;import android.app.Activity;import android.app
摘要由CSDN通过智能技术生成

 

package com.example.uhf;

import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.app.AlertDialog;
import android.util.Log;
import android.view.Menu;
import android.view.View;
import android.view.WindowManager;
import android.view.View.OnClickListener;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.Spinner;
import android.widget.TextView;
import android.widget.Toast;
import android.widget.AdapterView.OnItemSelectedListener;

import com.WifiCtr.WifiCtr;
import com.friendlyarm.AndroidSDK.HardwareControler;

@SuppressLint({ "DefaultLocale", "HandlerLeak" })
public class MainActivity extends Activity {

    TextView commucationView;
    private Button stopButton;
    private Button find_one;
    private Button find_more;
    private Button stop_more;
    private Button send_button;  
    private Spinner cmdSpinner;
    private ArrayAdapter<String> cmdAdapter;

    private int fd = 0;
    int cmd_num;//命令编号

    String thread = "readThread";

    String choosed_serial = "/dev/s3c2410_serial3";

    int choosed_buad = 115200;
    boolean flag=false;
    byte[] buf= new byte[100];   
    byte[] buf_zl= new byte[20]; 
    byte[] read_one = new byte[]{(byte)0xa5,(byte)0x5a,0x00,0x0a,(byte)0x80,0x00,0x64,(byte)0xee,0x0d,0x0a};
    byte[] read_more= new byte[]{(byte)0xa5,(byte)0x5a,0x00,0x0a,(byte)0x82,0x00,0x00,(byte)0x88,0x0d,0x0a};
    byte[] stop_read_more= new byte[]{(byte)0xa5,(byte)0x5a,0x00,0x08,(byte)0x8c,(byte)0x84,0x0d,0x0a};
    /*发送功率命令数组  */
    byte[][] cmd= new byte[][]{
    {(byte)0xa5,(byte)0x5a,0x00,(byte)0x0e,0x10,0x00,0x01,0x03,(byte)0xe8,0x03,(byte)0xe8,0x1f,0x0d,0x0a},//发射接收功率均为10
    {(byte)0xa5,(byte)0x5a,0x00,(byte)0x0e,0x10,0x00,0x01,0x07,(byte)0xd0,0x07,(byte)0xd0,0x1f,0x0d,0x0a},//发射接收功率均为20
    {(byte)0xa5,(byte)0x5a,0x00,(byte)0x0e,0x10,0x00,0x01,0x0b,(byte)0xb8,0x0b,(byte)0xb8,0x1f,0x0d,0x0a},//发射接收功率均为30     		
    {(byte)0xa5,(byte)0x5a,0x00,(byte)0x0e,0x10,0x00,0x01,0x0f,(byte)0xa0,0x0f,(byte)0xa0,0x1f,0x0d,0x0a},//发射接收功率均为40 
    {(byte)0xa5,(byte)0x5a,0x00,(byte)0x0e,0x10,0x00,0x01,0x13,(byte)0x88,0x13,(byte)0x88,0x1f,0x0d,0x0a},//发
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值