梁海濤
梁海濤

Reputation: 11

can't use Windows's bluetoothleapis

Am I doing something wrong here? I want to set values ​​for a characteristic but the parameters look weird and not working at all


typedef struct _BTH_LE_GATT_CHARACTERISTIC_VALUE {
    ULONG DataSize;

#ifdef MIDL_PASS
    [size_is(DataSize)] UCHAR Data[*];
#else
   _Field_size_bytes_(DataSize) UCHAR Data[1];
#endif
} BTH_LE_GATT_CHARACTERISTIC_VALUE, *PBTH_LE_GATT_CHARACTERISTIC_VALUE;

the struct doesn't contain any pointer but a one size char array?

unsigned char ClearAxisZ[] = { 0xff,0xaa,0x52 };

BTH_LE_GATT_CHARACTERISTIC_VALUE Value = {};
Value.DataSize= 3;
Value.Data[0] = ClearAxisZ[0];
BluetoothGATTSetCharacteristicValue
(
                Device, 
                Characteristices + CharacteristicIndex, 
                &Value,
                NULL , 
                BLUETOOTH_GATT_FLAG_WRITE_WITHOUT_RESPONSE
);

and this is what i wanted to do

Upvotes: 1

Views: 36

Answers (0)

Related Questions