# shp04 **Repository Path**: wangda11/shp04 ## Basic Information - **Project Name**: shp04 - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2024-08-27 - **Last Updated**: 2024-09-02 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # shp04_demo_app SHP04 用于验证蓝牙SPP连接的demo app [//]: # (library介绍) 1. mBLESPPUtils = new BLESPPUtils(Context, OnBluetoothAction); //初始化功能类 2. mBLESPPUtils.enableBluetooth(); //使能蓝牙适配器 3. mBLESPPUtils.setBtDeviceName(String); //设置已连接设备的名字,可以是前部分,会比较前8个字节 4. mBLESPPUtils.getConnectedBtDevice(); //获取符合要求的已连接设备,获取后会进行socket通信; 5. mBLESPPUtils.disConnectedBtDevice(); //关闭socket通信 6. mBLESPPUtils.send(String strValue); //发送数据到下位机 interface接口说明: 1. onConnectSuccess(PairedDeviceInfo device) //获取已连接的耳机设备 device.getName() //设备名称 device.getMacAddr() //设备mac地址 2. onSendBytes(byte bytes); //发送数据到下位机 bytes为发送数据 3. void onReceiveBattery(String[] bytes, int battery, BatteryStatus batteryStatus) //接收到下位机发送的电量数据 battery //耳机电池电量 batteryStatus //耳机电池的状态:未充电、充电中、充满电 4. onReceiveCame(Bitmap bitmap, int width, int height) //接收到下位机发送的图像数据 bitmap //用户唇图 width //图像宽 height //图像高 5. onReceiveUseMode(String[] bytes, int useMode);//接收到下位机发送的耳机模式状态 useMode //使用模式 6. onReceiveLabel(String[] bytes, int label); //接收到下位机发送的标签信息、 label //唇语识别结果(标签编号)