小编Sub*_*ham的帖子

Ble-getting错误代码 - 128写入charactertic时

我正在使用以下反应库react-native-ble-manager

我试图在BLE设备上执行读写操作.我成功地执行了读操作.但是在写入BLE设备时我收到错误代码128.

首先,我正在启用特征通知 -

BleManager.startNotification(peripheralId, serviceId, characteristicId)
Run Code Online (Sandbox Code Playgroud)

写是这样的 -
将'hex'值转换为base64字符串 -

  const base64String = new Buffer('0x00B00050D0', 'hex').toString('base64');

  BleManager.write(peripheralId, serviceId, characteristicId, base64Value)
Run Code Online (Sandbox Code Playgroud)

写操作返回错误代码-128

:(

UPDATE - 这是用于启动通知和写入值的代码片段 - 完整文件可在此处找到 - BluetoothLeService.java

public void writeCharacteristic(BleCharacteristic bleCharacteristic, String inputValue) {

    if (mBluetoothAdapter == null || mBluetoothGatt == null) {
        Log.w(TAG, "BluetoothAdapter not initialized");
        return;
    }

    if (!bleCharacteristic.isNotificationStarted()) {
        Log.w(TAG, "Notification not started please start notification");
        return;
    }

    BluetoothGattCharacteristic bluetoothGattCharacteristic = bleCharacteristic.getBluetoothGattCharacteristic();
    bluetoothGattCharacteristic.setValue(inputValue);
    mBluetoothGatt.writeCharacteristic(bluetoothGattCharacteristic);
}

public void setCharacteristicNotification(BleCharacteristic bleCharacteristic) {
    if (mBluetoothAdapter == …
Run Code Online (Sandbox Code Playgroud)

android bluetooth bluetooth-lowenergy react-native

6
推荐指数
1
解决办法
1117
查看次数

org.springframework.orm.hibernate4.HibernateSystemException:请求未知服务[org.hibernate.stat.spi.StatisticsImplementor];

我正在使用hibernate4和spring 3和jsf2.0进行注入我使用注释我在Google上搜索了这个例外,但是在这里找不到任何合适的解决方案我发布了我的日志,应用程序上下文和dao实现

Here is my logs
> BlockquoteHibernate: select employee0_.empid as empid0_, employee0_.emailId as emailId0_, employee0_.mobileNo as mobileNo0_, employee0_.password as password0_, employee0_.skypeID as skypeID0_, employee0_.userName as userName0_ from employee employee0_ where employee0_.userName=?
Aug 10, 2012 5:00:28 PM javax.faces.event.MethodExpressionActionListener processAction
SEVERE: Received 'org.springframework.orm.hibernate4.HibernateSystemException' when invoking action listener '#{loginBacking.empLogin}' for component 'j_idt16'
Aug 10, 2012 5:00:28 PM javax.faces.event.MethodExpressionActionListener processAction
SEVERE: org.springframework.orm.hibernate4.HibernateSystemException: Unknown service requested [org.hibernate.stat.spi.StatisticsImplementor]; nested exception is org.hibernate.service.UnknownServiceException: Unknown service requested [org.hibernate.stat.spi.StatisticsImplementor]
    at org.springframework.orm.hibernate4.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:206)
    at org.springframework.orm.hibernate4.HibernateTransactionManager.convertHibernateAccessException(HibernateTransactionManager.java:606)
    at org.springframework.orm.hibernate4.HibernateTransactionManager.doRollback(HibernateTransactionManager.java:507)
    at org.springframework.transaction.support.AbstractPlatformTransactionManager.processRollback(AbstractPlatformTransactionManager.java:845)
    at …
Run Code Online (Sandbox Code Playgroud)

spring hibernate transactions

2
推荐指数
1
解决办法
1万
查看次数

获取java.lang.IllegalArgumentException:已添加:Lcom/google/inject/AbstractModule

我正在使用带有gradle构建工具的android studio.我正在尝试使用RoboGuice进行依赖注入.这是我的builde.gradle混淆

   buildscript {
    repositories {
        mavenCentral()
        maven { url 'http://repo1.maven.org/maven2' }

    }
    dependencies {
        classpath 'com.android.tools.build:gradle:0.5.+'
    }
}

    apply plugin: 'android'

    repositories{
    mavenCentral()
}


    android {
    compileSdkVersion 17
    buildToolsVersion "17.0.0"

    defaultConfig {
        minSdkVersion 11
        targetSdkVersion 16
    }
}

    dependencies {
    compile 'com.android.support:support-v4:13.0.0'
    compile 'org.roboguice:roboguice:2.0'
    compile 'com.google.inject:guice:3.0'
    compile 'com.google.code.findbugs:jsr305:1.3.9'
    compile 'com.j256.ormlite:ormlite-android:4.46'
    compile 'com.j256.ormlite:ormlite-core:4.46'
}
Run Code Online (Sandbox Code Playgroud)

这些是我尝试构建时的日志

 UNEXPECTED TOP-LEVEL EXCEPTION:
    java.lang.IllegalArgumentException: already added: Lcom/google/inject/AbstractModule;
        at com.android.dx.dex.file.ClassDefsSection.add(ClassDefsSection.java:123)
        at com.android.dx.dex.file.DexFile.add(DexFile.java:163)
        at com.android.dx.command.dexer.Main.processClass(Main.java:490)
        at com.android.dx.command.dexer.Main.processFileBytes(Main.java:459)
        at com.android.dx.command.dexer.Main.access$400(Main.java:67)
        at com.android.dx.command.dexer.Main$1.processFileBytes(Main.java:398)
        at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:245)
        at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:131)
        at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:109) …
Run Code Online (Sandbox Code Playgroud)

android gradle roboguice android-studio

1
推荐指数
1
解决办法
2306
查看次数