manekinekko / angular-web-bluetooth

The missing Web Bluetooth module for Angular
https://manekinekko.github.io/angular-web-bluetooth/
MIT License
196 stars 59 forks source link

How to use custom service #61

Closed Puneetkumarpal closed 4 years ago

Puneetkumarpal commented 5 years ago

hi,

i want to communicate by device with hm10 (BLE module). it use service 0xFFE0 and characteristics 0xFFE1 for send and receive data. how can i communicate to this device it's show me an error

manekinekko-angular-web-bluetooth.js:95 TypeError: Failed to execute 'requestDevice' on 'Bluetooth': Invalid Service name: 'ffe0'. It must be a valid UUID alias (e.g. 0x1234), UUID (lowercase hex characters e.g. '00001234-0000-1000-8000-00805f9b34fb'), or recognized standard name from https://www.bluetooth.com/specifications/gatt/services e.g. 'alert_notification'. at BrowserWebBluetooth.push../dist/manekinekko/angular-web-bluetooth/fesm5/manekinekko-angular-web-bluetooth.js.BrowserWebBluetooth.requestDevice (manekinekko-angular-web-bluetooth.js:27)

Please help me as soon as possible

NidasioAlberto commented 5 years ago

For me the issue was that the custom service UUID I inserted had upper cases letter instead of lower cases ones. About the issues of @Puneetkumarpal I think the problem is that if you want to use a custom UUID for a service, that UUID can't be 16bits, it need to be 128bits. See this

manekinekko commented 4 years ago

Thanks @NidasioAlberto for providing a quick answer.