[6.0][Bluetooth] Representation of binary data unification 59/231859/10
authorArkadiusz Pietraszek <a.pietraszek@samsung.com>
Fri, 24 Apr 2020 13:38:11 +0000 (15:38 +0200)
committerArkadiusz Pietraszek <a.pietraszek@samsung.com>
Tue, 14 Jul 2020 09:46:54 +0000 (11:46 +0200)
commitc82950fac6619ab44151c9fc555d7bb17fd2a3c1
tree93543bcf57300182c0187774d7f8f545e9de78eb
parentbd512e88d8054d2ff6180e99e7bb5941887a6236
[6.0][Bluetooth] Representation of binary data unification

Currently binary data is passed to functions and received in return as different types.
This API change has been designed to unify binary data handling across Bluetooth module.

Adding type:
  typedef (byte[] or DOMString or Uint8Array) Bytes;

Adding functions:
  byte[] toByteArray(Bytes);
  DOMString toDOMString(Bytes);
  Uint8Array toUint8Array(Bytes);

Changing functions signatures:
  BluetoothLEServiceData(DOMString uuid, Bytes data);
  BluetoothLEManufacturerData(DOMString uuid, Bytes data);
  void BluetoothGATTCharacteristic::writeValue (Bytes value, optional SuccessCallback? successCallback, optional ErrorCallback? errorCallback);
  void BluetoothGATTDescriptor::writeValue (Bytes value, optional SuccessCallback? successCallback, optional ErrorCallback? errorCallback);
  unsigned long BluetoothSocket::writeData(Bytes);

[ACR]
https://code.sec.samsung.net/jira/browse/TWDAPI-259

[Verification]
Automatic bluetooth tct pass rate 100%
Unit tests for new functions added

Change-Id: I31e436149ecab6c4b7223ba493d13638cd707851
Signed-off-by: Arkadiusz Pietraszek <a.pietraszek@samsung.com>
src/bluetooth/bluetooth_api.js
src/bluetooth/js/ut/test_toByteArray.js [new file with mode: 0644]
src/bluetooth/js/ut/test_toDOMString.js [new file with mode: 0644]
src/bluetooth/js/ut/test_toUint8Array.js [new file with mode: 0644]