私は、Accu-Chek Aviva Connectからデータを収集するiOSアプリケーションを作成しようとしています。 BGメーターとペアに「Accu-Chek Aviva Connect」BGメーターからデータを収集するiOSアプリ。 (Bluetooth低エネルギー)
私はレコードのアクセス制御ポイントの特性に書き込み要求を送信します。
- (void)peripheral:(CBPeripheral *)aPeripheral didDiscoverCharacteristicsForService:(CBService *)service error:(NSError *)error {
if ([service.UUID isEqual:[CBUUID UUIDWithString:@"1808"]]) {
for (CBCharacteristic *aChar in service.characteristics) {
// Read Glucose Measurement...
// Read Glucose Measurement Context...
// Read Glucose Feature...
// Read Date Time...
// Read Record Access Control Point
if ([aChar.UUID isEqual:[CBUUID UUIDWithString:@"2A52"]]) {
[aPeripheral readValueForCharacteristic:aChar];
[aPeripheral setNotifyValue:YES forCharacteristic:aChar];
uint8_t bytes[] = {0x04, 0x01, 0x00};
NSData *data = [NSData dataWithBytes:(void*)&bytes length:sizeof(bytes)];
[aPeripheral writeValue:data forCharacteristic:aChar type:CBCharacteristicWriteWithResponse];
}
}
}
}
そしてiPhone上の私は、セキュリティコードを入力するフィールドでUIAlertを参照してください。そして、私はiPhoneとAccu-Chek Aviva Connectとペアリングすることができます。しかし、次回に書き込みリクエストをに送信すると、(デバイスが切断された後)というメッセージが表示されます。「エラー:認証が不十分です」とiPhoneのUIAlertはありません。
私はすべてが間違っていると感じています。
ブルートゥースデバイスのログからレコードを読み込みたいとします。 AFAIU私はRead Record Access Control Point([aPeripheral writeValue:data forCharacteristic:aChar type:CBCharacteristicWriteWithResponse];
)にバイトを書き込み、答えはperipheral:didWriteValueForCharacteristic:error:
になります。しかし、私は"エラー:認証が不十分です"私の方法で立つので、私はそれを行うことはできません!
"認証が不十分"であるコードを投稿する必要があります。 iOSやデバイス自体から来ているのか不思議です。また、Aviva Connect APIはどこに記述されていますか?それは簡単にGoogleができません... –
Accu-Chekの公式文書はありません。しかし、公式のBluetooth Glucose Serviceを使用しています:https://www.bluetooth.com/specifications/gatt/viewer?attributeXmlFile=org.bluetooth.service.glucose.xml – MarK