|
@@ -131,11 +131,25 @@ public class BeaconMateImpl implements BeaconMate {
|
|
|
StringBuilder appStr = new StringBuilder();
|
|
StringBuilder appStr = new StringBuilder();
|
|
|
beaconStr = beaconStr.substring(beaconStr.length()-12);
|
|
beaconStr = beaconStr.substring(beaconStr.length()-12);
|
|
|
appStr.append("00"+beaconStr.substring(0,2));
|
|
appStr.append("00"+beaconStr.substring(0,2));
|
|
|
- appStr.append(Integer.parseInt(beaconStr.substring(2,6),16));
|
|
|
|
|
- appStr.append(Integer.parseInt(beaconStr.substring(6,10),16));
|
|
|
|
|
|
|
+ appStr.append(zeroFill(Integer.parseInt(beaconStr.substring(2,6),16)+""));
|
|
|
|
|
+ appStr.append(zeroFill(Integer.parseInt(beaconStr.substring(6,10),16)+""));
|
|
|
return appStr.toString();
|
|
return appStr.toString();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ //处理信标补0机制
|
|
|
|
|
+ private String zeroFill(String numStr){
|
|
|
|
|
+ StringBuilder builderStr = new StringBuilder();
|
|
|
|
|
+ if(numStr.length()<5){
|
|
|
|
|
+ for(int i=0;i<5-numStr.length();i++){
|
|
|
|
|
+ builderStr.append("0");
|
|
|
|
|
+ }
|
|
|
|
|
+ builderStr.append(numStr);
|
|
|
|
|
+ }else{
|
|
|
|
|
+ builderStr.append(numStr);
|
|
|
|
|
+ }
|
|
|
|
|
+ return builderStr.toString();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
//蓝牙网关修改在线
|
|
//蓝牙网关修改在线
|
|
|
public void setOpenBluetoothGateway(String mac){
|
|
public void setOpenBluetoothGateway(String mac){
|
|
|
Map <String,Object> map = new HashMap<>();
|
|
Map <String,Object> map = new HashMap<>();
|